From d1b0122f1755518342cbe9f89381c3bb9bd7225f Mon Sep 17 00:00:00 2001 From: weibaohui Date: Mon, 5 Aug 2024 18:31:01 +0800 Subject: [PATCH] Add Mermaid Markdown chart view --- BlazorApp/BlazorApp.csproj | 4 +- BlazorApp/Pages/Mermaid.razor | 14 + BlazorApp/Program.cs | 5 +- BlazorApp/Service/MermaidLoader.cs | 77 + BlazorApp/_Imports.razor | 1 + .../wwwroot/js/lib/mermaid/array-2ff2c7a6.js | 7 + .../js/lib/mermaid/channel-ebbc4130.js | 6 + .../wwwroot/js/lib/mermaid/clone-afc2f047.js | 11 + .../js/lib/mermaid/createText-03b82060.js | 3443 +++++++ .../wwwroot/js/lib/mermaid/edges-16357fde.js | 1142 ++ .../wwwroot/js/lib/mermaid/flowDb-9a89ea33.js | 2258 ++++ .../js/lib/mermaid/flowDiagram-v2-f2119625.js | 26 + .../wwwroot/js/lib/mermaid/graph-0ee63739.js | 1087 ++ .../wwwroot/js/lib/mermaid/index-bb6d8841.js | 406 + .../wwwroot/js/lib/mermaid/layout-fd473db2.js | 1796 ++++ .../wwwroot/js/lib/mermaid/line-24d93f1b.js | 40 + .../js/lib/mermaid/mermaid-9f2aa176.js | 9159 +++++++++++++++++ .../js/lib/mermaid/mermaid.esm.min.mjs | 5 + .../wwwroot/js/lib/mermaid/path-428ebac9.js | 107 + .../wwwroot/js/lib/mermaid/styles-e75131e4.js | 462 + 20 files changed, 20052 insertions(+), 4 deletions(-) create mode 100644 BlazorApp/Pages/Mermaid.razor create mode 100644 BlazorApp/Service/MermaidLoader.cs create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/array-2ff2c7a6.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/channel-ebbc4130.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/clone-afc2f047.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/createText-03b82060.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/edges-16357fde.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/flowDb-9a89ea33.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/flowDiagram-v2-f2119625.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/graph-0ee63739.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/index-bb6d8841.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/layout-fd473db2.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/line-24d93f1b.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/mermaid-9f2aa176.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/mermaid.esm.min.mjs create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/path-428ebac9.js create mode 100644 BlazorApp/wwwroot/js/lib/mermaid/styles-e75131e4.js diff --git a/BlazorApp/BlazorApp.csproj b/BlazorApp/BlazorApp.csproj index d9f32b48..0bd98e06 100644 --- a/BlazorApp/BlazorApp.csproj +++ b/BlazorApp/BlazorApp.csproj @@ -6,6 +6,7 @@ + @@ -26,7 +27,4 @@ - - - diff --git a/BlazorApp/Pages/Mermaid.razor b/BlazorApp/Pages/Mermaid.razor new file mode 100644 index 00000000..d842437e --- /dev/null +++ b/BlazorApp/Pages/Mermaid.razor @@ -0,0 +1,14 @@ +@page "/Mermaid" + + +@code { + string diagramDef = def1; + + const string def1 = @" +flowchart LR +A --> B +B --> C +C --> A +"; + +} diff --git a/BlazorApp/Program.cs b/BlazorApp/Program.cs index 8d6e6e94..62d960b2 100644 --- a/BlazorApp/Program.cs +++ b/BlazorApp/Program.cs @@ -124,8 +124,11 @@ builder.Services.AddWorkflow(); - var app = builder.Build(); + + +app.UseMiddleware(); + // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { diff --git a/BlazorApp/Service/MermaidLoader.cs b/BlazorApp/Service/MermaidLoader.cs new file mode 100644 index 00000000..f86e7786 --- /dev/null +++ b/BlazorApp/Service/MermaidLoader.cs @@ -0,0 +1,77 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; + +namespace BlazorApp.Service; + +/// +/// 将Mermaid.js的cdn互联网版本的JS文件修改为适用于Blazor的版本,并将其注入到HTML页面中。 +/// 以此提高在局域网中使用Mermaid.js的体验。 +/// +/// +public class ModifyResponseMiddleware(RequestDelegate next) +{ + public async Task InvokeAsync(HttpContext context) + { + if (context.Request.Path.StartsWithSegments("/_content/Blazorade.Mermaid/js/blazoradeMermaid.js")) + { + var content = @"import mermaid from ""/js/lib/mermaid/mermaid.esm.min.mjs""; + +export function run(id, definition, configuration) { + console.debug(""run (id, definition, configuration)"", id, definition, configuration); + var elem = document.getElementById(id); + elem.removeAttribute(""data-processed""); + + elem.innerHTML = definition; + renderOnly(""#"" + id, configuration); +} + +var renderCount = 0; +export async function renderOnly(selector, configuration) { + console.debug(""renderOnly(selector, configuration)"", selector, configuration); + + if (renderCount == 0) { + renderCount = 1; + prerenderDiagram(); + } + + if (configuration) { + mermaid.initialize(configuration); + } + + await mermaid.run({ querySelector: selector }); + renderCount++; +} + +/** + * This function is called if no diagrams have been rendered previously. It is used to render a very simple + * flow chart diagram with no themes. Once the diagram has been rendered, it is removed from the DOM. + * This is to work around a problem that occurs on initial rendering of diagrams that include inline + * themes. That problem does not occur after the initial diagram has been rendered. + */ +function prerenderDiagram() { + var body = document.getElementsByTagName(""body""); + if (body.length > 0) { + var diagElement = document.createElement(""pre""); + var dt = new Date(); + var id = ""blzrd-"" + dt.getFullYear() + dt.getMonth() + dt.getDate() + dt.getHours() + dt.getMinutes() + dt.getSeconds() + dt.getMilliseconds(); + diagElement.setAttribute(""id"", id); + body.item(0).appendChild(diagElement); + + run(id, ""flowchart TB\n a-->b""); + + body.item(0).removeChild(diagElement); + } +} +"; + + context.Response.ContentType = "text/javascript"; + context.Response.StatusCode = 200; + + await context.Response.WriteAsync(content); + } + else + { + await next(context); + } + } +} diff --git a/BlazorApp/_Imports.razor b/BlazorApp/_Imports.razor index 246ec51b..fa08d3d0 100644 --- a/BlazorApp/_Imports.razor +++ b/BlazorApp/_Imports.razor @@ -20,3 +20,4 @@ @using Blazor.Diagrams.Core.Geometry; @using Blazor.Diagrams.Components.Renderers; @using Blazor.Diagrams.Components.Widgets; +@using Blazorade.Mermaid.Components diff --git a/BlazorApp/wwwroot/js/lib/mermaid/array-2ff2c7a6.js b/BlazorApp/wwwroot/js/lib/mermaid/array-2ff2c7a6.js new file mode 100644 index 00000000..e866bb1a --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/array-2ff2c7a6.js @@ -0,0 +1,7 @@ +function t(r) { + return typeof r == "object" && "length" in r ? r : Array.from(r); +} + +export { + t as a +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/channel-ebbc4130.js b/BlazorApp/wwwroot/js/lib/mermaid/channel-ebbc4130.js new file mode 100644 index 00000000..4c741dbf --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/channel-ebbc4130.js @@ -0,0 +1,6 @@ +import {aI as o, aJ as r} from "./mermaid-9f2aa176.js"; + +const s = (a, n) => o.lang.round(r.parse(a)[n]), e = s; +export { + e as c +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/clone-afc2f047.js b/BlazorApp/wwwroot/js/lib/mermaid/clone-afc2f047.js new file mode 100644 index 00000000..81fedc21 --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/clone-afc2f047.js @@ -0,0 +1,11 @@ +import {c as r} from "./graph-0ee63739.js"; + +var e = 4; + +function a(o) { + return r(o, e); +} + +export { + a as c +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/createText-03b82060.js b/BlazorApp/wwwroot/js/lib/mermaid/createText-03b82060.js new file mode 100644 index 00000000..6d396b2d --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/createText-03b82060.js @@ -0,0 +1,3443 @@ +import {b7 as It, b8 as At, l as zt} from "./mermaid-9f2aa176.js"; + +const Tt = {}; + +function Bt(n, r) { + const t = r || Tt, e = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, + u = typeof t.includeHtml == "boolean" ? t.includeHtml : !0; + return et(n, e, u); +} + +function et(n, r, t) { + if (Lt(n)) { + if ("value" in n) + return n.type === "html" && !t ? "" : n.value; + if (r && "alt" in n && n.alt) + return n.alt; + if ("children" in n) + return Vn(n.children, r, t); + } + return Array.isArray(n) ? Vn(n, r, t) : ""; +} + +function Vn(n, r, t) { + const e = []; + let u = -1; + for (; ++u < n.length;) + e[u] = et(n[u], r, t); + return e.join(""); +} + +function Lt(n) { + return !!(n && typeof n == "object"); +} + +function tn(n, r, t, e) { + const u = n.length; + let i = 0, l; + if (r < 0 ? r = -r > u ? 0 : u + r : r = r > u ? u : r, t = t > 0 ? t : 0, e.length < 1e4) + l = Array.from(e), l.unshift(r, t), n.splice(...l); + else + for (t && n.splice(r, t); i < e.length;) + l = e.slice(i, i + 1e4), l.unshift(r, 0), n.splice(...l), i += 1e4, r += 1e4; +} + +function Y(n, r) { + return n.length > 0 ? (tn(n, n.length, 0, r), n) : r; +} + +const Wn = {}.hasOwnProperty; + +function Ot(n) { + const r = {}; + let t = -1; + for (; ++t < n.length;) + Dt(r, n[t]); + return r; +} + +function Dt(n, r) { + let t; + for (t in r) { + const u = (Wn.call(n, t) ? n[t] : void 0) || (n[t] = {}), i = r[t]; + let l; + if (i) + for (l in i) { + Wn.call(u, l) || (u[l] = []); + const a = i[l]; + Pt( + // @ts-expect-error Looks like a list. + u[l], + Array.isArray(a) ? a : a ? [a] : [] + ); + } + } +} + +function Pt(n, r) { + let t = -1; + const e = []; + for (; ++t < r.length;) + (r[t].add === "after" ? n : e).push(r[t]); + tn(n, 0, 0, e); +} + +const _t = /[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/, + nn = cn(/[A-Za-z]/), v = cn(/[\dA-Za-z]/), Mt = cn(/[#-'*+\--9=?A-Z^-~]/); + +function An(n) { + return ( + // Special whitespace codes (which have negative values), C0 and Control + // character DEL + n !== null && (n < 32 || n === 127) + ); +} + +const zn = cn(/\d/), jt = cn(/[\dA-Fa-f]/), Rt = cn(/[!-/:-@[-`{-~]/); + +function C(n) { + return n !== null && n < -2; +} + +function Z(n) { + return n !== null && (n < 0 || n === 32); +} + +function z(n) { + return n === -2 || n === -1 || n === 32; +} + +const qt = cn(_t), Ht = cn(/\s/); + +function cn(n) { + return r; + + function r(t) { + return t !== null && n.test(String.fromCharCode(t)); + } +} + +function O(n, r, t, e) { + const u = e ? e - 1 : Number.POSITIVE_INFINITY; + let i = 0; + return l; + + function l(m) { + return z(m) ? (n.enter(t), a(m)) : r(m); + } + + function a(m) { + return z(m) && i++ < u ? (n.consume(m), a) : (n.exit(t), r(m)); + } +} + +const Nt = { + tokenize: Vt +}; + +function Vt(n) { + const r = n.attempt( + this.parser.constructs.contentInitial, + e, + u + ); + let t; + return r; + + function e(a) { + if (a === null) { + n.consume(a); + return; + } + return n.enter("lineEnding"), n.consume(a), n.exit("lineEnding"), O(n, r, "linePrefix"); + } + + function u(a) { + return n.enter("paragraph"), i(a); + } + + function i(a) { + const m = n.enter("chunkText", { + contentType: "text", + previous: t + }); + return t && (t.next = m), t = m, l(a); + } + + function l(a) { + if (a === null) { + n.exit("chunkText"), n.exit("paragraph"), n.consume(a); + return; + } + return C(a) ? (n.consume(a), n.exit("chunkText"), i) : (n.consume(a), l); + } +} + +const Wt = { + tokenize: Qt +}, Qn = { + tokenize: Ut +}; + +function Qt(n) { + const r = this, t = []; + let e = 0, u, i, l; + return a; + + function a(F) { + if (e < t.length) { + const D = t[e]; + return r.containerState = D[1], n.attempt( + D[0].continuation, + m, + c + )(F); + } + return c(F); + } + + function m(F) { + if (e++, r.containerState._closeFlow) { + r.containerState._closeFlow = void 0, u && j(); + const D = r.events.length; + let _ = D, k; + for (; _--;) + if (r.events[_][0] === "exit" && r.events[_][1].type === "chunkFlow") { + k = r.events[_][1].end; + break; + } + b(e); + let T = D; + for (; T < r.events.length;) + r.events[T][1].end = Object.assign({}, k), T++; + return tn( + r.events, + _ + 1, + 0, + r.events.slice(D) + ), r.events.length = T, c(F); + } + return a(F); + } + + function c(F) { + if (e === t.length) { + if (!u) + return x(F); + if (u.currentConstruct && u.currentConstruct.concrete) + return A(F); + r.interrupt = !!(u.currentConstruct && !u._gfmTableDynamicInterruptHack); + } + return r.containerState = {}, n.check( + Qn, + p, + f + )(F); + } + + function p(F) { + return u && j(), b(e), x(F); + } + + function f(F) { + return r.parser.lazy[r.now().line] = e !== t.length, l = r.now().offset, A(F); + } + + function x(F) { + return r.containerState = {}, n.attempt( + Qn, + h, + A + )(F); + } + + function h(F) { + return e++, t.push([r.currentConstruct, r.containerState]), x(F); + } + + function A(F) { + if (F === null) { + u && j(), b(0), n.consume(F); + return; + } + return u = u || r.parser.flow(r.now()), n.enter("chunkFlow", { + contentType: "flow", + previous: i, + _tokenizer: u + }), I(F); + } + + function I(F) { + if (F === null) { + M(n.exit("chunkFlow"), !0), b(0), n.consume(F); + return; + } + return C(F) ? (n.consume(F), M(n.exit("chunkFlow")), e = 0, r.interrupt = void 0, a) : (n.consume(F), I); + } + + function M(F, D) { + const _ = r.sliceStream(F); + if (D && _.push(null), F.previous = i, i && (i.next = F), i = F, u.defineSkip(F.start), u.write(_), r.parser.lazy[F.start.line]) { + let k = u.events.length; + for (; k--;) + if ( + // The token starts before the line ending… + u.events[k][1].start.offset < l && // …and either is not ended yet… + (!u.events[k][1].end || // …or ends after it. + u.events[k][1].end.offset > l) + ) + return; + const T = r.events.length; + let H = T, N, V; + for (; H--;) + if (r.events[H][0] === "exit" && r.events[H][1].type === "chunkFlow") { + if (N) { + V = r.events[H][1].end; + break; + } + N = !0; + } + for (b(e), k = T; k < r.events.length;) + r.events[k][1].end = Object.assign({}, V), k++; + tn( + r.events, + H + 1, + 0, + r.events.slice(T) + ), r.events.length = k; + } + } + + function b(F) { + let D = t.length; + for (; D-- > F;) { + const _ = t[D]; + r.containerState = _[1], _[0].exit.call(r, n); + } + t.length = F; + } + + function j() { + u.write([null]), i = void 0, u = void 0, r.containerState._closeFlow = void 0; + } +} + +function Ut(n, r, t) { + return O( + n, + n.attempt(this.parser.constructs.document, r, t), + "linePrefix", + this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + ); +} + +function Un(n) { + if (n === null || Z(n) || Ht(n)) + return 1; + if (qt(n)) + return 2; +} + +function Ln(n, r, t) { + const e = []; + let u = -1; + for (; ++u < n.length;) { + const i = n[u].resolveAll; + i && !e.includes(i) && (r = i(r, t), e.push(i)); + } + return r; +} + +const In = { + name: "attention", + tokenize: Zt, + resolveAll: $t +}; + +function $t(n, r) { + let t = -1, e, u, i, l, a, m, c, p; + for (; ++t < n.length;) + if (n[t][0] === "enter" && n[t][1].type === "attentionSequence" && n[t][1]._close) { + for (e = t; e--;) + if (n[e][0] === "exit" && n[e][1].type === "attentionSequence" && n[e][1]._open && // If the markers are the same: + r.sliceSerialize(n[e][1]).charCodeAt(0) === r.sliceSerialize(n[t][1]).charCodeAt(0)) { + if ((n[e][1]._close || n[t][1]._open) && (n[t][1].end.offset - n[t][1].start.offset) % 3 && !((n[e][1].end.offset - n[e][1].start.offset + n[t][1].end.offset - n[t][1].start.offset) % 3)) + continue; + m = n[e][1].end.offset - n[e][1].start.offset > 1 && n[t][1].end.offset - n[t][1].start.offset > 1 ? 2 : 1; + const f = Object.assign({}, n[e][1].end), x = Object.assign({}, n[t][1].start); + $n(f, -m), $n(x, m), l = { + type: m > 1 ? "strongSequence" : "emphasisSequence", + start: f, + end: Object.assign({}, n[e][1].end) + }, a = { + type: m > 1 ? "strongSequence" : "emphasisSequence", + start: Object.assign({}, n[t][1].start), + end: x + }, i = { + type: m > 1 ? "strongText" : "emphasisText", + start: Object.assign({}, n[e][1].end), + end: Object.assign({}, n[t][1].start) + }, u = { + type: m > 1 ? "strong" : "emphasis", + start: Object.assign({}, l.start), + end: Object.assign({}, a.end) + }, n[e][1].end = Object.assign({}, l.start), n[t][1].start = Object.assign({}, a.end), c = [], n[e][1].end.offset - n[e][1].start.offset && (c = Y(c, [ + ["enter", n[e][1], r], + ["exit", n[e][1], r] + ])), c = Y(c, [ + ["enter", u, r], + ["enter", l, r], + ["exit", l, r], + ["enter", i, r] + ]), c = Y( + c, + Ln( + r.parser.constructs.insideSpan.null, + n.slice(e + 1, t), + r + ) + ), c = Y(c, [ + ["exit", i, r], + ["enter", a, r], + ["exit", a, r], + ["exit", u, r] + ]), n[t][1].end.offset - n[t][1].start.offset ? (p = 2, c = Y(c, [ + ["enter", n[t][1], r], + ["exit", n[t][1], r] + ])) : p = 0, tn(n, e - 1, t - e + 3, c), t = e + c.length - p - 2; + break; + } + } + for (t = -1; ++t < n.length;) + n[t][1].type === "attentionSequence" && (n[t][1].type = "data"); + return n; +} + +function Zt(n, r) { + const t = this.parser.constructs.attentionMarkers.null, e = this.previous, u = Un(e); + let i; + return l; + + function l(m) { + return i = m, n.enter("attentionSequence"), a(m); + } + + function a(m) { + if (m === i) + return n.consume(m), a; + const c = n.exit("attentionSequence"), p = Un(m), f = !p || p === 2 && u || t.includes(m), + x = !u || u === 2 && p || t.includes(e); + return c._open = !!(i === 42 ? f : f && (u || !x)), c._close = !!(i === 42 ? x : x && (p || !f)), r(m); + } +} + +function $n(n, r) { + n.column += r, n.offset += r, n._bufferIndex += r; +} + +const Yt = { + name: "autolink", + tokenize: Gt +}; + +function Gt(n, r, t) { + let e = 0; + return u; + + function u(h) { + return n.enter("autolink"), n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.enter("autolinkProtocol"), i; + } + + function i(h) { + return nn(h) ? (n.consume(h), l) : c(h); + } + + function l(h) { + return h === 43 || h === 45 || h === 46 || v(h) ? (e = 1, a(h)) : c(h); + } + + function a(h) { + return h === 58 ? (n.consume(h), e = 0, m) : (h === 43 || h === 45 || h === 46 || v(h)) && e++ < 32 ? (n.consume(h), a) : (e = 0, c(h)); + } + + function m(h) { + return h === 62 ? (n.exit("autolinkProtocol"), n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.exit("autolink"), r) : h === null || h === 32 || h === 60 || An(h) ? t(h) : (n.consume(h), m); + } + + function c(h) { + return h === 64 ? (n.consume(h), p) : Mt(h) ? (n.consume(h), c) : t(h); + } + + function p(h) { + return v(h) ? f(h) : t(h); + } + + function f(h) { + return h === 46 ? (n.consume(h), e = 0, p) : h === 62 ? (n.exit("autolinkProtocol").type = "autolinkEmail", n.enter("autolinkMarker"), n.consume(h), n.exit("autolinkMarker"), n.exit("autolink"), r) : x(h); + } + + function x(h) { + if ((h === 45 || v(h)) && e++ < 63) { + const A = h === 45 ? x : f; + return n.consume(h), A; + } + return t(h); + } +} + +const Sn = { + tokenize: Jt, + partial: !0 +}; + +function Jt(n, r, t) { + return e; + + function e(i) { + return z(i) ? O(n, u, "linePrefix")(i) : u(i); + } + + function u(i) { + return i === null || C(i) ? r(i) : t(i); + } +} + +const rt = { + name: "blockQuote", + tokenize: Kt, + continuation: { + tokenize: Xt + }, + exit: vt +}; + +function Kt(n, r, t) { + const e = this; + return u; + + function u(l) { + if (l === 62) { + const a = e.containerState; + return a.open || (n.enter("blockQuote", { + _container: !0 + }), a.open = !0), n.enter("blockQuotePrefix"), n.enter("blockQuoteMarker"), n.consume(l), n.exit("blockQuoteMarker"), i; + } + return t(l); + } + + function i(l) { + return z(l) ? (n.enter("blockQuotePrefixWhitespace"), n.consume(l), n.exit("blockQuotePrefixWhitespace"), n.exit("blockQuotePrefix"), r) : (n.exit("blockQuotePrefix"), r(l)); + } +} + +function Xt(n, r, t) { + const e = this; + return u; + + function u(l) { + return z(l) ? O( + n, + i, + "linePrefix", + e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + )(l) : i(l); + } + + function i(l) { + return n.attempt(rt, r, t)(l); + } +} + +function vt(n) { + n.exit("blockQuote"); +} + +const it = { + name: "characterEscape", + tokenize: ne +}; + +function ne(n, r, t) { + return e; + + function e(i) { + return n.enter("characterEscape"), n.enter("escapeMarker"), n.consume(i), n.exit("escapeMarker"), u; + } + + function u(i) { + return Rt(i) ? (n.enter("characterEscapeValue"), n.consume(i), n.exit("characterEscapeValue"), n.exit("characterEscape"), r) : t(i); + } +} + +const Zn = document.createElement("i"); + +function On(n) { + const r = "&" + n + ";"; + Zn.innerHTML = r; + const t = Zn.textContent; + return t.charCodeAt(t.length - 1) === 59 && n !== "semi" || t === r ? !1 : t; +} + +const ut = { + name: "characterReference", + tokenize: te +}; + +function te(n, r, t) { + const e = this; + let u = 0, i, l; + return a; + + function a(f) { + return n.enter("characterReference"), n.enter("characterReferenceMarker"), n.consume(f), n.exit("characterReferenceMarker"), m; + } + + function m(f) { + return f === 35 ? (n.enter("characterReferenceMarkerNumeric"), n.consume(f), n.exit("characterReferenceMarkerNumeric"), c) : (n.enter("characterReferenceValue"), i = 31, l = v, p(f)); + } + + function c(f) { + return f === 88 || f === 120 ? (n.enter("characterReferenceMarkerHexadecimal"), n.consume(f), n.exit("characterReferenceMarkerHexadecimal"), n.enter("characterReferenceValue"), i = 6, l = jt, p) : (n.enter("characterReferenceValue"), i = 7, l = zn, p(f)); + } + + function p(f) { + if (f === 59 && u) { + const x = n.exit("characterReferenceValue"); + return l === v && !On(e.sliceSerialize(x)) ? t(f) : (n.enter("characterReferenceMarker"), n.consume(f), n.exit("characterReferenceMarker"), n.exit("characterReference"), r); + } + return l(f) && u++ < i ? (n.consume(f), p) : t(f); + } +} + +const Yn = { + tokenize: re, + partial: !0 +}, Gn = { + name: "codeFenced", + tokenize: ee, + concrete: !0 +}; + +function ee(n, r, t) { + const e = this, u = { + tokenize: _, + partial: !0 + }; + let i = 0, l = 0, a; + return m; + + function m(k) { + return c(k); + } + + function c(k) { + const T = e.events[e.events.length - 1]; + return i = T && T[1].type === "linePrefix" ? T[2].sliceSerialize(T[1], !0).length : 0, a = k, n.enter("codeFenced"), n.enter("codeFencedFence"), n.enter("codeFencedFenceSequence"), p(k); + } + + function p(k) { + return k === a ? (l++, n.consume(k), p) : l < 3 ? t(k) : (n.exit("codeFencedFenceSequence"), z(k) ? O(n, f, "whitespace")(k) : f(k)); + } + + function f(k) { + return k === null || C(k) ? (n.exit("codeFencedFence"), e.interrupt ? r(k) : n.check(Yn, I, D)(k)) : (n.enter("codeFencedFenceInfo"), n.enter("chunkString", { + contentType: "string" + }), x(k)); + } + + function x(k) { + return k === null || C(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), f(k)) : z(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceInfo"), O(n, h, "whitespace")(k)) : k === 96 && k === a ? t(k) : (n.consume(k), x); + } + + function h(k) { + return k === null || C(k) ? f(k) : (n.enter("codeFencedFenceMeta"), n.enter("chunkString", { + contentType: "string" + }), A(k)); + } + + function A(k) { + return k === null || C(k) ? (n.exit("chunkString"), n.exit("codeFencedFenceMeta"), f(k)) : k === 96 && k === a ? t(k) : (n.consume(k), A); + } + + function I(k) { + return n.attempt(u, D, M)(k); + } + + function M(k) { + return n.enter("lineEnding"), n.consume(k), n.exit("lineEnding"), b; + } + + function b(k) { + return i > 0 && z(k) ? O( + n, + j, + "linePrefix", + i + 1 + )(k) : j(k); + } + + function j(k) { + return k === null || C(k) ? n.check(Yn, I, D)(k) : (n.enter("codeFlowValue"), F(k)); + } + + function F(k) { + return k === null || C(k) ? (n.exit("codeFlowValue"), j(k)) : (n.consume(k), F); + } + + function D(k) { + return n.exit("codeFenced"), r(k); + } + + function _(k, T, H) { + let N = 0; + return V; + + function V(w) { + return k.enter("lineEnding"), k.consume(w), k.exit("lineEnding"), y; + } + + function y(w) { + return k.enter("codeFencedFence"), z(w) ? O( + k, + S, + "linePrefix", + e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + )(w) : S(w); + } + + function S(w) { + return w === a ? (k.enter("codeFencedFenceSequence"), P(w)) : H(w); + } + + function P(w) { + return w === a ? (N++, k.consume(w), P) : N >= l ? (k.exit("codeFencedFenceSequence"), z(w) ? O(k, R, "whitespace")(w) : R(w)) : H(w); + } + + function R(w) { + return w === null || C(w) ? (k.exit("codeFencedFence"), T(w)) : H(w); + } + } +} + +function re(n, r, t) { + const e = this; + return u; + + function u(l) { + return l === null ? t(l) : (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), i); + } + + function i(l) { + return e.parser.lazy[e.now().line] ? t(l) : r(l); + } +} + +const Cn = { + name: "codeIndented", + tokenize: ue +}, ie = { + tokenize: le, + partial: !0 +}; + +function ue(n, r, t) { + const e = this; + return u; + + function u(c) { + return n.enter("codeIndented"), O(n, i, "linePrefix", 4 + 1)(c); + } + + function i(c) { + const p = e.events[e.events.length - 1]; + return p && p[1].type === "linePrefix" && p[2].sliceSerialize(p[1], !0).length >= 4 ? l(c) : t(c); + } + + function l(c) { + return c === null ? m(c) : C(c) ? n.attempt(ie, l, m)(c) : (n.enter("codeFlowValue"), a(c)); + } + + function a(c) { + return c === null || C(c) ? (n.exit("codeFlowValue"), l(c)) : (n.consume(c), a); + } + + function m(c) { + return n.exit("codeIndented"), r(c); + } +} + +function le(n, r, t) { + const e = this; + return u; + + function u(l) { + return e.parser.lazy[e.now().line] ? t(l) : C(l) ? (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), u) : O(n, i, "linePrefix", 4 + 1)(l); + } + + function i(l) { + const a = e.events[e.events.length - 1]; + return a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(l) : C(l) ? u(l) : t(l); + } +} + +const ae = { + name: "codeText", + tokenize: ce, + resolve: oe, + previous: se +}; + +function oe(n) { + let r = n.length - 4, t = 3, e, u; + if ((n[t][1].type === "lineEnding" || n[t][1].type === "space") && (n[r][1].type === "lineEnding" || n[r][1].type === "space")) { + for (e = t; ++e < r;) + if (n[e][1].type === "codeTextData") { + n[t][1].type = "codeTextPadding", n[r][1].type = "codeTextPadding", t += 2, r -= 2; + break; + } + } + for (e = t - 1, r++; ++e <= r;) + u === void 0 ? e !== r && n[e][1].type !== "lineEnding" && (u = e) : (e === r || n[e][1].type === "lineEnding") && (n[u][1].type = "codeTextData", e !== u + 2 && (n[u][1].end = n[e - 1][1].end, n.splice(u + 2, e - u - 2), r -= e - u - 2, e = u + 2), u = void 0); + return n; +} + +function se(n) { + return n !== 96 || this.events[this.events.length - 1][1].type === "characterEscape"; +} + +function ce(n, r, t) { + let e = 0, u, i; + return l; + + function l(f) { + return n.enter("codeText"), n.enter("codeTextSequence"), a(f); + } + + function a(f) { + return f === 96 ? (n.consume(f), e++, a) : (n.exit("codeTextSequence"), m(f)); + } + + function m(f) { + return f === null ? t(f) : f === 32 ? (n.enter("space"), n.consume(f), n.exit("space"), m) : f === 96 ? (i = n.enter("codeTextSequence"), u = 0, p(f)) : C(f) ? (n.enter("lineEnding"), n.consume(f), n.exit("lineEnding"), m) : (n.enter("codeTextData"), c(f)); + } + + function c(f) { + return f === null || f === 32 || f === 96 || C(f) ? (n.exit("codeTextData"), m(f)) : (n.consume(f), c); + } + + function p(f) { + return f === 96 ? (n.consume(f), u++, p) : u === e ? (n.exit("codeTextSequence"), n.exit("codeText"), r(f)) : (i.type = "codeTextData", c(f)); + } +} + +function lt(n) { + const r = {}; + let t = -1, e, u, i, l, a, m, c; + for (; ++t < n.length;) { + for (; t in r;) + t = r[t]; + if (e = n[t], t && e[1].type === "chunkFlow" && n[t - 1][1].type === "listItemPrefix" && (m = e[1]._tokenizer.events, i = 0, i < m.length && m[i][1].type === "lineEndingBlank" && (i += 2), i < m.length && m[i][1].type === "content")) + for (; ++i < m.length && m[i][1].type !== "content";) + m[i][1].type === "chunkText" && (m[i][1]._isInFirstContentOfListItem = !0, i++); + if (e[0] === "enter") + e[1].contentType && (Object.assign(r, he(n, t)), t = r[t], c = !0); + else if (e[1]._container) { + for (i = t, u = void 0; i-- && (l = n[i], l[1].type === "lineEnding" || l[1].type === "lineEndingBlank");) + l[0] === "enter" && (u && (n[u][1].type = "lineEndingBlank"), l[1].type = "lineEnding", u = i); + u && (e[1].end = Object.assign({}, n[u][1].start), a = n.slice(u, t), a.unshift(e), tn(n, u, t - u + 1, a)); + } + } + return !c; +} + +function he(n, r) { + const t = n[r][1], e = n[r][2]; + let u = r - 1; + const i = [], l = t._tokenizer || e.parser[t.contentType](t.start), a = l.events, m = [], c = {}; + let p, f, x = -1, h = t, A = 0, I = 0; + const M = [I]; + for (; h;) { + for (; n[++u][1] !== h;) + ; + i.push(u), h._tokenizer || (p = e.sliceStream(h), h.next || p.push(null), f && l.defineSkip(h.start), h._isInFirstContentOfListItem && (l._gfmTasklistFirstContentOfListItem = !0), l.write(p), h._isInFirstContentOfListItem && (l._gfmTasklistFirstContentOfListItem = void 0)), f = h, h = h.next; + } + for (h = t; ++x < a.length;) + // Find a void token that includes a break. + a[x][0] === "exit" && a[x - 1][0] === "enter" && a[x][1].type === a[x - 1][1].type && a[x][1].start.line !== a[x][1].end.line && (I = x + 1, M.push(I), h._tokenizer = void 0, h.previous = void 0, h = h.next); + for (l.events = [], h ? (h._tokenizer = void 0, h.previous = void 0) : M.pop(), x = M.length; x--;) { + const b = a.slice(M[x], M[x + 1]), j = i.pop(); + m.unshift([j, j + b.length - 1]), tn(n, j, 2, b); + } + for (x = -1; ++x < m.length;) + c[A + m[x][0]] = A + m[x][1], A += m[x][1] - m[x][0] - 1; + return c; +} + +const pe = { + tokenize: xe, + resolve: me +}, fe = { + tokenize: ge, + partial: !0 +}; + +function me(n) { + return lt(n), n; +} + +function xe(n, r) { + let t; + return e; + + function e(a) { + return n.enter("content"), t = n.enter("chunkContent", { + contentType: "content" + }), u(a); + } + + function u(a) { + return a === null ? i(a) : C(a) ? n.check( + fe, + l, + i + )(a) : (n.consume(a), u); + } + + function i(a) { + return n.exit("chunkContent"), n.exit("content"), r(a); + } + + function l(a) { + return n.consume(a), n.exit("chunkContent"), t.next = n.enter("chunkContent", { + contentType: "content", + previous: t + }), t = t.next, u; + } +} + +function ge(n, r, t) { + const e = this; + return u; + + function u(l) { + return n.exit("chunkContent"), n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), O(n, i, "linePrefix"); + } + + function i(l) { + if (l === null || C(l)) + return t(l); + const a = e.events[e.events.length - 1]; + return !e.parser.constructs.disable.null.includes("codeIndented") && a && a[1].type === "linePrefix" && a[2].sliceSerialize(a[1], !0).length >= 4 ? r(l) : n.interrupt(e.parser.constructs.flow, t, r)(l); + } +} + +function at(n, r, t, e, u, i, l, a, m) { + const c = m || Number.POSITIVE_INFINITY; + let p = 0; + return f; + + function f(b) { + return b === 60 ? (n.enter(e), n.enter(u), n.enter(i), n.consume(b), n.exit(i), x) : b === null || b === 32 || b === 41 || An(b) ? t(b) : (n.enter(e), n.enter(l), n.enter(a), n.enter("chunkString", { + contentType: "string" + }), I(b)); + } + + function x(b) { + return b === 62 ? (n.enter(i), n.consume(b), n.exit(i), n.exit(u), n.exit(e), r) : (n.enter(a), n.enter("chunkString", { + contentType: "string" + }), h(b)); + } + + function h(b) { + return b === 62 ? (n.exit("chunkString"), n.exit(a), x(b)) : b === null || b === 60 || C(b) ? t(b) : (n.consume(b), b === 92 ? A : h); + } + + function A(b) { + return b === 60 || b === 62 || b === 92 ? (n.consume(b), h) : h(b); + } + + function I(b) { + return !p && (b === null || b === 41 || Z(b)) ? (n.exit("chunkString"), n.exit(a), n.exit(l), n.exit(e), r(b)) : p < c && b === 40 ? (n.consume(b), p++, I) : b === 41 ? (n.consume(b), p--, I) : b === null || b === 32 || b === 40 || An(b) ? t(b) : (n.consume(b), b === 92 ? M : I); + } + + function M(b) { + return b === 40 || b === 41 || b === 92 ? (n.consume(b), I) : I(b); + } +} + +function ot(n, r, t, e, u, i) { + const l = this; + let a = 0, m; + return c; + + function c(h) { + return n.enter(e), n.enter(u), n.consume(h), n.exit(u), n.enter(i), p; + } + + function p(h) { + return a > 999 || h === null || h === 91 || h === 93 && !m || // To do: remove in the future once we’ve switched from + // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`, + // which doesn’t need this. + // Hidden footnotes hook. + /* c8 ignore next 3 */ + h === 94 && !a && "_hiddenFootnoteSupport" in l.parser.constructs ? t(h) : h === 93 ? (n.exit(i), n.enter(u), n.consume(h), n.exit(u), n.exit(e), r) : C(h) ? (n.enter("lineEnding"), n.consume(h), n.exit("lineEnding"), p) : (n.enter("chunkString", { + contentType: "string" + }), f(h)); + } + + function f(h) { + return h === null || h === 91 || h === 93 || C(h) || a++ > 999 ? (n.exit("chunkString"), p(h)) : (n.consume(h), m || (m = !z(h)), h === 92 ? x : f); + } + + function x(h) { + return h === 91 || h === 92 || h === 93 ? (n.consume(h), a++, f) : f(h); + } +} + +function st(n, r, t, e, u, i) { + let l; + return a; + + function a(x) { + return x === 34 || x === 39 || x === 40 ? (n.enter(e), n.enter(u), n.consume(x), n.exit(u), l = x === 40 ? 41 : x, m) : t(x); + } + + function m(x) { + return x === l ? (n.enter(u), n.consume(x), n.exit(u), n.exit(e), r) : (n.enter(i), c(x)); + } + + function c(x) { + return x === l ? (n.exit(i), m(l)) : x === null ? t(x) : C(x) ? (n.enter("lineEnding"), n.consume(x), n.exit("lineEnding"), O(n, c, "linePrefix")) : (n.enter("chunkString", { + contentType: "string" + }), p(x)); + } + + function p(x) { + return x === l || x === null || C(x) ? (n.exit("chunkString"), c(x)) : (n.consume(x), x === 92 ? f : p); + } + + function f(x) { + return x === l || x === 92 ? (n.consume(x), p) : p(x); + } +} + +function dn(n, r) { + let t; + return e; + + function e(u) { + return C(u) ? (n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), t = !0, e) : z(u) ? O( + n, + e, + t ? "linePrefix" : "lineSuffix" + )(u) : r(u); + } +} + +function xn(n) { + return n.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase(); +} + +const ke = { + name: "definition", + tokenize: be +}, de = { + tokenize: ye, + partial: !0 +}; + +function be(n, r, t) { + const e = this; + let u; + return i; + + function i(h) { + return n.enter("definition"), l(h); + } + + function l(h) { + return ot.call( + e, + n, + a, + // Note: we don’t need to reset the way `markdown-rs` does. + t, + "definitionLabel", + "definitionLabelMarker", + "definitionLabelString" + )(h); + } + + function a(h) { + return u = xn( + e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1) + ), h === 58 ? (n.enter("definitionMarker"), n.consume(h), n.exit("definitionMarker"), m) : t(h); + } + + function m(h) { + return Z(h) ? dn(n, c)(h) : c(h); + } + + function c(h) { + return at( + n, + p, + // Note: we don’t need to reset the way `markdown-rs` does. + t, + "definitionDestination", + "definitionDestinationLiteral", + "definitionDestinationLiteralMarker", + "definitionDestinationRaw", + "definitionDestinationString" + )(h); + } + + function p(h) { + return n.attempt(de, f, f)(h); + } + + function f(h) { + return z(h) ? O(n, x, "whitespace")(h) : x(h); + } + + function x(h) { + return h === null || C(h) ? (n.exit("definition"), e.parser.defined.push(u), r(h)) : t(h); + } +} + +function ye(n, r, t) { + return e; + + function e(a) { + return Z(a) ? dn(n, u)(a) : t(a); + } + + function u(a) { + return st( + n, + i, + t, + "definitionTitle", + "definitionTitleMarker", + "definitionTitleString" + )(a); + } + + function i(a) { + return z(a) ? O(n, l, "whitespace")(a) : l(a); + } + + function l(a) { + return a === null || C(a) ? r(a) : t(a); + } +} + +const Se = { + name: "hardBreakEscape", + tokenize: Fe +}; + +function Fe(n, r, t) { + return e; + + function e(i) { + return n.enter("hardBreakEscape"), n.consume(i), u; + } + + function u(i) { + return C(i) ? (n.exit("hardBreakEscape"), r(i)) : t(i); + } +} + +const Ee = { + name: "headingAtx", + tokenize: we, + resolve: Ce +}; + +function Ce(n, r) { + let t = n.length - 2, e = 3, u, i; + return n[e][1].type === "whitespace" && (e += 2), t - 2 > e && n[t][1].type === "whitespace" && (t -= 2), n[t][1].type === "atxHeadingSequence" && (e === t - 1 || t - 4 > e && n[t - 2][1].type === "whitespace") && (t -= e + 1 === t ? 2 : 4), t > e && (u = { + type: "atxHeadingText", + start: n[e][1].start, + end: n[t][1].end + }, i = { + type: "chunkText", + start: n[e][1].start, + end: n[t][1].end, + contentType: "text" + }, tn(n, e, t - e + 1, [ + ["enter", u, r], + ["enter", i, r], + ["exit", i, r], + ["exit", u, r] + ])), n; +} + +function we(n, r, t) { + let e = 0; + return u; + + function u(p) { + return n.enter("atxHeading"), i(p); + } + + function i(p) { + return n.enter("atxHeadingSequence"), l(p); + } + + function l(p) { + return p === 35 && e++ < 6 ? (n.consume(p), l) : p === null || Z(p) ? (n.exit("atxHeadingSequence"), a(p)) : t(p); + } + + function a(p) { + return p === 35 ? (n.enter("atxHeadingSequence"), m(p)) : p === null || C(p) ? (n.exit("atxHeading"), r(p)) : z(p) ? O(n, a, "whitespace")(p) : (n.enter("atxHeadingText"), c(p)); + } + + function m(p) { + return p === 35 ? (n.consume(p), m) : (n.exit("atxHeadingSequence"), a(p)); + } + + function c(p) { + return p === null || p === 35 || Z(p) ? (n.exit("atxHeadingText"), a(p)) : (n.consume(p), c); + } +} + +const Ae = [ + "address", + "article", + "aside", + "base", + "basefont", + "blockquote", + "body", + "caption", + "center", + "col", + "colgroup", + "dd", + "details", + "dialog", + "dir", + "div", + "dl", + "dt", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "frame", + "frameset", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hr", + "html", + "iframe", + "legend", + "li", + "link", + "main", + "menu", + "menuitem", + "nav", + "noframes", + "ol", + "optgroup", + "option", + "p", + "param", + "search", + "section", + "summary", + "table", + "tbody", + "td", + "tfoot", + "th", + "thead", + "title", + "tr", + "track", + "ul" +], Jn = ["pre", "script", "style", "textarea"], ze = { + name: "htmlFlow", + tokenize: Le, + resolveTo: Be, + concrete: !0 +}, Ie = { + tokenize: De, + partial: !0 +}, Te = { + tokenize: Oe, + partial: !0 +}; + +function Be(n) { + let r = n.length; + for (; r-- && !(n[r][0] === "enter" && n[r][1].type === "htmlFlow");) + ; + return r > 1 && n[r - 2][1].type === "linePrefix" && (n[r][1].start = n[r - 2][1].start, n[r + 1][1].start = n[r - 2][1].start, n.splice(r - 2, 2)), n; +} + +function Le(n, r, t) { + const e = this; + let u, i, l, a, m; + return c; + + function c(s) { + return p(s); + } + + function p(s) { + return n.enter("htmlFlow"), n.enter("htmlFlowData"), n.consume(s), f; + } + + function f(s) { + return s === 33 ? (n.consume(s), x) : s === 47 ? (n.consume(s), i = !0, I) : s === 63 ? (n.consume(s), u = 3, e.interrupt ? r : o) : nn(s) ? (n.consume(s), l = String.fromCharCode(s), M) : t(s); + } + + function x(s) { + return s === 45 ? (n.consume(s), u = 2, h) : s === 91 ? (n.consume(s), u = 5, a = 0, A) : nn(s) ? (n.consume(s), u = 4, e.interrupt ? r : o) : t(s); + } + + function h(s) { + return s === 45 ? (n.consume(s), e.interrupt ? r : o) : t(s); + } + + function A(s) { + const K = "CDATA["; + return s === K.charCodeAt(a++) ? (n.consume(s), a === K.length ? e.interrupt ? r : S : A) : t(s); + } + + function I(s) { + return nn(s) ? (n.consume(s), l = String.fromCharCode(s), M) : t(s); + } + + function M(s) { + if (s === null || s === 47 || s === 62 || Z(s)) { + const K = s === 47, hn = l.toLowerCase(); + return !K && !i && Jn.includes(hn) ? (u = 1, e.interrupt ? r(s) : S(s)) : Ae.includes(l.toLowerCase()) ? (u = 6, K ? (n.consume(s), b) : e.interrupt ? r(s) : S(s)) : (u = 7, e.interrupt && !e.parser.lazy[e.now().line] ? t(s) : i ? j(s) : F(s)); + } + return s === 45 || v(s) ? (n.consume(s), l += String.fromCharCode(s), M) : t(s); + } + + function b(s) { + return s === 62 ? (n.consume(s), e.interrupt ? r : S) : t(s); + } + + function j(s) { + return z(s) ? (n.consume(s), j) : V(s); + } + + function F(s) { + return s === 47 ? (n.consume(s), V) : s === 58 || s === 95 || nn(s) ? (n.consume(s), D) : z(s) ? (n.consume(s), F) : V(s); + } + + function D(s) { + return s === 45 || s === 46 || s === 58 || s === 95 || v(s) ? (n.consume(s), D) : _(s); + } + + function _(s) { + return s === 61 ? (n.consume(s), k) : z(s) ? (n.consume(s), _) : F(s); + } + + function k(s) { + return s === null || s === 60 || s === 61 || s === 62 || s === 96 ? t(s) : s === 34 || s === 39 ? (n.consume(s), m = s, T) : z(s) ? (n.consume(s), k) : H(s); + } + + function T(s) { + return s === m ? (n.consume(s), m = null, N) : s === null || C(s) ? t(s) : (n.consume(s), T); + } + + function H(s) { + return s === null || s === 34 || s === 39 || s === 47 || s === 60 || s === 61 || s === 62 || s === 96 || Z(s) ? _(s) : (n.consume(s), H); + } + + function N(s) { + return s === 47 || s === 62 || z(s) ? F(s) : t(s); + } + + function V(s) { + return s === 62 ? (n.consume(s), y) : t(s); + } + + function y(s) { + return s === null || C(s) ? S(s) : z(s) ? (n.consume(s), y) : t(s); + } + + function S(s) { + return s === 45 && u === 2 ? (n.consume(s), U) : s === 60 && u === 1 ? (n.consume(s), W) : s === 62 && u === 4 ? (n.consume(s), J) : s === 63 && u === 3 ? (n.consume(s), o) : s === 93 && u === 5 ? (n.consume(s), en) : C(s) && (u === 6 || u === 7) ? (n.exit("htmlFlowData"), n.check( + Ie, + rn, + P + )(s)) : s === null || C(s) ? (n.exit("htmlFlowData"), P(s)) : (n.consume(s), S); + } + + function P(s) { + return n.check( + Te, + R, + rn + )(s); + } + + function R(s) { + return n.enter("lineEnding"), n.consume(s), n.exit("lineEnding"), w; + } + + function w(s) { + return s === null || C(s) ? P(s) : (n.enter("htmlFlowData"), S(s)); + } + + function U(s) { + return s === 45 ? (n.consume(s), o) : S(s); + } + + function W(s) { + return s === 47 ? (n.consume(s), l = "", G) : S(s); + } + + function G(s) { + if (s === 62) { + const K = l.toLowerCase(); + return Jn.includes(K) ? (n.consume(s), J) : S(s); + } + return nn(s) && l.length < 8 ? (n.consume(s), l += String.fromCharCode(s), G) : S(s); + } + + function en(s) { + return s === 93 ? (n.consume(s), o) : S(s); + } + + function o(s) { + return s === 62 ? (n.consume(s), J) : s === 45 && u === 2 ? (n.consume(s), o) : S(s); + } + + function J(s) { + return s === null || C(s) ? (n.exit("htmlFlowData"), rn(s)) : (n.consume(s), J); + } + + function rn(s) { + return n.exit("htmlFlow"), r(s); + } +} + +function Oe(n, r, t) { + const e = this; + return u; + + function u(l) { + return C(l) ? (n.enter("lineEnding"), n.consume(l), n.exit("lineEnding"), i) : t(l); + } + + function i(l) { + return e.parser.lazy[e.now().line] ? t(l) : r(l); + } +} + +function De(n, r, t) { + return e; + + function e(u) { + return n.enter("lineEnding"), n.consume(u), n.exit("lineEnding"), n.attempt(Sn, r, t); + } +} + +const Pe = { + name: "htmlText", + tokenize: _e +}; + +function _e(n, r, t) { + const e = this; + let u, i, l; + return a; + + function a(o) { + return n.enter("htmlText"), n.enter("htmlTextData"), n.consume(o), m; + } + + function m(o) { + return o === 33 ? (n.consume(o), c) : o === 47 ? (n.consume(o), _) : o === 63 ? (n.consume(o), F) : nn(o) ? (n.consume(o), H) : t(o); + } + + function c(o) { + return o === 45 ? (n.consume(o), p) : o === 91 ? (n.consume(o), i = 0, A) : nn(o) ? (n.consume(o), j) : t(o); + } + + function p(o) { + return o === 45 ? (n.consume(o), h) : t(o); + } + + function f(o) { + return o === null ? t(o) : o === 45 ? (n.consume(o), x) : C(o) ? (l = f, W(o)) : (n.consume(o), f); + } + + function x(o) { + return o === 45 ? (n.consume(o), h) : f(o); + } + + function h(o) { + return o === 62 ? U(o) : o === 45 ? x(o) : f(o); + } + + function A(o) { + const J = "CDATA["; + return o === J.charCodeAt(i++) ? (n.consume(o), i === J.length ? I : A) : t(o); + } + + function I(o) { + return o === null ? t(o) : o === 93 ? (n.consume(o), M) : C(o) ? (l = I, W(o)) : (n.consume(o), I); + } + + function M(o) { + return o === 93 ? (n.consume(o), b) : I(o); + } + + function b(o) { + return o === 62 ? U(o) : o === 93 ? (n.consume(o), b) : I(o); + } + + function j(o) { + return o === null || o === 62 ? U(o) : C(o) ? (l = j, W(o)) : (n.consume(o), j); + } + + function F(o) { + return o === null ? t(o) : o === 63 ? (n.consume(o), D) : C(o) ? (l = F, W(o)) : (n.consume(o), F); + } + + function D(o) { + return o === 62 ? U(o) : F(o); + } + + function _(o) { + return nn(o) ? (n.consume(o), k) : t(o); + } + + function k(o) { + return o === 45 || v(o) ? (n.consume(o), k) : T(o); + } + + function T(o) { + return C(o) ? (l = T, W(o)) : z(o) ? (n.consume(o), T) : U(o); + } + + function H(o) { + return o === 45 || v(o) ? (n.consume(o), H) : o === 47 || o === 62 || Z(o) ? N(o) : t(o); + } + + function N(o) { + return o === 47 ? (n.consume(o), U) : o === 58 || o === 95 || nn(o) ? (n.consume(o), V) : C(o) ? (l = N, W(o)) : z(o) ? (n.consume(o), N) : U(o); + } + + function V(o) { + return o === 45 || o === 46 || o === 58 || o === 95 || v(o) ? (n.consume(o), V) : y(o); + } + + function y(o) { + return o === 61 ? (n.consume(o), S) : C(o) ? (l = y, W(o)) : z(o) ? (n.consume(o), y) : N(o); + } + + function S(o) { + return o === null || o === 60 || o === 61 || o === 62 || o === 96 ? t(o) : o === 34 || o === 39 ? (n.consume(o), u = o, P) : C(o) ? (l = S, W(o)) : z(o) ? (n.consume(o), S) : (n.consume(o), R); + } + + function P(o) { + return o === u ? (n.consume(o), u = void 0, w) : o === null ? t(o) : C(o) ? (l = P, W(o)) : (n.consume(o), P); + } + + function R(o) { + return o === null || o === 34 || o === 39 || o === 60 || o === 61 || o === 96 ? t(o) : o === 47 || o === 62 || Z(o) ? N(o) : (n.consume(o), R); + } + + function w(o) { + return o === 47 || o === 62 || Z(o) ? N(o) : t(o); + } + + function U(o) { + return o === 62 ? (n.consume(o), n.exit("htmlTextData"), n.exit("htmlText"), r) : t(o); + } + + function W(o) { + return n.exit("htmlTextData"), n.enter("lineEnding"), n.consume(o), n.exit("lineEnding"), G; + } + + function G(o) { + return z(o) ? O( + n, + en, + "linePrefix", + e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + )(o) : en(o); + } + + function en(o) { + return n.enter("htmlTextData"), l(o); + } +} + +const Dn = { + name: "labelEnd", + tokenize: Ne, + resolveTo: He, + resolveAll: qe +}, Me = { + tokenize: Ve +}, je = { + tokenize: We +}, Re = { + tokenize: Qe +}; + +function qe(n) { + let r = -1; + for (; ++r < n.length;) { + const t = n[r][1]; + (t.type === "labelImage" || t.type === "labelLink" || t.type === "labelEnd") && (n.splice(r + 1, t.type === "labelImage" ? 4 : 2), t.type = "data", r++); + } + return n; +} + +function He(n, r) { + let t = n.length, e = 0, u, i, l, a; + for (; t--;) + if (u = n[t][1], i) { + if (u.type === "link" || u.type === "labelLink" && u._inactive) + break; + n[t][0] === "enter" && u.type === "labelLink" && (u._inactive = !0); + } else if (l) { + if (n[t][0] === "enter" && (u.type === "labelImage" || u.type === "labelLink") && !u._balanced && (i = t, u.type !== "labelLink")) { + e = 2; + break; + } + } else + u.type === "labelEnd" && (l = t); + const m = { + type: n[i][1].type === "labelLink" ? "link" : "image", + start: Object.assign({}, n[i][1].start), + end: Object.assign({}, n[n.length - 1][1].end) + }, c = { + type: "label", + start: Object.assign({}, n[i][1].start), + end: Object.assign({}, n[l][1].end) + }, p = { + type: "labelText", + start: Object.assign({}, n[i + e + 2][1].end), + end: Object.assign({}, n[l - 2][1].start) + }; + return a = [ + ["enter", m, r], + ["enter", c, r] + ], a = Y(a, n.slice(i + 1, i + e + 3)), a = Y(a, [["enter", p, r]]), a = Y( + a, + Ln( + r.parser.constructs.insideSpan.null, + n.slice(i + e + 4, l - 3), + r + ) + ), a = Y(a, [ + ["exit", p, r], + n[l - 2], + n[l - 1], + ["exit", c, r] + ]), a = Y(a, n.slice(l + 1)), a = Y(a, [["exit", m, r]]), tn(n, i, n.length, a), n; +} + +function Ne(n, r, t) { + const e = this; + let u = e.events.length, i, l; + for (; u--;) + if ((e.events[u][1].type === "labelImage" || e.events[u][1].type === "labelLink") && !e.events[u][1]._balanced) { + i = e.events[u][1]; + break; + } + return a; + + function a(x) { + return i ? i._inactive ? f(x) : (l = e.parser.defined.includes( + xn( + e.sliceSerialize({ + start: i.end, + end: e.now() + }) + ) + ), n.enter("labelEnd"), n.enter("labelMarker"), n.consume(x), n.exit("labelMarker"), n.exit("labelEnd"), m) : t(x); + } + + function m(x) { + return x === 40 ? n.attempt( + Me, + p, + l ? p : f + )(x) : x === 91 ? n.attempt( + je, + p, + l ? c : f + )(x) : l ? p(x) : f(x); + } + + function c(x) { + return n.attempt( + Re, + p, + f + )(x); + } + + function p(x) { + return r(x); + } + + function f(x) { + return i._balanced = !0, t(x); + } +} + +function Ve(n, r, t) { + return e; + + function e(f) { + return n.enter("resource"), n.enter("resourceMarker"), n.consume(f), n.exit("resourceMarker"), u; + } + + function u(f) { + return Z(f) ? dn(n, i)(f) : i(f); + } + + function i(f) { + return f === 41 ? p(f) : at( + n, + l, + a, + "resourceDestination", + "resourceDestinationLiteral", + "resourceDestinationLiteralMarker", + "resourceDestinationRaw", + "resourceDestinationString", + 32 + )(f); + } + + function l(f) { + return Z(f) ? dn(n, m)(f) : p(f); + } + + function a(f) { + return t(f); + } + + function m(f) { + return f === 34 || f === 39 || f === 40 ? st( + n, + c, + t, + "resourceTitle", + "resourceTitleMarker", + "resourceTitleString" + )(f) : p(f); + } + + function c(f) { + return Z(f) ? dn(n, p)(f) : p(f); + } + + function p(f) { + return f === 41 ? (n.enter("resourceMarker"), n.consume(f), n.exit("resourceMarker"), n.exit("resource"), r) : t(f); + } +} + +function We(n, r, t) { + const e = this; + return u; + + function u(a) { + return ot.call( + e, + n, + i, + l, + "reference", + "referenceMarker", + "referenceString" + )(a); + } + + function i(a) { + return e.parser.defined.includes( + xn( + e.sliceSerialize(e.events[e.events.length - 1][1]).slice(1, -1) + ) + ) ? r(a) : t(a); + } + + function l(a) { + return t(a); + } +} + +function Qe(n, r, t) { + return e; + + function e(i) { + return n.enter("reference"), n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), u; + } + + function u(i) { + return i === 93 ? (n.enter("referenceMarker"), n.consume(i), n.exit("referenceMarker"), n.exit("reference"), r) : t(i); + } +} + +const Ue = { + name: "labelStartImage", + tokenize: $e, + resolveAll: Dn.resolveAll +}; + +function $e(n, r, t) { + const e = this; + return u; + + function u(a) { + return n.enter("labelImage"), n.enter("labelImageMarker"), n.consume(a), n.exit("labelImageMarker"), i; + } + + function i(a) { + return a === 91 ? (n.enter("labelMarker"), n.consume(a), n.exit("labelMarker"), n.exit("labelImage"), l) : t(a); + } + + function l(a) { + return a === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(a) : r(a); + } +} + +const Ze = { + name: "labelStartLink", + tokenize: Ye, + resolveAll: Dn.resolveAll +}; + +function Ye(n, r, t) { + const e = this; + return u; + + function u(l) { + return n.enter("labelLink"), n.enter("labelMarker"), n.consume(l), n.exit("labelMarker"), n.exit("labelLink"), i; + } + + function i(l) { + return l === 94 && "_hiddenFootnoteSupport" in e.parser.constructs ? t(l) : r(l); + } +} + +const wn = { + name: "lineEnding", + tokenize: Ge +}; + +function Ge(n, r) { + return t; + + function t(e) { + return n.enter("lineEnding"), n.consume(e), n.exit("lineEnding"), O(n, r, "linePrefix"); + } +} + +const bn = { + name: "thematicBreak", + tokenize: Je +}; + +function Je(n, r, t) { + let e = 0, u; + return i; + + function i(c) { + return n.enter("thematicBreak"), l(c); + } + + function l(c) { + return u = c, a(c); + } + + function a(c) { + return c === u ? (n.enter("thematicBreakSequence"), m(c)) : e >= 3 && (c === null || C(c)) ? (n.exit("thematicBreak"), r(c)) : t(c); + } + + function m(c) { + return c === u ? (n.consume(c), e++, m) : (n.exit("thematicBreakSequence"), z(c) ? O(n, a, "whitespace")(c) : a(c)); + } +} + +const $ = { + name: "list", + tokenize: ve, + continuation: { + tokenize: nr + }, + exit: er +}, Ke = { + tokenize: rr, + partial: !0 +}, Xe = { + tokenize: tr, + partial: !0 +}; + +function ve(n, r, t) { + const e = this, u = e.events[e.events.length - 1]; + let i = u && u[1].type === "linePrefix" ? u[2].sliceSerialize(u[1], !0).length : 0, l = 0; + return a; + + function a(h) { + const A = e.containerState.type || (h === 42 || h === 43 || h === 45 ? "listUnordered" : "listOrdered"); + if (A === "listUnordered" ? !e.containerState.marker || h === e.containerState.marker : zn(h)) { + if (e.containerState.type || (e.containerState.type = A, n.enter(A, { + _container: !0 + })), A === "listUnordered") + return n.enter("listItemPrefix"), h === 42 || h === 45 ? n.check(bn, t, c)(h) : c(h); + if (!e.interrupt || h === 49) + return n.enter("listItemPrefix"), n.enter("listItemValue"), m(h); + } + return t(h); + } + + function m(h) { + return zn(h) && ++l < 10 ? (n.consume(h), m) : (!e.interrupt || l < 2) && (e.containerState.marker ? h === e.containerState.marker : h === 41 || h === 46) ? (n.exit("listItemValue"), c(h)) : t(h); + } + + function c(h) { + return n.enter("listItemMarker"), n.consume(h), n.exit("listItemMarker"), e.containerState.marker = e.containerState.marker || h, n.check( + Sn, + // Can’t be empty when interrupting. + e.interrupt ? t : p, + n.attempt( + Ke, + x, + f + ) + ); + } + + function p(h) { + return e.containerState.initialBlankLine = !0, i++, x(h); + } + + function f(h) { + return z(h) ? (n.enter("listItemPrefixWhitespace"), n.consume(h), n.exit("listItemPrefixWhitespace"), x) : t(h); + } + + function x(h) { + return e.containerState.size = i + e.sliceSerialize(n.exit("listItemPrefix"), !0).length, r(h); + } +} + +function nr(n, r, t) { + const e = this; + return e.containerState._closeFlow = void 0, n.check(Sn, u, i); + + function u(a) { + return e.containerState.furtherBlankLines = e.containerState.furtherBlankLines || e.containerState.initialBlankLine, O( + n, + r, + "listItemIndent", + e.containerState.size + 1 + )(a); + } + + function i(a) { + return e.containerState.furtherBlankLines || !z(a) ? (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, l(a)) : (e.containerState.furtherBlankLines = void 0, e.containerState.initialBlankLine = void 0, n.attempt(Xe, r, l)(a)); + } + + function l(a) { + return e.containerState._closeFlow = !0, e.interrupt = void 0, O( + n, + n.attempt($, r, t), + "linePrefix", + e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + )(a); + } +} + +function tr(n, r, t) { + const e = this; + return O( + n, + u, + "listItemIndent", + e.containerState.size + 1 + ); + + function u(i) { + const l = e.events[e.events.length - 1]; + return l && l[1].type === "listItemIndent" && l[2].sliceSerialize(l[1], !0).length === e.containerState.size ? r(i) : t(i); + } +} + +function er(n) { + n.exit(this.containerState.type); +} + +function rr(n, r, t) { + const e = this; + return O( + n, + u, + "listItemPrefixWhitespace", + e.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1 + ); + + function u(i) { + const l = e.events[e.events.length - 1]; + return !z(i) && l && l[1].type === "listItemPrefixWhitespace" ? r(i) : t(i); + } +} + +const Kn = { + name: "setextUnderline", + tokenize: ur, + resolveTo: ir +}; + +function ir(n, r) { + let t = n.length, e, u, i; + for (; t--;) + if (n[t][0] === "enter") { + if (n[t][1].type === "content") { + e = t; + break; + } + n[t][1].type === "paragraph" && (u = t); + } else + n[t][1].type === "content" && n.splice(t, 1), !i && n[t][1].type === "definition" && (i = t); + const l = { + type: "setextHeading", + start: Object.assign({}, n[u][1].start), + end: Object.assign({}, n[n.length - 1][1].end) + }; + return n[u][1].type = "setextHeadingText", i ? (n.splice(u, 0, ["enter", l, r]), n.splice(i + 1, 0, ["exit", n[e][1], r]), n[e][1].end = Object.assign({}, n[i][1].end)) : n[e][1] = l, n.push(["exit", l, r]), n; +} + +function ur(n, r, t) { + const e = this; + let u; + return i; + + function i(c) { + let p = e.events.length, f; + for (; p--;) + if (e.events[p][1].type !== "lineEnding" && e.events[p][1].type !== "linePrefix" && e.events[p][1].type !== "content") { + f = e.events[p][1].type === "paragraph"; + break; + } + return !e.parser.lazy[e.now().line] && (e.interrupt || f) ? (n.enter("setextHeadingLine"), u = c, l(c)) : t(c); + } + + function l(c) { + return n.enter("setextHeadingLineSequence"), a(c); + } + + function a(c) { + return c === u ? (n.consume(c), a) : (n.exit("setextHeadingLineSequence"), z(c) ? O(n, m, "lineSuffix")(c) : m(c)); + } + + function m(c) { + return c === null || C(c) ? (n.exit("setextHeadingLine"), r(c)) : t(c); + } +} + +const lr = { + tokenize: ar +}; + +function ar(n) { + const r = this, t = n.attempt( + // Try to parse a blank line. + Sn, + e, + // Try to parse initial flow (essentially, only code). + n.attempt( + this.parser.constructs.flowInitial, + u, + O( + n, + n.attempt( + this.parser.constructs.flow, + u, + n.attempt(pe, u) + ), + "linePrefix" + ) + ) + ); + return t; + + function e(i) { + if (i === null) { + n.consume(i); + return; + } + return n.enter("lineEndingBlank"), n.consume(i), n.exit("lineEndingBlank"), r.currentConstruct = void 0, t; + } + + function u(i) { + if (i === null) { + n.consume(i); + return; + } + return n.enter("lineEnding"), n.consume(i), n.exit("lineEnding"), r.currentConstruct = void 0, t; + } +} + +const or = { + resolveAll: ht() +}, sr = ct("string"), cr = ct("text"); + +function ct(n) { + return { + tokenize: r, + resolveAll: ht( + n === "text" ? hr : void 0 + ) + }; + + function r(t) { + const e = this, u = this.parser.constructs[n], i = t.attempt(u, l, a); + return l; + + function l(p) { + return c(p) ? i(p) : a(p); + } + + function a(p) { + if (p === null) { + t.consume(p); + return; + } + return t.enter("data"), t.consume(p), m; + } + + function m(p) { + return c(p) ? (t.exit("data"), i(p)) : (t.consume(p), m); + } + + function c(p) { + if (p === null) + return !0; + const f = u[p]; + let x = -1; + if (f) + for (; ++x < f.length;) { + const h = f[x]; + if (!h.previous || h.previous.call(e, e.previous)) + return !0; + } + return !1; + } + } +} + +function ht(n) { + return r; + + function r(t, e) { + let u = -1, i; + for (; ++u <= t.length;) + i === void 0 ? t[u] && t[u][1].type === "data" && (i = u, u++) : (!t[u] || t[u][1].type !== "data") && (u !== i + 2 && (t[i][1].end = t[u - 1][1].end, t.splice(i + 2, u - i - 2), u = i + 2), i = void 0); + return n ? n(t, e) : t; + } +} + +function hr(n, r) { + let t = 0; + for (; ++t <= n.length;) + if ((t === n.length || n[t][1].type === "lineEnding") && n[t - 1][1].type === "data") { + const e = n[t - 1][1], u = r.sliceStream(e); + let i = u.length, l = -1, a = 0, m; + for (; i--;) { + const c = u[i]; + if (typeof c == "string") { + for (l = c.length; c.charCodeAt(l - 1) === 32;) + a++, l--; + if (l) + break; + l = -1; + } else if (c === -2) + m = !0, a++; + else if (c !== -1) { + i++; + break; + } + } + if (a) { + const c = { + type: t === n.length || m || a < 2 ? "lineSuffix" : "hardBreakTrailing", + start: { + line: e.end.line, + column: e.end.column - a, + offset: e.end.offset - a, + _index: e.start._index + i, + _bufferIndex: i ? l : e.start._bufferIndex + l + }, + end: Object.assign({}, e.end) + }; + e.end = Object.assign({}, c.start), e.start.offset === e.end.offset ? Object.assign(e, c) : (n.splice( + t, + 0, + ["enter", c, r], + ["exit", c, r] + ), t += 2); + } + t++; + } + return n; +} + +function pr(n, r, t) { + let e = Object.assign( + t ? Object.assign({}, t) : { + line: 1, + column: 1, + offset: 0 + }, + { + _index: 0, + _bufferIndex: -1 + } + ); + const u = {}, i = []; + let l = [], a = []; + const m = { + consume: j, + enter: F, + exit: D, + attempt: T(_), + check: T(k), + interrupt: T(k, { + interrupt: !0 + }) + }, c = { + previous: null, + code: null, + containerState: {}, + events: [], + parser: n, + sliceStream: h, + sliceSerialize: x, + now: A, + defineSkip: I, + write: f + }; + let p = r.tokenize.call(c, m); + return r.resolveAll && i.push(r), c; + + function f(y) { + return l = Y(l, y), M(), l[l.length - 1] !== null ? [] : (H(r, 0), c.events = Ln(i, c.events, c), c.events); + } + + function x(y, S) { + return mr(h(y), S); + } + + function h(y) { + return fr(l, y); + } + + function A() { + const {line: y, column: S, offset: P, _index: R, _bufferIndex: w} = e; + return { + line: y, + column: S, + offset: P, + _index: R, + _bufferIndex: w + }; + } + + function I(y) { + u[y.line] = y.column, V(); + } + + function M() { + let y; + for (; e._index < l.length;) { + const S = l[e._index]; + if (typeof S == "string") + for (y = e._index, e._bufferIndex < 0 && (e._bufferIndex = 0); e._index === y && e._bufferIndex < S.length;) + b(S.charCodeAt(e._bufferIndex)); + else + b(S); + } + } + + function b(y) { + p = p(y); + } + + function j(y) { + C(y) ? (e.line++, e.column = 1, e.offset += y === -3 ? 2 : 1, V()) : y !== -1 && (e.column++, e.offset++), e._bufferIndex < 0 ? e._index++ : (e._bufferIndex++, e._bufferIndex === l[e._index].length && (e._bufferIndex = -1, e._index++)), c.previous = y; + } + + function F(y, S) { + const P = S || {}; + return P.type = y, P.start = A(), c.events.push(["enter", P, c]), a.push(P), P; + } + + function D(y) { + const S = a.pop(); + return S.end = A(), c.events.push(["exit", S, c]), S; + } + + function _(y, S) { + H(y, S.from); + } + + function k(y, S) { + S.restore(); + } + + function T(y, S) { + return P; + + function P(R, w, U) { + let W, G, en, o; + return Array.isArray(R) ? rn(R) : "tokenize" in R ? ( + // @ts-expect-error Looks like a construct. + rn([R]) + ) : J(R); + + function J(Q) { + return pn; + + function pn(an) { + const fn = an !== null && Q[an], mn = an !== null && Q.null, Fn = [ + // To do: add more extension tests. + /* c8 ignore next 2 */ + ...Array.isArray(fn) ? fn : fn ? [fn] : [], + ...Array.isArray(mn) ? mn : mn ? [mn] : [] + ]; + return rn(Fn)(an); + } + } + + function rn(Q) { + return W = Q, G = 0, Q.length === 0 ? U : s(Q[G]); + } + + function s(Q) { + return pn; + + function pn(an) { + return o = N(), en = Q, Q.partial || (c.currentConstruct = Q), Q.name && c.parser.constructs.disable.null.includes(Q.name) ? hn() : Q.tokenize.call( + // If we do have fields, create an object w/ `context` as its + // prototype. + // This allows a “live binding”, which is needed for `interrupt`. + S ? Object.assign(Object.create(c), S) : c, + m, + K, + hn + )(an); + } + } + + function K(Q) { + return y(en, o), w; + } + + function hn(Q) { + return o.restore(), ++G < W.length ? s(W[G]) : U; + } + } + } + + function H(y, S) { + y.resolveAll && !i.includes(y) && i.push(y), y.resolve && tn( + c.events, + S, + c.events.length - S, + y.resolve(c.events.slice(S), c) + ), y.resolveTo && (c.events = y.resolveTo(c.events, c)); + } + + function N() { + const y = A(), S = c.previous, P = c.currentConstruct, R = c.events.length, w = Array.from(a); + return { + restore: U, + from: R + }; + + function U() { + e = y, c.previous = S, c.currentConstruct = P, c.events.length = R, a = w, V(); + } + } + + function V() { + e.line in u && e.column < 2 && (e.column = u[e.line], e.offset += u[e.line] - 1); + } +} + +function fr(n, r) { + const t = r.start._index, e = r.start._bufferIndex, u = r.end._index, i = r.end._bufferIndex; + let l; + if (t === u) + l = [n[t].slice(e, i)]; + else { + if (l = n.slice(t, u), e > -1) { + const a = l[0]; + typeof a == "string" ? l[0] = a.slice(e) : l.shift(); + } + i > 0 && l.push(n[u].slice(0, i)); + } + return l; +} + +function mr(n, r) { + let t = -1; + const e = []; + let u; + for (; ++t < n.length;) { + const i = n[t]; + let l; + if (typeof i == "string") + l = i; + else + switch (i) { + case -5: { + l = "\r"; + break; + } + case -4: { + l = ` +`; + break; + } + case -3: { + l = `\r +`; + break; + } + case -2: { + l = r ? " " : " "; + break; + } + case -1: { + if (!r && u) + continue; + l = " "; + break; + } + default: + l = String.fromCharCode(i); + } + u = i === -2, e.push(l); + } + return e.join(""); +} + +const xr = { + 42: $, + 43: $, + 45: $, + 48: $, + 49: $, + 50: $, + 51: $, + 52: $, + 53: $, + 54: $, + 55: $, + 56: $, + 57: $, + 62: rt +}, gr = { + 91: ke +}, kr = { + [-2]: Cn, + [-1]: Cn, + 32: Cn +}, dr = { + 35: Ee, + 42: bn, + 45: [Kn, bn], + 60: ze, + 61: Kn, + 95: bn, + 96: Gn, + 126: Gn +}, br = { + 38: ut, + 92: it +}, yr = { + [-5]: wn, + [-4]: wn, + [-3]: wn, + 33: Ue, + 38: ut, + 42: In, + 60: [Yt, Pe], + 91: Ze, + 92: [Se, it], + 93: Dn, + 95: In, + 96: ae +}, Sr = { + null: [In, or] +}, Fr = { + null: [42, 95] +}, Er = { + null: [] +}, Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + attentionMarkers: Fr, + contentInitial: gr, + disable: Er, + document: xr, + flow: dr, + flowInitial: kr, + insideSpan: Sr, + string: br, + text: yr +}, Symbol.toStringTag, {value: "Module"})); + +function wr(n) { + const t = ( + /** @type {FullNormalizedExtension} */ + Ot([Cr, ...(n || {}).extensions || []]) + ), e = { + defined: [], + lazy: {}, + constructs: t, + content: u(Nt), + document: u(Wt), + flow: u(lr), + string: u(sr), + text: u(cr) + }; + return e; + + function u(i) { + return l; + + function l(a) { + return pr(e, i, a); + } + } +} + +const Xn = /[\0\t\n\r]/g; + +function Ar() { + let n = 1, r = "", t = !0, e; + return u; + + function u(i, l, a) { + const m = []; + let c, p, f, x, h; + for (i = r + i.toString(l), f = 0, r = "", t && (i.charCodeAt(0) === 65279 && f++, t = void 0); f < i.length;) { + if (Xn.lastIndex = f, c = Xn.exec(i), x = c && c.index !== void 0 ? c.index : i.length, h = i.charCodeAt(x), !c) { + r = i.slice(f); + break; + } + if (h === 10 && f === x && e) + m.push(-3), e = void 0; + else + switch (e && (m.push(-5), e = void 0), f < x && (m.push(i.slice(f, x)), n += x - f), h) { + case 0: { + m.push(65533), n++; + break; + } + case 9: { + for (p = Math.ceil(n / 4) * 4, m.push(-2); n++ < p;) + m.push(-1); + break; + } + case 10: { + m.push(-4), n = 1; + break; + } + default: + e = !0, n = 1; + } + f = x + 1; + } + return a && (e && m.push(-5), r && m.push(r), m.push(null)), m; + } +} + +function zr(n) { + for (; !lt(n);) + ; + return n; +} + +function pt(n, r) { + const t = Number.parseInt(n, r); + return ( + // C0 except for HT, LF, FF, CR, space. + t < 9 || t === 11 || t > 13 && t < 32 || // Control character (DEL) of C0, and C1 controls. + t > 126 && t < 160 || // Lone high surrogates and low surrogates. + t > 55295 && t < 57344 || // Noncharacters. + t > 64975 && t < 65008 || (t & 65535) === 65535 || (t & 65535) === 65534 || // Out of range + t > 1114111 ? "�" : String.fromCharCode(t) + ); +} + +const Ir = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi; + +function Tr(n) { + return n.replace(Ir, Br); +} + +function Br(n, r, t) { + if (r) + return r; + if (t.charCodeAt(0) === 35) { + const u = t.charCodeAt(1), i = u === 120 || u === 88; + return pt(t.slice(i ? 2 : 1), i ? 16 : 10); + } + return On(t) || n; +} + +function yn(n) { + return !n || typeof n != "object" ? "" : "position" in n || "type" in n ? vn(n.position) : "start" in n || "end" in n ? vn(n) : "line" in n || "column" in n ? Tn(n) : ""; +} + +function Tn(n) { + return nt(n && n.line) + ":" + nt(n && n.column); +} + +function vn(n) { + return Tn(n && n.start) + "-" + Tn(n && n.end); +} + +function nt(n) { + return n && typeof n == "number" ? n : 1; +} + +const ft = {}.hasOwnProperty, mt = ( + /** + * @type {( + * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) & + * ((value: Value, options?: Options | null | undefined) => Root) + * )} + */ + /** + * @param {Value} value + * @param {Encoding | Options | null | undefined} [encoding] + * @param {Options | null | undefined} [options] + * @returns {Root} + */ + function (n, r, t) { + return typeof r != "string" && (t = r, r = void 0), Lr(t)( + zr( + wr(t).document().write(Ar()(n, r, !0)) + ) + ); + } +); + +function Lr(n) { + const r = { + transforms: [], + canContainEols: ["emphasis", "fragment", "heading", "paragraph", "strong"], + enter: { + autolink: a(Hn), + autolinkProtocol: y, + autolinkEmail: y, + atxHeading: a(jn), + blockQuote: a(Fn), + characterEscape: y, + characterReference: y, + codeFenced: a(Mn), + codeFencedFenceInfo: m, + codeFencedFenceMeta: m, + codeIndented: a(Mn, m), + codeText: a(kt, m), + codeTextData: y, + data: y, + codeFlowValue: y, + definition: a(dt), + definitionDestinationString: m, + definitionLabelString: m, + definitionTitleString: m, + emphasis: a(bt), + hardBreakEscape: a(Rn), + hardBreakTrailing: a(Rn), + htmlFlow: a(qn, m), + htmlFlowData: y, + htmlText: a(qn, m), + htmlTextData: y, + image: a(yt), + label: m, + link: a(Hn), + listItem: a(St), + listItemValue: A, + listOrdered: a(Nn, h), + listUnordered: a(Nn), + paragraph: a(Ft), + reference: hn, + referenceString: m, + resourceDestinationString: m, + resourceTitleString: m, + setextHeading: a(jn), + strong: a(Et), + thematicBreak: a(wt) + }, + exit: { + atxHeading: p(), + atxHeadingSequence: T, + autolink: p(), + autolinkEmail: mn, + autolinkProtocol: fn, + blockQuote: p(), + characterEscapeValue: S, + characterReferenceMarkerHexadecimal: pn, + characterReferenceMarkerNumeric: pn, + characterReferenceValue: an, + codeFenced: p(j), + codeFencedFence: b, + codeFencedFenceInfo: I, + codeFencedFenceMeta: M, + codeFlowValue: S, + codeIndented: p(F), + codeText: p(W), + codeTextData: S, + data: S, + definition: p(), + definitionDestinationString: k, + definitionLabelString: D, + definitionTitleString: _, + emphasis: p(), + hardBreakEscape: p(R), + hardBreakTrailing: p(R), + htmlFlow: p(w), + htmlFlowData: S, + htmlText: p(U), + htmlTextData: S, + image: p(en), + label: J, + labelText: o, + lineEnding: P, + link: p(G), + listItem: p(), + listOrdered: p(), + listUnordered: p(), + paragraph: p(), + referenceString: Q, + resourceDestinationString: rn, + resourceTitleString: s, + resource: K, + setextHeading: p(V), + setextHeadingLineSequence: N, + setextHeadingText: H, + strong: p(), + thematicBreak: p() + } + }; + xt(r, (n || {}).mdastExtensions || []); + const t = {}; + return e; + + function e(g) { + let d = { + type: "root", + children: [] + }; + const E = { + stack: [d], + tokenStack: [], + config: r, + enter: c, + exit: f, + buffer: m, + resume: x, + setData: i, + getData: l + }, B = []; + let L = -1; + for (; ++L < g.length;) + if (g[L][1].type === "listOrdered" || g[L][1].type === "listUnordered") + if (g[L][0] === "enter") + B.push(L); + else { + const X = B.pop(); + L = u(g, X, L); + } + for (L = -1; ++L < g.length;) { + const X = r[g[L][0]]; + ft.call(X, g[L][1].type) && X[g[L][1].type].call( + Object.assign( + { + sliceSerialize: g[L][2].sliceSerialize + }, + E + ), + g[L][1] + ); + } + if (E.tokenStack.length > 0) { + const X = E.tokenStack[E.tokenStack.length - 1]; + (X[1] || tt).call(E, void 0, X[0]); + } + for (d.position = { + start: sn( + g.length > 0 ? g[0][1].start : { + line: 1, + column: 1, + offset: 0 + } + ), + end: sn( + g.length > 0 ? g[g.length - 2][1].end : { + line: 1, + column: 1, + offset: 0 + } + ) + }, L = -1; ++L < r.transforms.length;) + d = r.transforms[L](d) || d; + return d; + } + + function u(g, d, E) { + let B = d - 1, L = -1, X = !1, on, un, gn, kn; + for (; ++B <= E;) { + const q = g[B]; + if (q[1].type === "listUnordered" || q[1].type === "listOrdered" || q[1].type === "blockQuote" ? (q[0] === "enter" ? L++ : L--, kn = void 0) : q[1].type === "lineEndingBlank" ? q[0] === "enter" && (on && !kn && !L && !gn && (gn = B), kn = void 0) : q[1].type === "linePrefix" || q[1].type === "listItemValue" || q[1].type === "listItemMarker" || q[1].type === "listItemPrefix" || q[1].type === "listItemPrefixWhitespace" || (kn = void 0), !L && q[0] === "enter" && q[1].type === "listItemPrefix" || L === -1 && q[0] === "exit" && (q[1].type === "listUnordered" || q[1].type === "listOrdered")) { + if (on) { + let En = B; + for (un = void 0; En--;) { + const ln = g[En]; + if (ln[1].type === "lineEnding" || ln[1].type === "lineEndingBlank") { + if (ln[0] === "exit") + continue; + un && (g[un][1].type = "lineEndingBlank", X = !0), ln[1].type = "lineEnding", un = En; + } else if (!(ln[1].type === "linePrefix" || ln[1].type === "blockQuotePrefix" || ln[1].type === "blockQuotePrefixWhitespace" || ln[1].type === "blockQuoteMarker" || ln[1].type === "listItemIndent")) + break; + } + gn && (!un || gn < un) && (on._spread = !0), on.end = Object.assign( + {}, + un ? g[un][1].start : q[1].end + ), g.splice(un || B, 0, ["exit", on, q[2]]), B++, E++; + } + q[1].type === "listItemPrefix" && (on = { + type: "listItem", + _spread: !1, + start: Object.assign({}, q[1].start), + // @ts-expect-error: we’ll add `end` in a second. + end: void 0 + }, g.splice(B, 0, ["enter", on, q[2]]), B++, E++, gn = void 0, kn = !0); + } + } + return g[d][1]._spread = X, E; + } + + function i(g, d) { + t[g] = d; + } + + function l(g) { + return t[g]; + } + + function a(g, d) { + return E; + + function E(B) { + c.call(this, g(B), B), d && d.call(this, B); + } + } + + function m() { + this.stack.push({ + type: "fragment", + children: [] + }); + } + + function c(g, d, E) { + return this.stack[this.stack.length - 1].children.push(g), this.stack.push(g), this.tokenStack.push([d, E]), g.position = { + start: sn(d.start) + }, g; + } + + function p(g) { + return d; + + function d(E) { + g && g.call(this, E), f.call(this, E); + } + } + + function f(g, d) { + const E = this.stack.pop(), B = this.tokenStack.pop(); + if (B) + B[0].type !== g.type && (d ? d.call(this, g, B[0]) : (B[1] || tt).call(this, g, B[0])); + else + throw new Error( + "Cannot close `" + g.type + "` (" + yn({ + start: g.start, + end: g.end + }) + "): it’s not open" + ); + return E.position.end = sn(g.end), E; + } + + function x() { + return Bt(this.stack.pop()); + } + + function h() { + i("expectingFirstListItemValue", !0); + } + + function A(g) { + if (l("expectingFirstListItemValue")) { + const d = this.stack[this.stack.length - 2]; + d.start = Number.parseInt(this.sliceSerialize(g), 10), i("expectingFirstListItemValue"); + } + } + + function I() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.lang = g; + } + + function M() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.meta = g; + } + + function b() { + l("flowCodeInside") || (this.buffer(), i("flowCodeInside", !0)); + } + + function j() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.value = g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), i("flowCodeInside"); + } + + function F() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.value = g.replace(/(\r?\n|\r)$/g, ""); + } + + function D(g) { + const d = this.resume(), E = this.stack[this.stack.length - 1]; + E.label = d, E.identifier = xn( + this.sliceSerialize(g) + ).toLowerCase(); + } + + function _() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.title = g; + } + + function k() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.url = g; + } + + function T(g) { + const d = this.stack[this.stack.length - 1]; + if (!d.depth) { + const E = this.sliceSerialize(g).length; + d.depth = E; + } + } + + function H() { + i("setextHeadingSlurpLineEnding", !0); + } + + function N(g) { + const d = this.stack[this.stack.length - 1]; + d.depth = this.sliceSerialize(g).charCodeAt(0) === 61 ? 1 : 2; + } + + function V() { + i("setextHeadingSlurpLineEnding"); + } + + function y(g) { + const d = this.stack[this.stack.length - 1]; + let E = d.children[d.children.length - 1]; + (!E || E.type !== "text") && (E = Ct(), E.position = { + start: sn(g.start) + }, d.children.push(E)), this.stack.push(E); + } + + function S(g) { + const d = this.stack.pop(); + d.value += this.sliceSerialize(g), d.position.end = sn(g.end); + } + + function P(g) { + const d = this.stack[this.stack.length - 1]; + if (l("atHardBreak")) { + const E = d.children[d.children.length - 1]; + E.position.end = sn(g.end), i("atHardBreak"); + return; + } + !l("setextHeadingSlurpLineEnding") && r.canContainEols.includes(d.type) && (y.call(this, g), S.call(this, g)); + } + + function R() { + i("atHardBreak", !0); + } + + function w() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.value = g; + } + + function U() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.value = g; + } + + function W() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.value = g; + } + + function G() { + const g = this.stack[this.stack.length - 1]; + if (l("inReference")) { + const d = l("referenceType") || "shortcut"; + g.type += "Reference", g.referenceType = d, delete g.url, delete g.title; + } else + delete g.identifier, delete g.label; + i("referenceType"); + } + + function en() { + const g = this.stack[this.stack.length - 1]; + if (l("inReference")) { + const d = l("referenceType") || "shortcut"; + g.type += "Reference", g.referenceType = d, delete g.url, delete g.title; + } else + delete g.identifier, delete g.label; + i("referenceType"); + } + + function o(g) { + const d = this.sliceSerialize(g), E = this.stack[this.stack.length - 2]; + E.label = Tr(d), E.identifier = xn(d).toLowerCase(); + } + + function J() { + const g = this.stack[this.stack.length - 1], d = this.resume(), E = this.stack[this.stack.length - 1]; + if (i("inReference", !0), E.type === "link") { + const B = g.children; + E.children = B; + } else + E.alt = d; + } + + function rn() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.url = g; + } + + function s() { + const g = this.resume(), d = this.stack[this.stack.length - 1]; + d.title = g; + } + + function K() { + i("inReference"); + } + + function hn() { + i("referenceType", "collapsed"); + } + + function Q(g) { + const d = this.resume(), E = this.stack[this.stack.length - 1]; + E.label = d, E.identifier = xn( + this.sliceSerialize(g) + ).toLowerCase(), i("referenceType", "full"); + } + + function pn(g) { + i("characterReferenceType", g.type); + } + + function an(g) { + const d = this.sliceSerialize(g), E = l("characterReferenceType"); + let B; + E ? (B = pt( + d, + E === "characterReferenceMarkerNumeric" ? 10 : 16 + ), i("characterReferenceType")) : B = On(d); + const L = this.stack.pop(); + L.value += B, L.position.end = sn(g.end); + } + + function fn(g) { + S.call(this, g); + const d = this.stack[this.stack.length - 1]; + d.url = this.sliceSerialize(g); + } + + function mn(g) { + S.call(this, g); + const d = this.stack[this.stack.length - 1]; + d.url = "mailto:" + this.sliceSerialize(g); + } + + function Fn() { + return { + type: "blockquote", + children: [] + }; + } + + function Mn() { + return { + type: "code", + lang: null, + meta: null, + value: "" + }; + } + + function kt() { + return { + type: "inlineCode", + value: "" + }; + } + + function dt() { + return { + type: "definition", + identifier: "", + label: null, + title: null, + url: "" + }; + } + + function bt() { + return { + type: "emphasis", + children: [] + }; + } + + function jn() { + return { + type: "heading", + depth: void 0, + children: [] + }; + } + + function Rn() { + return { + type: "break" + }; + } + + function qn() { + return { + type: "html", + value: "" + }; + } + + function yt() { + return { + type: "image", + title: null, + url: "", + alt: null + }; + } + + function Hn() { + return { + type: "link", + title: null, + url: "", + children: [] + }; + } + + function Nn(g) { + return { + type: "list", + ordered: g.type === "listOrdered", + start: null, + spread: g._spread, + children: [] + }; + } + + function St(g) { + return { + type: "listItem", + spread: g._spread, + checked: null, + children: [] + }; + } + + function Ft() { + return { + type: "paragraph", + children: [] + }; + } + + function Et() { + return { + type: "strong", + children: [] + }; + } + + function Ct() { + return { + type: "text", + value: "" + }; + } + + function wt() { + return { + type: "thematicBreak" + }; + } +} + +function sn(n) { + return { + line: n.line, + column: n.column, + offset: n.offset + }; +} + +function xt(n, r) { + let t = -1; + for (; ++t < r.length;) { + const e = r[t]; + Array.isArray(e) ? xt(n, e) : Or(n, e); + } +} + +function Or(n, r) { + let t; + for (t in r) + if (ft.call(r, t)) { + if (t === "canContainEols") { + const e = r[t]; + e && n[t].push(...e); + } else if (t === "transforms") { + const e = r[t]; + e && n[t].push(...e); + } else if (t === "enter" || t === "exit") { + const e = r[t]; + e && Object.assign(n[t], e); + } + } +} + +function tt(n, r) { + throw n ? new Error( + "Cannot close `" + n.type + "` (" + yn({ + start: n.start, + end: n.end + }) + "): a different token (`" + r.type + "`, " + yn({ + start: r.start, + end: r.end + }) + ") is open" + ) : new Error( + "Cannot close document, a token (`" + r.type + "`, " + yn({ + start: r.start, + end: r.end + }) + ") is still open" + ); +} + +function Dr(n) { + const r = n.replace(/\n{2,}/g, ` +`); + return At(r); +} + +function Pr(n) { + const r = Dr(n), {children: t} = mt(r), e = [[]]; + let u = 0; + + function i(l, a = "normal") { + l.type === "text" ? l.value.split(` +`).forEach((c, p) => { + p !== 0 && (u++, e.push([])), c.split(" ").forEach((f) => { + f && e[u].push({content: f, type: a}); + }); + }) : (l.type === "strong" || l.type === "emphasis") && l.children.forEach((m) => { + i(m, l.type); + }); + } + + return t.forEach((l) => { + l.type === "paragraph" && l.children.forEach((a) => { + i(a); + }); + }), e; +} + +function _r(n) { + const {children: r} = mt(n); + + function t(e) { + return e.type === "text" ? e.value.replace(/\n/g, "
") : e.type === "strong" ? `${e.children.map(t).join("")}` : e.type === "emphasis" ? `${e.children.map(t).join("")}` : e.type === "paragraph" ? `

${e.children.map(t).join("")}

` : `Unsupported markdown: ${e.type}`; + } + + return r.map(t).join(""); +} + +function Mr(n) { + return Intl.Segmenter ? [...new Intl.Segmenter().segment(n)].map((r) => r.segment) : [...n]; +} + +function jr(n, r) { + const t = Mr(r.content); + return gt(n, [], t, r.type); +} + +function gt(n, r, t, e) { + if (t.length === 0) + return [ + {content: r.join(""), type: e}, + {content: "", type: e} + ]; + const [u, ...i] = t, l = [...r, u]; + return n([{content: l.join(""), type: e}]) ? gt(n, l, i, e) : (r.length === 0 && u && (r.push(u), t.shift()), [ + {content: r.join(""), type: e}, + {content: t.join(""), type: e} + ]); +} + +function Rr(n, r) { + if (n.some(({content: t}) => t.includes(` +`))) + throw new Error("splitLineToFitWidth does not support newlines in the line"); + return Bn(n, r); +} + +function Bn(n, r, t = [], e = []) { + if (n.length === 0) + return e.length > 0 && t.push(e), t.length > 0 ? t : []; + let u = ""; + n[0].content === " " && (u = " ", n.shift()); + const i = n.shift() ?? {content: " ", type: "normal"}, l = [...e]; + if (u !== "" && l.push({content: u, type: "normal"}), l.push(i), r(l)) + return Bn(n, r, t, l); + if (e.length > 0) + t.push(e), n.unshift(i); + else if (i.content) { + const [a, m] = jr(r, i); + t.push([a]), m.content && n.unshift(m); + } + return Bn(n, r, t); +} + +function qr(n, r) { + r && n.attr("style", r); +} + +function Hr(n, r, t, e, u = !1) { + const i = n.append("foreignObject"), l = i.append("xhtml:div"), a = r.label, + m = r.isNode ? "nodeLabel" : "edgeLabel"; + l.html( + ` + " + a + "" + ), qr(l, r.labelStyle), l.style("display", "table-cell"), l.style("white-space", "nowrap"), l.style("max-width", t + "px"), l.attr("xmlns", "http://www.w3.org/1999/xhtml"), u && l.attr("class", "labelBkg"); + let c = l.node().getBoundingClientRect(); + return c.width === t && (l.style("display", "table"), l.style("white-space", "break-spaces"), l.style("width", t + "px"), c = l.node().getBoundingClientRect()), i.style("width", c.width), i.style("height", c.height), i.node(); +} + +function Pn(n, r, t) { + return n.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", r * t - 0.1 + "em").attr("dy", t + "em"); +} + +function Nr(n, r, t) { + const e = n.append("text"), u = Pn(e, 1, r); + _n(u, t); + const i = u.node().getComputedTextLength(); + return e.remove(), i; +} + +function Qr(n, r, t) { + var l; + const e = n.append("text"), u = Pn(e, 1, r); + _n(u, [{content: t, type: "normal"}]); + const i = (l = u.node()) == null ? void 0 : l.getBoundingClientRect(); + return i && e.remove(), i; +} + +function Vr(n, r, t, e = !1) { + const i = r.append("g"), l = i.insert("rect").attr("class", "background"), a = i.append("text").attr("y", "-10.1"); + let m = 0; + for (const c of t) { + const p = (x) => Nr(i, 1.1, x) <= n, f = p(c) ? [c] : Rr(c, p); + for (const x of f) { + const h = Pn(a, m, 1.1); + _n(h, x), m++; + } + } + if (e) { + const c = a.node().getBBox(), p = 2; + return l.attr("x", -p).attr("y", -p).attr("width", c.width + 2 * p).attr("height", c.height + 2 * p), i.node(); + } else + return a.node(); +} + +function _n(n, r) { + n.text(""), r.forEach((t, e) => { + const u = n.append("tspan").attr("font-style", t.type === "emphasis" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", t.type === "strong" ? "bold" : "normal"); + e === 0 ? u.text(t.content) : u.text(" " + t.content); + }); +} + +const Ur = (n, r = "", { + style: t = "", + isTitle: e = !1, + classes: u = "", + useHtmlLabels: i = !0, + isNode: l = !0, + width: a = 200, + addSvgBackground: m = !1 +} = {}) => { + if (zt.info("createText", r, t, e, u, i, l, m), i) { + const c = _r(r), p = { + isNode: l, + label: It(c).replace( + /fa[blrs]?:fa-[\w-]+/g, + // cspell: disable-line + (x) => `` + ), + labelStyle: t.replace("fill:", "color:") + }; + return Hr(n, p, a, u, m); + } else { + const c = Pr(r); + return Vr(a, n, c, m); + } +}; +export { + Ur as a, + Qr as c +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/edges-16357fde.js b/BlazorApp/wwwroot/js/lib/mermaid/edges-16357fde.js new file mode 100644 index 00000000..50cf1230 --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/edges-16357fde.js @@ -0,0 +1,1142 @@ +import {A as j, b7 as Q, c as b, d as q, F as lt, j as B, l as g, p as H} from "./mermaid-9f2aa176.js"; +import {a as st} from "./createText-03b82060.js"; +import {l as ct} from "./line-24d93f1b.js"; + +const ht = (e, t, a, i) => { + t.forEach((l) => { + wt[l](e, a, i); + }); +}, ot = (e, t, a) => { + g.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"); +}, yt = (e, t, a) => { + e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); +}, ft = (e, t, a) => { + e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); +}, pt = (e, t, a) => { + e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); +}, dt = (e, t, a) => { + e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6); +}, xt = (e, t, a) => { + e.append("marker").attr("id", a + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); +}, gt = (e, t, a) => { + e.append("marker").attr("id", a + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"); +}, ut = (e, t, a) => { + e.append("marker").attr("id", a + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"); +}, bt = (e, t, a) => { + e.append("defs").append("marker").attr("id", a + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); +}, wt = { + extension: ot, + composition: yt, + aggregation: ft, + dependency: pt, + lollipop: dt, + point: xt, + circle: gt, + cross: ut, + barb: bt +}, hr = ht; + +function mt(e, t) { + t && e.attr("style", t); +} + +function kt(e) { + const t = B(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), a = t.append("xhtml:div"), + i = e.label, l = e.isNode ? "nodeLabel" : "edgeLabel"; + return a.html( + '" + i + "" + ), mt(a, e.labelStyle), a.style("display", "inline-block"), a.style("white-space", "nowrap"), a.attr("xmlns", "http://www.w3.org/1999/xhtml"), t.node(); +} + +const vt = (e, t, a, i) => { + let l = e || ""; + if (typeof l == "object" && (l = l[0]), H(b().flowchart.htmlLabels)) { + l = l.replace(/\\n|\n/g, "
"), g.debug("vertexText" + l); + const r = { + isNode: i, + label: Q(l).replace( + /fa[blrs]?:fa-[\w-]+/g, + // cspell: disable-line + (n) => `` + ), + labelStyle: t.replace("fill:", "color:") + }; + return kt(r); + } else { + const r = document.createElementNS("http://www.w3.org/2000/svg", "text"); + r.setAttribute("style", t.replace("color:", "fill:")); + let s = []; + typeof l == "string" ? s = l.split(/\\n|\n|/gi) : Array.isArray(l) ? s = l : s = []; + for (const n of s) { + const c = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + c.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), c.setAttribute("dy", "1em"), c.setAttribute("x", "0"), a ? c.setAttribute("class", "title-row") : c.setAttribute("class", "row"), c.textContent = n.trim(), r.appendChild(c); + } + return r; + } +}, R = vt, M = async (e, t, a, i) => { + let l; + const r = t.useHtmlLabels || H(b().flowchart.htmlLabels); + a ? l = a : l = "node default"; + const s = e.insert("g").attr("class", l).attr("id", t.domId || t.id), + n = s.insert("g").attr("class", "label").attr("style", t.labelStyle); + let c; + t.labelText === void 0 ? c = "" : c = typeof t.labelText == "string" ? t.labelText : t.labelText[0]; + const o = n.node(); + let h; + t.labelType === "markdown" ? h = st(n, q(Q(c), b()), { + useHtmlLabels: r, + width: t.width || b().flowchart.wrappingWidth, + classes: "markdown-node-label" + }) : h = o.appendChild( + R( + q(Q(c), b()), + t.labelStyle, + !1, + i + ) + ); + let y = h.getBBox(); + const p = t.padding / 2; + if (H(b().flowchart.htmlLabels)) { + const f = h.children[0], x = B(h), k = f.getElementsByTagName("img"); + if (k) { + const d = c.replace(/]*>/g, "").trim() === ""; + await Promise.all( + [...k].map( + (u) => new Promise((S) => { + function E() { + if (u.style.display = "flex", u.style.flexDirection = "column", d) { + const C = b().fontSize ? b().fontSize : window.getComputedStyle(document.body).fontSize, + W = 5, A = parseInt(C, 10) * W + "px"; + u.style.minWidth = A, u.style.maxWidth = A; + } else + u.style.width = "100%"; + S(u); + } + + setTimeout(() => { + u.complete && E(); + }), u.addEventListener("error", E), u.addEventListener("load", E); + }) + ) + ); + } + y = f.getBoundingClientRect(), x.attr("width", y.width), x.attr("height", y.height); + } + return r ? n.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")") : n.attr("transform", "translate(0, " + -y.height / 2 + ")"), t.centerLabel && n.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), n.insert("rect", ":first-child"), { + shapeSvg: s, + bbox: y, + halfPadding: p, + label: n + }; +}, m = (e, t) => { + const a = t.node().getBBox(); + e.width = a.width, e.height = a.height; +}; + +function I(e, t, a, i) { + return e.insert("polygon", ":first-child").attr( + "points", + i.map(function (l) { + return l.x + "," + l.y; + }).join(" ") + ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")"); +} + +function Lt(e, t) { + return e.intersect(t); +} + +function it(e, t, a, i) { + var l = e.x, r = e.y, s = l - i.x, n = r - i.y, c = Math.sqrt(t * t * n * n + a * a * s * s), + o = Math.abs(t * a * s / c); + i.x < l && (o = -o); + var h = Math.abs(t * a * n / c); + return i.y < r && (h = -h), {x: l + o, y: r + h}; +} + +function St(e, t, a) { + return it(e, t, t, a); +} + +function Mt(e, t, a, i) { + var l, r, s, n, c, o, h, y, p, f, x, k, d, u, S; + if (l = t.y - e.y, s = e.x - t.x, c = t.x * e.y - e.x * t.y, p = l * a.x + s * a.y + c, f = l * i.x + s * i.y + c, !(p !== 0 && f !== 0 && J(p, f)) && (r = i.y - a.y, n = a.x - i.x, o = i.x * a.y - a.x * i.y, h = r * e.x + n * e.y + o, y = r * t.x + n * t.y + o, !(h !== 0 && y !== 0 && J(h, y)) && (x = l * n - r * s, x !== 0))) + return k = Math.abs(x / 2), d = s * o - n * c, u = d < 0 ? (d - k) / x : (d + k) / x, d = r * c - l * o, S = d < 0 ? (d - k) / x : (d + k) / x, { + x: u, + y: S + }; +} + +function J(e, t) { + return e * t > 0; +} + +function Tt(e, t, a) { + var i = e.x, l = e.y, r = [], s = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY; + typeof t.forEach == "function" ? t.forEach(function (x) { + s = Math.min(s, x.x), n = Math.min(n, x.y); + }) : (s = Math.min(s, t.x), n = Math.min(n, t.y)); + for (var c = i - e.width / 2 - s, o = l - e.height / 2 - n, h = 0; h < t.length; h++) { + var y = t[h], p = t[h < t.length - 1 ? h + 1 : 0], f = Mt( + e, + a, + {x: c + y.x, y: o + y.y}, + {x: c + p.x, y: o + p.y} + ); + f && r.push(f); + } + return r.length ? (r.length > 1 && r.sort(function (x, k) { + var d = x.x - a.x, u = x.y - a.y, S = Math.sqrt(d * d + u * u), E = k.x - a.x, C = k.y - a.y, + W = Math.sqrt(E * E + C * C); + return S < W ? -1 : S === W ? 0 : 1; + }), r[0]) : e; +} + +const Et = (e, t) => { + var a = e.x, i = e.y, l = t.x - a, r = t.y - i, s = e.width / 2, n = e.height / 2, c, o; + return Math.abs(r) * s > Math.abs(l) * n ? (r < 0 && (n = -n), c = r === 0 ? 0 : n * l / r, o = n) : (l < 0 && (s = -s), c = s, o = l === 0 ? 0 : s * r / l), { + x: a + c, + y: i + o + }; +}, Bt = Et, w = { + node: Lt, + circle: St, + ellipse: it, + polygon: Tt, + rect: Bt +}, Ct = async (e, t) => { + t.useHtmlLabels || b().flowchart.htmlLabels || (t.centerLabel = !0); + const {shapeSvg: i, bbox: l, halfPadding: r} = await M( + e, + t, + "node " + t.classes, + !0 + ); + g.info("Classes = ", t.classes); + const s = i.insert("rect", ":first-child"); + return s.attr("rx", t.rx).attr("ry", t.ry).attr("x", -l.width / 2 - r).attr("y", -l.height / 2 - r).attr("width", l.width + t.padding).attr("height", l.height + t.padding), m(t, s), t.intersect = function (n) { + return w.rect(t, n); + }, i; +}, $t = Ct, _t = (e) => { + const t = /* @__PURE__ */ new Set(); + for (const a of e) + switch (a) { + case "x": + t.add("right"), t.add("left"); + break; + case "y": + t.add("up"), t.add("down"); + break; + default: + t.add(a); + break; + } + return t; +}, Rt = (e, t, a) => { + const i = _t(e), l = 2, r = t.height + 2 * a.padding, s = r / l, n = t.width + 2 * s + a.padding, c = a.padding / 2; + return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [ + // Bottom + {x: 0, y: 0}, + {x: s, y: 0}, + {x: n / 2, y: 2 * c}, + {x: n - s, y: 0}, + {x: n, y: 0}, + // Right + {x: n, y: -r / 3}, + {x: n + 2 * c, y: -r / 2}, + {x: n, y: -2 * r / 3}, + {x: n, y: -r}, + // Top + {x: n - s, y: -r}, + {x: n / 2, y: -r - 2 * c}, + {x: s, y: -r}, + // Left + {x: 0, y: -r}, + {x: 0, y: -2 * r / 3}, + {x: -2 * c, y: -r / 2}, + {x: 0, y: -r / 3} + ] : i.has("right") && i.has("left") && i.has("up") ? [ + {x: s, y: 0}, + {x: n - s, y: 0}, + {x: n, y: -r / 2}, + {x: n - s, y: -r}, + {x: s, y: -r}, + {x: 0, y: -r / 2} + ] : i.has("right") && i.has("left") && i.has("down") ? [ + {x: 0, y: 0}, + {x: s, y: -r}, + {x: n - s, y: -r}, + {x: n, y: 0} + ] : i.has("right") && i.has("up") && i.has("down") ? [ + {x: 0, y: 0}, + {x: n, y: -s}, + {x: n, y: -r + s}, + {x: 0, y: -r} + ] : i.has("left") && i.has("up") && i.has("down") ? [ + {x: n, y: 0}, + {x: 0, y: -s}, + {x: 0, y: -r + s}, + {x: n, y: -r} + ] : i.has("right") && i.has("left") ? [ + {x: s, y: 0}, + {x: s, y: -c}, + {x: n - s, y: -c}, + {x: n - s, y: 0}, + {x: n, y: -r / 2}, + {x: n - s, y: -r}, + {x: n - s, y: -r + c}, + {x: s, y: -r + c}, + {x: s, y: -r}, + {x: 0, y: -r / 2} + ] : i.has("up") && i.has("down") ? [ + // Bottom center + {x: n / 2, y: 0}, + // Left pont of bottom arrow + {x: 0, y: -c}, + {x: s, y: -c}, + // Left top over vertical section + {x: s, y: -r + c}, + {x: 0, y: -r + c}, + // Top of arrow + {x: n / 2, y: -r}, + {x: n, y: -r + c}, + // Top of right vertical bar + {x: n - s, y: -r + c}, + {x: n - s, y: -c}, + {x: n, y: -c} + ] : i.has("right") && i.has("up") ? [ + {x: 0, y: 0}, + {x: n, y: -s}, + {x: 0, y: -r} + ] : i.has("right") && i.has("down") ? [ + {x: 0, y: 0}, + {x: n, y: 0}, + {x: 0, y: -r} + ] : i.has("left") && i.has("up") ? [ + {x: n, y: 0}, + {x: 0, y: -s}, + {x: n, y: -r} + ] : i.has("left") && i.has("down") ? [ + {x: n, y: 0}, + {x: 0, y: 0}, + {x: n, y: -r} + ] : i.has("right") ? [ + {x: s, y: -c}, + {x: s, y: -c}, + {x: n - s, y: -c}, + {x: n - s, y: 0}, + {x: n, y: -r / 2}, + {x: n - s, y: -r}, + {x: n - s, y: -r + c}, + // top left corner of arrow + {x: s, y: -r + c}, + {x: s, y: -r + c} + ] : i.has("left") ? [ + {x: s, y: 0}, + {x: s, y: -c}, + // Two points, the right corners + {x: n - s, y: -c}, + {x: n - s, y: -r + c}, + {x: s, y: -r + c}, + {x: s, y: -r}, + {x: 0, y: -r / 2} + ] : i.has("up") ? [ + // Bottom center + {x: s, y: -c}, + // Left top over vertical section + {x: s, y: -r + c}, + {x: 0, y: -r + c}, + // Top of arrow + {x: n / 2, y: -r}, + {x: n, y: -r + c}, + // Top of right vertical bar + {x: n - s, y: -r + c}, + {x: n - s, y: -c} + ] : i.has("down") ? [ + // Bottom center + {x: n / 2, y: 0}, + // Left pont of bottom arrow + {x: 0, y: -c}, + {x: s, y: -c}, + // Left top over vertical section + {x: s, y: -r + c}, + {x: n - s, y: -r + c}, + {x: n - s, y: -c}, + {x: n, y: -c} + ] : [{x: 0, y: 0}]; +}, K = (e) => e ? " " + e : "", _ = (e, t) => `${t || "node default"}${K(e.classes)} ${K( + e.class +)}`, P = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M( + e, + t, + _(t, void 0), + !0 + ), l = i.width + t.padding, r = i.height + t.padding, s = l + r, n = [ + {x: s / 2, y: 0}, + {x: s, y: -s / 2}, + {x: s / 2, y: -s}, + {x: 0, y: -s / 2} + ]; + g.info("Question main (Circle)"); + const c = I(a, s, s, n); + return c.attr("style", t.style), m(t, c), t.intersect = function (o) { + return g.warn("Intersect called"), w.polygon(t, n, o); + }, a; +}, Ht = (e, t) => { + const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 28, l = [ + {x: 0, y: i / 2}, + {x: i / 2, y: 0}, + {x: 0, y: -i / 2}, + {x: -i / 2, y: 0} + ]; + return a.insert("polygon", ":first-child").attr( + "points", + l.map(function (s) { + return s.x + "," + s.y; + }).join(" ") + ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function (s) { + return w.circle(t, 14, s); + }, a; +}, It = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M( + e, + t, + _(t, void 0), + !0 + ), l = 4, r = i.height + t.padding, s = r / l, n = i.width + 2 * s + t.padding, c = [ + {x: s, y: 0}, + {x: n - s, y: 0}, + {x: n, y: -r / 2}, + {x: n - s, y: -r}, + {x: s, y: -r}, + {x: 0, y: -r / 2} + ], o = I(a, n, r, c); + return o.attr("style", t.style), m(t, o), t.intersect = function (h) { + return w.polygon(t, c, h); + }, a; +}, Nt = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M(e, t, void 0, !0), l = 2, r = i.height + 2 * t.padding, s = r / l, + n = i.width + 2 * s + t.padding, c = Rt(t.directions, i, t), o = I(a, n, r, c); + return o.attr("style", t.style), m(t, o), t.intersect = function (h) { + return w.polygon(t, c, h); + }, a; +}, Ot = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M( + e, + t, + _(t, void 0), + !0 + ), l = i.width + t.padding, r = i.height + t.padding, s = [ + {x: -r / 2, y: 0}, + {x: l, y: 0}, + {x: l, y: -r}, + {x: -r / 2, y: -r}, + {x: 0, y: -r / 2} + ]; + return I(a, l, r, s).attr("style", t.style), t.width = l + r, t.height = r, t.intersect = function (c) { + return w.polygon(t, s, c); + }, a; +}, Wt = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M(e, t, _(t), !0), l = i.width + t.padding, r = i.height + t.padding, s = [ + {x: -2 * r / 6, y: 0}, + {x: l - r / 6, y: 0}, + {x: l + 2 * r / 6, y: -r}, + {x: r / 6, y: -r} + ], n = I(a, l, r, s); + return n.attr("style", t.style), m(t, n), t.intersect = function (c) { + return w.polygon(t, s, c); + }, a; +}, Xt = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M( + e, + t, + _(t, void 0), + !0 + ), l = i.width + t.padding, r = i.height + t.padding, s = [ + {x: 2 * r / 6, y: 0}, + {x: l + r / 6, y: 0}, + {x: l - 2 * r / 6, y: -r}, + {x: -r / 6, y: -r} + ], n = I(a, l, r, s); + return n.attr("style", t.style), m(t, n), t.intersect = function (c) { + return w.polygon(t, s, c); + }, a; +}, Yt = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M( + e, + t, + _(t, void 0), + !0 + ), l = i.width + t.padding, r = i.height + t.padding, s = [ + {x: -2 * r / 6, y: 0}, + {x: l + 2 * r / 6, y: 0}, + {x: l - r / 6, y: -r}, + {x: r / 6, y: -r} + ], n = I(a, l, r, s); + return n.attr("style", t.style), m(t, n), t.intersect = function (c) { + return w.polygon(t, s, c); + }, a; +}, At = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M( + e, + t, + _(t, void 0), + !0 + ), l = i.width + t.padding, r = i.height + t.padding, s = [ + {x: r / 6, y: 0}, + {x: l - r / 6, y: 0}, + {x: l + 2 * r / 6, y: -r}, + {x: -2 * r / 6, y: -r} + ], n = I(a, l, r, s); + return n.attr("style", t.style), m(t, n), t.intersect = function (c) { + return w.polygon(t, s, c); + }, a; +}, Dt = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M( + e, + t, + _(t, void 0), + !0 + ), l = i.width + t.padding, r = i.height + t.padding, s = [ + {x: 0, y: 0}, + {x: l + r / 2, y: 0}, + {x: l, y: -r / 2}, + {x: l + r / 2, y: -r}, + {x: 0, y: -r} + ], n = I(a, l, r, s); + return n.attr("style", t.style), m(t, n), t.intersect = function (c) { + return w.polygon(t, s, c); + }, a; +}, jt = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M( + e, + t, + _(t, void 0), + !0 + ), l = i.width + t.padding, r = l / 2, s = r / (2.5 + l / 50), n = i.height + s + t.padding, + c = "M 0," + s + " a " + r + "," + s + " 0,0,0 " + l + " 0 a " + r + "," + s + " 0,0,0 " + -l + " 0 l 0," + n + " a " + r + "," + s + " 0,0,0 " + l + " 0 l 0," + -n, + o = a.attr("label-offset-y", s).insert("path", ":first-child").attr("style", t.style).attr("d", c).attr("transform", "translate(" + -l / 2 + "," + -(n / 2 + s) + ")"); + return m(t, o), t.intersect = function (h) { + const y = w.rect(t, h), p = y.x - t.x; + if (r != 0 && (Math.abs(p) < t.width / 2 || Math.abs(p) == t.width / 2 && Math.abs(y.y - t.y) > t.height / 2 - s)) { + let f = s * s * (1 - p * p / (r * r)); + f != 0 && (f = Math.sqrt(f)), f = s - f, h.y - t.y > 0 && (f = -f), y.y += f; + } + return y; + }, a; +}, Ut = async (e, t) => { + const {shapeSvg: a, bbox: i, halfPadding: l} = await M( + e, + t, + "node " + t.classes + " " + t.class, + !0 + ), r = a.insert("rect", ":first-child"), s = t.positioned ? t.width : i.width + t.padding, + n = t.positioned ? t.height : i.height + t.padding, c = t.positioned ? -s / 2 : -i.width / 2 - l, + o = t.positioned ? -n / 2 : -i.height / 2 - l; + if (r.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", o).attr("width", s).attr("height", n), t.props) { + const h = new Set(Object.keys(t.props)); + t.props.borders && (V(r, t.props.borders, s, n), h.delete("borders")), h.forEach((y) => { + g.warn(`Unknown node property ${y}`); + }); + } + return m(t, r), t.intersect = function (h) { + return w.rect(t, h); + }, a; +}, zt = async (e, t) => { + const {shapeSvg: a, bbox: i, halfPadding: l} = await M( + e, + t, + "node " + t.classes, + !0 + ), r = a.insert("rect", ":first-child"), s = t.positioned ? t.width : i.width + t.padding, + n = t.positioned ? t.height : i.height + t.padding, c = t.positioned ? -s / 2 : -i.width / 2 - l, + o = t.positioned ? -n / 2 : -i.height / 2 - l; + if (r.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", c).attr("y", o).attr("width", s).attr("height", n), t.props) { + const h = new Set(Object.keys(t.props)); + t.props.borders && (V(r, t.props.borders, s, n), h.delete("borders")), h.forEach((y) => { + g.warn(`Unknown node property ${y}`); + }); + } + return m(t, r), t.intersect = function (h) { + return w.rect(t, h); + }, a; +}, Zt = async (e, t) => { + const {shapeSvg: a} = await M(e, t, "label", !0); + g.trace("Classes = ", t.class); + const i = a.insert("rect", ":first-child"), l = 0, r = 0; + if (i.attr("width", l).attr("height", r), a.attr("class", "label edgeLabel"), t.props) { + const s = new Set(Object.keys(t.props)); + t.props.borders && (V(i, t.props.borders, l, r), s.delete("borders")), s.forEach((n) => { + g.warn(`Unknown node property ${n}`); + }); + } + return m(t, i), t.intersect = function (s) { + return w.rect(t, s); + }, a; +}; + +function V(e, t, a, i) { + const l = [], r = (n) => { + l.push(n, 0); + }, s = (n) => { + l.push(0, n); + }; + t.includes("t") ? (g.debug("add top border"), r(a)) : s(a), t.includes("r") ? (g.debug("add right border"), r(i)) : s(i), t.includes("b") ? (g.debug("add bottom border"), r(a)) : s(a), t.includes("l") ? (g.debug("add left border"), r(i)) : s(i), e.attr("stroke-dasharray", l.join(" ")); +} + +const Gt = (e, t) => { + let a; + t.classes ? a = "node " + t.classes : a = "node default"; + const i = e.insert("g").attr("class", a).attr("id", t.domId || t.id), l = i.insert("rect", ":first-child"), + r = i.insert("line"), s = i.insert("g").attr("class", "label"), + n = t.labelText.flat ? t.labelText.flat() : t.labelText; + let c = ""; + typeof n == "object" ? c = n[0] : c = n, g.info("Label text abc79", c, n, typeof n == "object"); + const o = s.node().appendChild(R(c, t.labelStyle, !0, !0)); + let h = {width: 0, height: 0}; + if (H(b().flowchart.htmlLabels)) { + const k = o.children[0], d = B(o); + h = k.getBoundingClientRect(), d.attr("width", h.width), d.attr("height", h.height); + } + g.info("Text 2", n); + const y = n.slice(1, n.length); + let p = o.getBBox(); + const f = s.node().appendChild( + R(y.join ? y.join("
") : y, t.labelStyle, !0, !0) + ); + if (H(b().flowchart.htmlLabels)) { + const k = f.children[0], d = B(f); + h = k.getBoundingClientRect(), d.attr("width", h.width), d.attr("height", h.height); + } + const x = t.padding / 2; + return B(f).attr( + "transform", + "translate( " + // (titleBox.width - bbox.width) / 2 + + (h.width > p.width ? 0 : (p.width - h.width) / 2) + ", " + (p.height + x + 5) + ")" + ), B(o).attr( + "transform", + "translate( " + // (titleBox.width - bbox.width) / 2 + + (h.width < p.width ? 0 : -(p.width - h.width) / 2) + ", 0)" + ), h = s.node().getBBox(), s.attr( + "transform", + "translate(" + -h.width / 2 + ", " + (-h.height / 2 - x + 3) + ")" + ), l.attr("class", "outer title-state").attr("x", -h.width / 2 - x).attr("y", -h.height / 2 - x).attr("width", h.width + t.padding).attr("height", h.height + t.padding), r.attr("class", "divider").attr("x1", -h.width / 2 - x).attr("x2", h.width / 2 + x).attr("y1", -h.height / 2 - x + p.height + x).attr("y2", -h.height / 2 - x + p.height + x), m(t, l), t.intersect = function (k) { + return w.rect(t, k); + }, i; +}, Ft = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M( + e, + t, + _(t, void 0), + !0 + ), l = i.height + t.padding, r = i.width + l / 4 + t.padding, + s = a.insert("rect", ":first-child").attr("style", t.style).attr("rx", l / 2).attr("ry", l / 2).attr("x", -r / 2).attr("y", -l / 2).attr("width", r).attr("height", l); + return m(t, s), t.intersect = function (n) { + return w.rect(t, n); + }, a; +}, Qt = async (e, t) => { + const {shapeSvg: a, bbox: i, halfPadding: l} = await M( + e, + t, + _(t, void 0), + !0 + ), r = a.insert("circle", ":first-child"); + return r.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), g.info("Circle main"), m(t, r), t.intersect = function (s) { + return g.info("Circle intersect", t, i.width / 2 + l, s), w.circle(t, i.width / 2 + l, s); + }, a; +}, Vt = async (e, t) => { + const {shapeSvg: a, bbox: i, halfPadding: l} = await M( + e, + t, + _(t, void 0), + !0 + ), r = 5, s = a.insert("g", ":first-child"), n = s.insert("circle"), c = s.insert("circle"); + return s.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l + r).attr("width", i.width + t.padding + r * 2).attr("height", i.height + t.padding + r * 2), c.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), g.info("DoubleCircle main"), m(t, n), t.intersect = function (o) { + return g.info("DoubleCircle intersect", t, i.width / 2 + l + r, o), w.circle(t, i.width / 2 + l + r, o); + }, a; +}, qt = async (e, t) => { + const {shapeSvg: a, bbox: i} = await M( + e, + t, + _(t, void 0), + !0 + ), l = i.width + t.padding, r = i.height + t.padding, s = [ + {x: 0, y: 0}, + {x: l, y: 0}, + {x: l, y: -r}, + {x: 0, y: -r}, + {x: 0, y: 0}, + {x: -8, y: 0}, + {x: l + 8, y: 0}, + {x: l + 8, y: -r}, + {x: -8, y: -r}, + {x: -8, y: 0} + ], n = I(a, l, r, s); + return n.attr("style", t.style), m(t, n), t.intersect = function (c) { + return w.polygon(t, s, c); + }, a; +}, Jt = (e, t) => { + const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), + i = a.insert("circle", ":first-child"); + return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), m(t, i), t.intersect = function (l) { + return w.circle(t, 7, l); + }, a; +}, tt = (e, t, a) => { + const i = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id); + let l = 70, r = 10; + a === "LR" && (l = 10, r = 70); + const s = i.append("rect").attr("x", -1 * l / 2).attr("y", -1 * r / 2).attr("width", l).attr("height", r).attr("class", "fork-join"); + return m(t, s), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function (n) { + return w.rect(t, n); + }, i; +}, Kt = (e, t) => { + const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), + i = a.insert("circle", ":first-child"), l = a.insert("circle", ":first-child"); + return l.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), i.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), m(t, l), t.intersect = function (r) { + return w.circle(t, 7, r); + }, a; +}, Pt = (e, t) => { + const a = t.padding / 2, i = 4, l = 8; + let r; + t.classes ? r = "node " + t.classes : r = "node default"; + const s = e.insert("g").attr("class", r).attr("id", t.domId || t.id), n = s.insert("rect", ":first-child"), + c = s.insert("line"), o = s.insert("line"); + let h = 0, y = i; + const p = s.insert("g").attr("class", "label"); + let f = 0; + const x = t.classData.annotations && t.classData.annotations[0], + k = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", + d = p.node().appendChild(R(k, t.labelStyle, !0, !0)); + let u = d.getBBox(); + if (H(b().flowchart.htmlLabels)) { + const v = d.children[0], L = B(d); + u = v.getBoundingClientRect(), L.attr("width", u.width), L.attr("height", u.height); + } + t.classData.annotations[0] && (y += u.height + i, h += u.width); + let S = t.classData.label; + t.classData.type !== void 0 && t.classData.type !== "" && (b().flowchart.htmlLabels ? S += "<" + t.classData.type + ">" : S += "<" + t.classData.type + ">"); + const E = p.node().appendChild(R(S, t.labelStyle, !0, !0)); + B(E).attr("class", "classTitle"); + let C = E.getBBox(); + if (H(b().flowchart.htmlLabels)) { + const v = E.children[0], L = B(E); + C = v.getBoundingClientRect(), L.attr("width", C.width), L.attr("height", C.height); + } + y += C.height + i, C.width > h && (h = C.width); + const W = []; + t.classData.members.forEach((v) => { + const L = v.getDisplayDetails(); + let X = L.displayText; + b().flowchart.htmlLabels && (X = X.replace(//g, ">")); + const N = p.node().appendChild( + R( + X, + L.cssStyle ? L.cssStyle : t.labelStyle, + !0, + !0 + ) + ); + let $ = N.getBBox(); + if (H(b().flowchart.htmlLabels)) { + const F = N.children[0], D = B(N); + $ = F.getBoundingClientRect(), D.attr("width", $.width), D.attr("height", $.height); + } + $.width > h && (h = $.width), y += $.height + i, W.push(N); + }), y += l; + const A = []; + if (t.classData.methods.forEach((v) => { + const L = v.getDisplayDetails(); + let X = L.displayText; + b().flowchart.htmlLabels && (X = X.replace(//g, ">")); + const N = p.node().appendChild( + R( + X, + L.cssStyle ? L.cssStyle : t.labelStyle, + !0, + !0 + ) + ); + let $ = N.getBBox(); + if (H(b().flowchart.htmlLabels)) { + const F = N.children[0], D = B(N); + $ = F.getBoundingClientRect(), D.attr("width", $.width), D.attr("height", $.height); + } + $.width > h && (h = $.width), y += $.height + i, A.push(N); + }), y += l, x) { + let v = (h - u.width) / 2; + B(d).attr( + "transform", + "translate( " + (-1 * h / 2 + v) + ", " + -1 * y / 2 + ")" + ), f = u.height + i; + } + let nt = (h - C.width) / 2; + return B(E).attr( + "transform", + "translate( " + (-1 * h / 2 + nt) + ", " + (-1 * y / 2 + f) + ")" + ), f += C.height + i, c.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -y / 2 - a + l + f).attr("y2", -y / 2 - a + l + f), f += l, W.forEach((v) => { + B(v).attr( + "transform", + "translate( " + -h / 2 + ", " + (-1 * y / 2 + f + l / 2) + ")" + ); + const L = v == null ? void 0 : v.getBBox(); + f += ((L == null ? void 0 : L.height) ?? 0) + i; + }), f += l, o.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -y / 2 - a + l + f).attr("y2", -y / 2 - a + l + f), f += l, A.forEach((v) => { + B(v).attr( + "transform", + "translate( " + -h / 2 + ", " + (-1 * y / 2 + f) + ")" + ); + const L = v == null ? void 0 : v.getBBox(); + f += ((L == null ? void 0 : L.height) ?? 0) + i; + }), n.attr("style", t.style).attr("class", "outer title-state").attr("x", -h / 2 - a).attr("y", -(y / 2) - a).attr("width", h + t.padding).attr("height", y + t.padding), m(t, n), t.intersect = function (v) { + return w.rect(t, v); + }, s; +}, rt = { + rhombus: P, + composite: zt, + question: P, + rect: Ut, + labelRect: Zt, + rectWithTitle: Gt, + choice: Ht, + circle: Qt, + doublecircle: Vt, + stadium: Ft, + hexagon: It, + block_arrow: Nt, + rect_left_inv_arrow: Ot, + lean_right: Wt, + lean_left: Xt, + trapezoid: Yt, + inv_trapezoid: At, + rect_right_inv_arrow: Dt, + cylinder: jt, + start: Jt, + end: Kt, + note: $t, + subroutine: qt, + fork: tt, + join: tt, + class_box: Pt +}; +let Y = {}; +const or = async (e, t, a) => { + let i, l; + if (t.link) { + let r; + b().securityLevel === "sandbox" ? r = "_top" : t.linkTarget && (r = t.linkTarget || "_blank"), i = e.insert("svg:a").attr("xlink:href", t.link).attr("target", r), l = await rt[t.shape](i, t, a); + } else + l = await rt[t.shape](e, t, a), i = l; + return t.tooltip && l.attr("title", t.tooltip), t.class && l.attr("class", "node default " + t.class), i.attr("data-node", "true"), i.attr("data-id", t.id), Y[t.id] = i, t.haveCallback && Y[t.id].attr("class", Y[t.id].attr("class") + " clickable"), i; +}, yr = (e, t) => { + Y[t.id] = e; +}, fr = () => { + Y = {}; +}, pr = (e) => { + const t = Y[e.id]; + g.trace( + "Transforming node", + e.diff, + e, + "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")" + ); + const a = 8, i = e.diff || 0; + return e.clusterNode ? t.attr( + "transform", + "translate(" + (e.x + i - e.width / 2) + ", " + (e.y - e.height / 2 - a) + ")" + ) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), i; +}, tr = ({ + flowchart: e + }) => { + var l, r; + const t = ((l = e == null ? void 0 : e.subGraphTitleMargin) == null ? void 0 : l.top) ?? 0, + a = ((r = e == null ? void 0 : e.subGraphTitleMargin) == null ? void 0 : r.bottom) ?? 0, i = t + a; + return { + subGraphTitleTopMargin: t, + subGraphTitleBottomMargin: a, + subGraphTitleTotalMargin: i + }; +}, O = { + aggregation: 18, + extension: 18, + composition: 18, + dependency: 6, + lollipop: 13.5, + arrow_point: 5.3 +}; + +function U(e, t) { + if (e === void 0 || t === void 0) + return {angle: 0, deltaX: 0, deltaY: 0}; + e = Z(e), t = Z(t); + const [a, i] = [e.x, e.y], [l, r] = [t.x, t.y], s = l - a, n = r - i; + return {angle: Math.atan(n / s), deltaX: s, deltaY: n}; +} + +const Z = (e) => Array.isArray(e) ? {x: e[0], y: e[1]} : e, rr = (e) => ({ + x: function (t, a, i) { + let l = 0; + if (a === 0 && Object.hasOwn(O, e.arrowTypeStart)) { + const {angle: r, deltaX: s} = U(i[0], i[1]); + l = O[e.arrowTypeStart] * Math.cos(r) * (s >= 0 ? 1 : -1); + } else if (a === i.length - 1 && Object.hasOwn(O, e.arrowTypeEnd)) { + const {angle: r, deltaX: s} = U( + i[i.length - 1], + i[i.length - 2] + ); + l = O[e.arrowTypeEnd] * Math.cos(r) * (s >= 0 ? 1 : -1); + } + return Z(t).x + l; + }, + y: function (t, a, i) { + let l = 0; + if (a === 0 && Object.hasOwn(O, e.arrowTypeStart)) { + const {angle: r, deltaY: s} = U(i[0], i[1]); + l = O[e.arrowTypeStart] * Math.abs(Math.sin(r)) * (s >= 0 ? 1 : -1); + } else if (a === i.length - 1 && Object.hasOwn(O, e.arrowTypeEnd)) { + const {angle: r, deltaY: s} = U( + i[i.length - 1], + i[i.length - 2] + ); + l = O[e.arrowTypeEnd] * Math.abs(Math.sin(r)) * (s >= 0 ? 1 : -1); + } + return Z(t).y + l; + } +}), ar = (e, t, a, i, l) => { + t.arrowTypeStart && at(e, "start", t.arrowTypeStart, a, i, l), t.arrowTypeEnd && at(e, "end", t.arrowTypeEnd, a, i, l); +}, er = { + arrow_cross: "cross", + arrow_point: "point", + arrow_barb: "barb", + arrow_circle: "circle", + aggregation: "aggregation", + extension: "extension", + composition: "composition", + dependency: "dependency", + lollipop: "lollipop" +}, at = (e, t, a, i, l, r) => { + const s = er[a]; + if (!s) { + g.warn(`Unknown arrow type: ${a}`); + return; + } + const n = t === "start" ? "Start" : "End"; + e.attr(`marker-${t}`, `url(${i}#${l}_${r}-${s}${n})`); +}; +let G = {}, T = {}; +const dr = () => { + G = {}, T = {}; +}, xr = (e, t) => { + const a = H(b().flowchart.htmlLabels), i = t.labelType === "markdown" ? st(e, t.label, { + style: t.labelStyle, + useHtmlLabels: a, + addSvgBackground: !0 + }) : R(t.label, t.labelStyle), l = e.insert("g").attr("class", "edgeLabel"), + r = l.insert("g").attr("class", "label"); + r.node().appendChild(i); + let s = i.getBBox(); + if (a) { + const c = i.children[0], o = B(i); + s = c.getBoundingClientRect(), o.attr("width", s.width), o.attr("height", s.height); + } + r.attr("transform", "translate(" + -s.width / 2 + ", " + -s.height / 2 + ")"), G[t.id] = l, t.width = s.width, t.height = s.height; + let n; + if (t.startLabelLeft) { + const c = R(t.startLabelLeft, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), + h = o.insert("g").attr("class", "inner"); + n = h.node().appendChild(c); + const y = c.getBBox(); + h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), T[t.id] || (T[t.id] = {}), T[t.id].startLeft = o, z(n, t.startLabelLeft); + } + if (t.startLabelRight) { + const c = R(t.startLabelRight, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), + h = o.insert("g").attr("class", "inner"); + n = o.node().appendChild(c), h.node().appendChild(c); + const y = c.getBBox(); + h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), T[t.id] || (T[t.id] = {}), T[t.id].startRight = o, z(n, t.startLabelRight); + } + if (t.endLabelLeft) { + const c = R(t.endLabelLeft, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), + h = o.insert("g").attr("class", "inner"); + n = h.node().appendChild(c); + const y = c.getBBox(); + h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), o.node().appendChild(c), T[t.id] || (T[t.id] = {}), T[t.id].endLeft = o, z(n, t.endLabelLeft); + } + if (t.endLabelRight) { + const c = R(t.endLabelRight, t.labelStyle), o = e.insert("g").attr("class", "edgeTerminals"), + h = o.insert("g").attr("class", "inner"); + n = h.node().appendChild(c); + const y = c.getBBox(); + h.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), o.node().appendChild(c), T[t.id] || (T[t.id] = {}), T[t.id].endRight = o, z(n, t.endLabelRight); + } + return i; +}; + +function z(e, t) { + b().flowchart.htmlLabels && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px"); +} + +const gr = (e, t) => { + g.debug("Moving label abc88 ", e.id, e.label, G[e.id], t); + let a = t.updatedPath ? t.updatedPath : t.originalPath; + const i = b(), {subGraphTitleTotalMargin: l} = tr(i); + if (e.label) { + const r = G[e.id]; + let s = e.x, n = e.y; + if (a) { + const c = j.calcLabelPosition(a); + g.debug( + "Moving label " + e.label + " from (", + s, + ",", + n, + ") to (", + c.x, + ",", + c.y, + ") abc88" + ), t.updatedPath && (s = c.x, n = c.y); + } + r.attr("transform", `translate(${s}, ${n + l / 2})`); + } + if (e.startLabelLeft) { + const r = T[e.id].startLeft; + let s = e.x, n = e.y; + if (a) { + const c = j.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a); + s = c.x, n = c.y; + } + r.attr("transform", `translate(${s}, ${n})`); + } + if (e.startLabelRight) { + const r = T[e.id].startRight; + let s = e.x, n = e.y; + if (a) { + const c = j.calcTerminalLabelPosition( + e.arrowTypeStart ? 10 : 0, + "start_right", + a + ); + s = c.x, n = c.y; + } + r.attr("transform", `translate(${s}, ${n})`); + } + if (e.endLabelLeft) { + const r = T[e.id].endLeft; + let s = e.x, n = e.y; + if (a) { + const c = j.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a); + s = c.x, n = c.y; + } + r.attr("transform", `translate(${s}, ${n})`); + } + if (e.endLabelRight) { + const r = T[e.id].endRight; + let s = e.x, n = e.y; + if (a) { + const c = j.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a); + s = c.x, n = c.y; + } + r.attr("transform", `translate(${s}, ${n})`); + } +}, sr = (e, t) => { + const a = e.x, i = e.y, l = Math.abs(t.x - a), r = Math.abs(t.y - i), s = e.width / 2, n = e.height / 2; + return l >= s || r >= n; +}, ir = (e, t, a) => { + g.debug(`intersection calc abc89: + outsidePoint: ${JSON.stringify(t)} + insidePoint : ${JSON.stringify(a)} + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`); + const i = e.x, l = e.y, r = Math.abs(i - a.x), s = e.width / 2; + let n = a.x < t.x ? s - r : s + r; + const c = e.height / 2, o = Math.abs(t.y - a.y), h = Math.abs(t.x - a.x); + if (Math.abs(l - t.y) * s > Math.abs(i - t.x) * c) { + let y = a.y < t.y ? t.y - c - l : l - c - t.y; + n = h * y / o; + const p = { + x: a.x < t.x ? a.x + n : a.x - h + n, + y: a.y < t.y ? a.y + o - y : a.y - o + y + }; + return n === 0 && (p.x = t.x, p.y = t.y), h === 0 && (p.x = t.x), o === 0 && (p.y = t.y), g.debug(`abc89 topp/bott calc, Q ${o}, q ${y}, R ${h}, r ${n}`, p), p; + } else { + a.x < t.x ? n = t.x - s - i : n = i - s - t.x; + let y = o * n / h, p = a.x < t.x ? a.x + h - n : a.x - h + n, f = a.y < t.y ? a.y + y : a.y - y; + return g.debug(`sides calc abc89, Q ${o}, q ${y}, R ${h}, r ${n}`, { + _x: p, + _y: f + }), n === 0 && (p = t.x, f = t.y), h === 0 && (p = t.x), o === 0 && (f = t.y), {x: p, y: f}; + } +}, et = (e, t) => { + g.debug("abc88 cutPathAtIntersect", e, t); + let a = [], i = e[0], l = !1; + return e.forEach((r) => { + if (!sr(t, r) && !l) { + const s = ir(t, i, r); + let n = !1; + a.forEach((c) => { + n = n || c.x === s.x && c.y === s.y; + }), a.some((c) => c.x === s.x && c.y === s.y) || a.push(s), l = !0; + } else + i = r, l || a.push(r); + }), a; +}, ur = function (e, t, a, i, l, r, s) { + let n = a.points; + g.debug("abc88 InsertEdge: edge=", a, "e=", t); + let c = !1; + const o = r.node(t.v); + var h = r.node(t.w); + h != null && h.intersect && (o != null && o.intersect) && (n = n.slice(1, a.points.length - 1), n.unshift(o.intersect(n[0])), n.push(h.intersect(n[n.length - 1]))), a.toCluster && (g.debug("to cluster abc88", i[a.toCluster]), n = et(a.points, i[a.toCluster].node), c = !0), a.fromCluster && (g.debug("from cluster abc88", i[a.fromCluster]), n = et(n.reverse(), i[a.fromCluster].node).reverse(), c = !0); + const y = n.filter((C) => !Number.isNaN(C.y)); + let p = lt; + a.curve && (l === "graph" || l === "flowchart") && (p = a.curve); + const {x: f, y: x} = rr(a), k = ct().x(f).y(x).curve(p); + let d; + switch (a.thickness) { + case "normal": + d = "edge-thickness-normal"; + break; + case "thick": + d = "edge-thickness-thick"; + break; + case "invisible": + d = "edge-thickness-thick"; + break; + default: + d = ""; + } + switch (a.pattern) { + case "solid": + d += " edge-pattern-solid"; + break; + case "dotted": + d += " edge-pattern-dotted"; + break; + case "dashed": + d += " edge-pattern-dashed"; + break; + } + const u = e.append("path").attr("d", k(y)).attr("id", a.id).attr("class", " " + d + (a.classes ? " " + a.classes : "")).attr("style", a.style); + let S = ""; + (b().flowchart.arrowMarkerAbsolute || b().state.arrowMarkerAbsolute) && (S = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, S = S.replace(/\(/g, "\\("), S = S.replace(/\)/g, "\\)")), ar(u, a, S, s, l); + let E = {}; + return c && (E.updatedPath = n), E.originalPath = a.points, E; +}; +export { + hr as a, + fr as b, + R as c, + dr as d, + or as e, + xr as f, + tr as g, + ur as h, + Bt as i, + gr as j, + rr as k, + M as l, + ar as m, + pr as p, + yr as s, + m as u +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/flowDb-9a89ea33.js b/BlazorApp/wwwroot/js/lib/mermaid/flowDb-9a89ea33.js new file mode 100644 index 00000000..48479380 --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/flowDb-9a89ea33.js @@ -0,0 +1,2258 @@ +import { + a as Le, + A as At, + ar as me, + b as ve, + C as Ie, + c as et, + D as Re, + E as Ne, + f as we, + g as Ve, + j as w1, + l as J1, + s as ye +} from "./mermaid-9f2aa176.js"; + +var dt = function () { + var e = function (f1, a, l, f) { + for (l = l || {}, f = f1.length; f--; l[f1[f]] = a) + ; + return l; + }, u = [1, 4], n = [1, 3], r = [1, 5], + c = [1, 8, 9, 10, 11, 27, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], + o = [2, 2], h = [1, 13], U = [1, 14], F = [1, 15], w = [1, 16], X = [1, 23], l1 = [1, 25], d1 = [1, 26], + p1 = [1, 27], S = [1, 49], k = [1, 48], o1 = [1, 29], U1 = [1, 30], G1 = [1, 31], M1 = [1, 32], K1 = [1, 33], + x = [1, 44], B = [1, 46], m = [1, 42], y = [1, 47], V = [1, 43], L = [1, 50], v = [1, 45], I = [1, 51], + R = [1, 52], Y1 = [1, 34], j1 = [1, 35], z1 = [1, 36], X1 = [1, 37], I1 = [1, 57], + b = [1, 8, 9, 10, 11, 27, 32, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], + q = [1, 61], Q = [1, 60], Z = [1, 62], H1 = [8, 9, 11, 73, 75], k1 = [1, 88], b1 = [1, 93], g1 = [1, 92], + D1 = [1, 89], F1 = [1, 85], T1 = [1, 91], C1 = [1, 87], S1 = [1, 94], _1 = [1, 90], x1 = [1, 95], B1 = [1, 86], + W1 = [8, 9, 10, 11, 73, 75], N = [8, 9, 10, 11, 44, 73, 75], + M = [8, 9, 10, 11, 29, 42, 44, 46, 48, 50, 52, 54, 56, 58, 61, 63, 65, 66, 68, 73, 75, 86, 99, 102, 103, 106, 108, 111, 112, 113], + Et = [8, 9, 11, 42, 58, 73, 75, 86, 99, 102, 103, 106, 108, 111, 112, 113], + R1 = [42, 58, 86, 99, 102, 103, 106, 108, 111, 112, 113], kt = [1, 121], bt = [1, 120], gt = [1, 128], + Dt = [1, 142], Ft = [1, 143], Tt = [1, 144], Ct = [1, 145], St = [1, 130], _t = [1, 132], xt = [1, 136], + Bt = [1, 137], mt = [1, 138], yt = [1, 139], Vt = [1, 140], Lt = [1, 141], vt = [1, 146], It = [1, 147], + Rt = [1, 126], Nt = [1, 127], wt = [1, 134], Ot = [1, 129], Pt = [1, 133], Ut = [1, 131], + rt = [8, 9, 10, 11, 27, 32, 34, 36, 38, 42, 58, 81, 82, 83, 84, 85, 86, 99, 102, 103, 106, 108, 111, 112, 113, 118, 119, 120, 121], + Gt = [1, 149], T = [8, 9, 11], K = [8, 9, 10, 11, 14, 42, 58, 86, 102, 103, 106, 108, 111, 112, 113], + d = [1, 169], O = [1, 165], P = [1, 166], p = [1, 170], A = [1, 167], E = [1, 168], m1 = [75, 113, 116], + g = [8, 9, 10, 11, 12, 14, 27, 29, 32, 42, 58, 73, 81, 82, 83, 84, 85, 86, 87, 102, 106, 108, 111, 112, 113], + Mt = [10, 103], h1 = [31, 47, 49, 51, 53, 55, 60, 62, 64, 65, 67, 69, 113, 114, 115], J = [1, 235], + $ = [1, 233], t1 = [1, 237], e1 = [1, 231], s1 = [1, 232], u1 = [1, 234], n1 = [1, 236], i1 = [1, 238], + y1 = [1, 255], Kt = [8, 9, 11, 103], W = [8, 9, 10, 11, 58, 81, 102, 103, 106, 107, 108, 109], at = { + trace: function () { + }, + yy: {}, + symbols_: { + error: 2, + start: 3, + graphConfig: 4, + document: 5, + line: 6, + statement: 7, + SEMI: 8, + NEWLINE: 9, + SPACE: 10, + EOF: 11, + GRAPH: 12, + NODIR: 13, + DIR: 14, + FirstStmtSeparator: 15, + ending: 16, + endToken: 17, + spaceList: 18, + spaceListNewline: 19, + vertexStatement: 20, + separator: 21, + styleStatement: 22, + linkStyleStatement: 23, + classDefStatement: 24, + classStatement: 25, + clickStatement: 26, + subgraph: 27, + textNoTags: 28, + SQS: 29, + text: 30, + SQE: 31, + end: 32, + direction: 33, + acc_title: 34, + acc_title_value: 35, + acc_descr: 36, + acc_descr_value: 37, + acc_descr_multiline_value: 38, + link: 39, + node: 40, + styledVertex: 41, + AMP: 42, + vertex: 43, + STYLE_SEPARATOR: 44, + idString: 45, + DOUBLECIRCLESTART: 46, + DOUBLECIRCLEEND: 47, + PS: 48, + PE: 49, + "(-": 50, + "-)": 51, + STADIUMSTART: 52, + STADIUMEND: 53, + SUBROUTINESTART: 54, + SUBROUTINEEND: 55, + VERTEX_WITH_PROPS_START: 56, + "NODE_STRING[field]": 57, + COLON: 58, + "NODE_STRING[value]": 59, + PIPE: 60, + CYLINDERSTART: 61, + CYLINDEREND: 62, + DIAMOND_START: 63, + DIAMOND_STOP: 64, + TAGEND: 65, + TRAPSTART: 66, + TRAPEND: 67, + INVTRAPSTART: 68, + INVTRAPEND: 69, + linkStatement: 70, + arrowText: 71, + TESTSTR: 72, + START_LINK: 73, + edgeText: 74, + LINK: 75, + edgeTextToken: 76, + STR: 77, + MD_STR: 78, + textToken: 79, + keywords: 80, + STYLE: 81, + LINKSTYLE: 82, + CLASSDEF: 83, + CLASS: 84, + CLICK: 85, + DOWN: 86, + UP: 87, + textNoTagsToken: 88, + stylesOpt: 89, + "idString[vertex]": 90, + "idString[class]": 91, + CALLBACKNAME: 92, + CALLBACKARGS: 93, + HREF: 94, + LINK_TARGET: 95, + "STR[link]": 96, + "STR[tooltip]": 97, + alphaNum: 98, + DEFAULT: 99, + numList: 100, + INTERPOLATE: 101, + NUM: 102, + COMMA: 103, + style: 104, + styleComponent: 105, + NODE_STRING: 106, + UNIT: 107, + BRKT: 108, + PCT: 109, + idStringToken: 110, + MINUS: 111, + MULT: 112, + UNICODE_TEXT: 113, + TEXT: 114, + TAGSTART: 115, + EDGE_TEXT: 116, + alphaNumToken: 117, + direction_tb: 118, + direction_bt: 119, + direction_rl: 120, + direction_lr: 121, + $accept: 0, + $end: 1 + }, + terminals_: { + 2: "error", + 8: "SEMI", + 9: "NEWLINE", + 10: "SPACE", + 11: "EOF", + 12: "GRAPH", + 13: "NODIR", + 14: "DIR", + 27: "subgraph", + 29: "SQS", + 31: "SQE", + 32: "end", + 34: "acc_title", + 35: "acc_title_value", + 36: "acc_descr", + 37: "acc_descr_value", + 38: "acc_descr_multiline_value", + 42: "AMP", + 44: "STYLE_SEPARATOR", + 46: "DOUBLECIRCLESTART", + 47: "DOUBLECIRCLEEND", + 48: "PS", + 49: "PE", + 50: "(-", + 51: "-)", + 52: "STADIUMSTART", + 53: "STADIUMEND", + 54: "SUBROUTINESTART", + 55: "SUBROUTINEEND", + 56: "VERTEX_WITH_PROPS_START", + 57: "NODE_STRING[field]", + 58: "COLON", + 59: "NODE_STRING[value]", + 60: "PIPE", + 61: "CYLINDERSTART", + 62: "CYLINDEREND", + 63: "DIAMOND_START", + 64: "DIAMOND_STOP", + 65: "TAGEND", + 66: "TRAPSTART", + 67: "TRAPEND", + 68: "INVTRAPSTART", + 69: "INVTRAPEND", + 72: "TESTSTR", + 73: "START_LINK", + 75: "LINK", + 77: "STR", + 78: "MD_STR", + 81: "STYLE", + 82: "LINKSTYLE", + 83: "CLASSDEF", + 84: "CLASS", + 85: "CLICK", + 86: "DOWN", + 87: "UP", + 90: "idString[vertex]", + 91: "idString[class]", + 92: "CALLBACKNAME", + 93: "CALLBACKARGS", + 94: "HREF", + 95: "LINK_TARGET", + 96: "STR[link]", + 97: "STR[tooltip]", + 99: "DEFAULT", + 101: "INTERPOLATE", + 102: "NUM", + 103: "COMMA", + 106: "NODE_STRING", + 107: "UNIT", + 108: "BRKT", + 109: "PCT", + 111: "MINUS", + 112: "MULT", + 113: "UNICODE_TEXT", + 114: "TEXT", + 115: "TAGSTART", + 116: "EDGE_TEXT", + 118: "direction_tb", + 119: "direction_bt", + 120: "direction_rl", + 121: "direction_lr" + }, + productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 2], [4, 3], [16, 2], [16, 1], [17, 1], [17, 1], [17, 1], [15, 1], [15, 1], [15, 2], [19, 2], [19, 2], [19, 1], [19, 1], [18, 2], [18, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 9], [7, 6], [7, 4], [7, 1], [7, 2], [7, 2], [7, 1], [21, 1], [21, 1], [21, 1], [20, 3], [20, 4], [20, 2], [20, 1], [40, 1], [40, 5], [41, 1], [41, 3], [43, 4], [43, 4], [43, 6], [43, 4], [43, 4], [43, 4], [43, 8], [43, 4], [43, 4], [43, 4], [43, 6], [43, 4], [43, 4], [43, 4], [43, 4], [43, 4], [43, 1], [39, 2], [39, 3], [39, 3], [39, 1], [39, 3], [74, 1], [74, 2], [74, 1], [74, 1], [70, 1], [71, 3], [30, 1], [30, 2], [30, 1], [30, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [80, 1], [28, 1], [28, 2], [28, 1], [28, 1], [24, 5], [25, 5], [26, 2], [26, 4], [26, 3], [26, 5], [26, 3], [26, 5], [26, 5], [26, 7], [26, 2], [26, 4], [26, 2], [26, 4], [26, 4], [26, 6], [22, 5], [23, 5], [23, 5], [23, 9], [23, 9], [23, 7], [23, 7], [100, 1], [100, 3], [89, 1], [89, 3], [104, 1], [104, 2], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [105, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [110, 1], [79, 1], [79, 1], [79, 1], [79, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [88, 1], [76, 1], [76, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [117, 1], [45, 1], [45, 2], [98, 1], [98, 2], [33, 1], [33, 1], [33, 1], [33, 1]], + performAction: function (a, l, f, i, C, t, N1) { + var s = t.length - 1; + switch (C) { + case 2: + this.$ = []; + break; + case 3: + (!Array.isArray(t[s]) || t[s].length > 0) && t[s - 1].push(t[s]), this.$ = t[s - 1]; + break; + case 4: + case 176: + this.$ = t[s]; + break; + case 11: + i.setDirection("TB"), this.$ = "TB"; + break; + case 12: + i.setDirection(t[s - 1]), this.$ = t[s - 1]; + break; + case 27: + this.$ = t[s - 1].nodes; + break; + case 28: + case 29: + case 30: + case 31: + case 32: + this.$ = []; + break; + case 33: + this.$ = i.addSubGraph(t[s - 6], t[s - 1], t[s - 4]); + break; + case 34: + this.$ = i.addSubGraph(t[s - 3], t[s - 1], t[s - 3]); + break; + case 35: + this.$ = i.addSubGraph(void 0, t[s - 1], void 0); + break; + case 37: + this.$ = t[s].trim(), i.setAccTitle(this.$); + break; + case 38: + case 39: + this.$ = t[s].trim(), i.setAccDescription(this.$); + break; + case 43: + i.addLink(t[s - 2].stmt, t[s], t[s - 1]), this.$ = {stmt: t[s], nodes: t[s].concat(t[s - 2].nodes)}; + break; + case 44: + i.addLink(t[s - 3].stmt, t[s - 1], t[s - 2]), this.$ = { + stmt: t[s - 1], + nodes: t[s - 1].concat(t[s - 3].nodes) + }; + break; + case 45: + this.$ = {stmt: t[s - 1], nodes: t[s - 1]}; + break; + case 46: + this.$ = {stmt: t[s], nodes: t[s]}; + break; + case 47: + this.$ = [t[s]]; + break; + case 48: + this.$ = t[s - 4].concat(t[s]); + break; + case 49: + this.$ = t[s]; + break; + case 50: + this.$ = t[s - 2], i.setClass(t[s - 2], t[s]); + break; + case 51: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "square"); + break; + case 52: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "doublecircle"); + break; + case 53: + this.$ = t[s - 5], i.addVertex(t[s - 5], t[s - 2], "circle"); + break; + case 54: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "ellipse"); + break; + case 55: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "stadium"); + break; + case 56: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "subroutine"); + break; + case 57: + this.$ = t[s - 7], i.addVertex(t[s - 7], t[s - 1], "rect", void 0, void 0, void 0, Object.fromEntries([[t[s - 5], t[s - 3]]])); + break; + case 58: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "cylinder"); + break; + case 59: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "round"); + break; + case 60: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "diamond"); + break; + case 61: + this.$ = t[s - 5], i.addVertex(t[s - 5], t[s - 2], "hexagon"); + break; + case 62: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "odd"); + break; + case 63: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "trapezoid"); + break; + case 64: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "inv_trapezoid"); + break; + case 65: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "lean_right"); + break; + case 66: + this.$ = t[s - 3], i.addVertex(t[s - 3], t[s - 1], "lean_left"); + break; + case 67: + this.$ = t[s], i.addVertex(t[s]); + break; + case 68: + t[s - 1].text = t[s], this.$ = t[s - 1]; + break; + case 69: + case 70: + t[s - 2].text = t[s - 1], this.$ = t[s - 2]; + break; + case 71: + this.$ = t[s]; + break; + case 72: + var Y = i.destructLink(t[s], t[s - 2]); + this.$ = {type: Y.type, stroke: Y.stroke, length: Y.length, text: t[s - 1]}; + break; + case 73: + this.$ = {text: t[s], type: "text"}; + break; + case 74: + this.$ = {text: t[s - 1].text + "" + t[s], type: t[s - 1].type}; + break; + case 75: + this.$ = {text: t[s], type: "string"}; + break; + case 76: + this.$ = {text: t[s], type: "markdown"}; + break; + case 77: + var Y = i.destructLink(t[s]); + this.$ = {type: Y.type, stroke: Y.stroke, length: Y.length}; + break; + case 78: + this.$ = t[s - 1]; + break; + case 79: + this.$ = {text: t[s], type: "text"}; + break; + case 80: + this.$ = {text: t[s - 1].text + "" + t[s], type: t[s - 1].type}; + break; + case 81: + this.$ = {text: t[s], type: "string"}; + break; + case 82: + case 97: + this.$ = {text: t[s], type: "markdown"}; + break; + case 94: + this.$ = {text: t[s], type: "text"}; + break; + case 95: + this.$ = {text: t[s - 1].text + "" + t[s], type: t[s - 1].type}; + break; + case 96: + this.$ = {text: t[s], type: "text"}; + break; + case 98: + this.$ = t[s - 4], i.addClass(t[s - 2], t[s]); + break; + case 99: + this.$ = t[s - 4], i.setClass(t[s - 2], t[s]); + break; + case 100: + case 108: + this.$ = t[s - 1], i.setClickEvent(t[s - 1], t[s]); + break; + case 101: + case 109: + this.$ = t[s - 3], i.setClickEvent(t[s - 3], t[s - 2]), i.setTooltip(t[s - 3], t[s]); + break; + case 102: + this.$ = t[s - 2], i.setClickEvent(t[s - 2], t[s - 1], t[s]); + break; + case 103: + this.$ = t[s - 4], i.setClickEvent(t[s - 4], t[s - 3], t[s - 2]), i.setTooltip(t[s - 4], t[s]); + break; + case 104: + this.$ = t[s - 2], i.setLink(t[s - 2], t[s]); + break; + case 105: + this.$ = t[s - 4], i.setLink(t[s - 4], t[s - 2]), i.setTooltip(t[s - 4], t[s]); + break; + case 106: + this.$ = t[s - 4], i.setLink(t[s - 4], t[s - 2], t[s]); + break; + case 107: + this.$ = t[s - 6], i.setLink(t[s - 6], t[s - 4], t[s]), i.setTooltip(t[s - 6], t[s - 2]); + break; + case 110: + this.$ = t[s - 1], i.setLink(t[s - 1], t[s]); + break; + case 111: + this.$ = t[s - 3], i.setLink(t[s - 3], t[s - 2]), i.setTooltip(t[s - 3], t[s]); + break; + case 112: + this.$ = t[s - 3], i.setLink(t[s - 3], t[s - 2], t[s]); + break; + case 113: + this.$ = t[s - 5], i.setLink(t[s - 5], t[s - 4], t[s]), i.setTooltip(t[s - 5], t[s - 2]); + break; + case 114: + this.$ = t[s - 4], i.addVertex(t[s - 2], void 0, void 0, t[s]); + break; + case 115: + this.$ = t[s - 4], i.updateLink([t[s - 2]], t[s]); + break; + case 116: + this.$ = t[s - 4], i.updateLink(t[s - 2], t[s]); + break; + case 117: + this.$ = t[s - 8], i.updateLinkInterpolate([t[s - 6]], t[s - 2]), i.updateLink([t[s - 6]], t[s]); + break; + case 118: + this.$ = t[s - 8], i.updateLinkInterpolate(t[s - 6], t[s - 2]), i.updateLink(t[s - 6], t[s]); + break; + case 119: + this.$ = t[s - 6], i.updateLinkInterpolate([t[s - 4]], t[s]); + break; + case 120: + this.$ = t[s - 6], i.updateLinkInterpolate(t[s - 4], t[s]); + break; + case 121: + case 123: + this.$ = [t[s]]; + break; + case 122: + case 124: + t[s - 2].push(t[s]), this.$ = t[s - 2]; + break; + case 126: + this.$ = t[s - 1] + t[s]; + break; + case 174: + this.$ = t[s]; + break; + case 175: + this.$ = t[s - 1] + "" + t[s]; + break; + case 177: + this.$ = t[s - 1] + "" + t[s]; + break; + case 178: + this.$ = {stmt: "dir", value: "TB"}; + break; + case 179: + this.$ = {stmt: "dir", value: "BT"}; + break; + case 180: + this.$ = {stmt: "dir", value: "RL"}; + break; + case 181: + this.$ = {stmt: "dir", value: "LR"}; + break; + } + }, + table: [{3: 1, 4: 2, 9: u, 10: n, 12: r}, {1: [3]}, e(c, o, {5: 6}), {4: 7, 9: u, 10: n, 12: r}, { + 4: 8, + 9: u, + 10: n, + 12: r + }, {13: [1, 9], 14: [1, 10]}, { + 1: [2, 1], + 6: 11, + 7: 12, + 8: h, + 9: U, + 10: F, + 11: w, + 20: 17, + 22: 18, + 23: 19, + 24: 20, + 25: 21, + 26: 22, + 27: X, + 33: 24, + 34: l1, + 36: d1, + 38: p1, + 40: 28, + 41: 38, + 42: S, + 43: 39, + 45: 40, + 58: k, + 81: o1, + 82: U1, + 83: G1, + 84: M1, + 85: K1, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R, + 118: Y1, + 119: j1, + 120: z1, + 121: X1 + }, e(c, [2, 9]), e(c, [2, 10]), e(c, [2, 11]), { + 8: [1, 54], + 9: [1, 55], + 10: I1, + 15: 53, + 18: 56 + }, e(b, [2, 3]), e(b, [2, 4]), e(b, [2, 5]), e(b, [2, 6]), e(b, [2, 7]), e(b, [2, 8]), { + 8: q, + 9: Q, + 11: Z, + 21: 58, + 39: 59, + 70: 63, + 73: [1, 64], + 75: [1, 65] + }, {8: q, 9: Q, 11: Z, 21: 66}, {8: q, 9: Q, 11: Z, 21: 67}, {8: q, 9: Q, 11: Z, 21: 68}, { + 8: q, + 9: Q, + 11: Z, + 21: 69 + }, {8: q, 9: Q, 11: Z, 21: 70}, { + 8: q, + 9: Q, + 10: [1, 71], + 11: Z, + 21: 72 + }, e(b, [2, 36]), {35: [1, 73]}, {37: [1, 74]}, e(b, [2, 39]), e(H1, [2, 46], { + 18: 75, + 10: I1 + }), {10: [1, 76]}, {10: [1, 77]}, {10: [1, 78]}, {10: [1, 79]}, { + 14: k1, + 42: b1, + 58: g1, + 77: [1, 83], + 86: D1, + 92: [1, 80], + 94: [1, 81], + 98: 82, + 102: F1, + 103: T1, + 106: C1, + 108: S1, + 111: _1, + 112: x1, + 113: B1, + 117: 84 + }, e(b, [2, 178]), e(b, [2, 179]), e(b, [2, 180]), e(b, [2, 181]), e(W1, [2, 47]), e(W1, [2, 49], {44: [1, 96]}), e(N, [2, 67], { + 110: 109, + 29: [1, 97], + 42: S, + 46: [1, 98], + 48: [1, 99], + 50: [1, 100], + 52: [1, 101], + 54: [1, 102], + 56: [1, 103], + 58: k, + 61: [1, 104], + 63: [1, 105], + 65: [1, 106], + 66: [1, 107], + 68: [1, 108], + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 111: v, + 112: I, + 113: R + }), e(M, [2, 174]), e(M, [2, 135]), e(M, [2, 136]), e(M, [2, 137]), e(M, [2, 138]), e(M, [2, 139]), e(M, [2, 140]), e(M, [2, 141]), e(M, [2, 142]), e(M, [2, 143]), e(M, [2, 144]), e(M, [2, 145]), e(c, [2, 12]), e(c, [2, 18]), e(c, [2, 19]), {9: [1, 110]}, e(Et, [2, 26], { + 18: 111, + 10: I1 + }), e(b, [2, 27]), { + 40: 112, + 41: 38, + 42: S, + 43: 39, + 45: 40, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R + }, e(b, [2, 40]), e(b, [2, 41]), e(b, [2, 42]), e(R1, [2, 71], {71: 113, 60: [1, 115], 72: [1, 114]}), { + 74: 116, + 76: 117, + 77: [1, 118], + 78: [1, 119], + 113: kt, + 116: bt + }, e([42, 58, 60, 72, 86, 99, 102, 103, 106, 108, 111, 112, 113], [2, 77]), e(b, [2, 28]), e(b, [2, 29]), e(b, [2, 30]), e(b, [2, 31]), e(b, [2, 32]), { + 10: gt, + 12: Dt, + 14: Ft, + 27: Tt, + 28: 122, + 32: Ct, + 42: St, + 58: _t, + 73: xt, + 77: [1, 124], + 78: [1, 125], + 80: 135, + 81: Bt, + 82: mt, + 83: yt, + 84: Vt, + 85: Lt, + 86: vt, + 87: It, + 88: 123, + 102: Rt, + 106: Nt, + 108: wt, + 111: Ot, + 112: Pt, + 113: Ut + }, e(rt, o, {5: 148}), e(b, [2, 37]), e(b, [2, 38]), e(H1, [2, 45], {42: Gt}), { + 42: S, + 45: 150, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R + }, {99: [1, 151], 100: 152, 102: [1, 153]}, { + 42: S, + 45: 154, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R + }, { + 42: S, + 45: 155, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R + }, e(T, [2, 100], {10: [1, 156], 93: [1, 157]}), {77: [1, 158]}, e(T, [2, 108], { + 117: 160, + 10: [1, 159], + 14: k1, + 42: b1, + 58: g1, + 86: D1, + 102: F1, + 103: T1, + 106: C1, + 108: S1, + 111: _1, + 112: x1, + 113: B1 + }), e(T, [2, 110], {10: [1, 161]}), e(K, [2, 176]), e(K, [2, 163]), e(K, [2, 164]), e(K, [2, 165]), e(K, [2, 166]), e(K, [2, 167]), e(K, [2, 168]), e(K, [2, 169]), e(K, [2, 170]), e(K, [2, 171]), e(K, [2, 172]), e(K, [2, 173]), { + 42: S, + 45: 162, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R + }, {30: 163, 65: d, 77: O, 78: P, 79: 164, 113: p, 114: A, 115: E}, { + 30: 171, + 65: d, + 77: O, + 78: P, + 79: 164, + 113: p, + 114: A, + 115: E + }, {30: 173, 48: [1, 172], 65: d, 77: O, 78: P, 79: 164, 113: p, 114: A, 115: E}, { + 30: 174, + 65: d, + 77: O, + 78: P, + 79: 164, + 113: p, + 114: A, + 115: E + }, {30: 175, 65: d, 77: O, 78: P, 79: 164, 113: p, 114: A, 115: E}, { + 30: 176, + 65: d, + 77: O, + 78: P, + 79: 164, + 113: p, + 114: A, + 115: E + }, {106: [1, 177]}, {30: 178, 65: d, 77: O, 78: P, 79: 164, 113: p, 114: A, 115: E}, { + 30: 179, + 63: [1, 180], + 65: d, + 77: O, + 78: P, + 79: 164, + 113: p, + 114: A, + 115: E + }, {30: 181, 65: d, 77: O, 78: P, 79: 164, 113: p, 114: A, 115: E}, { + 30: 182, + 65: d, + 77: O, + 78: P, + 79: 164, + 113: p, + 114: A, + 115: E + }, { + 30: 183, + 65: d, + 77: O, + 78: P, + 79: 164, + 113: p, + 114: A, + 115: E + }, e(M, [2, 175]), e(c, [2, 20]), e(Et, [2, 25]), e(H1, [2, 43], { + 18: 184, + 10: I1 + }), e(R1, [2, 68], {10: [1, 185]}), {10: [1, 186]}, { + 30: 187, + 65: d, + 77: O, + 78: P, + 79: 164, + 113: p, + 114: A, + 115: E + }, { + 75: [1, 188], + 76: 189, + 113: kt, + 116: bt + }, e(m1, [2, 73]), e(m1, [2, 75]), e(m1, [2, 76]), e(m1, [2, 161]), e(m1, [2, 162]), { + 8: q, + 9: Q, + 10: gt, + 11: Z, + 12: Dt, + 14: Ft, + 21: 191, + 27: Tt, + 29: [1, 190], + 32: Ct, + 42: St, + 58: _t, + 73: xt, + 80: 135, + 81: Bt, + 82: mt, + 83: yt, + 84: Vt, + 85: Lt, + 86: vt, + 87: It, + 88: 192, + 102: Rt, + 106: Nt, + 108: wt, + 111: Ot, + 112: Pt, + 113: Ut + }, e(g, [2, 94]), e(g, [2, 96]), e(g, [2, 97]), e(g, [2, 150]), e(g, [2, 151]), e(g, [2, 152]), e(g, [2, 153]), e(g, [2, 154]), e(g, [2, 155]), e(g, [2, 156]), e(g, [2, 157]), e(g, [2, 158]), e(g, [2, 159]), e(g, [2, 160]), e(g, [2, 83]), e(g, [2, 84]), e(g, [2, 85]), e(g, [2, 86]), e(g, [2, 87]), e(g, [2, 88]), e(g, [2, 89]), e(g, [2, 90]), e(g, [2, 91]), e(g, [2, 92]), e(g, [2, 93]), { + 6: 11, + 7: 12, + 8: h, + 9: U, + 10: F, + 11: w, + 20: 17, + 22: 18, + 23: 19, + 24: 20, + 25: 21, + 26: 22, + 27: X, + 32: [1, 193], + 33: 24, + 34: l1, + 36: d1, + 38: p1, + 40: 28, + 41: 38, + 42: S, + 43: 39, + 45: 40, + 58: k, + 81: o1, + 82: U1, + 83: G1, + 84: M1, + 85: K1, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R, + 118: Y1, + 119: j1, + 120: z1, + 121: X1 + }, {10: I1, 18: 194}, { + 10: [1, 195], + 42: S, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 109, + 111: v, + 112: I, + 113: R + }, {10: [1, 196]}, {10: [1, 197], 103: [1, 198]}, e(Mt, [2, 121]), { + 10: [1, 199], + 42: S, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 109, + 111: v, + 112: I, + 113: R + }, { + 10: [1, 200], + 42: S, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 109, + 111: v, + 112: I, + 113: R + }, {77: [1, 201]}, e(T, [2, 102], {10: [1, 202]}), e(T, [2, 104], {10: [1, 203]}), {77: [1, 204]}, e(K, [2, 177]), { + 77: [1, 205], + 95: [1, 206] + }, e(W1, [2, 50], { + 110: 109, + 42: S, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 111: v, + 112: I, + 113: R + }), { + 31: [1, 207], + 65: d, + 79: 208, + 113: p, + 114: A, + 115: E + }, e(h1, [2, 79]), e(h1, [2, 81]), e(h1, [2, 82]), e(h1, [2, 146]), e(h1, [2, 147]), e(h1, [2, 148]), e(h1, [2, 149]), { + 47: [1, 209], + 65: d, + 79: 208, + 113: p, + 114: A, + 115: E + }, {30: 210, 65: d, 77: O, 78: P, 79: 164, 113: p, 114: A, 115: E}, { + 49: [1, 211], + 65: d, + 79: 208, + 113: p, + 114: A, + 115: E + }, {51: [1, 212], 65: d, 79: 208, 113: p, 114: A, 115: E}, { + 53: [1, 213], + 65: d, + 79: 208, + 113: p, + 114: A, + 115: E + }, {55: [1, 214], 65: d, 79: 208, 113: p, 114: A, 115: E}, {58: [1, 215]}, { + 62: [1, 216], + 65: d, + 79: 208, + 113: p, + 114: A, + 115: E + }, {64: [1, 217], 65: d, 79: 208, 113: p, 114: A, 115: E}, { + 30: 218, + 65: d, + 77: O, + 78: P, + 79: 164, + 113: p, + 114: A, + 115: E + }, {31: [1, 219], 65: d, 79: 208, 113: p, 114: A, 115: E}, { + 65: d, + 67: [1, 220], + 69: [1, 221], + 79: 208, + 113: p, + 114: A, + 115: E + }, { + 65: d, + 67: [1, 223], + 69: [1, 222], + 79: 208, + 113: p, + 114: A, + 115: E + }, e(H1, [2, 44], {42: Gt}), e(R1, [2, 70]), e(R1, [2, 69]), { + 60: [1, 224], + 65: d, + 79: 208, + 113: p, + 114: A, + 115: E + }, e(R1, [2, 72]), e(m1, [2, 74]), { + 30: 225, + 65: d, + 77: O, + 78: P, + 79: 164, + 113: p, + 114: A, + 115: E + }, e(rt, o, {5: 226}), e(g, [2, 95]), e(b, [2, 35]), { + 41: 227, + 42: S, + 43: 39, + 45: 40, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R + }, {10: J, 58: $, 81: t1, 89: 228, 102: e1, 104: 229, 105: 230, 106: s1, 107: u1, 108: n1, 109: i1}, { + 10: J, + 58: $, + 81: t1, + 89: 239, + 101: [1, 240], + 102: e1, + 104: 229, + 105: 230, + 106: s1, + 107: u1, + 108: n1, + 109: i1 + }, { + 10: J, + 58: $, + 81: t1, + 89: 241, + 101: [1, 242], + 102: e1, + 104: 229, + 105: 230, + 106: s1, + 107: u1, + 108: n1, + 109: i1 + }, {102: [1, 243]}, { + 10: J, + 58: $, + 81: t1, + 89: 244, + 102: e1, + 104: 229, + 105: 230, + 106: s1, + 107: u1, + 108: n1, + 109: i1 + }, { + 42: S, + 45: 245, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R + }, e(T, [2, 101]), {77: [1, 246]}, { + 77: [1, 247], + 95: [1, 248] + }, e(T, [2, 109]), e(T, [2, 111], {10: [1, 249]}), e(T, [2, 112]), e(N, [2, 51]), e(h1, [2, 80]), e(N, [2, 52]), { + 49: [1, 250], + 65: d, + 79: 208, + 113: p, + 114: A, + 115: E + }, e(N, [2, 59]), e(N, [2, 54]), e(N, [2, 55]), e(N, [2, 56]), {106: [1, 251]}, e(N, [2, 58]), e(N, [2, 60]), { + 64: [1, 252], + 65: d, + 79: 208, + 113: p, + 114: A, + 115: E + }, e(N, [2, 62]), e(N, [2, 63]), e(N, [2, 65]), e(N, [2, 64]), e(N, [2, 66]), e([10, 42, 58, 86, 99, 102, 103, 106, 108, 111, 112, 113], [2, 78]), { + 31: [1, 253], + 65: d, + 79: 208, + 113: p, + 114: A, + 115: E + }, { + 6: 11, + 7: 12, + 8: h, + 9: U, + 10: F, + 11: w, + 20: 17, + 22: 18, + 23: 19, + 24: 20, + 25: 21, + 26: 22, + 27: X, + 32: [1, 254], + 33: 24, + 34: l1, + 36: d1, + 38: p1, + 40: 28, + 41: 38, + 42: S, + 43: 39, + 45: 40, + 58: k, + 81: o1, + 82: U1, + 83: G1, + 84: M1, + 85: K1, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R, + 118: Y1, + 119: j1, + 120: z1, + 121: X1 + }, e(W1, [2, 48]), e(T, [2, 114], {103: y1}), e(Kt, [2, 123], { + 105: 256, + 10: J, + 58: $, + 81: t1, + 102: e1, + 106: s1, + 107: u1, + 108: n1, + 109: i1 + }), e(W, [2, 125]), e(W, [2, 127]), e(W, [2, 128]), e(W, [2, 129]), e(W, [2, 130]), e(W, [2, 131]), e(W, [2, 132]), e(W, [2, 133]), e(W, [2, 134]), e(T, [2, 115], {103: y1}), {10: [1, 257]}, e(T, [2, 116], {103: y1}), {10: [1, 258]}, e(Mt, [2, 122]), e(T, [2, 98], {103: y1}), e(T, [2, 99], { + 110: 109, + 42: S, + 58: k, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 111: v, + 112: I, + 113: R + }), e(T, [2, 103]), e(T, [2, 105], {10: [1, 259]}), e(T, [2, 106]), {95: [1, 260]}, {49: [1, 261]}, {60: [1, 262]}, {64: [1, 263]}, { + 8: q, + 9: Q, + 11: Z, + 21: 264 + }, e(b, [2, 34]), { + 10: J, + 58: $, + 81: t1, + 102: e1, + 104: 265, + 105: 230, + 106: s1, + 107: u1, + 108: n1, + 109: i1 + }, e(W, [2, 126]), { + 14: k1, + 42: b1, + 58: g1, + 86: D1, + 98: 266, + 102: F1, + 103: T1, + 106: C1, + 108: S1, + 111: _1, + 112: x1, + 113: B1, + 117: 84 + }, { + 14: k1, + 42: b1, + 58: g1, + 86: D1, + 98: 267, + 102: F1, + 103: T1, + 106: C1, + 108: S1, + 111: _1, + 112: x1, + 113: B1, + 117: 84 + }, {95: [1, 268]}, e(T, [2, 113]), e(N, [2, 53]), { + 30: 269, + 65: d, + 77: O, + 78: P, + 79: 164, + 113: p, + 114: A, + 115: E + }, e(N, [2, 61]), e(rt, o, {5: 270}), e(Kt, [2, 124], { + 105: 256, + 10: J, + 58: $, + 81: t1, + 102: e1, + 106: s1, + 107: u1, + 108: n1, + 109: i1 + }), e(T, [2, 119], { + 117: 160, + 10: [1, 271], + 14: k1, + 42: b1, + 58: g1, + 86: D1, + 102: F1, + 103: T1, + 106: C1, + 108: S1, + 111: _1, + 112: x1, + 113: B1 + }), e(T, [2, 120], { + 117: 160, + 10: [1, 272], + 14: k1, + 42: b1, + 58: g1, + 86: D1, + 102: F1, + 103: T1, + 106: C1, + 108: S1, + 111: _1, + 112: x1, + 113: B1 + }), e(T, [2, 107]), {31: [1, 273], 65: d, 79: 208, 113: p, 114: A, 115: E}, { + 6: 11, + 7: 12, + 8: h, + 9: U, + 10: F, + 11: w, + 20: 17, + 22: 18, + 23: 19, + 24: 20, + 25: 21, + 26: 22, + 27: X, + 32: [1, 274], + 33: 24, + 34: l1, + 36: d1, + 38: p1, + 40: 28, + 41: 38, + 42: S, + 43: 39, + 45: 40, + 58: k, + 81: o1, + 82: U1, + 83: G1, + 84: M1, + 85: K1, + 86: x, + 99: B, + 102: m, + 103: y, + 106: V, + 108: L, + 110: 41, + 111: v, + 112: I, + 113: R, + 118: Y1, + 119: j1, + 120: z1, + 121: X1 + }, {10: J, 58: $, 81: t1, 89: 275, 102: e1, 104: 229, 105: 230, 106: s1, 107: u1, 108: n1, 109: i1}, { + 10: J, + 58: $, + 81: t1, + 89: 276, + 102: e1, + 104: 229, + 105: 230, + 106: s1, + 107: u1, + 108: n1, + 109: i1 + }, e(N, [2, 57]), e(b, [2, 33]), e(T, [2, 117], {103: y1}), e(T, [2, 118], {103: y1})], + defaultActions: {}, + parseError: function (a, l) { + if (l.recoverable) + this.trace(a); + else { + var f = new Error(a); + throw f.hash = l, f; + } + }, + parse: function (a) { + var l = this, f = [0], i = [], C = [null], t = [], N1 = this.table, s = "", Y = 0, Yt = 0, Se = 2, jt = 1, + _e = t.slice.call(arguments, 1), _ = Object.create(this.lexer), A1 = {yy: {}}; + for (var lt in this.yy) + Object.prototype.hasOwnProperty.call(this.yy, lt) && (A1.yy[lt] = this.yy[lt]); + _.setInput(a, A1.yy), A1.yy.lexer = _, A1.yy.parser = this, typeof _.yylloc > "u" && (_.yylloc = {}); + var ot = _.yylloc; + t.push(ot); + var xe = _.options && _.options.ranges; + typeof A1.yy.parseError == "function" ? this.parseError = A1.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; + + function Be() { + var a1; + return a1 = i.pop() || _.lex() || jt, typeof a1 != "number" && (a1 instanceof Array && (i = a1, a1 = i.pop()), a1 = l.symbols_[a1] || a1), a1; + } + + for (var G, E1, j, ht, V1 = {}, q1, r1, zt, Q1; ;) { + if (E1 = f[f.length - 1], this.defaultActions[E1] ? j = this.defaultActions[E1] : ((G === null || typeof G > "u") && (G = Be()), j = N1[E1] && N1[E1][G]), typeof j > "u" || !j.length || !j[0]) { + var ft = ""; + Q1 = []; + for (q1 in N1[E1]) + this.terminals_[q1] && q1 > Se && Q1.push("'" + this.terminals_[q1] + "'"); + _.showPosition ? ft = "Parse error on line " + (Y + 1) + `: +` + _.showPosition() + ` +Expecting ` + Q1.join(", ") + ", got '" + (this.terminals_[G] || G) + "'" : ft = "Parse error on line " + (Y + 1) + ": Unexpected " + (G == jt ? "end of input" : "'" + (this.terminals_[G] || G) + "'"), this.parseError(ft, { + text: _.match, + token: this.terminals_[G] || G, + line: _.yylineno, + loc: ot, + expected: Q1 + }); + } + if (j[0] instanceof Array && j.length > 1) + throw new Error("Parse Error: multiple actions possible at state: " + E1 + ", token: " + G); + switch (j[0]) { + case 1: + f.push(G), C.push(_.yytext), t.push(_.yylloc), f.push(j[1]), G = null, Yt = _.yyleng, s = _.yytext, Y = _.yylineno, ot = _.yylloc; + break; + case 2: + if (r1 = this.productions_[j[1]][1], V1.$ = C[C.length - r1], V1._$ = { + first_line: t[t.length - (r1 || 1)].first_line, + last_line: t[t.length - 1].last_line, + first_column: t[t.length - (r1 || 1)].first_column, + last_column: t[t.length - 1].last_column + }, xe && (V1._$.range = [ + t[t.length - (r1 || 1)].range[0], + t[t.length - 1].range[1] + ]), ht = this.performAction.apply(V1, [ + s, + Yt, + Y, + A1.yy, + j[1], + C, + t + ].concat(_e)), typeof ht < "u") + return ht; + r1 && (f = f.slice(0, -1 * r1 * 2), C = C.slice(0, -1 * r1), t = t.slice(0, -1 * r1)), f.push(this.productions_[j[1]][0]), C.push(V1.$), t.push(V1._$), zt = N1[f[f.length - 2]][f[f.length - 1]], f.push(zt); + break; + case 3: + return !0; + } + } + return !0; + } + }, Ce = function () { + var f1 = { + EOF: 1, + parseError: function (l, f) { + if (this.yy.parser) + this.yy.parser.parseError(l, f); + else + throw new Error(l); + }, + // resets the lexer, sets new input + setInput: function (a, l) { + return this.yy = l || this.yy || {}, this._input = a, 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; + }, + // consumes and returns one char from the input + input: function () { + var a = this._input[0]; + this.yytext += a, this.yyleng++, this.offset++, this.match += a, this.matched += a; + var l = a.match(/(?:\r\n?|\n).*/g); + return l ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), a; + }, + // unshifts one char (or a string) into the input + unput: function (a) { + var l = a.length, f = a.split(/(?:\r\n?|\n)/g); + this._input = a + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l; + var i = 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), f.length - 1 && (this.yylineno -= f.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: f ? (f.length === i.length ? this.yylloc.first_column : 0) + i[i.length - f.length].length - f[0].length : this.yylloc.first_column - l + }, this.options.ranges && (this.yylloc.range = [C[0], C[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this; + }, + // When called from action, caches matched text and appends it on next action + more: function () { + return this._more = !0, this; + }, + // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. + 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; + }, + // retain first n characters of the match + less: function (a) { + this.unput(this.match.slice(a)); + }, + // displays already matched input, i.e. for error messages + pastInput: function () { + var a = this.matched.substr(0, this.matched.length - this.match.length); + return (a.length > 20 ? "..." : "") + a.substr(-20).replace(/\n/g, ""); + }, + // displays upcoming input, i.e. for error messages + upcomingInput: function () { + var a = this.match; + return a.length < 20 && (a += this._input.substr(0, 20 - a.length)), (a.substr(0, 20) + (a.length > 20 ? "..." : "")).replace(/\n/g, ""); + }, + // displays the character position where the lexing error occurred, i.e. for error messages + showPosition: function () { + var a = this.pastInput(), l = new Array(a.length + 1).join("-"); + return a + this.upcomingInput() + ` +` + l + "^"; + }, + // test the lexed token: return FALSE when not a match, otherwise return token + test_match: function (a, l) { + var f, i, 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))), i = a[0].match(/(?:\r\n?|\n).*/g), i && (this.yylineno += i.length), this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: i ? i[i.length - 1].length - i[i.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + a[0].length + }, this.yytext += a[0], this.match += a[0], this.matches = a, 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(a[0].length), this.matched += a[0], f = this.performAction.call(this, this.yy, this, l, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), f) + return f; + if (this._backtrack) { + for (var t in C) + this[t] = C[t]; + return !1; + } + return !1; + }, + // return next match in input + next: function () { + if (this.done) + return this.EOF; + this._input || (this.done = !0); + var a, l, f, i; + this._more || (this.yytext = "", this.match = ""); + for (var C = this._currentRules(), t = 0; t < C.length; t++) + if (f = this._input.match(this.rules[C[t]]), f && (!l || f[0].length > l[0].length)) { + if (l = f, i = t, this.options.backtrack_lexer) { + if (a = this.test_match(f, C[t]), a !== !1) + return a; + if (this._backtrack) { + l = !1; + continue; + } else + return !1; + } else if (!this.options.flex) + break; + } + return l ? (a = this.test_match(l, C[i]), a !== !1 ? a : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text. +` + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + }, + // return next match that has a token + lex: function () { + var l = this.next(); + return l || this.lex(); + }, + // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) + begin: function (l) { + this.conditionStack.push(l); + }, + // pop the previously active lexer condition state off the condition stack + popState: function () { + var l = this.conditionStack.length - 1; + return l > 0 ? this.conditionStack.pop() : this.conditionStack[0]; + }, + // produce the lexer rule set which is active for the currently active lexer condition state + _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; + }, + // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available + topState: function (l) { + return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL"; + }, + // alias for begin(condition) + pushState: function (l) { + this.begin(l); + }, + // return the number of states currently on the stack + stateStackSize: function () { + return this.conditionStack.length; + }, + options: {}, + performAction: function (l, f, i, C) { + switch (i) { + case 0: + return this.begin("acc_title"), 34; + case 1: + return this.popState(), "acc_title_value"; + case 2: + return this.begin("acc_descr"), 36; + case 3: + return this.popState(), "acc_descr_value"; + case 4: + this.begin("acc_descr_multiline"); + break; + case 5: + this.popState(); + break; + case 6: + return "acc_descr_multiline_value"; + case 7: + this.begin("callbackname"); + break; + case 8: + this.popState(); + break; + case 9: + this.popState(), this.begin("callbackargs"); + break; + case 10: + return 92; + case 11: + this.popState(); + break; + case 12: + return 93; + case 13: + return "MD_STR"; + case 14: + this.popState(); + break; + case 15: + this.begin("md_string"); + break; + case 16: + return "STR"; + case 17: + this.popState(); + break; + case 18: + this.pushState("string"); + break; + case 19: + return 81; + case 20: + return 99; + case 21: + return 82; + case 22: + return 101; + case 23: + return 83; + case 24: + return 84; + case 25: + return 94; + case 26: + this.begin("click"); + break; + case 27: + this.popState(); + break; + case 28: + return 85; + case 29: + return l.lex.firstGraph() && this.begin("dir"), 12; + case 30: + return l.lex.firstGraph() && this.begin("dir"), 12; + case 31: + return l.lex.firstGraph() && this.begin("dir"), 12; + case 32: + return 27; + case 33: + return 32; + case 34: + return 95; + case 35: + return 95; + case 36: + return 95; + case 37: + return 95; + case 38: + return this.popState(), 13; + case 39: + return this.popState(), 14; + case 40: + return this.popState(), 14; + case 41: + return this.popState(), 14; + case 42: + return this.popState(), 14; + case 43: + return this.popState(), 14; + case 44: + return this.popState(), 14; + case 45: + return this.popState(), 14; + case 46: + return this.popState(), 14; + case 47: + return this.popState(), 14; + case 48: + return this.popState(), 14; + case 49: + return 118; + case 50: + return 119; + case 51: + return 120; + case 52: + return 121; + case 53: + return 102; + case 54: + return 108; + case 55: + return 44; + case 56: + return 58; + case 57: + return 42; + case 58: + return 8; + case 59: + return 103; + case 60: + return 112; + case 61: + return this.popState(), 75; + case 62: + return this.pushState("edgeText"), 73; + case 63: + return 116; + case 64: + return this.popState(), 75; + case 65: + return this.pushState("thickEdgeText"), 73; + case 66: + return 116; + case 67: + return this.popState(), 75; + case 68: + return this.pushState("dottedEdgeText"), 73; + case 69: + return 116; + case 70: + return 75; + case 71: + return this.popState(), 51; + case 72: + return "TEXT"; + case 73: + return this.pushState("ellipseText"), 50; + case 74: + return this.popState(), 53; + case 75: + return this.pushState("text"), 52; + case 76: + return this.popState(), 55; + case 77: + return this.pushState("text"), 54; + case 78: + return 56; + case 79: + return this.pushState("text"), 65; + case 80: + return this.popState(), 62; + case 81: + return this.pushState("text"), 61; + case 82: + return this.popState(), 47; + case 83: + return this.pushState("text"), 46; + case 84: + return this.popState(), 67; + case 85: + return this.popState(), 69; + case 86: + return 114; + case 87: + return this.pushState("trapText"), 66; + case 88: + return this.pushState("trapText"), 68; + case 89: + return 115; + case 90: + return 65; + case 91: + return 87; + case 92: + return "SEP"; + case 93: + return 86; + case 94: + return 112; + case 95: + return 108; + case 96: + return 42; + case 97: + return 106; + case 98: + return 111; + case 99: + return 113; + case 100: + return this.popState(), 60; + case 101: + return this.pushState("text"), 60; + case 102: + return this.popState(), 49; + case 103: + return this.pushState("text"), 48; + case 104: + return this.popState(), 31; + case 105: + return this.pushState("text"), 29; + case 106: + return this.popState(), 64; + case 107: + return this.pushState("text"), 63; + case 108: + return "TEXT"; + case 109: + return "QUOTE"; + case 110: + return 9; + case 111: + return 10; + case 112: + return 11; + } + }, + rules: [/^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["][`])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:["])/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:href[\s])/, /^(?:click[\s]+)/, /^(?:[\s\n])/, /^(?:[^\s\n]*)/, /^(?:flowchart-elk\b)/, /^(?:graph\b)/, /^(?:flowchart\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:(\r?\n)*\s*\n)/, /^(?:\s*LR\b)/, /^(?:\s*RL\b)/, /^(?:\s*TB\b)/, /^(?:\s*BT\b)/, /^(?:\s*TD\b)/, /^(?:\s*BR\b)/, /^(?:\s*<)/, /^(?:\s*>)/, /^(?:\s*\^)/, /^(?:\s*v\b)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::::)/, /^(?::)/, /^(?:&)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:[^-]|-(?!-)+)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:[^=]|=(?!))/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:[^\.]|\.(?!))/, /^(?:\s*~~[\~]+\s*)/, /^(?:[-/\)][\)])/, /^(?:[^\(\)\[\]\{\}]|!\)+)/, /^(?:\(-)/, /^(?:\]\))/, /^(?:\(\[)/, /^(?:\]\])/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:>)/, /^(?:\)\])/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\(\(\()/, /^(?:[\\(?=\])][\]])/, /^(?:\/(?=\])\])/, /^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:\\\|)/, /^(?:v\b)/, /^(?:\*)/, /^(?:#)/, /^(?:&)/, /^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/, /^(?:-)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\|)/, /^(?:\))/, /^(?:\()/, /^(?:\])/, /^(?:\[)/, /^(?:(\}))/, /^(?:\{)/, /^(?:[^\[\]\(\)\{\}\|\"]+)/, /^(?:")/, /^(?:(\r?\n)+)/, /^(?:\s)/, /^(?:$)/], + conditions: { + callbackargs: { + rules: [11, 12, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], + inclusive: !1 + }, + callbackname: { + rules: [8, 9, 10, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], + inclusive: !1 + }, + href: {rules: [15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], inclusive: !1}, + click: {rules: [15, 18, 27, 28, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], inclusive: !1}, + dottedEdgeText: { + rules: [15, 18, 67, 69, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], + inclusive: !1 + }, + thickEdgeText: { + rules: [15, 18, 64, 66, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], + inclusive: !1 + }, + edgeText: {rules: [15, 18, 61, 63, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], inclusive: !1}, + trapText: { + rules: [15, 18, 70, 73, 75, 77, 81, 83, 84, 85, 86, 87, 88, 101, 103, 105, 107], + inclusive: !1 + }, + ellipseText: { + rules: [15, 18, 70, 71, 72, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], + inclusive: !1 + }, + text: { + rules: [15, 18, 70, 73, 74, 75, 76, 77, 80, 81, 82, 83, 87, 88, 100, 101, 102, 103, 104, 105, 106, 107, 108], + inclusive: !1 + }, + vertex: {rules: [15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], inclusive: !1}, + dir: { + rules: [15, 18, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], + inclusive: !1 + }, + acc_descr_multiline: { + rules: [5, 6, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], + inclusive: !1 + }, + acc_descr: {rules: [3, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], inclusive: !1}, + acc_title: {rules: [1, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], inclusive: !1}, + md_string: {rules: [13, 14, 15, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], inclusive: !1}, + string: {rules: [15, 16, 17, 18, 70, 73, 75, 77, 81, 83, 87, 88, 101, 103, 105, 107], inclusive: !1}, + INITIAL: { + rules: [0, 2, 4, 7, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 64, 65, 67, 68, 70, 73, 75, 77, 78, 79, 81, 83, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 103, 105, 107, 109, 110, 111, 112], + inclusive: !0 + } + } + }; + return f1; + }(); + at.lexer = Ce; + + function ct() { + this.yy = {}; + } + + return ct.prototype = at, at.Parser = ct, new ct(); +}(); +dt.parser = dt; +const Xe = dt, Oe = "flowchart-"; +let Xt = 0, v1 = et(), D = {}, H = [], L1 = {}, c1 = [], $1 = {}, tt = {}, Z1 = 0, pt = !0, z, st, ut = []; +const nt = (e) => we.sanitizeText(e, v1), P1 = function (e) { + const u = Object.keys(D); + for (const n of u) + if (D[n].id === e) + return D[n].domId; + return e; +}, Ht = function (e, u, n, r, c, o, h = {}) { + let U, F = e; + F !== void 0 && F.trim().length !== 0 && (D[F] === void 0 && (D[F] = { + id: F, + labelType: "text", + domId: Oe + F + "-" + Xt, + styles: [], + classes: [] + }), Xt++, u !== void 0 ? (v1 = et(), U = nt(u.text.trim()), D[F].labelType = u.type, U[0] === '"' && U[U.length - 1] === '"' && (U = U.substring(1, U.length - 1)), D[F].text = U) : D[F].text === void 0 && (D[F].text = e), n !== void 0 && (D[F].type = n), r != null && r.forEach(function (w) { + D[F].styles.push(w); + }), c != null && c.forEach(function (w) { + D[F].classes.push(w); + }), o !== void 0 && (D[F].dir = o), D[F].props === void 0 ? D[F].props = h : h !== void 0 && Object.assign(D[F].props, h)); +}, Wt = function (e, u, n) { + const o = {start: e, end: u, type: void 0, text: "", labelType: "text"}; + J1.info("abc78 Got edge...", o); + const h = n.text; + if (h !== void 0 && (o.text = nt(h.text.trim()), o.text[0] === '"' && o.text[o.text.length - 1] === '"' && (o.text = o.text.substring(1, o.text.length - 1)), o.labelType = h.type), n !== void 0 && (o.type = n.type, o.stroke = n.stroke, o.length = n.length), (o == null ? void 0 : o.length) > 10 && (o.length = 10), H.length < (v1.maxEdges ?? 500)) + J1.info("abc78 pushing edge..."), H.push(o); + else + throw new Error( + `Edge limit exceeded. ${H.length} edges found, but the limit is ${v1.maxEdges}. + +Initialize mermaid with maxEdges set to a higher number to allow more edges. +You cannot set this config via configuration inside the diagram as it is a secure config. +You have to call mermaid.initialize.` + ); +}, qt = function (e, u, n) { + J1.info("addLink (abc78)", e, u, n); + let r, c; + for (r = 0; r < e.length; r++) + for (c = 0; c < u.length; c++) + Wt(e[r], u[c], n); +}, Qt = function (e, u) { + e.forEach(function (n) { + n === "default" ? H.defaultInterpolate = u : H[n].interpolate = u; + }); +}, Zt = function (e, u) { + e.forEach(function (n) { + if (n >= H.length) + throw new Error( + `The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${H.length - 1}. (Help: Ensure that the index is within the range of existing edges.)` + ); + n === "default" ? H.defaultStyle = u : (At.isSubstringInArray("fill", u) === -1 && u.push("fill:none"), H[n].style = u); + }); +}, Jt = function (e, u) { + e.split(",").forEach(function (n) { + L1[n] === void 0 && (L1[n] = {id: n, styles: [], textStyles: []}), u != null && u.forEach(function (r) { + if (r.match("color")) { + const c = r.replace("fill", "bgFill").replace("color", "fill"); + L1[n].textStyles.push(c); + } + L1[n].styles.push(r); + }); + }); +}, $t = function (e) { + z = e, z.match(/.*/) && (z = "LR"), z.match(/.*v/) && (z = "TB"), z === "TD" && (z = "TB"); +}, it = function (e, u) { + e.split(",").forEach(function (n) { + let r = n; + D[r] !== void 0 && D[r].classes.push(u), $1[r] !== void 0 && $1[r].classes.push(u); + }); +}, Pe = function (e, u) { + e.split(",").forEach(function (n) { + u !== void 0 && (tt[st === "gen-1" ? P1(n) : n] = nt(u)); + }); +}, Ue = function (e, u, n) { + let r = P1(e); + if (et().securityLevel !== "loose" || u === void 0) + return; + let c = []; + if (typeof n == "string") { + c = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); + for (let o = 0; o < c.length; o++) { + let h = c[o].trim(); + h.charAt(0) === '"' && h.charAt(h.length - 1) === '"' && (h = h.substr(1, h.length - 2)), c[o] = h; + } + } + c.length === 0 && c.push(e), D[e] !== void 0 && (D[e].haveCallback = !0, ut.push(function () { + const o = document.querySelector(`[id="${r}"]`); + o !== null && o.addEventListener( + "click", + function () { + At.runFunc(u, ...c); + }, + !1 + ); + })); +}, te = function (e, u, n) { + e.split(",").forEach(function (r) { + D[r] !== void 0 && (D[r].link = At.formatUrl(u, v1), D[r].linkTarget = n); + }), it(e, "clickable"); +}, ee = function (e) { + if (tt.hasOwnProperty(e)) + return tt[e]; +}, se = function (e, u, n) { + e.split(",").forEach(function (r) { + Ue(r, u, n); + }), it(e, "clickable"); +}, ue = function (e) { + ut.forEach(function (u) { + u(e); + }); +}, ne = function () { + return z.trim(); +}, ie = function () { + return D; +}, re = function () { + return H; +}, ae = function () { + return L1; +}, ce = function (e) { + let u = w1(".mermaidTooltip"); + (u._groups || u)[0][0] === null && (u = w1("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0)), w1(e).select("svg").selectAll("g.node").on("mouseover", function () { + const c = w1(this); + if (c.attr("title") === null) + return; + const h = this.getBoundingClientRect(); + u.transition().duration(200).style("opacity", ".9"), u.text(c.attr("title")).style("left", window.scrollX + h.left + (h.right - h.left) / 2 + "px").style("top", window.scrollY + h.bottom + "px"), u.html(u.html().replace(/<br\/>/g, "
")), c.classed("hover", !0); + }).on("mouseout", function () { + u.transition().duration(500).style("opacity", 0), w1(this).classed("hover", !1); + }); +}; +ut.push(ce); +const le = function (e = "gen-1") { + D = {}, L1 = {}, H = [], ut = [ce], c1 = [], $1 = {}, Z1 = 0, tt = {}, pt = !0, st = e, v1 = et(), Ne(); +}, oe = (e) => { + st = e || "gen-2"; +}, he = function () { + return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"; +}, fe = function (e, u, n) { + let r = e.text.trim(), c = n.text; + e === n && n.text.match(/\s/) && (r = void 0); + + function o(X) { + const l1 = {boolean: {}, number: {}, string: {}}, d1 = []; + let p1; + return { + nodeList: X.filter(function (k) { + const o1 = typeof k; + return k.stmt && k.stmt === "dir" ? (p1 = k.value, !1) : k.trim() === "" ? !1 : o1 in l1 ? l1[o1].hasOwnProperty(k) ? !1 : l1[o1][k] = !0 : d1.includes(k) ? !1 : d1.push(k); + }), dir: p1 + }; + } + + let h = []; + const {nodeList: U, dir: F} = o(h.concat.apply(h, u)); + if (h = U, st === "gen-1") + for (let X = 0; X < h.length; X++) + h[X] = P1(h[X]); + r = r || "subGraph" + Z1, c = c || "", c = nt(c), Z1 = Z1 + 1; + const w = { + id: r, + nodes: h, + title: c.trim(), + classes: [], + dir: F, + labelType: n.type + }; + return J1.info("Adding", w.id, w.nodes, w.dir), w.nodes = Fe(w, c1).nodes, c1.push(w), $1[r] = w, r; +}, Ge = function (e) { + for (const [u, n] of c1.entries()) + if (n.id === e) + return u; + return -1; +}; +let O1 = -1; +const de = [], pe = function (e, u) { + const n = c1[u].nodes; + if (O1 = O1 + 1, O1 > 2e3) + return; + if (de[O1] = u, c1[u].id === e) + return { + result: !0, + count: 0 + }; + let r = 0, c = 1; + for (; r < n.length;) { + const o = Ge(n[r]); + if (o >= 0) { + const h = pe(e, o); + if (h.result) + return { + result: !0, + count: c + h.count + }; + c = c + h.count; + } + r = r + 1; + } + return { + result: !1, + count: c + }; +}, Ae = function (e) { + return de[e]; +}, Ee = function () { + O1 = -1, c1.length > 0 && pe("none", c1.length - 1); +}, ke = function () { + return c1; +}, be = () => pt ? (pt = !1, !0) : !1, Me = (e) => { + let u = e.trim(), n = "arrow_open"; + switch (u[0]) { + case "<": + n = "arrow_point", u = u.slice(1); + break; + case "x": + n = "arrow_cross", u = u.slice(1); + break; + case "o": + n = "arrow_circle", u = u.slice(1); + break; + } + let r = "normal"; + return u.includes("=") && (r = "thick"), u.includes(".") && (r = "dotted"), {type: n, stroke: r}; +}, Ke = (e, u) => { + const n = u.length; + let r = 0; + for (let c = 0; c < n; ++c) + u[c] === e && ++r; + return r; +}, Ye = (e) => { + const u = e.trim(); + let n = u.slice(0, -1), r = "arrow_open"; + switch (u.slice(-1)) { + case "x": + r = "arrow_cross", u[0] === "x" && (r = "double_" + r, n = n.slice(1)); + break; + case ">": + r = "arrow_point", u[0] === "<" && (r = "double_" + r, n = n.slice(1)); + break; + case "o": + r = "arrow_circle", u[0] === "o" && (r = "double_" + r, n = n.slice(1)); + break; + } + let c = "normal", o = n.length - 1; + n[0] === "=" && (c = "thick"), n[0] === "~" && (c = "invisible"); + let h = Ke(".", n); + return h && (c = "dotted", o = h), {type: r, stroke: c, length: o}; +}, ge = (e, u) => { + const n = Ye(e); + let r; + if (u) { + if (r = Me(u), r.stroke !== n.stroke) + return {type: "INVALID", stroke: "INVALID"}; + if (r.type === "arrow_open") + r.type = n.type; + else { + if (r.type !== n.type) + return {type: "INVALID", stroke: "INVALID"}; + r.type = "double_" + r.type; + } + return r.type === "double_arrow" && (r.type = "double_arrow_point"), r.length = n.length, r; + } + return n; +}, De = (e, u) => { + let n = !1; + return e.forEach((r) => { + r.nodes.indexOf(u) >= 0 && (n = !0); + }), n; +}, Fe = (e, u) => { + const n = []; + return e.nodes.forEach((r, c) => { + De(u, r) || n.push(e.nodes[c]); + }), {nodes: n}; +}, Te = { + firstGraph: be +}, je = { + defaultConfig: () => me.flowchart, + setAccTitle: ye, + getAccTitle: Ve, + getAccDescription: Le, + setAccDescription: ve, + addVertex: Ht, + lookUpDomId: P1, + addLink: qt, + updateLinkInterpolate: Qt, + updateLink: Zt, + addClass: Jt, + setDirection: $t, + setClass: it, + setTooltip: Pe, + getTooltip: ee, + setClickEvent: se, + setLink: te, + bindFunctions: ue, + getDirection: ne, + getVertices: ie, + getEdges: re, + getClasses: ae, + clear: le, + setGen: oe, + defaultStyle: he, + addSubGraph: fe, + getDepthFirstPos: Ae, + indexNodes: Ee, + getSubGraphs: ke, + destructLink: ge, + lex: Te, + exists: De, + makeUniq: Fe, + setDiagramTitle: Ie, + getDiagramTitle: Re +}, He = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + addClass: Jt, + addLink: qt, + addSingleLink: Wt, + addSubGraph: fe, + addVertex: Ht, + bindFunctions: ue, + clear: le, + default: je, + defaultStyle: he, + destructLink: ge, + firstGraph: be, + getClasses: ae, + getDepthFirstPos: Ae, + getDirection: ne, + getEdges: re, + getSubGraphs: ke, + getTooltip: ee, + getVertices: ie, + indexNodes: Ee, + lex: Te, + lookUpDomId: P1, + setClass: it, + setClickEvent: se, + setDirection: $t, + setGen: oe, + setLink: te, + updateLink: Zt, + updateLinkInterpolate: Qt +}, Symbol.toStringTag, {value: "Module"})); +export { + He as d, + je as f, + Xe as p +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/flowDiagram-v2-f2119625.js b/BlazorApp/wwwroot/js/lib/mermaid/flowDiagram-v2-f2119625.js new file mode 100644 index 00000000..a7caad32 --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/flowDiagram-v2-f2119625.js @@ -0,0 +1,26 @@ +import {f as o, p as e} from "./flowDb-9a89ea33.js"; +import {f as t, g as a} from "./styles-e75131e4.js"; +import {u as i} from "./mermaid-9f2aa176.js"; +import "./graph-0ee63739.js"; +import "./index-bb6d8841.js"; +import "./layout-fd473db2.js"; +import "./clone-afc2f047.js"; +import "./edges-16357fde.js"; +import "./createText-03b82060.js"; +import "./line-24d93f1b.js"; +import "./array-2ff2c7a6.js"; +import "./path-428ebac9.js"; +import "./channel-ebbc4130.js"; + +const M = { + parser: e, + db: o, + renderer: t, + styles: a, + init: (r) => { + r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, i({flowchart: {arrowMarkerAbsolute: r.arrowMarkerAbsolute}}), t.setConf(r.flowchart), o.clear(), o.setGen("gen-2"); + } +}; +export { + M as diagram +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/graph-0ee63739.js b/BlazorApp/wwwroot/js/lib/mermaid/graph-0ee63739.js new file mode 100644 index 00000000..cc681d99 --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/graph-0ee63739.js @@ -0,0 +1,1087 @@ +import { + a$ as L, + a8 as me, + a_ as en, + ac as on, + ae as X, + af as tn, + ag as Te, + ah as y, + ai as fn, + aK as I, + ak as we, + aL as qe, + al as un, + aM as O, + am as nn, + aN as Xe, + an as $e, + aO as Qe, + ao as M, + aP as We, + aQ as Ee, + aR as G, + aS as Je, + aT as Oe, + aU as ze, + aV as C, + aW as R, + aX as Ve, + aY as Z, + aZ as ke, + b0 as rn, + b1 as re, + b2 as sn, + b3 as an, + b4 as B, + b5 as dn, + b6 as ie, + z as te +} from "./mermaid-9f2aa176.js"; + +var hn = "[object Symbol]"; + +function Q(e) { + return typeof e == "symbol" || I(e) && qe(e) == hn; +} + +function ve(e, n) { + for (var r = -1, t = e == null ? 0 : e.length, i = Array(t); ++r < t;) + i[r] = n(e[r], r, e); + return i; +} + +var ln = 1 / 0, se = O ? O.prototype : void 0, ae = se ? se.toString : void 0; + +function Pe(e) { + if (typeof e == "string") + return e; + if (y(e)) + return ve(e, Pe) + ""; + if (Q(e)) + return ae ? ae.call(e) : ""; + var n = e + ""; + return n == "0" && 1 / e == -ln ? "-0" : n; +} + +function gn() { +} + +function Le(e, n) { + for (var r = -1, t = e == null ? 0 : e.length; ++r < t && n(e[r], r, e) !== !1;) + ; + return e; +} + +function cn(e, n, r, t) { + for (var i = e.length, s = r + (t ? 1 : -1); t ? s-- : ++s < i;) + if (n(e[s], s, e)) + return s; + return -1; +} + +function _n(e) { + return e !== e; +} + +function pn(e, n, r) { + for (var t = r - 1, i = e.length; ++t < i;) + if (e[t] === n) + return t; + return -1; +} + +function bn(e, n, r) { + return n === n ? pn(e, n, r) : cn(e, _n, r); +} + +function yn(e, n) { + var r = e == null ? 0 : e.length; + return !!r && bn(e, n, 0) > -1; +} + +function T(e) { + return Te(e) ? Xe(e) : Qe(e); +} + +var An = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Tn = /^\w*$/; + +function W(e, n) { + if (y(e)) + return !1; + var r = typeof e; + return r == "number" || r == "symbol" || r == "boolean" || e == null || Q(e) ? !0 : Tn.test(e) || !An.test(e) || n != null && e in Object(n); +} + +var En = 500; + +function On(e) { + var n = We(e, function (t) { + return r.size === En && r.clear(), t; + }), r = n.cache; + return n; +} + +var $n = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, + mn = /\\(\\)?/g, wn = On(function (e) { + var n = []; + return e.charCodeAt(0) === 46 && n.push(""), e.replace($n, function (r, t, i, s) { + n.push(i ? s.replace(mn, "$1") : t || r); + }), n; + }); +const vn = wn; + +function Pn(e) { + return e == null ? "" : Pe(e); +} + +function Ie(e, n) { + return y(e) ? e : W(e, n) ? [e] : vn(Pn(e)); +} + +var Ln = 1 / 0; + +function U(e) { + if (typeof e == "string" || Q(e)) + return e; + var n = e + ""; + return n == "0" && 1 / e == -Ln ? "-0" : n; +} + +function Ce(e, n) { + n = Ie(n, e); + for (var r = 0, t = n.length; e != null && r < t;) + e = e[U(n[r++])]; + return r && r == t ? e : void 0; +} + +function In(e, n, r) { + var t = e == null ? void 0 : Ce(e, n); + return t === void 0 ? r : t; +} + +function J(e, n) { + for (var r = -1, t = n.length, i = e.length; ++r < t;) + e[i + r] = n[r]; + return e; +} + +var ue = O ? O.isConcatSpreadable : void 0; + +function Cn(e) { + return y(e) || Ee(e) || !!(ue && e && e[ue]); +} + +function Se(e, n, r, t, i) { + var s = -1, a = e.length; + for (r || (r = Cn), i || (i = []); ++s < a;) { + var u = e[s]; + n > 0 && r(u) ? n > 1 ? Se(u, n - 1, r, t, i) : J(i, u) : t || (i[i.length] = u); + } + return i; +} + +function Sn(e, n, r, t) { + var i = -1, s = e == null ? 0 : e.length; + for (t && s && (r = e[++i]); ++i < s;) + r = n(r, e[i], i, e); + return r; +} + +function Nn(e, n) { + return e && G(n, T(n), e); +} + +function Fn(e, n) { + return e && G(n, X(n), e); +} + +function Ne(e, n) { + for (var r = -1, t = e == null ? 0 : e.length, i = 0, s = []; ++r < t;) { + var a = e[r]; + n(a, r, e) && (s[i++] = a); + } + return s; +} + +function Fe() { + return []; +} + +var Mn = Object.prototype, xn = Mn.propertyIsEnumerable, fe = Object.getOwnPropertySymbols, Dn = fe ? function (e) { + return e == null ? [] : (e = Object(e), Ne(fe(e), function (n) { + return xn.call(e, n); + })); +} : Fe; +const z = Dn; + +function Rn(e, n) { + return G(e, z(e), n); +} + +var Gn = Object.getOwnPropertySymbols, Un = Gn ? function (e) { + for (var n = []; e;) + J(n, z(e)), e = Je(e); + return n; +} : Fe; +const Me = Un; + +function Bn(e, n) { + return G(e, Me(e), n); +} + +function xe(e, n, r) { + var t = n(e); + return y(e) ? t : J(t, r(e)); +} + +function q(e) { + return xe(e, T, z); +} + +function jn(e) { + return xe(e, X, Me); +} + +var Kn = Object.prototype, Hn = Kn.hasOwnProperty; + +function Yn(e) { + var n = e.length, r = new e.constructor(n); + return n && typeof e[0] == "string" && Hn.call(e, "index") && (r.index = e.index, r.input = e.input), r; +} + +function Zn(e, n) { + var r = n ? Oe(e.buffer) : e.buffer; + return new e.constructor(r, e.byteOffset, e.byteLength); +} + +var qn = /\w*$/; + +function Xn(e) { + var n = new e.constructor(e.source, qn.exec(e)); + return n.lastIndex = e.lastIndex, n; +} + +var oe = O ? O.prototype : void 0, de = oe ? oe.valueOf : void 0; + +function Qn(e) { + return de ? Object(de.call(e)) : {}; +} + +var Wn = "[object Boolean]", Jn = "[object Date]", zn = "[object Map]", Vn = "[object Number]", kn = "[object RegExp]", + er = "[object Set]", nr = "[object String]", rr = "[object Symbol]", tr = "[object ArrayBuffer]", + ir = "[object DataView]", sr = "[object Float32Array]", ar = "[object Float64Array]", ur = "[object Int8Array]", + fr = "[object Int16Array]", or = "[object Int32Array]", dr = "[object Uint8Array]", + hr = "[object Uint8ClampedArray]", lr = "[object Uint16Array]", gr = "[object Uint32Array]"; + +function cr(e, n, r) { + var t = e.constructor; + switch (n) { + case tr: + return Oe(e); + case Wn: + case Jn: + return new t(+e); + case ir: + return Zn(e, r); + case sr: + case ar: + case ur: + case fr: + case or: + case dr: + case hr: + case lr: + case gr: + return ze(e, r); + case zn: + return new t(); + case Vn: + case nr: + return new t(e); + case kn: + return Xn(e); + case er: + return new t(); + case rr: + return Qn(e); + } +} + +var _r = "[object Map]"; + +function pr(e) { + return I(e) && C(e) == _r; +} + +var he = R && R.isMap, br = he ? $e(he) : pr; +const yr = br; +var Ar = "[object Set]"; + +function Tr(e) { + return I(e) && C(e) == Ar; +} + +var le = R && R.isSet, Er = le ? $e(le) : Tr; +const Or = Er; +var $r = 1, mr = 2, wr = 4, De = "[object Arguments]", vr = "[object Array]", Pr = "[object Boolean]", + Lr = "[object Date]", Ir = "[object Error]", Re = "[object Function]", Cr = "[object GeneratorFunction]", + Sr = "[object Map]", Nr = "[object Number]", Ge = "[object Object]", Fr = "[object RegExp]", Mr = "[object Set]", + xr = "[object String]", Dr = "[object Symbol]", Rr = "[object WeakMap]", Gr = "[object ArrayBuffer]", + Ur = "[object DataView]", Br = "[object Float32Array]", jr = "[object Float64Array]", Kr = "[object Int8Array]", + Hr = "[object Int16Array]", Yr = "[object Int32Array]", Zr = "[object Uint8Array]", + qr = "[object Uint8ClampedArray]", Xr = "[object Uint16Array]", Qr = "[object Uint32Array]", h = {}; +h[De] = h[vr] = h[Gr] = h[Ur] = h[Pr] = h[Lr] = h[Br] = h[jr] = h[Kr] = h[Hr] = h[Yr] = h[Sr] = h[Nr] = h[Ge] = h[Fr] = h[Mr] = h[xr] = h[Dr] = h[Zr] = h[qr] = h[Xr] = h[Qr] = !0; +h[Ir] = h[Re] = h[Rr] = !1; + +function j(e, n, r, t, i, s) { + var a, u = n & $r, f = n & mr, g = n & wr; + if (r && (a = i ? r(e, t, i, s) : r(e)), a !== void 0) + return a; + if (!me(e)) + return e; + var l = y(e); + if (l) { + if (a = Yn(e), !u) + return Ve(e, a); + } else { + var o = C(e), d = o == Re || o == Cr; + if (Z(e)) + return ke(e, u); + if (o == Ge || o == De || d && !i) { + if (a = f || d ? {} : en(e), !u) + return f ? Bn(e, Fn(a, e)) : Rn(e, Nn(a, e)); + } else { + if (!h[o]) + return i ? e : {}; + a = cr(e, o, u); + } + } + s || (s = new L()); + var A = s.get(e); + if (A) + return A; + s.set(e, a), Or(e) ? e.forEach(function (c) { + a.add(j(c, n, r, c, e, s)); + }) : yr(e) && e.forEach(function (c, _) { + a.set(_, j(c, n, r, _, e, s)); + }); + var p = g ? f ? jn : q : f ? X : T, b = l ? void 0 : p(e); + return Le(b || e, function (c, _) { + b && (_ = c, c = e[_]), nn(a, _, j(c, n, r, _, e, s)); + }), a; +} + +var Wr = "__lodash_hash_undefined__"; + +function Jr(e) { + return this.__data__.set(e, Wr), this; +} + +function zr(e) { + return this.__data__.has(e); +} + +function S(e) { + var n = -1, r = e == null ? 0 : e.length; + for (this.__data__ = new rn(); ++n < r;) + this.add(e[n]); +} + +S.prototype.add = S.prototype.push = Jr; +S.prototype.has = zr; + +function Vr(e, n) { + for (var r = -1, t = e == null ? 0 : e.length; ++r < t;) + if (n(e[r], r, e)) + return !0; + return !1; +} + +function Ue(e, n) { + return e.has(n); +} + +var kr = 1, et = 2; + +function Be(e, n, r, t, i, s) { + var a = r & kr, u = e.length, f = n.length; + if (u != f && !(a && f > u)) + return !1; + var g = s.get(e), l = s.get(n); + if (g && l) + return g == n && l == e; + var o = -1, d = !0, A = r & et ? new S() : void 0; + for (s.set(e, n), s.set(n, e); ++o < u;) { + var p = e[o], b = n[o]; + if (t) + var c = a ? t(b, p, o, n, e, s) : t(p, b, o, e, n, s); + if (c !== void 0) { + if (c) + continue; + d = !1; + break; + } + if (A) { + if (!Vr(n, function (_, $) { + if (!Ue(A, $) && (p === _ || i(p, _, r, t, s))) + return A.push($); + })) { + d = !1; + break; + } + } else if (!(p === b || i(p, b, r, t, s))) { + d = !1; + break; + } + } + return s.delete(e), s.delete(n), d; +} + +function nt(e) { + var n = -1, r = Array(e.size); + return e.forEach(function (t, i) { + r[++n] = [i, t]; + }), r; +} + +function V(e) { + var n = -1, r = Array(e.size); + return e.forEach(function (t) { + r[++n] = t; + }), r; +} + +var rt = 1, tt = 2, it = "[object Boolean]", st = "[object Date]", at = "[object Error]", ut = "[object Map]", + ft = "[object Number]", ot = "[object RegExp]", dt = "[object Set]", ht = "[object String]", lt = "[object Symbol]", + gt = "[object ArrayBuffer]", ct = "[object DataView]", ge = O ? O.prototype : void 0, K = ge ? ge.valueOf : void 0; + +function _t(e, n, r, t, i, s, a) { + switch (r) { + case ct: + if (e.byteLength != n.byteLength || e.byteOffset != n.byteOffset) + return !1; + e = e.buffer, n = n.buffer; + case gt: + return !(e.byteLength != n.byteLength || !s(new re(e), new re(n))); + case it: + case st: + case ft: + return tn(+e, +n); + case at: + return e.name == n.name && e.message == n.message; + case ot: + case ht: + return e == n + ""; + case ut: + var u = nt; + case dt: + var f = t & rt; + if (u || (u = V), e.size != n.size && !f) + return !1; + var g = a.get(e); + if (g) + return g == n; + t |= tt, a.set(e, n); + var l = Be(u(e), u(n), t, i, s, a); + return a.delete(e), l; + case lt: + if (K) + return K.call(e) == K.call(n); + } + return !1; +} + +var pt = 1, bt = Object.prototype, yt = bt.hasOwnProperty; + +function At(e, n, r, t, i, s) { + var a = r & pt, u = q(e), f = u.length, g = q(n), l = g.length; + if (f != l && !a) + return !1; + for (var o = f; o--;) { + var d = u[o]; + if (!(a ? d in n : yt.call(n, d))) + return !1; + } + var A = s.get(e), p = s.get(n); + if (A && p) + return A == n && p == e; + var b = !0; + s.set(e, n), s.set(n, e); + for (var c = a; ++o < f;) { + d = u[o]; + var _ = e[d], $ = n[d]; + if (t) + var ne = a ? t($, _, d, n, e, s) : t(_, $, d, e, n, s); + if (!(ne === void 0 ? _ === $ || i(_, $, r, t, s) : ne)) { + b = !1; + break; + } + c || (c = d == "constructor"); + } + if (b && !c) { + var N = e.constructor, F = n.constructor; + N != F && "constructor" in e && "constructor" in n && !(typeof N == "function" && N instanceof N && typeof F == "function" && F instanceof F) && (b = !1); + } + return s.delete(e), s.delete(n), b; +} + +var Tt = 1, ce = "[object Arguments]", _e = "[object Array]", x = "[object Object]", Et = Object.prototype, + pe = Et.hasOwnProperty; + +function Ot(e, n, r, t, i, s) { + var a = y(e), u = y(n), f = a ? _e : C(e), g = u ? _e : C(n); + f = f == ce ? x : f, g = g == ce ? x : g; + var l = f == x, o = g == x, d = f == g; + if (d && Z(e)) { + if (!Z(n)) + return !1; + a = !0, l = !1; + } + if (d && !l) + return s || (s = new L()), a || sn(e) ? Be(e, n, r, t, i, s) : _t(e, n, f, r, t, i, s); + if (!(r & Tt)) { + var A = l && pe.call(e, "__wrapped__"), p = o && pe.call(n, "__wrapped__"); + if (A || p) { + var b = A ? e.value() : e, c = p ? n.value() : n; + return s || (s = new L()), i(b, c, r, t, s); + } + } + return d ? (s || (s = new L()), At(e, n, r, t, i, s)) : !1; +} + +function k(e, n, r, t, i) { + return e === n ? !0 : e == null || n == null || !I(e) && !I(n) ? e !== e && n !== n : Ot(e, n, r, t, k, i); +} + +var $t = 1, mt = 2; + +function wt(e, n, r, t) { + var i = r.length, s = i, a = !t; + if (e == null) + return !s; + for (e = Object(e); i--;) { + var u = r[i]; + if (a && u[2] ? u[1] !== e[u[0]] : !(u[0] in e)) + return !1; + } + for (; ++i < s;) { + u = r[i]; + var f = u[0], g = e[f], l = u[1]; + if (a && u[2]) { + if (g === void 0 && !(f in e)) + return !1; + } else { + var o = new L(); + if (t) + var d = t(g, l, f, e, n, o); + if (!(d === void 0 ? k(l, g, $t | mt, t, o) : d)) + return !1; + } + } + return !0; +} + +function je(e) { + return e === e && !me(e); +} + +function vt(e) { + for (var n = T(e), r = n.length; r--;) { + var t = n[r], i = e[t]; + n[r] = [t, i, je(i)]; + } + return n; +} + +function Ke(e, n) { + return function (r) { + return r == null ? !1 : r[e] === n && (n !== void 0 || e in Object(r)); + }; +} + +function Pt(e) { + var n = vt(e); + return n.length == 1 && n[0][2] ? Ke(n[0][0], n[0][1]) : function (r) { + return r === e || wt(r, e, n); + }; +} + +function Lt(e, n) { + return e != null && n in Object(e); +} + +function He(e, n, r) { + n = Ie(n, e); + for (var t = -1, i = n.length, s = !1; ++t < i;) { + var a = U(n[t]); + if (!(s = e != null && r(e, a))) + break; + e = e[a]; + } + return s || ++t != i ? s : (i = e == null ? 0 : e.length, !!i && an(i) && un(a, i) && (y(e) || Ee(e))); +} + +function It(e, n) { + return e != null && He(e, n, Lt); +} + +var Ct = 1, St = 2; + +function Nt(e, n) { + return W(e) && je(n) ? Ke(U(e), n) : function (r) { + var t = In(r, e); + return t === void 0 && t === n ? It(r, e) : k(n, t, Ct | St); + }; +} + +function Ft(e) { + return function (n) { + return n == null ? void 0 : n[e]; + }; +} + +function Mt(e) { + return function (n) { + return Ce(n, e); + }; +} + +function xt(e) { + return W(e) ? Ft(U(e)) : Mt(e); +} + +function Ye(e) { + return typeof e == "function" ? e : e == null ? we : typeof e == "object" ? y(e) ? Nt(e[0], e[1]) : Pt(e) : xt(e); +} + +function Dt(e, n) { + return e && fn(e, n, T); +} + +function Rt(e, n) { + return function (r, t) { + if (r == null) + return r; + if (!Te(r)) + return e(r, t); + for (var i = r.length, s = n ? i : -1, a = Object(r); (n ? s-- : ++s < i) && t(a[s], s, a) !== !1;) + ; + return r; + }; +} + +var Gt = Rt(Dt); +const ee = Gt; + +function Ut(e, n, r) { + for (var t = -1, i = e == null ? 0 : e.length; ++t < i;) + if (r(n, e[t])) + return !0; + return !1; +} + +function Bt(e) { + return typeof e == "function" ? e : we; +} + +function m(e, n) { + var r = y(e) ? Le : ee; + return r(e, Bt(n)); +} + +function jt(e, n) { + var r = []; + return ee(e, function (t, i, s) { + n(t, i, s) && r.push(t); + }), r; +} + +function D(e, n) { + var r = y(e) ? Ne : jt; + return r(e, Ye(n)); +} + +var Kt = Object.prototype, Ht = Kt.hasOwnProperty; + +function Yt(e, n) { + return e != null && Ht.call(e, n); +} + +function E(e, n) { + return e != null && He(e, n, Yt); +} + +function Zt(e, n) { + return ve(n, function (r) { + return e[r]; + }); +} + +function H(e) { + return e == null ? [] : Zt(e, T(e)); +} + +function v(e) { + return e === void 0; +} + +function qt(e, n, r, t, i) { + return i(e, function (s, a, u) { + r = t ? (t = !1, s) : n(r, s, a, u); + }), r; +} + +function Xt(e, n, r) { + var t = y(e) ? Sn : qt, i = arguments.length < 3; + return t(e, Ye(n), r, i, ee); +} + +var Qt = 1 / 0, Wt = B && 1 / V(new B([, -0]))[1] == Qt ? function (e) { + return new B(e); +} : gn; +const Jt = Wt; +var zt = 200; + +function Vt(e, n, r) { + var t = -1, i = yn, s = e.length, a = !0, u = [], f = u; + if (r) + a = !1, i = Ut; + else if (s >= zt) { + var g = n ? null : Jt(e); + if (g) + return V(g); + a = !1, i = Ue, f = new S(); + } else + f = n ? [] : u; + e: + for (; ++t < s;) { + var l = e[t], o = n ? n(l) : l; + if (l = r || l !== 0 ? l : 0, a && o === o) { + for (var d = f.length; d--;) + if (f[d] === o) + continue e; + n && f.push(o), u.push(l); + } else + i(f, o, r) || (f !== u && f.push(o), u.push(l)); + } + return u; +} + +var kt = on(function (e) { + return Vt(Se(e, 1, dn, !0)); +}); +const ei = kt; +var ni = "\0", w = "\0", be = ""; + +class Ze { + constructor(n = {}) { + this._isDirected = E(n, "directed") ? n.directed : !0, this._isMultigraph = E(n, "multigraph") ? n.multigraph : !1, this._isCompound = E(n, "compound") ? n.compound : !1, this._label = void 0, this._defaultNodeLabelFn = M(void 0), this._defaultEdgeLabelFn = M(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[w] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {}; + } + + /* === Graph functions ========= */ + isDirected() { + return this._isDirected; + } + + isMultigraph() { + return this._isMultigraph; + } + + isCompound() { + return this._isCompound; + } + + setGraph(n) { + return this._label = n, this; + } + + graph() { + return this._label; + } + + /* === Node functions ========== */ + setDefaultNodeLabel(n) { + return te(n) || (n = M(n)), this._defaultNodeLabelFn = n, this; + } + + nodeCount() { + return this._nodeCount; + } + + nodes() { + return T(this._nodes); + } + + sources() { + var n = this; + return D(this.nodes(), function (r) { + return ie(n._in[r]); + }); + } + + sinks() { + var n = this; + return D(this.nodes(), function (r) { + return ie(n._out[r]); + }); + } + + setNodes(n, r) { + var t = arguments, i = this; + return m(n, function (s) { + t.length > 1 ? i.setNode(s, r) : i.setNode(s); + }), this; + } + + setNode(n, r) { + return E(this._nodes, n) ? (arguments.length > 1 && (this._nodes[n] = r), this) : (this._nodes[n] = arguments.length > 1 ? r : this._defaultNodeLabelFn(n), this._isCompound && (this._parent[n] = w, this._children[n] = {}, this._children[w][n] = !0), this._in[n] = {}, this._preds[n] = {}, this._out[n] = {}, this._sucs[n] = {}, ++this._nodeCount, this); + } + + node(n) { + return this._nodes[n]; + } + + hasNode(n) { + return E(this._nodes, n); + } + + removeNode(n) { + var r = this; + if (E(this._nodes, n)) { + var t = function (i) { + r.removeEdge(r._edgeObjs[i]); + }; + delete this._nodes[n], this._isCompound && (this._removeFromParentsChildList(n), delete this._parent[n], m(this.children(n), function (i) { + r.setParent(i); + }), delete this._children[n]), m(T(this._in[n]), t), delete this._in[n], delete this._preds[n], m(T(this._out[n]), t), delete this._out[n], delete this._sucs[n], --this._nodeCount; + } + return this; + } + + setParent(n, r) { + if (!this._isCompound) + throw new Error("Cannot set parent in a non-compound graph"); + if (v(r)) + r = w; + else { + r += ""; + for (var t = r; !v(t); t = this.parent(t)) + if (t === n) + throw new Error("Setting " + r + " as parent of " + n + " would create a cycle"); + this.setNode(r); + } + return this.setNode(n), this._removeFromParentsChildList(n), this._parent[n] = r, this._children[r][n] = !0, this; + } + + _removeFromParentsChildList(n) { + delete this._children[this._parent[n]][n]; + } + + parent(n) { + if (this._isCompound) { + var r = this._parent[n]; + if (r !== w) + return r; + } + } + + children(n) { + if (v(n) && (n = w), this._isCompound) { + var r = this._children[n]; + if (r) + return T(r); + } else { + if (n === w) + return this.nodes(); + if (this.hasNode(n)) + return []; + } + } + + predecessors(n) { + var r = this._preds[n]; + if (r) + return T(r); + } + + successors(n) { + var r = this._sucs[n]; + if (r) + return T(r); + } + + neighbors(n) { + var r = this.predecessors(n); + if (r) + return ei(r, this.successors(n)); + } + + isLeaf(n) { + var r; + return this.isDirected() ? r = this.successors(n) : r = this.neighbors(n), r.length === 0; + } + + filterNodes(n) { + var r = new this.constructor({ + directed: this._isDirected, + multigraph: this._isMultigraph, + compound: this._isCompound + }); + r.setGraph(this.graph()); + var t = this; + m(this._nodes, function (a, u) { + n(u) && r.setNode(u, a); + }), m(this._edgeObjs, function (a) { + r.hasNode(a.v) && r.hasNode(a.w) && r.setEdge(a, t.edge(a)); + }); + var i = {}; + + function s(a) { + var u = t.parent(a); + return u === void 0 || r.hasNode(u) ? (i[a] = u, u) : u in i ? i[u] : s(u); + } + + return this._isCompound && m(r.nodes(), function (a) { + r.setParent(a, s(a)); + }), r; + } + + /* === Edge functions ========== */ + setDefaultEdgeLabel(n) { + return te(n) || (n = M(n)), this._defaultEdgeLabelFn = n, this; + } + + edgeCount() { + return this._edgeCount; + } + + edges() { + return H(this._edgeObjs); + } + + setPath(n, r) { + var t = this, i = arguments; + return Xt(n, function (s, a) { + return i.length > 1 ? t.setEdge(s, a, r) : t.setEdge(s, a), a; + }), this; + } + + /* + * setEdge(v, w, [value, [name]]) + * setEdge({ v, w, [name] }, [value]) + */ + setEdge() { + var n, r, t, i, s = !1, a = arguments[0]; + typeof a == "object" && a !== null && "v" in a ? (n = a.v, r = a.w, t = a.name, arguments.length === 2 && (i = arguments[1], s = !0)) : (n = a, r = arguments[1], t = arguments[3], arguments.length > 2 && (i = arguments[2], s = !0)), n = "" + n, r = "" + r, v(t) || (t = "" + t); + var u = P(this._isDirected, n, r, t); + if (E(this._edgeLabels, u)) + return s && (this._edgeLabels[u] = i), this; + if (!v(t) && !this._isMultigraph) + throw new Error("Cannot set a named edge when isMultigraph = false"); + this.setNode(n), this.setNode(r), this._edgeLabels[u] = s ? i : this._defaultEdgeLabelFn(n, r, t); + var f = ri(this._isDirected, n, r, t); + return n = f.v, r = f.w, Object.freeze(f), this._edgeObjs[u] = f, ye(this._preds[r], n), ye(this._sucs[n], r), this._in[r][u] = f, this._out[n][u] = f, this._edgeCount++, this; + } + + edge(n, r, t) { + var i = arguments.length === 1 ? Y(this._isDirected, arguments[0]) : P(this._isDirected, n, r, t); + return this._edgeLabels[i]; + } + + hasEdge(n, r, t) { + var i = arguments.length === 1 ? Y(this._isDirected, arguments[0]) : P(this._isDirected, n, r, t); + return E(this._edgeLabels, i); + } + + removeEdge(n, r, t) { + var i = arguments.length === 1 ? Y(this._isDirected, arguments[0]) : P(this._isDirected, n, r, t), + s = this._edgeObjs[i]; + return s && (n = s.v, r = s.w, delete this._edgeLabels[i], delete this._edgeObjs[i], Ae(this._preds[r], n), Ae(this._sucs[n], r), delete this._in[r][i], delete this._out[n][i], this._edgeCount--), this; + } + + inEdges(n, r) { + var t = this._in[n]; + if (t) { + var i = H(t); + return r ? D(i, function (s) { + return s.v === r; + }) : i; + } + } + + outEdges(n, r) { + var t = this._out[n]; + if (t) { + var i = H(t); + return r ? D(i, function (s) { + return s.w === r; + }) : i; + } + } + + nodeEdges(n, r) { + var t = this.inEdges(n, r); + if (t) + return t.concat(this.outEdges(n, r)); + } +} + +Ze.prototype._nodeCount = 0; +Ze.prototype._edgeCount = 0; + +function ye(e, n) { + e[n] ? e[n]++ : e[n] = 1; +} + +function Ae(e, n) { + --e[n] || delete e[n]; +} + +function P(e, n, r, t) { + var i = "" + n, s = "" + r; + if (!e && i > s) { + var a = i; + i = s, s = a; + } + return i + be + s + be + (v(t) ? ni : t); +} + +function ri(e, n, r, t) { + var i = "" + n, s = "" + r; + if (!e && i > s) { + var a = i; + i = s, s = a; + } + var u = {v: i, w: s}; + return t && (u.name = t), u; +} + +function Y(e, n) { + return P(e, n.v, n.w, n.name); +} + +export { + Ze as G, + Q as a, + Se as b, + j as c, + Ye as d, + cn as e, + m as f, + ee as g, + E as h, + v as i, + ve as j, + T as k, + Bt as l, + Dt as m, + Ie as n, + Ce as o, + It as p, + Pn as q, + D as r, + Xt as s, + U as t, + H as v +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/index-bb6d8841.js b/BlazorApp/wwwroot/js/lib/mermaid/index-bb6d8841.js new file mode 100644 index 00000000..e2551bae --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/index-bb6d8841.js @@ -0,0 +1,406 @@ +import {G as A, i as N} from "./graph-0ee63739.js"; +import {l as H, m as J} from "./layout-fd473db2.js"; +import {c as V} from "./clone-afc2f047.js"; +import { + a as U, + b as W, + c as L, + d as _, + e as K, + f as Q, + g as D, + h as Y, + i as p, + j as Z, + p as O, + s as z, + u as q +} from "./edges-16357fde.js"; +import {c as T, j as R, l as s, p as S} from "./mermaid-9f2aa176.js"; +import {a as I} from "./createText-03b82060.js"; + +function m(e) { + var t = { + options: { + directed: e.isDirected(), + multigraph: e.isMultigraph(), + compound: e.isCompound() + }, + nodes: tt(e), + edges: et(e) + }; + return N(e.graph()) || (t.value = V(e.graph())), t; +} + +function tt(e) { + return J(e.nodes(), function (t) { + var n = e.node(t), r = e.parent(t), i = {v: t}; + return N(n) || (i.value = n), N(r) || (i.parent = r), i; + }); +} + +function et(e) { + return J(e.edges(), function (t) { + var n = e.edge(t), r = {v: t.v, w: t.w}; + return N(t.name) || (r.name = t.name), N(n) || (r.value = n), r; + }); +} + +let l = {}, g = {}, P = {}; +const nt = () => { + g = {}, P = {}, l = {}; + }, B = (e, t) => (s.trace("In isDescendant", t, " ", e, " = ", g[t].includes(e)), !!g[t].includes(e)), + it = (e, t) => (s.info("Descendants of ", t, " is ", g[t]), s.info("Edge is ", e), e.v === t || e.w === t ? !1 : g[t] ? g[t].includes(e.v) || B(e.v, t) || B(e.w, t) || g[t].includes(e.w) : (s.debug("Tilt, ", t, ",not in descendants"), !1)), + k = (e, t, n, r) => { + s.warn( + "Copying children of ", + e, + "root", + r, + "data", + t.node(e), + r + ); + const i = t.children(e) || []; + e !== r && i.push(e), s.warn("Copying (nodes) clusterId", e, "nodes", i), i.forEach((a) => { + if (t.children(a).length > 0) + k(a, t, n, r); + else { + const d = t.node(a); + s.info("cp ", a, " to ", r, " with parent ", e), n.setNode(a, d), r !== t.parent(a) && (s.warn("Setting parent", a, t.parent(a)), n.setParent(a, t.parent(a))), e !== r && a !== e ? (s.debug("Setting parent", a, e), n.setParent(a, e)) : (s.info("In copy ", e, "root", r, "data", t.node(e), r), s.debug( + "Not Setting parent for node=", + a, + "cluster!==rootId", + e !== r, + "node!==clusterId", + a !== e + )); + const u = t.edges(a); + s.debug("Copying Edges", u), u.forEach((f) => { + s.info("Edge", f); + const h = t.edge(f.v, f.w, f.name); + s.info("Edge data", h, r); + try { + it(f, r) ? (s.info("Copying as ", f.v, f.w, h, f.name), n.setEdge(f.v, f.w, h, f.name), s.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : s.info( + "Skipping copy of edge ", + f.v, + "-->", + f.w, + " rootId: ", + r, + " clusterId:", + e + ); + } catch (w) { + s.error(w); + } + }); + } + s.debug("Removing node", a), t.removeNode(a); + }); + }, $ = (e, t) => { + const n = t.children(e); + let r = [...n]; + for (const i of n) + P[i] = e, r = [...r, ...$(i, t)]; + return r; + }, C = (e, t) => { + s.trace("Searching", e); + const n = t.children(e); + if (s.trace("Searching children of id ", e, n), n.length < 1) + return s.trace("This is a valid node", e), e; + for (const r of n) { + const i = C(r, t); + if (i) + return s.trace("Found replacement for", e, " => ", i), i; + } + }, X = (e) => !l[e] || !l[e].externalConnections ? e : l[e] ? l[e].id : e, st = (e, t) => { + if (!e || t > 10) { + s.debug("Opting out, no graph "); + return; + } else + s.debug("Opting in, graph "); + e.nodes().forEach(function (n) { + e.children(n).length > 0 && (s.warn( + "Cluster identified", + n, + " Replacement id in edges: ", + C(n, e) + ), g[n] = $(n, e), l[n] = {id: C(n, e), clusterData: e.node(n)}); + }), e.nodes().forEach(function (n) { + const r = e.children(n), i = e.edges(); + r.length > 0 ? (s.debug("Cluster identified", n, g), i.forEach((a) => { + if (a.v !== n && a.w !== n) { + const d = B(a.v, n), u = B(a.w, n); + d ^ u && (s.warn("Edge: ", a, " leaves cluster ", n), s.warn("Descendants of XXX ", n, ": ", g[n]), l[n].externalConnections = !0); + } + })) : s.debug("Not a cluster ", n, g); + }); + for (let n of Object.keys(l)) { + const r = l[n].id, i = e.parent(r); + i !== n && l[i] && !l[i].externalConnections && (l[n].id = i); + } + e.edges().forEach(function (n) { + const r = e.edge(n); + s.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), s.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n))); + let i = n.v, a = n.w; + if (s.warn( + "Fix XXX", + l, + "ids:", + n.v, + n.w, + "Translating: ", + l[n.v], + " --- ", + l[n.w] + ), l[n.v] && l[n.w] && l[n.v] === l[n.w]) { + s.warn("Fixing and trixing link to self - removing XXX", n.v, n.w, n.name), s.warn("Fixing and trixing - removing XXX", n.v, n.w, n.name), i = X(n.v), a = X(n.w), e.removeEdge(n.v, n.w, n.name); + const d = n.w + "---" + n.v; + e.setNode(d, { + domId: d, + id: d, + labelStyle: "", + labelText: r.label, + padding: 0, + shape: "labelRect", + style: "" + }); + const u = structuredClone(r), f = structuredClone(r); + u.label = "", u.arrowTypeEnd = "none", f.label = "", u.fromCluster = n.v, f.toCluster = n.v, e.setEdge(i, d, u, n.name + "-cyclic-special"), e.setEdge(d, a, f, n.name + "-cyclic-special"); + } else if (l[n.v] || l[n.w]) { + if (s.warn("Fixing and trixing - removing XXX", n.v, n.w, n.name), i = X(n.v), a = X(n.w), e.removeEdge(n.v, n.w, n.name), i !== n.v) { + const d = e.parent(i); + l[d].externalConnections = !0, r.fromCluster = n.v; + } + if (a !== n.w) { + const d = e.parent(a); + l[d].externalConnections = !0, r.toCluster = n.w; + } + s.warn("Fix Replacing with XXX", i, a, n.name), e.setEdge(i, a, r, n.name); + } + }), s.warn("Adjusted Graph", m(e)), F(e, 0), s.trace(l); + }, F = (e, t) => { + if (s.warn("extractor - ", t, m(e), e.children("D")), t > 10) { + s.error("Bailing out"); + return; + } + let n = e.nodes(), r = !1; + for (const i of n) { + const a = e.children(i); + r = r || a.length > 0; + } + if (!r) { + s.debug("Done, no node has children", e.nodes()); + return; + } + s.debug("Nodes = ", n, t); + for (const i of n) + if (s.debug( + "Extracting node", + i, + l, + l[i] && !l[i].externalConnections, + !e.parent(i), + e.node(i), + e.children("D"), + " Depth ", + t + ), !l[i]) + s.debug("Not a cluster", i, t); + else if (!l[i].externalConnections && // !graph.parent(node) && + e.children(i) && e.children(i).length > 0) { + s.warn( + "Cluster without external connections, without a parent and with children", + i, + t + ); + let d = e.graph().rankdir === "TB" ? "LR" : "TB"; + l[i] && l[i].clusterData && l[i].clusterData.dir && (d = l[i].clusterData.dir, s.warn("Fixing dir", l[i].clusterData.dir, d)); + const u = new A({ + multigraph: !0, + compound: !0 + }).setGraph({ + rankdir: d, + // Todo: set proper spacing + nodesep: 50, + ranksep: 50, + marginx: 8, + marginy: 8 + }).setDefaultEdgeLabel(function () { + return {}; + }); + s.warn("Old graph before copy", m(e)), k(i, e, u, i), e.setNode(i, { + clusterNode: !0, + id: i, + clusterData: l[i].clusterData, + labelText: l[i].labelText, + graph: u + }), s.warn("New graph after copy node: (", i, ")", m(u)), s.debug("Old graph after copy", m(e)); + } else + s.warn( + "Cluster ** ", + i, + " **not meeting the criteria !externalConnections:", + !l[i].externalConnections, + " no parent: ", + !e.parent(i), + " children ", + e.children(i) && e.children(i).length > 0, + e.children("D"), + t + ), s.debug(l); + n = e.nodes(), s.warn("New list of nodes", n); + for (const i of n) { + const a = e.node(i); + s.warn(" Now next level", i, a), a.clusterNode && F(a.graph, t + 1); + } + }, G = (e, t) => { + if (t.length === 0) + return []; + let n = Object.assign(t); + return t.forEach((r) => { + const i = e.children(r), a = G(e, i); + n = [...n, ...a]; + }), n; + }, rt = (e) => G(e, e.children()), at = (e, t) => { + s.info("Creating subgraph rect for ", t.id, t); + const n = T(), r = e.insert("g").attr("class", "cluster" + (t.class ? " " + t.class : "")).attr("id", t.id), + i = r.insert("rect", ":first-child"), a = S(n.flowchart.htmlLabels), + d = r.insert("g").attr("class", "cluster-label"), u = t.labelType === "markdown" ? I(d, t.labelText, { + style: t.labelStyle, + useHtmlLabels: a + }) : d.node().appendChild(L(t.labelText, t.labelStyle, void 0, !0)); + let f = u.getBBox(); + if (S(n.flowchart.htmlLabels)) { + const c = u.children[0], o = R(u); + f = c.getBoundingClientRect(), o.attr("width", f.width), o.attr("height", f.height); + } + const h = 0 * t.padding, w = h / 2, x = t.width <= f.width + h ? f.width + h : t.width; + t.width <= f.width + h ? t.diff = (f.width - t.width) / 2 - t.padding / 2 : t.diff = -t.padding / 2, s.trace("Data ", t, JSON.stringify(t)), i.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - x / 2).attr("y", t.y - t.height / 2 - w).attr("width", x).attr("height", t.height + h); + const {subGraphTitleTopMargin: v} = D(n); + a ? d.attr( + "transform", + // This puts the label on top of the box instead of inside it + `translate(${t.x - f.width / 2}, ${t.y - t.height / 2 + v})` + ) : d.attr( + "transform", + // This puts the label on top of the box instead of inside it + `translate(${t.x}, ${t.y - t.height / 2 + v})` + ); + const y = i.node().getBBox(); + return t.width = y.width, t.height = y.height, t.intersect = function (c) { + return p(t, c); + }, r; + }, ct = (e, t) => { + const n = e.insert("g").attr("class", "note-cluster").attr("id", t.id), r = n.insert("rect", ":first-child"), + i = 0 * t.padding, a = i / 2; + r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none"); + const d = r.node().getBBox(); + return t.width = d.width, t.height = d.height, t.intersect = function (u) { + return p(t, u); + }, n; + }, ot = (e, t) => { + const n = T(), r = e.insert("g").attr("class", t.classes).attr("id", t.id), i = r.insert("rect", ":first-child"), + a = r.insert("g").attr("class", "cluster-label"), d = r.append("rect"), + u = a.node().appendChild(L(t.labelText, t.labelStyle, void 0, !0)); + let f = u.getBBox(); + if (S(n.flowchart.htmlLabels)) { + const c = u.children[0], o = R(u); + f = c.getBoundingClientRect(), o.attr("width", f.width), o.attr("height", f.height); + } + f = u.getBBox(); + const h = 0 * t.padding, w = h / 2, x = t.width <= f.width + t.padding ? f.width + t.padding : t.width; + t.width <= f.width + t.padding ? t.diff = (f.width + t.padding * 0 - t.width) / 2 : t.diff = -t.padding / 2, i.attr("class", "outer").attr("x", t.x - x / 2 - w).attr("y", t.y - t.height / 2 - w).attr("width", x + h).attr("height", t.height + h), d.attr("class", "inner").attr("x", t.x - x / 2 - w).attr("y", t.y - t.height / 2 - w + f.height - 1).attr("width", x + h).attr("height", t.height + h - f.height - 3); + const {subGraphTitleTopMargin: v} = D(n); + a.attr( + "transform", + `translate(${t.x - f.width / 2}, ${t.y - t.height / 2 - t.padding / 3 + (S(n.flowchart.htmlLabels) ? 5 : 3) + v})` + ); + const y = i.node().getBBox(); + return t.height = y.height, t.intersect = function (c) { + return p(t, c); + }, r; + }, lt = (e, t) => { + const n = e.insert("g").attr("class", t.classes).attr("id", t.id), r = n.insert("rect", ":first-child"), + i = 0 * t.padding, a = i / 2; + r.attr("class", "divider").attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2).attr("width", t.width + i).attr("height", t.height + i); + const d = r.node().getBBox(); + return t.width = d.width, t.height = d.height, t.diff = -t.padding / 2, t.intersect = function (u) { + return p(t, u); + }, n; + }, ft = {rect: at, roundedWithTitle: ot, noteGroup: ct, divider: lt}; +let j = {}; +const dt = (e, t) => { + s.trace("Inserting cluster"); + const n = t.shape || "rect"; + j[t.id] = ft[n](e, t); +}, ut = () => { + j = {}; +}, M = async (e, t, n, r, i, a) => { + s.info("Graph in recursive render: XXX", m(t), i); + const d = t.graph().rankdir; + s.trace("Dir in recursive render - dir:", d); + const u = e.insert("g").attr("class", "root"); + t.nodes() ? s.info("Recursive render XXX", t.nodes()) : s.info("No nodes found for", t), t.edges().length > 0 && s.trace("Recursive edges", t.edge(t.edges()[0])); + const f = u.insert("g").attr("class", "clusters"), h = u.insert("g").attr("class", "edgePaths"), + w = u.insert("g").attr("class", "edgeLabels"), x = u.insert("g").attr("class", "nodes"); + await Promise.all( + t.nodes().map(async function (c) { + const o = t.node(c); + if (i !== void 0) { + const b = JSON.parse(JSON.stringify(i.clusterData)); + s.info("Setting data for cluster XXX (", c, ") ", b, i), t.setNode(i.id, b), t.parent(c) || (s.trace("Setting parent", c, i.id), t.setParent(c, i.id, b)); + } + if (s.info("(Insert) Node XXX" + c + ": " + JSON.stringify(t.node(c))), o && o.clusterNode) { + s.info("Cluster identified", c, o.width, t.node(c)); + const b = await M( + x, + o.graph, + n, + r, + t.node(c), + a + ), E = b.elem; + q(o, E), o.diff = b.diff || 0, s.info("Node bounds (abc123)", c, o, o.width, o.x, o.y), z(E, o), s.warn("Recursive render complete ", E, o); + } else + t.children(c).length > 0 ? (s.info("Cluster - the non recursive path XXX", c, o.id, o, t), s.info(C(o.id, t)), l[o.id] = { + id: C(o.id, t), + node: o + }) : (s.info("Node - the non recursive path", c, o.id, o), await K(x, t.node(c), d)); + }) + ), t.edges().forEach(function (c) { + const o = t.edge(c.v, c.w, c.name); + s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(c)), s.info("Edge " + c.v + " -> " + c.w + ": ", c, " ", JSON.stringify(t.edge(c))), s.info("Fix", l, "ids:", c.v, c.w, "Translating: ", l[c.v], l[c.w]), Q(w, o); + }), t.edges().forEach(function (c) { + s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(c)); + }), s.info("#############################################"), s.info("### Layout ###"), s.info("#############################################"), s.info(t), H(t), s.info("Graph after layout:", m(t)); + let v = 0; + const {subGraphTitleTotalMargin: y} = D(a); + return rt(t).forEach(function (c) { + const o = t.node(c); + s.info("Position " + c + ": " + JSON.stringify(t.node(c))), s.info( + "Position " + c + ": (" + o.x, + "," + o.y, + ") width: ", + o.width, + " height: ", + o.height + ), o && o.clusterNode ? (o.y += y, O(o)) : t.children(c).length > 0 ? (o.height += y, dt(f, o), l[o.id].node = o) : (o.y += y / 2, O(o)); + }), t.edges().forEach(function (c) { + const o = t.edge(c); + s.info("Edge " + c.v + " -> " + c.w + ": " + JSON.stringify(o), o), o.points.forEach((E) => E.y += y / 2); + const b = Y(h, c, o, l, n, t, r); + Z(o, b); + }), t.nodes().forEach(function (c) { + const o = t.node(c); + s.info(c, o.type, o.diff), o.type === "group" && (v = o.diff); + }), {elem: u, diff: v}; +}, bt = async (e, t, n, r, i) => { + U(e, n, r, i), W(), _(), ut(), nt(), s.warn("Graph at first:", JSON.stringify(m(t))), st(t), s.warn("Graph after:", JSON.stringify(m(t))); + const a = T(); + await M(e, t, r, i, void 0, a); +}; +export { + bt as r +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/layout-fd473db2.js b/BlazorApp/wwwroot/js/lib/mermaid/layout-fd473db2.js new file mode 100644 index 00000000..bf2cd3d5 --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/layout-fd473db2.js @@ -0,0 +1,1796 @@ +import { + a as F, + b as xn, + c as zn, + d as L, + e as Hn, + f as s, + g as jn, + G as x, + h as w, + i as g, + j as P, + k as Un, + l as En, + m as kn, + n as yn, + o as Nn, + p as Kn, + q as Zn, + r as M, + s as V, + t as Jn, + v as y +} from "./graph-0ee63739.js"; +import { + a8 as A, + a9 as Qn, + aa as ne, + ab as ee, + ac as Ln, + ad as B, + ae as _n, + af as re, + ag as Cn, + ah as J, + ai as te, + aj as ie, + ak as K, + al as ae, + am as In, + an as oe, + ao as ue, + ap as H +} from "./mermaid-9f2aa176.js"; + +var de = /\s/; + +function fe(n) { + for (var e = n.length; e-- && de.test(n.charAt(e));) + ; + return e; +} + +var se = /^\s+/; + +function ce(n) { + return n && n.slice(0, fe(n) + 1).replace(se, ""); +} + +var un = 0 / 0, he = /^[-+]0x[0-9a-f]+$/i, le = /^0b[01]+$/i, ve = /^0o[0-7]+$/i, pe = parseInt; + +function we(n) { + if (typeof n == "number") + return n; + if (F(n)) + return un; + if (A(n)) { + var e = typeof n.valueOf == "function" ? n.valueOf() : n; + n = A(e) ? e + "" : e; + } + if (typeof n != "string") + return n === 0 ? n : +n; + n = ce(n); + var r = le.test(n); + return r || ve.test(n) ? pe(n.slice(2), r ? 2 : 8) : he.test(n) ? un : +n; +} + +var dn = 1 / 0, me = 17976931348623157e292; + +function S(n) { + if (!n) + return n === 0 ? n : 0; + if (n = we(n), n === dn || n === -dn) { + var e = n < 0 ? -1 : 1; + return e * me; + } + return n === n ? n : 0; +} + +function be(n) { + var e = S(n), r = e % 1; + return e === e ? r ? e - r : e : 0; +} + +function _(n) { + var e = n == null ? 0 : n.length; + return e ? xn(n, 1) : []; +} + +function ge(n) { + return Qn(ne(n, void 0, _), n + ""); +} + +var xe = 1, Ee = 4; + +function ke(n) { + return zn(n, xe | Ee); +} + +var ye = function () { + return ee.Date.now(); +}; +const fn = ye; +var Rn = Object.prototype, Ne = Rn.hasOwnProperty, Le = Ln(function (n, e) { + n = Object(n); + var r = -1, t = e.length, i = t > 2 ? e[2] : void 0; + for (i && B(e[0], e[1], i) && (t = 1); ++r < t;) + for (var o = e[r], a = _n(o), u = -1, d = a.length; ++u < d;) { + var f = a[u], c = n[f]; + (c === void 0 || re(c, Rn[f]) && !Ne.call(n, f)) && (n[f] = o[f]); + } + return n; +}); +const _e = Le; + +function $(n) { + var e = n == null ? 0 : n.length; + return e ? n[e - 1] : void 0; +} + +function Ce(n) { + return function (e, r, t) { + var i = Object(e); + if (!Cn(e)) { + var o = L(r); + e = Un(e), r = function (u) { + return o(i[u], u, i); + }; + } + var a = n(e, r, t); + return a > -1 ? i[o ? e[a] : a] : void 0; + }; +} + +var Ie = Math.max; + +function Re(n, e, r) { + var t = n == null ? 0 : n.length; + if (!t) + return -1; + var i = r == null ? 0 : be(r); + return i < 0 && (i = Ie(t + i, 0)), Hn(n, L(e), i); +} + +var Te = Ce(Re); +const Z = Te; + +function Tn(n, e) { + var r = -1, t = Cn(n) ? Array(n.length) : []; + return jn(n, function (i, o, a) { + t[++r] = e(i, o, a); + }), t; +} + +function m(n, e) { + var r = J(n) ? P : Tn; + return r(n, L(e)); +} + +function Me(n, e) { + return n == null ? n : te(n, En(e), _n); +} + +function Oe(n, e) { + return n && kn(n, En(e)); +} + +function Pe(n, e) { + return n > e; +} + +function Mn(n, e) { + return n < e; +} + +function Y(n, e) { + var r = {}; + return e = L(e), kn(n, function (t, i, o) { + ie(r, i, e(t, i, o)); + }), r; +} + +function Q(n, e, r) { + for (var t = -1, i = n.length; ++t < i;) { + var o = n[t], a = e(o); + if (a != null && (u === void 0 ? a === a && !F(a) : r(a, u))) + var u = a, d = o; + } + return d; +} + +function E(n) { + return n && n.length ? Q(n, K, Pe) : void 0; +} + +function R(n) { + return n && n.length ? Q(n, K, Mn) : void 0; +} + +function nn(n, e) { + return n && n.length ? Q(n, L(e), Mn) : void 0; +} + +function Se(n, e, r, t) { + if (!A(n)) + return n; + e = yn(e, n); + for (var i = -1, o = e.length, a = o - 1, u = n; u != null && ++i < o;) { + var d = Jn(e[i]), f = r; + if (d === "__proto__" || d === "constructor" || d === "prototype") + return n; + if (i != a) { + var c = u[d]; + f = t ? t(c, d, u) : void 0, f === void 0 && (f = A(c) ? c : ae(e[i + 1]) ? [] : {}); + } + In(u, d, f), u = u[d]; + } + return n; +} + +function Fe(n, e, r) { + for (var t = -1, i = e.length, o = {}; ++t < i;) { + var a = e[t], u = Nn(n, a); + r(u, a) && Se(o, yn(a, n), u); + } + return o; +} + +function Ae(n, e) { + var r = n.length; + for (n.sort(e); r--;) + n[r] = n[r].value; + return n; +} + +function Be(n, e) { + if (n !== e) { + var r = n !== void 0, t = n === null, i = n === n, o = F(n), a = e !== void 0, u = e === null, d = e === e, + f = F(e); + if (!u && !f && !o && n > e || o && a && d && !u && !f || t && a && d || !r && d || !i) + return 1; + if (!t && !o && !f && n < e || f && r && i && !t && !o || u && r && i || !a && i || !d) + return -1; + } + return 0; +} + +function $e(n, e, r) { + for (var t = -1, i = n.criteria, o = e.criteria, a = i.length, u = r.length; ++t < a;) { + var d = Be(i[t], o[t]); + if (d) { + if (t >= u) + return d; + var f = r[t]; + return d * (f == "desc" ? -1 : 1); + } + } + return n.index - e.index; +} + +function Ge(n, e, r) { + e.length ? e = P(e, function (o) { + return J(o) ? function (a) { + return Nn(a, o.length === 1 ? o[0] : o); + } : o; + }) : e = [K]; + var t = -1; + e = P(e, oe(L)); + var i = Tn(n, function (o, a, u) { + var d = P(e, function (f) { + return f(o); + }); + return {criteria: d, index: ++t, value: o}; + }); + return Ae(i, function (o, a) { + return $e(o, a, r); + }); +} + +function Ve(n, e) { + return Fe(n, e, function (r, t) { + return Kn(n, t); + }); +} + +var Ye = ge(function (n, e) { + return n == null ? {} : Ve(n, e); +}); +const G = Ye; +var De = Math.ceil, qe = Math.max; + +function We(n, e, r, t) { + for (var i = -1, o = qe(De((e - n) / (r || 1)), 0), a = Array(o); o--;) + a[t ? o : ++i] = n, n += r; + return a; +} + +function Xe(n) { + return function (e, r, t) { + return t && typeof t != "number" && B(e, r, t) && (r = t = void 0), e = S(e), r === void 0 ? (r = e, e = 0) : r = S(r), t = t === void 0 ? e < r ? 1 : -1 : S(t), We(e, r, t, n); + }; +} + +var ze = Xe(); +const N = ze; +var Ue = Ln(function (n, e) { + if (n == null) + return []; + var r = e.length; + return r > 1 && B(n, e[0], e[1]) ? e = [] : r > 2 && B(e[0], e[1], e[2]) && (e = [e[0]]), Ge(n, xn(e, 1), []); +}); +const O = Ue; +var He = 0; + +function en(n) { + var e = ++He; + return Zn(n) + e; +} + +function je(n, e, r) { + for (var t = -1, i = n.length, o = e.length, a = {}; ++t < i;) { + var u = t < o ? e[t] : void 0; + r(a, n[t], u); + } + return a; +} + +function Je(n, e) { + return je(n || [], e || [], In); +} + +class Ke { + constructor() { + var e = {}; + e._next = e._prev = e, this._sentinel = e; + } + + dequeue() { + var e = this._sentinel, r = e._prev; + if (r !== e) + return sn(r), r; + } + + enqueue(e) { + var r = this._sentinel; + e._prev && e._next && sn(e), e._next = r._next, r._next._prev = e, r._next = e, e._prev = r; + } + + toString() { + for (var e = [], r = this._sentinel, t = r._prev; t !== r;) + e.push(JSON.stringify(t, Ze)), t = t._prev; + return "[" + e.join(", ") + "]"; + } +} + +function sn(n) { + n._prev._next = n._next, n._next._prev = n._prev, delete n._next, delete n._prev; +} + +function Ze(n, e) { + if (n !== "_next" && n !== "_prev") + return e; +} + +var Qe = ue(1); + +function nr(n, e) { + if (n.nodeCount() <= 1) + return []; + var r = rr(n, e || Qe), t = er(r.graph, r.buckets, r.zeroIdx); + return _( + m(t, function (i) { + return n.outEdges(i.v, i.w); + }) + ); +} + +function er(n, e, r) { + for (var t = [], i = e[e.length - 1], o = e[0], a; n.nodeCount();) { + for (; a = o.dequeue();) + q(n, e, r, a); + for (; a = i.dequeue();) + q(n, e, r, a); + if (n.nodeCount()) { + for (var u = e.length - 2; u > 0; --u) + if (a = e[u].dequeue(), a) { + t = t.concat(q(n, e, r, a, !0)); + break; + } + } + } + return t; +} + +function q(n, e, r, t, i) { + var o = i ? [] : void 0; + return s(n.inEdges(t.v), function (a) { + var u = n.edge(a), d = n.node(a.v); + i && o.push({v: a.v, w: a.w}), d.out -= u, j(e, r, d); + }), s(n.outEdges(t.v), function (a) { + var u = n.edge(a), d = a.w, f = n.node(d); + f.in -= u, j(e, r, f); + }), n.removeNode(t.v), o; +} + +function rr(n, e) { + var r = new x(), t = 0, i = 0; + s(n.nodes(), function (u) { + r.setNode(u, {v: u, in: 0, out: 0}); + }), s(n.edges(), function (u) { + var d = r.edge(u.v, u.w) || 0, f = e(u), c = d + f; + r.setEdge(u.v, u.w, c), i = Math.max(i, r.node(u.v).out += f), t = Math.max(t, r.node(u.w).in += f); + }); + var o = N(i + t + 3).map(function () { + return new Ke(); + }), a = t + 1; + return s(r.nodes(), function (u) { + j(o, a, r.node(u)); + }), {graph: r, buckets: o, zeroIdx: a}; +} + +function j(n, e, r) { + r.out ? r.in ? n[r.out - r.in + e].enqueue(r) : n[n.length - 1].enqueue(r) : n[0].enqueue(r); +} + +function tr(n) { + var e = n.graph().acyclicer === "greedy" ? nr(n, r(n)) : ir(n); + s(e, function (t) { + var i = n.edge(t); + n.removeEdge(t), i.forwardName = t.name, i.reversed = !0, n.setEdge(t.w, t.v, i, en("rev")); + }); + + function r(t) { + return function (i) { + return t.edge(i).weight; + }; + } +} + +function ir(n) { + var e = [], r = {}, t = {}; + + function i(o) { + w(t, o) || (t[o] = !0, r[o] = !0, s(n.outEdges(o), function (a) { + w(r, a.w) ? e.push(a) : i(a.w); + }), delete r[o]); + } + + return s(n.nodes(), i), e; +} + +function ar(n) { + s(n.edges(), function (e) { + var r = n.edge(e); + if (r.reversed) { + n.removeEdge(e); + var t = r.forwardName; + delete r.reversed, delete r.forwardName, n.setEdge(e.w, e.v, r, t); + } + }); +} + +function C(n, e, r, t) { + var i; + do + i = en(t); + while (n.hasNode(i)); + return r.dummy = e, n.setNode(i, r), i; +} + +function or(n) { + var e = new x().setGraph(n.graph()); + return s(n.nodes(), function (r) { + e.setNode(r, n.node(r)); + }), s(n.edges(), function (r) { + var t = e.edge(r.v, r.w) || {weight: 0, minlen: 1}, i = n.edge(r); + e.setEdge(r.v, r.w, { + weight: t.weight + i.weight, + minlen: Math.max(t.minlen, i.minlen) + }); + }), e; +} + +function On(n) { + var e = new x({multigraph: n.isMultigraph()}).setGraph(n.graph()); + return s(n.nodes(), function (r) { + n.children(r).length || e.setNode(r, n.node(r)); + }), s(n.edges(), function (r) { + e.setEdge(r, n.edge(r)); + }), e; +} + +function cn(n, e) { + var r = n.x, t = n.y, i = e.x - r, o = e.y - t, a = n.width / 2, u = n.height / 2; + if (!i && !o) + throw new Error("Not possible to find intersection inside of the rectangle"); + var d, f; + return Math.abs(o) * a > Math.abs(i) * u ? (o < 0 && (u = -u), d = u * i / o, f = u) : (i < 0 && (a = -a), d = a, f = a * o / i), { + x: r + d, + y: t + f + }; +} + +function D(n) { + var e = m(N(Pn(n) + 1), function () { + return []; + }); + return s(n.nodes(), function (r) { + var t = n.node(r), i = t.rank; + g(i) || (e[i][t.order] = r); + }), e; +} + +function ur(n) { + var e = R( + m(n.nodes(), function (r) { + return n.node(r).rank; + }) + ); + s(n.nodes(), function (r) { + var t = n.node(r); + w(t, "rank") && (t.rank -= e); + }); +} + +function dr(n) { + var e = R( + m(n.nodes(), function (o) { + return n.node(o).rank; + }) + ), r = []; + s(n.nodes(), function (o) { + var a = n.node(o).rank - e; + r[a] || (r[a] = []), r[a].push(o); + }); + var t = 0, i = n.graph().nodeRankFactor; + s(r, function (o, a) { + g(o) && a % i !== 0 ? --t : t && s(o, function (u) { + n.node(u).rank += t; + }); + }); +} + +function hn(n, e, r, t) { + var i = { + width: 0, + height: 0 + }; + return arguments.length >= 4 && (i.rank = r, i.order = t), C(n, "border", i, e); +} + +function Pn(n) { + return E( + m(n.nodes(), function (e) { + var r = n.node(e).rank; + if (!g(r)) + return r; + }) + ); +} + +function fr(n, e) { + var r = {lhs: [], rhs: []}; + return s(n, function (t) { + e(t) ? r.lhs.push(t) : r.rhs.push(t); + }), r; +} + +function sr(n, e) { + var r = fn(); + try { + return e(); + } finally { + console.log(n + " time: " + (fn() - r) + "ms"); + } +} + +function cr(n, e) { + return e(); +} + +function hr(n) { + function e(r) { + var t = n.children(r), i = n.node(r); + if (t.length && s(t, e), w(i, "minRank")) { + i.borderLeft = [], i.borderRight = []; + for (var o = i.minRank, a = i.maxRank + 1; o < a; ++o) + ln(n, "borderLeft", "_bl", r, i, o), ln(n, "borderRight", "_br", r, i, o); + } + } + + s(n.children(), e); +} + +function ln(n, e, r, t, i, o) { + var a = {width: 0, height: 0, rank: o, borderType: e}, u = i[e][o - 1], d = C(n, "border", a, r); + i[e][o] = d, n.setParent(d, t), u && n.setEdge(u, d, {weight: 1}); +} + +function lr(n) { + var e = n.graph().rankdir.toLowerCase(); + (e === "lr" || e === "rl") && Sn(n); +} + +function vr(n) { + var e = n.graph().rankdir.toLowerCase(); + (e === "bt" || e === "rl") && pr(n), (e === "lr" || e === "rl") && (wr(n), Sn(n)); +} + +function Sn(n) { + s(n.nodes(), function (e) { + vn(n.node(e)); + }), s(n.edges(), function (e) { + vn(n.edge(e)); + }); +} + +function vn(n) { + var e = n.width; + n.width = n.height, n.height = e; +} + +function pr(n) { + s(n.nodes(), function (e) { + W(n.node(e)); + }), s(n.edges(), function (e) { + var r = n.edge(e); + s(r.points, W), w(r, "y") && W(r); + }); +} + +function W(n) { + n.y = -n.y; +} + +function wr(n) { + s(n.nodes(), function (e) { + X(n.node(e)); + }), s(n.edges(), function (e) { + var r = n.edge(e); + s(r.points, X), w(r, "x") && X(r); + }); +} + +function X(n) { + var e = n.x; + n.x = n.y, n.y = e; +} + +function mr(n) { + n.graph().dummyChains = [], s(n.edges(), function (e) { + br(n, e); + }); +} + +function br(n, e) { + var r = e.v, t = n.node(r).rank, i = e.w, o = n.node(i).rank, a = e.name, u = n.edge(e), d = u.labelRank; + if (o !== t + 1) { + n.removeEdge(e); + var f, c, h; + for (h = 0, ++t; t < o; ++h, ++t) + u.points = [], c = { + width: 0, + height: 0, + edgeLabel: u, + edgeObj: e, + rank: t + }, f = C(n, "edge", c, "_d"), t === d && (c.width = u.width, c.height = u.height, c.dummy = "edge-label", c.labelpos = u.labelpos), n.setEdge(r, f, {weight: u.weight}, a), h === 0 && n.graph().dummyChains.push(f), r = f; + n.setEdge(r, i, {weight: u.weight}, a); + } +} + +function gr(n) { + s(n.graph().dummyChains, function (e) { + var r = n.node(e), t = r.edgeLabel, i; + for (n.setEdge(r.edgeObj, t); r.dummy;) + i = n.successors(e)[0], n.removeNode(e), t.points.push({ + x: r.x, + y: r.y + }), r.dummy === "edge-label" && (t.x = r.x, t.y = r.y, t.width = r.width, t.height = r.height), e = i, r = n.node(e); + }); +} + +function rn(n) { + var e = {}; + + function r(t) { + var i = n.node(t); + if (w(e, t)) + return i.rank; + e[t] = !0; + var o = R( + m(n.outEdges(t), function (a) { + return r(a.w) - n.edge(a).minlen; + }) + ); + return (o === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3 + o === void 0 || // return value of _.map([]) for Lodash 4 + o === null) && (o = 0), i.rank = o; + } + + s(n.sources(), r); +} + +function T(n, e) { + return n.node(e.w).rank - n.node(e.v).rank - n.edge(e).minlen; +} + +function Fn(n) { + var e = new x({directed: !1}), r = n.nodes()[0], t = n.nodeCount(); + e.setNode(r, {}); + for (var i, o; xr(e, n) < t;) + i = Er(e, n), o = e.hasNode(i.v) ? T(n, i) : -T(n, i), kr(e, n, o); + return e; +} + +function xr(n, e) { + function r(t) { + s(e.nodeEdges(t), function (i) { + var o = i.v, a = t === o ? i.w : o; + !n.hasNode(a) && !T(e, i) && (n.setNode(a, {}), n.setEdge(t, a, {}), r(a)); + }); + } + + return s(n.nodes(), r), n.nodeCount(); +} + +function Er(n, e) { + return nn(e.edges(), function (r) { + if (n.hasNode(r.v) !== n.hasNode(r.w)) + return T(e, r); + }); +} + +function kr(n, e, r) { + s(n.nodes(), function (t) { + e.node(t).rank += r; + }); +} + +function yr() { +} + +yr.prototype = new Error(); + +function An(n, e, r) { + J(e) || (e = [e]); + var t = (n.isDirected() ? n.successors : n.neighbors).bind(n), i = [], o = {}; + return s(e, function (a) { + if (!n.hasNode(a)) + throw new Error("Graph does not have node: " + a); + Bn(n, a, r === "post", o, t, i); + }), i; +} + +function Bn(n, e, r, t, i, o) { + w(t, e) || (t[e] = !0, r || o.push(e), s(i(e), function (a) { + Bn(n, a, r, t, i, o); + }), r && o.push(e)); +} + +function Nr(n, e) { + return An(n, e, "post"); +} + +function Lr(n, e) { + return An(n, e, "pre"); +} + +k.initLowLimValues = an; +k.initCutValues = tn; +k.calcCutValue = $n; +k.leaveEdge = Vn; +k.enterEdge = Yn; +k.exchangeEdges = Dn; + +function k(n) { + n = or(n), rn(n); + var e = Fn(n); + an(e), tn(e, n); + for (var r, t; r = Vn(e);) + t = Yn(e, n, r), Dn(e, n, r, t); +} + +function tn(n, e) { + var r = Nr(n, n.nodes()); + r = r.slice(0, r.length - 1), s(r, function (t) { + _r(n, e, t); + }); +} + +function _r(n, e, r) { + var t = n.node(r), i = t.parent; + n.edge(r, i).cutvalue = $n(n, e, r); +} + +function $n(n, e, r) { + var t = n.node(r), i = t.parent, o = !0, a = e.edge(r, i), u = 0; + return a || (o = !1, a = e.edge(i, r)), u = a.weight, s(e.nodeEdges(r), function (d) { + var f = d.v === r, c = f ? d.w : d.v; + if (c !== i) { + var h = f === o, l = e.edge(d).weight; + if (u += h ? l : -l, Ir(n, r, c)) { + var v = n.edge(r, c).cutvalue; + u += h ? -v : v; + } + } + }), u; +} + +function an(n, e) { + arguments.length < 2 && (e = n.nodes()[0]), Gn(n, {}, 1, e); +} + +function Gn(n, e, r, t, i) { + var o = r, a = n.node(t); + return e[t] = !0, s(n.neighbors(t), function (u) { + w(e, u) || (r = Gn(n, e, r, u, t)); + }), a.low = o, a.lim = r++, i ? a.parent = i : delete a.parent, r; +} + +function Vn(n) { + return Z(n.edges(), function (e) { + return n.edge(e).cutvalue < 0; + }); +} + +function Yn(n, e, r) { + var t = r.v, i = r.w; + e.hasEdge(t, i) || (t = r.w, i = r.v); + var o = n.node(t), a = n.node(i), u = o, d = !1; + o.lim > a.lim && (u = a, d = !0); + var f = M(e.edges(), function (c) { + return d === pn(n, n.node(c.v), u) && d !== pn(n, n.node(c.w), u); + }); + return nn(f, function (c) { + return T(e, c); + }); +} + +function Dn(n, e, r, t) { + var i = r.v, o = r.w; + n.removeEdge(i, o), n.setEdge(t.v, t.w, {}), an(n), tn(n, e), Cr(n, e); +} + +function Cr(n, e) { + var r = Z(n.nodes(), function (i) { + return !e.node(i).parent; + }), t = Lr(n, r); + t = t.slice(1), s(t, function (i) { + var o = n.node(i).parent, a = e.edge(i, o), u = !1; + a || (a = e.edge(o, i), u = !0), e.node(i).rank = e.node(o).rank + (u ? a.minlen : -a.minlen); + }); +} + +function Ir(n, e, r) { + return n.hasEdge(e, r); +} + +function pn(n, e, r) { + return r.low <= e.lim && e.lim <= r.lim; +} + +function Rr(n) { + switch (n.graph().ranker) { + case "network-simplex": + wn(n); + break; + case "tight-tree": + Mr(n); + break; + case "longest-path": + Tr(n); + break; + default: + wn(n); + } +} + +var Tr = rn; + +function Mr(n) { + rn(n), Fn(n); +} + +function wn(n) { + k(n); +} + +function Or(n) { + var e = C(n, "root", {}, "_root"), r = Pr(n), t = E(y(r)) - 1, i = 2 * t + 1; + n.graph().nestingRoot = e, s(n.edges(), function (a) { + n.edge(a).minlen *= i; + }); + var o = Sr(n) + 1; + s(n.children(), function (a) { + qn(n, e, i, o, t, r, a); + }), n.graph().nodeRankFactor = i; +} + +function qn(n, e, r, t, i, o, a) { + var u = n.children(a); + if (!u.length) { + a !== e && n.setEdge(e, a, {weight: 0, minlen: r}); + return; + } + var d = hn(n, "_bt"), f = hn(n, "_bb"), c = n.node(a); + n.setParent(d, a), c.borderTop = d, n.setParent(f, a), c.borderBottom = f, s(u, function (h) { + qn(n, e, r, t, i, o, h); + var l = n.node(h), v = l.borderTop ? l.borderTop : h, p = l.borderBottom ? l.borderBottom : h, + b = l.borderTop ? t : 2 * t, I = v !== p ? 1 : i - o[a] + 1; + n.setEdge(d, v, { + weight: b, + minlen: I, + nestingEdge: !0 + }), n.setEdge(p, f, { + weight: b, + minlen: I, + nestingEdge: !0 + }); + }), n.parent(a) || n.setEdge(e, d, {weight: 0, minlen: i + o[a]}); +} + +function Pr(n) { + var e = {}; + + function r(t, i) { + var o = n.children(t); + o && o.length && s(o, function (a) { + r(a, i + 1); + }), e[t] = i; + } + + return s(n.children(), function (t) { + r(t, 1); + }), e; +} + +function Sr(n) { + return V( + n.edges(), + function (e, r) { + return e + n.edge(r).weight; + }, + 0 + ); +} + +function Fr(n) { + var e = n.graph(); + n.removeNode(e.nestingRoot), delete e.nestingRoot, s(n.edges(), function (r) { + var t = n.edge(r); + t.nestingEdge && n.removeEdge(r); + }); +} + +function Ar(n, e, r) { + var t = {}, i; + s(r, function (o) { + for (var a = n.parent(o), u, d; a;) { + if (u = n.parent(a), u ? (d = t[u], t[u] = a) : (d = i, i = a), d && d !== a) { + e.setEdge(d, a); + return; + } + a = u; + } + }); +} + +function Br(n, e, r) { + var t = $r(n), i = new x({compound: !0}).setGraph({root: t}).setDefaultNodeLabel(function (o) { + return n.node(o); + }); + return s(n.nodes(), function (o) { + var a = n.node(o), u = n.parent(o); + (a.rank === e || a.minRank <= e && e <= a.maxRank) && (i.setNode(o), i.setParent(o, u || t), s(n[r](o), function (d) { + var f = d.v === o ? d.w : d.v, c = i.edge(f, o), h = g(c) ? 0 : c.weight; + i.setEdge(f, o, {weight: n.edge(d).weight + h}); + }), w(a, "minRank") && i.setNode(o, { + borderLeft: a.borderLeft[e], + borderRight: a.borderRight[e] + })); + }), i; +} + +function $r(n) { + for (var e; n.hasNode(e = en("_root"));) + ; + return e; +} + +function Gr(n, e) { + for (var r = 0, t = 1; t < e.length; ++t) + r += Vr(n, e[t - 1], e[t]); + return r; +} + +function Vr(n, e, r) { + for (var t = Je( + r, + m(r, function (f, c) { + return c; + }) + ), i = _( + m(e, function (f) { + return O( + m(n.outEdges(f), function (c) { + return {pos: t[c.w], weight: n.edge(c).weight}; + }), + "pos" + ); + }) + ), o = 1; o < r.length;) + o <<= 1; + var a = 2 * o - 1; + o -= 1; + var u = m(new Array(a), function () { + return 0; + }), d = 0; + return s( + // @ts-expect-error + i.forEach(function (f) { + var c = f.pos + o; + u[c] += f.weight; + for (var h = 0; c > 0;) + c % 2 && (h += u[c + 1]), c = c - 1 >> 1, u[c] += f.weight; + d += f.weight * h; + }) + ), d; +} + +function Yr(n) { + var e = {}, r = M(n.nodes(), function (u) { + return !n.children(u).length; + }), t = E( + m(r, function (u) { + return n.node(u).rank; + }) + ), i = m(N(t + 1), function () { + return []; + }); + + function o(u) { + if (!w(e, u)) { + e[u] = !0; + var d = n.node(u); + i[d.rank].push(u), s(n.successors(u), o); + } + } + + var a = O(r, function (u) { + return n.node(u).rank; + }); + return s(a, o), i; +} + +function Dr(n, e) { + return m(e, function (r) { + var t = n.inEdges(r); + if (t.length) { + var i = V( + t, + function (o, a) { + var u = n.edge(a), d = n.node(a.v); + return { + sum: o.sum + u.weight * d.order, + weight: o.weight + u.weight + }; + }, + {sum: 0, weight: 0} + ); + return { + v: r, + barycenter: i.sum / i.weight, + weight: i.weight + }; + } else + return {v: r}; + }); +} + +function qr(n, e) { + var r = {}; + s(n, function (i, o) { + var a = r[i.v] = { + indegree: 0, + in: [], + out: [], + vs: [i.v], + i: o + }; + g(i.barycenter) || (a.barycenter = i.barycenter, a.weight = i.weight); + }), s(e.edges(), function (i) { + var o = r[i.v], a = r[i.w]; + !g(o) && !g(a) && (a.indegree++, o.out.push(r[i.w])); + }); + var t = M(r, function (i) { + return !i.indegree; + }); + return Wr(t); +} + +function Wr(n) { + var e = []; + + function r(o) { + return function (a) { + a.merged || (g(a.barycenter) || g(o.barycenter) || a.barycenter >= o.barycenter) && Xr(o, a); + }; + } + + function t(o) { + return function (a) { + a.in.push(o), --a.indegree === 0 && n.push(a); + }; + } + + for (; n.length;) { + var i = n.pop(); + e.push(i), s(i.in.reverse(), r(i)), s(i.out, t(i)); + } + return m( + M(e, function (o) { + return !o.merged; + }), + function (o) { + return G(o, ["vs", "i", "barycenter", "weight"]); + } + ); +} + +function Xr(n, e) { + var r = 0, t = 0; + n.weight && (r += n.barycenter * n.weight, t += n.weight), e.weight && (r += e.barycenter * e.weight, t += e.weight), n.vs = e.vs.concat(n.vs), n.barycenter = r / t, n.weight = t, n.i = Math.min(e.i, n.i), e.merged = !0; +} + +function zr(n, e) { + var r = fr(n, function (c) { + return w(c, "barycenter"); + }), t = r.lhs, i = O(r.rhs, function (c) { + return -c.i; + }), o = [], a = 0, u = 0, d = 0; + t.sort(Ur(!!e)), d = mn(o, i, d), s(t, function (c) { + d += c.vs.length, o.push(c.vs), a += c.barycenter * c.weight, u += c.weight, d = mn(o, i, d); + }); + var f = {vs: _(o)}; + return u && (f.barycenter = a / u, f.weight = u), f; +} + +function mn(n, e, r) { + for (var t; e.length && (t = $(e)).i <= r;) + e.pop(), n.push(t.vs), r++; + return r; +} + +function Ur(n) { + return function (e, r) { + return e.barycenter < r.barycenter ? -1 : e.barycenter > r.barycenter ? 1 : n ? r.i - e.i : e.i - r.i; + }; +} + +function Wn(n, e, r, t) { + var i = n.children(e), o = n.node(e), a = o ? o.borderLeft : void 0, u = o ? o.borderRight : void 0, d = {}; + a && (i = M(i, function (p) { + return p !== a && p !== u; + })); + var f = Dr(n, i); + s(f, function (p) { + if (n.children(p.v).length) { + var b = Wn(n, p.v, r, t); + d[p.v] = b, w(b, "barycenter") && jr(p, b); + } + }); + var c = qr(f, r); + Hr(c, d); + var h = zr(c, t); + if (a && (h.vs = _([a, h.vs, u]), n.predecessors(a).length)) { + var l = n.node(n.predecessors(a)[0]), v = n.node(n.predecessors(u)[0]); + w(h, "barycenter") || (h.barycenter = 0, h.weight = 0), h.barycenter = (h.barycenter * h.weight + l.order + v.order) / (h.weight + 2), h.weight += 2; + } + return h; +} + +function Hr(n, e) { + s(n, function (r) { + r.vs = _( + r.vs.map(function (t) { + return e[t] ? e[t].vs : t; + }) + ); + }); +} + +function jr(n, e) { + g(n.barycenter) ? (n.barycenter = e.barycenter, n.weight = e.weight) : (n.barycenter = (n.barycenter * n.weight + e.barycenter * e.weight) / (n.weight + e.weight), n.weight += e.weight); +} + +function Jr(n) { + var e = Pn(n), r = bn(n, N(1, e + 1), "inEdges"), t = bn(n, N(e - 1, -1, -1), "outEdges"), i = Yr(n); + gn(n, i); + for (var o = Number.POSITIVE_INFINITY, a, u = 0, d = 0; d < 4; ++u, ++d) { + Kr(u % 2 ? r : t, u % 4 >= 2), i = D(n); + var f = Gr(n, i); + f < o && (d = 0, a = ke(i), o = f); + } + gn(n, a); +} + +function bn(n, e, r) { + return m(e, function (t) { + return Br(n, t, r); + }); +} + +function Kr(n, e) { + var r = new x(); + s(n, function (t) { + var i = t.graph().root, o = Wn(t, i, r, e); + s(o.vs, function (a, u) { + t.node(a).order = u; + }), Ar(t, r, o.vs); + }); +} + +function gn(n, e) { + s(e, function (r) { + s(r, function (t, i) { + n.node(t).order = i; + }); + }); +} + +function Zr(n) { + var e = nt(n); + s(n.graph().dummyChains, function (r) { + for (var t = n.node(r), i = t.edgeObj, o = Qr(n, e, i.v, i.w), a = o.path, u = o.lca, d = 0, f = a[d], c = !0; r !== i.w;) { + if (t = n.node(r), c) { + for (; (f = a[d]) !== u && n.node(f).maxRank < t.rank;) + d++; + f === u && (c = !1); + } + if (!c) { + for (; d < a.length - 1 && n.node(f = a[d + 1]).minRank <= t.rank;) + d++; + f = a[d]; + } + n.setParent(r, f), r = n.successors(r)[0]; + } + }); +} + +function Qr(n, e, r, t) { + var i = [], o = [], a = Math.min(e[r].low, e[t].low), u = Math.max(e[r].lim, e[t].lim), d, f; + d = r; + do + d = n.parent(d), i.push(d); + while (d && (e[d].low > a || u > e[d].lim)); + for (f = d, d = t; (d = n.parent(d)) !== f;) + o.push(d); + return {path: i.concat(o.reverse()), lca: f}; +} + +function nt(n) { + var e = {}, r = 0; + + function t(i) { + var o = r; + s(n.children(i), t), e[i] = {low: o, lim: r++}; + } + + return s(n.children(), t), e; +} + +function et(n, e) { + var r = {}; + + function t(i, o) { + var a = 0, u = 0, d = i.length, f = $(o); + return s(o, function (c, h) { + var l = tt(n, c), v = l ? n.node(l).order : d; + (l || c === f) && (s(o.slice(u, h + 1), function (p) { + s(n.predecessors(p), function (b) { + var I = n.node(b), on = I.order; + (on < a || v < on) && !(I.dummy && n.node(p).dummy) && Xn(r, b, p); + }); + }), u = h + 1, a = v); + }), o; + } + + return V(e, t), r; +} + +function rt(n, e) { + var r = {}; + + function t(o, a, u, d, f) { + var c; + s(N(a, u), function (h) { + c = o[h], n.node(c).dummy && s(n.predecessors(c), function (l) { + var v = n.node(l); + v.dummy && (v.order < d || v.order > f) && Xn(r, l, c); + }); + }); + } + + function i(o, a) { + var u = -1, d, f = 0; + return s(a, function (c, h) { + if (n.node(c).dummy === "border") { + var l = n.predecessors(c); + l.length && (d = n.node(l[0]).order, t(a, f, h, u, d), f = h, u = d); + } + t(a, f, a.length, d, o.length); + }), a; + } + + return V(e, i), r; +} + +function tt(n, e) { + if (n.node(e).dummy) + return Z(n.predecessors(e), function (r) { + return n.node(r).dummy; + }); +} + +function Xn(n, e, r) { + if (e > r) { + var t = e; + e = r, r = t; + } + var i = n[e]; + i || (n[e] = i = {}), i[r] = !0; +} + +function it(n, e, r) { + if (e > r) { + var t = e; + e = r, r = t; + } + return w(n[e], r); +} + +function at(n, e, r, t) { + var i = {}, o = {}, a = {}; + return s(e, function (u) { + s(u, function (d, f) { + i[d] = d, o[d] = d, a[d] = f; + }); + }), s(e, function (u) { + var d = -1; + s(u, function (f) { + var c = t(f); + if (c.length) { + c = O(c, function (b) { + return a[b]; + }); + for (var h = (c.length - 1) / 2, l = Math.floor(h), v = Math.ceil(h); l <= v; ++l) { + var p = c[l]; + o[f] === f && d < a[p] && !it(r, f, p) && (o[p] = f, o[f] = i[f] = i[p], d = a[p]); + } + } + }); + }), {root: i, align: o}; +} + +function ot(n, e, r, t, i) { + var o = {}, a = ut(n, e, r, i), u = i ? "borderLeft" : "borderRight"; + + function d(h, l) { + for (var v = a.nodes(), p = v.pop(), b = {}; p;) + b[p] ? h(p) : (b[p] = !0, v.push(p), v = v.concat(l(p))), p = v.pop(); + } + + function f(h) { + o[h] = a.inEdges(h).reduce(function (l, v) { + return Math.max(l, o[v.v] + a.edge(v)); + }, 0); + } + + function c(h) { + var l = a.outEdges(h).reduce(function (p, b) { + return Math.min(p, o[b.w] - a.edge(b)); + }, Number.POSITIVE_INFINITY), v = n.node(h); + l !== Number.POSITIVE_INFINITY && v.borderType !== u && (o[h] = Math.max(o[h], l)); + } + + return d(f, a.predecessors.bind(a)), d(c, a.successors.bind(a)), s(t, function (h) { + o[h] = o[r[h]]; + }), o; +} + +function ut(n, e, r, t) { + var i = new x(), o = n.graph(), a = ht(o.nodesep, o.edgesep, t); + return s(e, function (u) { + var d; + s(u, function (f) { + var c = r[f]; + if (i.setNode(c), d) { + var h = r[d], l = i.edge(h, c); + i.setEdge(h, c, Math.max(a(n, f, d), l || 0)); + } + d = f; + }); + }), i; +} + +function dt(n, e) { + return nn(y(e), function (r) { + var t = Number.NEGATIVE_INFINITY, i = Number.POSITIVE_INFINITY; + return Me(r, function (o, a) { + var u = lt(n, a) / 2; + t = Math.max(o + u, t), i = Math.min(o - u, i); + }), t - i; + }); +} + +function ft(n, e) { + var r = y(e), t = R(r), i = E(r); + s(["u", "d"], function (o) { + s(["l", "r"], function (a) { + var u = o + a, d = n[u], f; + if (d !== e) { + var c = y(d); + f = a === "l" ? t - R(c) : i - E(c), f && (n[u] = Y(d, function (h) { + return h + f; + })); + } + }); + }); +} + +function st(n, e) { + return Y(n.ul, function (r, t) { + if (e) + return n[e.toLowerCase()][t]; + var i = O(m(n, t)); + return (i[1] + i[2]) / 2; + }); +} + +function ct(n) { + var e = D(n), r = H(et(n, e), rt(n, e)), t = {}, i; + s(["u", "d"], function (a) { + i = a === "u" ? e : y(e).reverse(), s(["l", "r"], function (u) { + u === "r" && (i = m(i, function (h) { + return y(h).reverse(); + })); + var d = (a === "u" ? n.predecessors : n.successors).bind(n), f = at(n, i, r, d), + c = ot(n, i, f.root, f.align, u === "r"); + u === "r" && (c = Y(c, function (h) { + return -h; + })), t[a + u] = c; + }); + }); + var o = dt(n, t); + return ft(t, o), st(t, n.graph().align); +} + +function ht(n, e, r) { + return function (t, i, o) { + var a = t.node(i), u = t.node(o), d = 0, f; + if (d += a.width / 2, w(a, "labelpos")) + switch (a.labelpos.toLowerCase()) { + case "l": + f = -a.width / 2; + break; + case "r": + f = a.width / 2; + break; + } + if (f && (d += r ? f : -f), f = 0, d += (a.dummy ? e : n) / 2, d += (u.dummy ? e : n) / 2, d += u.width / 2, w(u, "labelpos")) + switch (u.labelpos.toLowerCase()) { + case "l": + f = u.width / 2; + break; + case "r": + f = -u.width / 2; + break; + } + return f && (d += r ? f : -f), f = 0, d; + }; +} + +function lt(n, e) { + return n.node(e).width; +} + +function vt(n) { + n = On(n), pt(n), Oe(ct(n), function (e, r) { + n.node(r).x = e; + }); +} + +function pt(n) { + var e = D(n), r = n.graph().ranksep, t = 0; + s(e, function (i) { + var o = E( + m(i, function (a) { + return n.node(a).height; + }) + ); + s(i, function (a) { + n.node(a).y = t + o / 2; + }), t += o + r; + }); +} + +function Yt(n, e) { + var r = e && e.debugTiming ? sr : cr; + r("layout", function () { + var t = r(" buildLayoutGraph", function () { + return _t(n); + }); + r(" runLayout", function () { + wt(t, r); + }), r(" updateInputGraph", function () { + mt(n, t); + }); + }); +} + +function wt(n, e) { + e(" makeSpaceForEdgeLabels", function () { + Ct(n); + }), e(" removeSelfEdges", function () { + At(n); + }), e(" acyclic", function () { + tr(n); + }), e(" nestingGraph.run", function () { + Or(n); + }), e(" rank", function () { + Rr(On(n)); + }), e(" injectEdgeLabelProxies", function () { + It(n); + }), e(" removeEmptyRanks", function () { + dr(n); + }), e(" nestingGraph.cleanup", function () { + Fr(n); + }), e(" normalizeRanks", function () { + ur(n); + }), e(" assignRankMinMax", function () { + Rt(n); + }), e(" removeEdgeLabelProxies", function () { + Tt(n); + }), e(" normalize.run", function () { + mr(n); + }), e(" parentDummyChains", function () { + Zr(n); + }), e(" addBorderSegments", function () { + hr(n); + }), e(" order", function () { + Jr(n); + }), e(" insertSelfEdges", function () { + Bt(n); + }), e(" adjustCoordinateSystem", function () { + lr(n); + }), e(" position", function () { + vt(n); + }), e(" positionSelfEdges", function () { + $t(n); + }), e(" removeBorderNodes", function () { + Ft(n); + }), e(" normalize.undo", function () { + gr(n); + }), e(" fixupEdgeLabelCoords", function () { + Pt(n); + }), e(" undoCoordinateSystem", function () { + vr(n); + }), e(" translateGraph", function () { + Mt(n); + }), e(" assignNodeIntersects", function () { + Ot(n); + }), e(" reversePoints", function () { + St(n); + }), e(" acyclic.undo", function () { + ar(n); + }); +} + +function mt(n, e) { + s(n.nodes(), function (r) { + var t = n.node(r), i = e.node(r); + t && (t.x = i.x, t.y = i.y, e.children(r).length && (t.width = i.width, t.height = i.height)); + }), s(n.edges(), function (r) { + var t = n.edge(r), i = e.edge(r); + t.points = i.points, w(i, "x") && (t.x = i.x, t.y = i.y); + }), n.graph().width = e.graph().width, n.graph().height = e.graph().height; +} + +var bt = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], + gt = {ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb"}, xt = ["acyclicer", "ranker", "rankdir", "align"], + Et = ["width", "height"], kt = {width: 0, height: 0}, yt = ["minlen", "weight", "width", "height", "labeloffset"], + Nt = { + minlen: 1, + weight: 1, + width: 0, + height: 0, + labeloffset: 10, + labelpos: "r" + }, Lt = ["labelpos"]; + +function _t(n) { + var e = new x({multigraph: !0, compound: !0}), r = U(n.graph()); + return e.setGraph( + H({}, gt, z(r, bt), G(r, xt)) + ), s(n.nodes(), function (t) { + var i = U(n.node(t)); + e.setNode(t, _e(z(i, Et), kt)), e.setParent(t, n.parent(t)); + }), s(n.edges(), function (t) { + var i = U(n.edge(t)); + e.setEdge( + t, + H({}, Nt, z(i, yt), G(i, Lt)) + ); + }), e; +} + +function Ct(n) { + var e = n.graph(); + e.ranksep /= 2, s(n.edges(), function (r) { + var t = n.edge(r); + t.minlen *= 2, t.labelpos.toLowerCase() !== "c" && (e.rankdir === "TB" || e.rankdir === "BT" ? t.width += t.labeloffset : t.height += t.labeloffset); + }); +} + +function It(n) { + s(n.edges(), function (e) { + var r = n.edge(e); + if (r.width && r.height) { + var t = n.node(e.v), i = n.node(e.w), o = {rank: (i.rank - t.rank) / 2 + t.rank, e}; + C(n, "edge-proxy", o, "_ep"); + } + }); +} + +function Rt(n) { + var e = 0; + s(n.nodes(), function (r) { + var t = n.node(r); + t.borderTop && (t.minRank = n.node(t.borderTop).rank, t.maxRank = n.node(t.borderBottom).rank, e = E(e, t.maxRank)); + }), n.graph().maxRank = e; +} + +function Tt(n) { + s(n.nodes(), function (e) { + var r = n.node(e); + r.dummy === "edge-proxy" && (n.edge(r.e).labelRank = r.rank, n.removeNode(e)); + }); +} + +function Mt(n) { + var e = Number.POSITIVE_INFINITY, r = 0, t = Number.POSITIVE_INFINITY, i = 0, o = n.graph(), a = o.marginx || 0, + u = o.marginy || 0; + + function d(f) { + var c = f.x, h = f.y, l = f.width, v = f.height; + e = Math.min(e, c - l / 2), r = Math.max(r, c + l / 2), t = Math.min(t, h - v / 2), i = Math.max(i, h + v / 2); + } + + s(n.nodes(), function (f) { + d(n.node(f)); + }), s(n.edges(), function (f) { + var c = n.edge(f); + w(c, "x") && d(c); + }), e -= a, t -= u, s(n.nodes(), function (f) { + var c = n.node(f); + c.x -= e, c.y -= t; + }), s(n.edges(), function (f) { + var c = n.edge(f); + s(c.points, function (h) { + h.x -= e, h.y -= t; + }), w(c, "x") && (c.x -= e), w(c, "y") && (c.y -= t); + }), o.width = r - e + a, o.height = i - t + u; +} + +function Ot(n) { + s(n.edges(), function (e) { + var r = n.edge(e), t = n.node(e.v), i = n.node(e.w), o, a; + r.points ? (o = r.points[0], a = r.points[r.points.length - 1]) : (r.points = [], o = i, a = t), r.points.unshift(cn(t, o)), r.points.push(cn(i, a)); + }); +} + +function Pt(n) { + s(n.edges(), function (e) { + var r = n.edge(e); + if (w(r, "x")) + switch ((r.labelpos === "l" || r.labelpos === "r") && (r.width -= r.labeloffset), r.labelpos) { + case "l": + r.x -= r.width / 2 + r.labeloffset; + break; + case "r": + r.x += r.width / 2 + r.labeloffset; + break; + } + }); +} + +function St(n) { + s(n.edges(), function (e) { + var r = n.edge(e); + r.reversed && r.points.reverse(); + }); +} + +function Ft(n) { + s(n.nodes(), function (e) { + if (n.children(e).length) { + var r = n.node(e), t = n.node(r.borderTop), i = n.node(r.borderBottom), o = n.node($(r.borderLeft)), + a = n.node($(r.borderRight)); + r.width = Math.abs(a.x - o.x), r.height = Math.abs(i.y - t.y), r.x = o.x + r.width / 2, r.y = t.y + r.height / 2; + } + }), s(n.nodes(), function (e) { + n.node(e).dummy === "border" && n.removeNode(e); + }); +} + +function At(n) { + s(n.edges(), function (e) { + if (e.v === e.w) { + var r = n.node(e.v); + r.selfEdges || (r.selfEdges = []), r.selfEdges.push({e, label: n.edge(e)}), n.removeEdge(e); + } + }); +} + +function Bt(n) { + var e = D(n); + s(e, function (r) { + var t = 0; + s(r, function (i, o) { + var a = n.node(i); + a.order = o + t, s(a.selfEdges, function (u) { + C( + n, + "selfedge", + { + width: u.label.width, + height: u.label.height, + rank: a.rank, + order: o + ++t, + e: u.e, + label: u.label + }, + "_se" + ); + }), delete a.selfEdges; + }); + }); +} + +function $t(n) { + s(n.nodes(), function (e) { + var r = n.node(e); + if (r.dummy === "selfedge") { + var t = n.node(r.e.v), i = t.x + t.width / 2, o = t.y, a = r.x - i, u = t.height / 2; + n.setEdge(r.e, r.label), n.removeNode(e), r.label.points = [ + {x: i + 2 * a / 3, y: o - u}, + {x: i + 5 * a / 6, y: o - u}, + {x: i + a, y: o}, + {x: i + 5 * a / 6, y: o + u}, + {x: i + 2 * a / 3, y: o + u} + ], r.label.x = r.x, r.label.y = r.y; + } + }); +} + +function z(n, e) { + return Y(G(n, e), Number); +} + +function U(n) { + var e = {}; + return s(n, function (r, t) { + e[t.toLowerCase()] = r; + }), e; +} + +export { + _e as d, + Yt as l, + m, + G as p, + N as r, + en as u +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/line-24d93f1b.js b/BlazorApp/wwwroot/js/lib/mermaid/line-24d93f1b.js new file mode 100644 index 00000000..17ddb611 --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/line-24d93f1b.js @@ -0,0 +1,40 @@ +import {a as h} from "./array-2ff2c7a6.js"; +import {c as o, w as d} from "./path-428ebac9.js"; +import {n as v} from "./mermaid-9f2aa176.js"; + +function w(t) { + return t[0]; +} + +function b(t) { + return t[1]; +} + +function P(t, u) { + var s = o(!0), i = null, l = v, r = null, m = d(e); + t = typeof t == "function" ? t : t === void 0 ? w : o(t), u = typeof u == "function" ? u : u === void 0 ? b : o(u); + + function e(n) { + var f, g = (n = h(n)).length, p, c = !1, a; + for (i == null && (r = l(a = m())), f = 0; f <= g; ++f) + !(f < g && s(p = n[f], f, n)) === c && ((c = !c) ? r.lineStart() : r.lineEnd()), c && r.point(+t(p, f, n), +u(p, f, n)); + if (a) + return r = null, a + "" || null; + } + + return e.x = function (n) { + return arguments.length ? (t = typeof n == "function" ? n : o(+n), e) : t; + }, e.y = function (n) { + return arguments.length ? (u = typeof n == "function" ? n : o(+n), e) : u; + }, e.defined = function (n) { + return arguments.length ? (s = typeof n == "function" ? n : o(!!n), e) : s; + }, e.curve = function (n) { + return arguments.length ? (l = n, i != null && (r = l(i)), e) : l; + }, e.context = function (n) { + return arguments.length ? (n == null ? i = r = null : r = l(i = n), e) : i; + }, e; +} + +export { + P as l +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/mermaid-9f2aa176.js b/BlazorApp/wwwroot/js/lib/mermaid/mermaid-9f2aa176.js new file mode 100644 index 00000000..8751e826 --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/mermaid-9f2aa176.js @@ -0,0 +1,9159 @@ +function mh(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 (u) { + var f, c; + return (c = (f = u.match(/[\t ]/g)) === null || f === void 0 ? void 0 : f.length) !== null && c !== void 0 ? c : 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)( *)$/), u = h ? h[1] : "", f = a; + typeof a == "string" && a.includes(` +`) && (f = String(a).split(` +`).map(function (c, d) { + return d === 0 ? c : "" + u + c; + }).join(` +`)), s += f + r[l + 1]; + }), s; +} + +var yh = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; + +function _h(t) { + return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; +} + +var Ns = {exports: {}}; +(function (t, e) { + (function (i, r) { + t.exports = r(); + })(yh, function () { + var i = 1e3, r = 6e4, n = 36e5, o = "millisecond", s = "second", a = "minute", l = "hour", h = "day", + u = "week", f = "month", c = "quarter", d = "year", m = "date", S = "Invalid Date", + O = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, + z = /\[([^\]]+)]|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, T = { + 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 (M) { + var k = ["th", "st", "nd", "rd"], C = M % 100; + return "[" + M + (k[(C - 20) % 10] || k[C] || k[0]) + "]"; + } + }, R = function (M, k, C) { + var w = String(M); + return !w || w.length >= k ? M : "" + Array(k + 1 - w.length).join(C) + M; + }, X = { + s: R, z: function (M) { + var k = -M.utcOffset(), C = Math.abs(k), w = Math.floor(C / 60), x = C % 60; + return (k <= 0 ? "+" : "-") + R(w, 2, "0") + ":" + R(x, 2, "0"); + }, m: function M(k, C) { + if (k.date() < C.date()) + return -M(C, k); + var w = 12 * (C.year() - k.year()) + (C.month() - k.month()), x = k.clone().add(w, f), b = C - x < 0, + D = k.clone().add(w + (b ? -1 : 1), f); + return +(-(w + (C - x) / (b ? x - D : D - x)) || 0); + }, a: function (M) { + return M < 0 ? Math.ceil(M) || 0 : Math.floor(M); + }, p: function (M) { + return { + M: f, + y: d, + w: u, + d: h, + D: m, + h: l, + m: a, + s, + ms: o, + Q: c + }[M] || String(M || "").toLowerCase().replace(/s$/, ""); + }, u: function (M) { + return M === void 0; + } + }, G = "en", V = {}; + V[G] = T; + var H = "$isDayjsObject", oe = function (M) { + return M instanceof Ct || !(!M || !M[H]); + }, Kt = function M(k, C, w) { + var x; + if (!k) + return G; + if (typeof k == "string") { + var b = k.toLowerCase(); + V[b] && (x = b), C && (V[b] = C, x = b); + var D = k.split("-"); + if (!x && D.length > 1) + return M(D[0]); + } else { + var I = k.name; + V[I] = k, x = I; + } + return !w && x && (G = x), x || !w && G; + }, P = function (M, k) { + if (oe(M)) + return M.clone(); + var C = typeof k == "object" ? k : {}; + return C.date = M, C.args = arguments, new Ct(C); + }, W = X; + W.l = Kt, W.i = oe, W.w = function (M, k) { + return P(M, {locale: k.$L, utc: k.$u, x: k.$x, $offset: k.$offset}); + }; + var Ct = function () { + function M(C) { + this.$L = Kt(C.locale, null, !0), this.parse(C), this.$x = this.$x || C.x || {}, this[H] = !0; + } + + var k = M.prototype; + return k.parse = function (C) { + this.$d = function (w) { + var x = w.date, b = w.utc; + if (x === null) + return /* @__PURE__ */ new Date(NaN); + if (W.u(x)) + return /* @__PURE__ */ new Date(); + if (x instanceof Date) + return new Date(x); + if (typeof x == "string" && !/Z$/i.test(x)) { + var D = x.match(O); + if (D) { + var I = D[2] - 1 || 0, Y = (D[7] || "0").substring(0, 3); + return b ? new Date(Date.UTC(D[1], I, D[3] || 1, D[4] || 0, D[5] || 0, D[6] || 0, Y)) : new Date(D[1], I, D[3] || 1, D[4] || 0, D[5] || 0, D[6] || 0, Y); + } + } + return new Date(x); + }(C), this.init(); + }, k.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(); + }, k.$utils = function () { + return W; + }, k.isValid = function () { + return this.$d.toString() !== S; + }, k.isSame = function (C, w) { + var x = P(C); + return this.startOf(w) <= x && x <= this.endOf(w); + }, k.isAfter = function (C, w) { + return P(C) < this.startOf(w); + }, k.isBefore = function (C, w) { + return this.endOf(w) < P(C); + }, k.$g = function (C, w, x) { + return W.u(C) ? this[w] : this.set(x, C); + }, k.unix = function () { + return Math.floor(this.valueOf() / 1e3); + }, k.valueOf = function () { + return this.$d.getTime(); + }, k.startOf = function (C, w) { + var x = this, b = !!W.u(w) || w, D = W.p(C), I = function (Lt, Z) { + var it = W.w(x.$u ? Date.UTC(x.$y, Z, Lt) : new Date(x.$y, Z, Lt), x); + return b ? it : it.endOf(h); + }, Y = function (Lt, Z) { + return W.w(x.toDate()[Lt].apply(x.toDate("s"), (b ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(Z)), x); + }, N = this.$W, K = this.$M, et = this.$D, Rt = "set" + (this.$u ? "UTC" : ""); + switch (D) { + case d: + return b ? I(1, 0) : I(31, 11); + case f: + return b ? I(1, K) : I(0, K + 1); + case u: + var St = this.$locale().weekStart || 0, Zt = (N < St ? N + 7 : N) - St; + return I(b ? et - Zt : et + (6 - Zt), K); + case h: + case m: + return Y(Rt + "Hours", 0); + case l: + return Y(Rt + "Minutes", 1); + case a: + return Y(Rt + "Seconds", 2); + case s: + return Y(Rt + "Milliseconds", 3); + default: + return this.clone(); + } + }, k.endOf = function (C) { + return this.startOf(C, !1); + }, k.$set = function (C, w) { + var x, b = W.p(C), D = "set" + (this.$u ? "UTC" : ""), + I = (x = {}, x[h] = D + "Date", x[m] = D + "Date", x[f] = D + "Month", x[d] = D + "FullYear", x[l] = D + "Hours", x[a] = D + "Minutes", x[s] = D + "Seconds", x[o] = D + "Milliseconds", x)[b], + Y = b === h ? this.$D + (w - this.$W) : w; + if (b === f || b === d) { + var N = this.clone().set(m, 1); + N.$d[I](Y), N.init(), this.$d = N.set(m, Math.min(this.$D, N.daysInMonth())).$d; + } else + I && this.$d[I](Y); + return this.init(), this; + }, k.set = function (C, w) { + return this.clone().$set(C, w); + }, k.get = function (C) { + return this[W.p(C)](); + }, k.add = function (C, w) { + var x, b = this; + C = Number(C); + var D = W.p(w), I = function (K) { + var et = P(b); + return W.w(et.date(et.date() + Math.round(K * C)), b); + }; + if (D === f) + return this.set(f, this.$M + C); + if (D === d) + return this.set(d, this.$y + C); + if (D === h) + return I(1); + if (D === u) + return I(7); + var Y = (x = {}, x[a] = r, x[l] = n, x[s] = i, x)[D] || 1, N = this.$d.getTime() + C * Y; + return W.w(N, this); + }, k.subtract = function (C, w) { + return this.add(-1 * C, w); + }, k.format = function (C) { + var w = this, x = this.$locale(); + if (!this.isValid()) + return x.invalidDate || S; + var b = C || "YYYY-MM-DDTHH:mm:ssZ", D = W.z(this), I = this.$H, Y = this.$m, N = this.$M, + K = x.weekdays, et = x.months, Rt = x.meridiem, St = function (Z, it, Pt, Jt) { + return Z && (Z[it] || Z(w, b)) || Pt[it].slice(0, Jt); + }, Zt = function (Z) { + return W.s(I % 12 || 12, Z, "0"); + }, Lt = Rt || function (Z, it, Pt) { + var Jt = Z < 12 ? "AM" : "PM"; + return Pt ? Jt.toLowerCase() : Jt; + }; + return b.replace(z, function (Z, it) { + return it || function (Pt) { + switch (Pt) { + case "YY": + return String(w.$y).slice(-2); + case "YYYY": + return W.s(w.$y, 4, "0"); + case "M": + return N + 1; + case "MM": + return W.s(N + 1, 2, "0"); + case "MMM": + return St(x.monthsShort, N, et, 3); + case "MMMM": + return St(et, N); + case "D": + return w.$D; + case "DD": + return W.s(w.$D, 2, "0"); + case "d": + return String(w.$W); + case "dd": + return St(x.weekdaysMin, w.$W, K, 2); + case "ddd": + return St(x.weekdaysShort, w.$W, K, 3); + case "dddd": + return K[w.$W]; + case "H": + return String(I); + case "HH": + return W.s(I, 2, "0"); + case "h": + return Zt(1); + case "hh": + return Zt(2); + case "a": + return Lt(I, Y, !0); + case "A": + return Lt(I, Y, !1); + case "m": + return String(Y); + case "mm": + return W.s(Y, 2, "0"); + case "s": + return String(w.$s); + case "ss": + return W.s(w.$s, 2, "0"); + case "SSS": + return W.s(w.$ms, 3, "0"); + case "Z": + return D; + } + return null; + }(Z) || D.replace(":", ""); + }); + }, k.utcOffset = function () { + return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); + }, k.diff = function (C, w, x) { + var b, D = this, I = W.p(w), Y = P(C), N = (Y.utcOffset() - this.utcOffset()) * r, K = this - Y, + et = function () { + return W.m(D, Y); + }; + switch (I) { + case d: + b = et() / 12; + break; + case f: + b = et(); + break; + case c: + b = et() / 3; + break; + case u: + b = (K - N) / 6048e5; + break; + case h: + b = (K - N) / 864e5; + break; + case l: + b = K / n; + break; + case a: + b = K / r; + break; + case s: + b = K / i; + break; + default: + b = K; + } + return x ? b : W.a(b); + }, k.daysInMonth = function () { + return this.endOf(f).$D; + }, k.$locale = function () { + return V[this.$L]; + }, k.locale = function (C, w) { + if (!C) + return this.$L; + var x = this.clone(), b = Kt(C, w, !0); + return b && (x.$L = b), x; + }, k.clone = function () { + return W.w(this.$d, this); + }, k.toDate = function () { + return new Date(this.valueOf()); + }, k.toJSON = function () { + return this.isValid() ? this.toISOString() : null; + }, k.toISOString = function () { + return this.$d.toISOString(); + }, k.toString = function () { + return this.$d.toUTCString(); + }, M; + }(), Nt = Ct.prototype; + return P.prototype = Nt, [["$ms", o], ["$s", s], ["$m", a], ["$H", l], ["$W", h], ["$M", f], ["$y", d], ["$D", m]].forEach(function (M) { + Nt[M[1]] = function (k) { + return this.$g(k, M[0], M[1]); + }; + }), P.extend = function (M, k) { + return M.$i || (M(k, Ct, P), M.$i = !0), P; + }, P.locale = Kt, P.isDayjs = oe, P.unix = function (M) { + return P(1e3 * M); + }, P.en = V[G], P.Ls = V, P.p = {}, P; + }); +})(Ns); +var Ch = Ns.exports; +const xh = /* @__PURE__ */ _h(Ch), 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, xt("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", xt("FATAL"))), e <= Wt.error && (L.error = console.error ? console.error.bind(console, xt("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", xt("ERROR"))), e <= Wt.warn && (L.warn = console.warn ? console.warn.bind(console, xt("WARN"), "color: orange") : console.log.bind(console, "\x1B[33m", xt("WARN"))), e <= Wt.info && (L.info = console.info ? console.info.bind(console, xt("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", xt("INFO"))), e <= Wt.debug && (L.debug = console.debug ? console.debug.bind(console, xt("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", xt("DEBUG"))), e <= Wt.trace && (L.trace = console.debug ? console.debug.bind(console, xt("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", xt("TRACE"))); +}, xt = (t) => `%c${xh().format("ss.SSS")} : ${t} : `; +var Rs = {}; +(function (t) { + Object.defineProperty(t, "__esModule", {value: !0}), t.sanitizeUrl = t.BLANK_URL = void 0; + var e = /^([^\w]*)(javascript|data|vbscript)/im, i = /&#(\w+)(^\w|;)?/g, r = /&(newline|tab);/gi, + n = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim, o = /^.+(:|:)/gim, s = [".", "/"]; + t.BLANK_URL = "about:blank"; + + function a(u) { + return s.indexOf(u[0]) > -1; + } + + function l(u) { + var f = u.replace(n, ""); + return f.replace(i, function (c, d) { + return String.fromCharCode(d); + }); + } + + function h(u) { + if (!u) + return t.BLANK_URL; + var f = l(u).replace(r, "").replace(n, "").trim(); + if (!f) + return t.BLANK_URL; + if (a(f)) + return f; + var c = f.match(o); + if (!c) + return f; + var d = c[0]; + return e.test(d) ? t.BLANK_URL : f; + } + + t.sanitizeUrl = h; +})(Rs); +var bh = { + value: () => { + } +}; + +function Ps() { + 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 Oi(i); +} + +function Oi(t) { + this._ = t; +} + +function Th(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}; + }); +} + +Oi.prototype = Ps.prototype = { + constructor: Oi, + on: function (t, e) { + var i = this._, r = Th(t + "", i), n, o = -1, s = r.length; + if (arguments.length < 2) { + for (; ++o < s;) + if ((n = (t = r[o]).type) && (n = kh(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] = To(i[n], t.name, e); + else if (e == null) + for (n in i) + i[n] = To(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 Oi(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 kh(t, e) { + for (var i = 0, r = t.length, n; i < r; ++i) + if ((n = t[i]).name === e) + return n.value; +} + +function To(t, e, i) { + for (var r = 0, n = t.length; r < n; ++r) + if (t[r].name === e) { + t[r] = bh, t = t.slice(0, r).concat(t.slice(r + 1)); + break; + } + return i != null && t.push({name: e, value: i}), t; +} + +var Jr = "http://www.w3.org/1999/xhtml"; +const ko = { + svg: "http://www.w3.org/2000/svg", + xhtml: Jr, + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" +}; + +function fr(t) { + var e = t += "", i = e.indexOf(":"); + return i >= 0 && (e = t.slice(0, i)) !== "xmlns" && (t = t.slice(i + 1)), ko.hasOwnProperty(e) ? { + space: ko[e], + local: t + } : t; +} + +function Sh(t) { + return function () { + var e = this.ownerDocument, i = this.namespaceURI; + return i === Jr && e.documentElement.namespaceURI === Jr ? e.createElement(t) : e.createElementNS(i, t); + }; +} + +function vh(t) { + return function () { + return this.ownerDocument.createElementNS(t.space, t.local); + }; +} + +function qs(t) { + var e = fr(t); + return (e.local ? vh : Sh)(e); +} + +function wh() { +} + +function Tn(t) { + return t == null ? wh : function () { + return this.querySelector(t); + }; +} + +function Bh(t) { + typeof t != "function" && (t = Tn(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, u = 0; u < s; ++u) + (l = o[u]) && (h = t.call(l, l.__data__, u, o)) && ("__data__" in l && (h.__data__ = l.__data__), a[u] = h); + return new yt(r, this._parents); +} + +function Fh(t) { + return t == null ? [] : Array.isArray(t) ? t : Array.from(t); +} + +function Ah() { + return []; +} + +function zs(t) { + return t == null ? Ah : function () { + return this.querySelectorAll(t); + }; +} + +function Lh(t) { + return function () { + return Fh(t.apply(this, arguments)); + }; +} + +function Eh(t) { + typeof t == "function" ? t = Lh(t) : t = zs(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 yt(r, n); +} + +function Ws(t) { + return function () { + return this.matches(t); + }; +} + +function Hs(t) { + return function (e) { + return e.matches(t); + }; +} + +var Mh = Array.prototype.find; + +function Oh(t) { + return function () { + return Mh.call(this.children, t); + }; +} + +function $h() { + return this.firstElementChild; +} + +function Ih(t) { + return this.select(t == null ? $h : Oh(typeof t == "function" ? t : Hs(t))); +} + +var Dh = Array.prototype.filter; + +function Nh() { + return Array.from(this.children); +} + +function Rh(t) { + return function () { + return Dh.call(this.children, t); + }; +} + +function Ph(t) { + return this.selectAll(t == null ? Nh : Rh(typeof t == "function" ? t : Hs(t))); +} + +function qh(t) { + typeof t != "function" && (t = Ws(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 yt(r, this._parents); +} + +function js(t) { + return new Array(t.length); +} + +function zh() { + return new yt(this._enter || this._groups.map(js), this._parents); +} + +function ji(t, e) { + this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; +} + +ji.prototype = { + constructor: ji, + 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 Wh(t) { + return function () { + return t; + }; +} + +function Hh(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 ji(t, o[s]); + for (; s < l; ++s) + (a = e[s]) && (n[s] = a); +} + +function jh(t, e, i, r, n, o, s) { + var a, l, h = /* @__PURE__ */ new Map(), u = e.length, f = o.length, c = new Array(u), d; + for (a = 0; a < u; ++a) + (l = e[a]) && (c[a] = d = s.call(l, l.__data__, a, e) + "", h.has(d) ? n[a] = l : h.set(d, l)); + for (a = 0; a < f; ++a) + d = s.call(t, o[a], a, o) + "", (l = h.get(d)) ? (r[a] = l, l.__data__ = o[a], h.delete(d)) : i[a] = new ji(t, o[a]); + for (a = 0; a < u; ++a) + (l = e[a]) && h.get(c[a]) === l && (n[a] = l); +} + +function Uh(t) { + return t.__data__; +} + +function Yh(t, e) { + if (!arguments.length) + return Array.from(this, Uh); + var i = e ? jh : Hh, r = this._parents, n = this._groups; + typeof t != "function" && (t = Wh(t)); + for (var o = n.length, s = new Array(o), a = new Array(o), l = new Array(o), h = 0; h < o; ++h) { + var u = r[h], f = n[h], c = f.length, d = Gh(t.call(u, u && u.__data__, h, r)), m = d.length, + S = a[h] = new Array(m), O = s[h] = new Array(m), z = l[h] = new Array(c); + i(u, f, S, O, z, d, e); + for (var T = 0, R = 0, X, G; T < m; ++T) + if (X = S[T]) { + for (T >= R && (R = T + 1); !(G = O[R]) && ++R < m;) + ; + X._next = G || null; + } + } + return s = new yt(s, r), s._enter = a, s._exit = l, s; +} + +function Gh(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); +} + +function Vh() { + return new yt(this._exit || this._groups.map(js), this._parents); +} + +function Xh(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 Kh(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], u = r[l], f = h.length, c = a[l] = new Array(f), d, m = 0; m < f; ++m) + (d = h[m] || u[m]) && (c[m] = d); + for (; l < n; ++l) + a[l] = i[l]; + return new yt(a, this._parents); +} + +function Zh() { + 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 Jh(t) { + t || (t = Qh); + + function e(f, c) { + return f && c ? t(f.__data__, c.__data__) : !f - !c; + } + + 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, u = 0; u < a; ++u) + (h = s[u]) && (l[u] = h); + l.sort(e); + } + return new yt(n, this._parents).order(); +} + +function Qh(t, e) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; +} + +function tc() { + var t = arguments[0]; + return arguments[0] = this, t.apply(null, arguments), this; +} + +function ec() { + return Array.from(this); +} + +function ic() { + 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 rc() { + let t = 0; + for (const e of this) + ++t; + return t; +} + +function nc() { + return !this.node(); +} + +function oc(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 sc(t) { + return function () { + this.removeAttribute(t); + }; +} + +function ac(t) { + return function () { + this.removeAttributeNS(t.space, t.local); + }; +} + +function lc(t, e) { + return function () { + this.setAttribute(t, e); + }; +} + +function hc(t, e) { + return function () { + this.setAttributeNS(t.space, t.local, e); + }; +} + +function cc(t, e) { + return function () { + var i = e.apply(this, arguments); + i == null ? this.removeAttribute(t) : this.setAttribute(t, i); + }; +} + +function uc(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 fc(t, e) { + var i = fr(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 ? ac : sc : typeof e == "function" ? i.local ? uc : cc : i.local ? hc : lc)(i, e)); +} + +function Us(t) { + return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; +} + +function dc(t) { + return function () { + this.style.removeProperty(t); + }; +} + +function pc(t, e, i) { + return function () { + this.style.setProperty(t, e, i); + }; +} + +function gc(t, e, i) { + return function () { + var r = e.apply(this, arguments); + r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, i); + }; +} + +function mc(t, e, i) { + return arguments.length > 1 ? this.each((e == null ? dc : typeof e == "function" ? gc : pc)(t, e, i ?? "")) : Ae(this.node(), t); +} + +function Ae(t, e) { + return t.style.getPropertyValue(e) || Us(t).getComputedStyle(t, null).getPropertyValue(e); +} + +function yc(t) { + return function () { + delete this[t]; + }; +} + +function _c(t, e) { + return function () { + this[t] = e; + }; +} + +function Cc(t, e) { + return function () { + var i = e.apply(this, arguments); + i == null ? delete this[t] : this[t] = i; + }; +} + +function xc(t, e) { + return arguments.length > 1 ? this.each((e == null ? yc : typeof e == "function" ? Cc : _c)(t, e)) : this.node()[t]; +} + +function Ys(t) { + return t.trim().split(/^|\s+/); +} + +function kn(t) { + return t.classList || new Gs(t); +} + +function Gs(t) { + this._node = t, this._names = Ys(t.getAttribute("class") || ""); +} + +Gs.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 Vs(t, e) { + for (var i = kn(t), r = -1, n = e.length; ++r < n;) + i.add(e[r]); +} + +function Xs(t, e) { + for (var i = kn(t), r = -1, n = e.length; ++r < n;) + i.remove(e[r]); +} + +function bc(t) { + return function () { + Vs(this, t); + }; +} + +function Tc(t) { + return function () { + Xs(this, t); + }; +} + +function kc(t, e) { + return function () { + (e.apply(this, arguments) ? Vs : Xs)(this, t); + }; +} + +function Sc(t, e) { + var i = Ys(t + ""); + if (arguments.length < 2) { + for (var r = kn(this.node()), n = -1, o = i.length; ++n < o;) + if (!r.contains(i[n])) + return !1; + return !0; + } + return this.each((typeof e == "function" ? kc : e ? bc : Tc)(i, e)); +} + +function vc() { + this.textContent = ""; +} + +function wc(t) { + return function () { + this.textContent = t; + }; +} + +function Bc(t) { + return function () { + var e = t.apply(this, arguments); + this.textContent = e ?? ""; + }; +} + +function Fc(t) { + return arguments.length ? this.each(t == null ? vc : (typeof t == "function" ? Bc : wc)(t)) : this.node().textContent; +} + +function Ac() { + this.innerHTML = ""; +} + +function Lc(t) { + return function () { + this.innerHTML = t; + }; +} + +function Ec(t) { + return function () { + var e = t.apply(this, arguments); + this.innerHTML = e ?? ""; + }; +} + +function Mc(t) { + return arguments.length ? this.each(t == null ? Ac : (typeof t == "function" ? Ec : Lc)(t)) : this.node().innerHTML; +} + +function Oc() { + this.nextSibling && this.parentNode.appendChild(this); +} + +function $c() { + return this.each(Oc); +} + +function Ic() { + this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); +} + +function Dc() { + return this.each(Ic); +} + +function Nc(t) { + var e = typeof t == "function" ? t : qs(t); + return this.select(function () { + return this.appendChild(e.apply(this, arguments)); + }); +} + +function Rc() { + return null; +} + +function Pc(t, e) { + var i = typeof t == "function" ? t : qs(t), r = e == null ? Rc : typeof e == "function" ? e : Tn(e); + return this.select(function () { + return this.insertBefore(i.apply(this, arguments), r.apply(this, arguments) || null); + }); +} + +function qc() { + var t = this.parentNode; + t && t.removeChild(this); +} + +function zc() { + return this.each(qc); +} + +function Wc() { + var t = this.cloneNode(!1), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; +} + +function Hc() { + var t = this.cloneNode(!0), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; +} + +function jc(t) { + return this.select(t ? Hc : Wc); +} + +function Uc(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; +} + +function Yc(t) { + return function (e) { + t.call(this, e, this.__data__); + }; +} + +function Gc(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 Vc(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 Xc(t, e, i) { + return function () { + var r = this.__on, n, o = Yc(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 Kc(t, e, i) { + var r = Gc(t + ""), n, o = r.length, s; + if (arguments.length < 2) { + var a = this.node().__on; + if (a) { + for (var l = 0, h = a.length, u; l < h; ++l) + for (n = 0, u = a[l]; n < o; ++n) + if ((s = r[n]).type === u.type && s.name === u.name) + return u.value; + } + return; + } + for (a = e ? Xc : Vc, n = 0; n < o; ++n) + this.each(a(r[n], e, i)); + return this; +} + +function Ks(t, e, i) { + var r = Us(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 Zc(t, e) { + return function () { + return Ks(this, t, e); + }; +} + +function Jc(t, e) { + return function () { + return Ks(this, t, e.apply(this, arguments)); + }; +} + +function Qc(t, e) { + return this.each((typeof e == "function" ? Jc : Zc)(t, e)); +} + +function* tu() { + 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 Zs = [null]; + +function yt(t, e) { + this._groups = t, this._parents = e; +} + +function di() { + return new yt([[document.documentElement]], Zs); +} + +function eu() { + return this; +} + +yt.prototype = di.prototype = { + constructor: yt, + select: Bh, + selectAll: Eh, + selectChild: Ih, + selectChildren: Ph, + filter: qh, + data: Yh, + enter: zh, + exit: Vh, + join: Xh, + merge: Kh, + selection: eu, + order: Zh, + sort: Jh, + call: tc, + nodes: ec, + node: ic, + size: rc, + empty: nc, + each: oc, + attr: fc, + style: mc, + property: xc, + classed: Sc, + text: Fc, + html: Mc, + raise: $c, + lower: Dc, + append: Nc, + insert: Pc, + remove: zc, + clone: jc, + datum: Uc, + on: Kc, + dispatch: Qc, + [Symbol.iterator]: tu +}; + +function bt(t) { + return typeof t == "string" ? new yt([[document.querySelector(t)]], [document.documentElement]) : new yt([[t]], Zs); +} + +function Sn(t, e, i) { + t.prototype = e.prototype = i, i.constructor = t; +} + +function Js(t, e) { + var i = Object.create(t.prototype); + for (var r in e) + i[r] = e[r]; + return i; +} + +function pi() { +} + +var ri = 0.7, Ui = 1 / ri, Fe = "\\s*([+-]?\\d+)\\s*", ni = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", + Et = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", iu = /^#([0-9a-f]{3,8})$/, + ru = new RegExp(`^rgb\\(${Fe},${Fe},${Fe}\\)$`), nu = new RegExp(`^rgb\\(${Et},${Et},${Et}\\)$`), + ou = new RegExp(`^rgba\\(${Fe},${Fe},${Fe},${ni}\\)$`), su = new RegExp(`^rgba\\(${Et},${Et},${Et},${ni}\\)$`), + au = new RegExp(`^hsl\\(${ni},${Et},${Et}\\)$`), lu = new RegExp(`^hsla\\(${ni},${Et},${Et},${ni}\\)$`), 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 + }; +Sn(pi, oi, { + copy(t) { + return Object.assign(new this.constructor(), this, t); + }, + displayable() { + return this.rgb().displayable(); + }, + hex: vo, + // Deprecated! Use color.formatHex. + formatHex: vo, + formatHex8: hu, + formatHsl: cu, + formatRgb: wo, + toString: wo +}); + +function vo() { + return this.rgb().formatHex(); +} + +function hu() { + return this.rgb().formatHex8(); +} + +function cu() { + return Qs(this).formatHsl(); +} + +function wo() { + return this.rgb().formatRgb(); +} + +function oi(t) { + var e, i; + return t = (t + "").trim().toLowerCase(), (e = iu.exec(t)) ? (i = e[1].length, e = parseInt(e[1], 16), i === 6 ? Bo(e) : i === 3 ? new pt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : i === 8 ? ki(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : i === 4 ? ki(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 = ru.exec(t)) ? new pt(e[1], e[2], e[3], 1) : (e = nu.exec(t)) ? new pt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = ou.exec(t)) ? ki(e[1], e[2], e[3], e[4]) : (e = su.exec(t)) ? ki(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = au.exec(t)) ? Lo(e[1], e[2] / 100, e[3] / 100, 1) : (e = lu.exec(t)) ? Lo(e[1], e[2] / 100, e[3] / 100, e[4]) : So.hasOwnProperty(t) ? Bo(So[t]) : t === "transparent" ? new pt(NaN, NaN, NaN, 0) : null; +} + +function Bo(t) { + return new pt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +} + +function ki(t, e, i, r) { + return r <= 0 && (t = e = i = NaN), new pt(t, e, i, r); +} + +function uu(t) { + return t instanceof pi || (t = oi(t)), t ? (t = t.rgb(), new pt(t.r, t.g, t.b, t.opacity)) : new pt(); +} + +function Qr(t, e, i, r) { + return arguments.length === 1 ? uu(t) : new pt(t, e, i, r ?? 1); +} + +function pt(t, e, i, r) { + this.r = +t, this.g = +e, this.b = +i, this.opacity = +r; +} + +Sn(pt, Qr, Js(pi, { + brighter(t) { + return t = t == null ? Ui : Math.pow(Ui, t), new pt(this.r * t, this.g * t, this.b * t, this.opacity); + }, + darker(t) { + return t = t == null ? ri : Math.pow(ri, t), new pt(this.r * t, this.g * t, this.b * t, this.opacity); + }, + rgb() { + return this; + }, + clamp() { + return new pt(ue(this.r), ue(this.g), ue(this.b), Yi(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: Fo, + // Deprecated! Use color.formatHex. + formatHex: Fo, + formatHex8: fu, + formatRgb: Ao, + toString: Ao +})); + +function Fo() { + return `#${ce(this.r)}${ce(this.g)}${ce(this.b)}`; +} + +function fu() { + return `#${ce(this.r)}${ce(this.g)}${ce(this.b)}${ce((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +} + +function Ao() { + const t = Yi(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${ue(this.r)}, ${ue(this.g)}, ${ue(this.b)}${t === 1 ? ")" : `, ${t})`}`; +} + +function Yi(t) { + return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); +} + +function ue(t) { + return Math.max(0, Math.min(255, Math.round(t) || 0)); +} + +function ce(t) { + return t = ue(t), (t < 16 ? "0" : "") + t.toString(16); +} + +function Lo(t, e, i, r) { + return r <= 0 ? t = e = i = NaN : i <= 0 || i >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new wt(t, e, i, r); +} + +function Qs(t) { + if (t instanceof wt) + return new wt(t.h, t.s, t.l, t.opacity); + if (t instanceof pi || (t = oi(t)), !t) + return new wt(); + if (t instanceof wt) + 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 wt(s, a, l, t.opacity); +} + +function du(t, e, i, r) { + return arguments.length === 1 ? Qs(t) : new wt(t, e, i, r ?? 1); +} + +function wt(t, e, i, r) { + this.h = +t, this.s = +e, this.l = +i, this.opacity = +r; +} + +Sn(wt, du, Js(pi, { + brighter(t) { + return t = t == null ? Ui : Math.pow(Ui, t), new wt(this.h, this.s, this.l * t, this.opacity); + }, + darker(t) { + return t = t == null ? ri : Math.pow(ri, t), new wt(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 pt( + Dr(t >= 240 ? t - 240 : t + 120, n, r), + Dr(t, n, r), + Dr(t < 120 ? t + 240 : t - 120, n, r), + this.opacity + ); + }, + clamp() { + return new wt(Eo(this.h), Si(this.s), Si(this.l), Yi(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 = Yi(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Eo(this.h)}, ${Si(this.s) * 100}%, ${Si(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + } +})); + +function Eo(t) { + return t = (t || 0) % 360, t < 0 ? t + 360 : t; +} + +function Si(t) { + return Math.max(0, Math.min(1, t || 0)); +} + +function Dr(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 vn = (t) => () => t; + +function ta(t, e) { + return function (i) { + return t + i * e; + }; +} + +function pu(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 l1(t, e) { + var i = e - t; + return i ? ta(t, i > 180 || i < -180 ? i - 360 * Math.round(i / 360) : i) : vn(isNaN(t) ? e : t); +} + +function gu(t) { + return (t = +t) == 1 ? ea : function (e, i) { + return i - e ? pu(e, i, t) : vn(isNaN(e) ? i : e); + }; +} + +function ea(t, e) { + var i = e - t; + return i ? ta(t, i) : vn(isNaN(t) ? e : t); +} + +const Mo = function t(e) { + var i = gu(e); + + function r(n, o) { + var s = i((n = Qr(n)).r, (o = Qr(o)).r), a = i(n.g, o.g), l = i(n.b, o.b), h = ea(n.opacity, o.opacity); + return function (u) { + return n.r = s(u), n.g = a(u), n.b = l(u), n.opacity = h(u), n + ""; + }; + } + + return r.gamma = t, r; +}(1); + +function te(t, e) { + return t = +t, e = +e, function (i) { + return t * (1 - i) + e * i; + }; +} + +var tn = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Nr = new RegExp(tn.source, "g"); + +function mu(t) { + return function () { + return t; + }; +} + +function yu(t) { + return function (e) { + return t(e) + ""; + }; +} + +function _u(t, e) { + var i = tn.lastIndex = Nr.lastIndex = 0, r, n, o, s = -1, a = [], l = []; + for (t = t + "", e = e + ""; (r = tn.exec(t)) && (n = Nr.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: te(r, n) + })), i = Nr.lastIndex; + return i < e.length && (o = e.slice(i), a[s] ? a[s] += o : a[++s] = o), a.length < 2 ? l[0] ? yu(l[0].x) : mu(e) : (e = l.length, function (h) { + for (var u = 0, f; u < e; ++u) + a[(f = l[u]).i] = f.x(h); + return a.join(""); + }); +} + +var Oo = 180 / Math.PI, en = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1 +}; + +function ia(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) * Oo, + skewX: Math.atan(l) * Oo, + scaleX: s, + scaleY: a + }; +} + +var vi; + +function Cu(t) { + const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); + return e.isIdentity ? en : ia(e.a, e.b, e.c, e.d, e.e, e.f); +} + +function xu(t) { + return t == null || (vi || (vi = document.createElementNS("http://www.w3.org/2000/svg", "g")), vi.setAttribute("transform", t), !(t = vi.transform.baseVal.consolidate())) ? en : (t = t.matrix, ia(t.a, t.b, t.c, t.d, t.e, t.f)); +} + +function ra(t, e, i, r) { + function n(h) { + return h.length ? h.pop() + " " : ""; + } + + function o(h, u, f, c, d, m) { + if (h !== f || u !== c) { + var S = d.push("translate(", null, e, null, i); + m.push({i: S - 4, x: te(h, f)}, {i: S - 2, x: te(u, c)}); + } else + (f || c) && d.push("translate(" + f + e + c + i); + } + + function s(h, u, f, c) { + h !== u ? (h - u > 180 ? u += 360 : u - h > 180 && (h += 360), c.push({ + i: f.push(n(f) + "rotate(", null, r) - 2, + x: te(h, u) + })) : u && f.push(n(f) + "rotate(" + u + r); + } + + function a(h, u, f, c) { + h !== u ? c.push({i: f.push(n(f) + "skewX(", null, r) - 2, x: te(h, u)}) : u && f.push(n(f) + "skewX(" + u + r); + } + + function l(h, u, f, c, d, m) { + if (h !== f || u !== c) { + var S = d.push(n(d) + "scale(", null, ",", null, ")"); + m.push({i: S - 4, x: te(h, f)}, {i: S - 2, x: te(u, c)}); + } else + (f !== 1 || c !== 1) && d.push(n(d) + "scale(" + f + "," + c + ")"); + } + + return function (h, u) { + var f = [], c = []; + return h = t(h), u = t(u), o(h.translateX, h.translateY, u.translateX, u.translateY, f, c), s(h.rotate, u.rotate, f, c), a(h.skewX, u.skewX, f, c), l(h.scaleX, h.scaleY, u.scaleX, u.scaleY, f, c), h = u = null, function (d) { + for (var m = -1, S = c.length, O; ++m < S;) + f[(O = c[m]).i] = O.x(d); + return f.join(""); + }; + }; +} + +var bu = ra(Cu, "px, ", "px)", "deg)"), Tu = ra(xu, ", ", ")", ")"), Le = 0, Ve = 0, He = 0, na = 1e3, Gi, Xe, Vi = 0, + pe = 0, dr = 0, si = typeof performance == "object" && performance.now ? performance : Date, + oa = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (t) { + setTimeout(t, 17); + }; + +function wn() { + return pe || (oa(ku), pe = si.now() + dr); +} + +function ku() { + pe = 0; +} + +function Xi() { + this._call = this._time = this._next = null; +} + +Xi.prototype = sa.prototype = { + constructor: Xi, + restart: function (t, e, i) { + if (typeof t != "function") + throw new TypeError("callback is not a function"); + i = (i == null ? wn() : +i) + (e == null ? 0 : +e), !this._next && Xe !== this && (Xe ? Xe._next = this : Gi = this, Xe = this), this._call = t, this._time = i, rn(); + }, + stop: function () { + this._call && (this._call = null, this._time = 1 / 0, rn()); + } +}; + +function sa(t, e, i) { + var r = new Xi(); + return r.restart(t, e, i), r; +} + +function Su() { + wn(), ++Le; + for (var t = Gi, e; t;) + (e = pe - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --Le; +} + +function $o() { + pe = (Vi = si.now()) + dr, Le = Ve = 0; + try { + Su(); + } finally { + Le = 0, wu(), pe = 0; + } +} + +function vu() { + var t = si.now(), e = t - Vi; + e > na && (dr -= e, Vi = t); +} + +function wu() { + for (var t, e = Gi, 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 : Gi = i); + Xe = t, rn(r); +} + +function rn(t) { + if (!Le) { + Ve && (Ve = clearTimeout(Ve)); + var e = t - pe; + e > 24 ? (t < 1 / 0 && (Ve = setTimeout($o, t - si.now() - dr)), He && (He = clearInterval(He))) : (He || (Vi = si.now(), He = setInterval(vu, na)), Le = 1, oa($o)); + } +} + +function Io(t, e, i) { + var r = new Xi(); + return e = e == null ? 0 : +e, r.restart((n) => { + r.stop(), t(n + e); + }, e, i), r; +} + +var Bu = Ps("start", "end", "cancel", "interrupt"), Fu = [], aa = 0, Do = 1, nn = 2, $i = 3, No = 4, on = 5, Ii = 6; + +function pr(t, e, i, r, n, o) { + var s = t.__transition; + if (!s) + t.__transition = {}; + else if (i in s) + return; + Au(t, i, { + name: e, + index: r, + // For context during callback. + group: n, + // For context during callback. + on: Bu, + tween: Fu, + time: o.time, + delay: o.delay, + duration: o.duration, + ease: o.ease, + timer: null, + state: aa + }); +} + +function Bn(t, e) { + var i = At(t, e); + if (i.state > aa) + throw new Error("too late; already scheduled"); + return i; +} + +function It(t, e) { + var i = At(t, e); + if (i.state > $i) + throw new Error("too late; already running"); + return i; +} + +function At(t, e) { + var i = t.__transition; + if (!i || !(i = i[e])) + throw new Error("transition not found"); + return i; +} + +function Au(t, e, i) { + var r = t.__transition, n; + r[e] = i, i.timer = sa(o, 0, i.time); + + function o(h) { + i.state = Do, i.timer.restart(s, i.delay, i.time), i.delay <= h && s(h - i.delay); + } + + function s(h) { + var u, f, c, d; + if (i.state !== Do) + return l(); + for (u in r) + if (d = r[u], d.name === i.name) { + if (d.state === $i) + return Io(s); + d.state === No ? (d.state = Ii, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = Ii, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]); + } + if (Io(function () { + i.state === $i && (i.state = No, i.timer.restart(a, i.delay, i.time), a(h)); + }), i.state = nn, i.on.call("start", t, t.__data__, i.index, i.group), i.state === nn) { + for (i.state = $i, n = new Array(c = i.tween.length), u = 0, f = -1; u < c; ++u) + (d = i.tween[u].value.call(t, t.__data__, i.index, i.group)) && (n[++f] = d); + n.length = f + 1; + } + } + + function a(h) { + for (var u = h < i.duration ? i.ease.call(null, h / i.duration) : (i.timer.restart(l), i.state = on, 1), f = -1, c = n.length; ++f < c;) + n[f].call(t, u); + i.state === on && (i.on.call("end", t, t.__data__, i.index, i.group), l()); + } + + function l() { + i.state = Ii, i.timer.stop(), delete r[e]; + for (var h in r) + return; + delete t.__transition; + } +} + +function Lu(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 > nn && r.state < on, r.state = Ii, r.timer.stop(), r.on.call(n ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete i[s]; + } + o && delete t.__transition; + } +} + +function Eu(t) { + return this.each(function () { + Lu(this, t); + }); +} + +function Mu(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 Ou(t, e, i) { + var r, n; + if (typeof i != "function") + throw new Error(); + return function () { + var o = It(this, t), s = o.tween; + if (s !== r) { + n = (r = s).slice(); + for (var a = {name: e, value: i}, l = 0, h = n.length; l < h; ++l) + if (n[l].name === e) { + n[l] = a; + break; + } + l === h && n.push(a); + } + o.tween = n; + }; +} + +function $u(t, e) { + var i = this._id; + if (t += "", arguments.length < 2) { + for (var r = At(this.node(), i).tween, n = 0, o = r.length, s; n < o; ++n) + if ((s = r[n]).name === t) + return s.value; + return null; + } + return this.each((e == null ? Mu : Ou)(i, t, e)); +} + +function Fn(t, e, i) { + var r = t._id; + return t.each(function () { + var n = It(this, r); + (n.value || (n.value = {}))[e] = i.apply(this, arguments); + }), function (n) { + return At(n, r).value[e]; + }; +} + +function la(t, e) { + var i; + return (typeof e == "number" ? te : e instanceof oi ? Mo : (i = oi(e)) ? (e = i, Mo) : _u)(t, e); +} + +function Iu(t) { + return function () { + this.removeAttribute(t); + }; +} + +function Du(t) { + return function () { + this.removeAttributeNS(t.space, t.local); + }; +} + +function Nu(t, e, i) { + var r, n = i + "", o; + return function () { + var s = this.getAttribute(t); + return s === n ? null : s === r ? o : o = e(r = s, i); + }; +} + +function Ru(t, e, i) { + var r, n = i + "", o; + return function () { + var s = this.getAttributeNS(t.space, t.local); + return s === n ? null : s === r ? o : o = e(r = s, i); + }; +} + +function Pu(t, e, i) { + var r, n, o; + return function () { + var s, a = i(this), l; + return a == null ? void this.removeAttribute(t) : (s = this.getAttribute(t), l = a + "", s === l ? null : s === r && l === n ? o : (n = l, o = e(r = s, a))); + }; +} + +function qu(t, e, i) { + var r, n, o; + return function () { + var s, a = i(this), l; + return a == null ? void this.removeAttributeNS(t.space, t.local) : (s = this.getAttributeNS(t.space, t.local), l = a + "", s === l ? null : s === r && l === n ? o : (n = l, o = e(r = s, a))); + }; +} + +function zu(t, e) { + var i = fr(t), r = i === "transform" ? Tu : la; + return this.attrTween(t, typeof e == "function" ? (i.local ? qu : Pu)(i, r, Fn(this, "attr." + t, e)) : e == null ? (i.local ? Du : Iu)(i) : (i.local ? Ru : Nu)(i, r, e)); +} + +function Wu(t, e) { + return function (i) { + this.setAttribute(t, e.call(this, i)); + }; +} + +function Hu(t, e) { + return function (i) { + this.setAttributeNS(t.space, t.local, e.call(this, i)); + }; +} + +function ju(t, e) { + var i, r; + + function n() { + var o = e.apply(this, arguments); + return o !== r && (i = (r = o) && Hu(t, o)), i; + } + + return n._value = e, n; +} + +function Uu(t, e) { + var i, r; + + function n() { + var o = e.apply(this, arguments); + return o !== r && (i = (r = o) && Wu(t, o)), i; + } + + return n._value = e, n; +} + +function Yu(t, e) { + var i = "attr." + t; + if (arguments.length < 2) + return (i = this.tween(i)) && i._value; + if (e == null) + return this.tween(i, null); + if (typeof e != "function") + throw new Error(); + var r = fr(t); + return this.tween(i, (r.local ? ju : Uu)(r, e)); +} + +function Gu(t, e) { + return function () { + Bn(this, t).delay = +e.apply(this, arguments); + }; +} + +function Vu(t, e) { + return e = +e, function () { + Bn(this, t).delay = e; + }; +} + +function Xu(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? Gu : Vu)(e, t)) : At(this.node(), e).delay; +} + +function Ku(t, e) { + return function () { + It(this, t).duration = +e.apply(this, arguments); + }; +} + +function Zu(t, e) { + return e = +e, function () { + It(this, t).duration = e; + }; +} + +function Ju(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? Ku : Zu)(e, t)) : At(this.node(), e).duration; +} + +function Qu(t, e) { + if (typeof e != "function") + throw new Error(); + return function () { + It(this, t).ease = e; + }; +} + +function tf(t) { + var e = this._id; + return arguments.length ? this.each(Qu(e, t)) : At(this.node(), e).ease; +} + +function ef(t, e) { + return function () { + var i = e.apply(this, arguments); + if (typeof i != "function") + throw new Error(); + It(this, t).ease = i; + }; +} + +function rf(t) { + if (typeof t != "function") + throw new Error(); + return this.each(ef(this._id, t)); +} + +function nf(t) { + typeof t != "function" && (t = Ws(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 Vt(r, this._parents, this._name, this._id); +} + +function of(t) { + if (t._id !== this._id) + throw new Error(); + for (var e = this._groups, i = t._groups, r = e.length, n = i.length, o = Math.min(r, n), s = new Array(r), a = 0; a < o; ++a) + for (var l = e[a], h = i[a], u = l.length, f = s[a] = new Array(u), c, d = 0; d < u; ++d) + (c = l[d] || h[d]) && (f[d] = c); + for (; a < r; ++a) + s[a] = e[a]; + return new Vt(s, this._parents, this._name, this._id); +} + +function sf(t) { + return (t + "").trim().split(/^|\s+/).every(function (e) { + var i = e.indexOf("."); + return i >= 0 && (e = e.slice(0, i)), !e || e === "start"; + }); +} + +function af(t, e, i) { + var r, n, o = sf(e) ? Bn : It; + return function () { + var s = o(this, t), a = s.on; + a !== r && (n = (r = a).copy()).on(e, i), s.on = n; + }; +} + +function lf(t, e) { + var i = this._id; + return arguments.length < 2 ? At(this.node(), i).on.on(t) : this.each(af(i, t, e)); +} + +function hf(t) { + return function () { + var e = this.parentNode; + for (var i in this.__transition) + if (+i !== t) + return; + e && e.removeChild(this); + }; +} + +function cf() { + return this.on("end.remove", hf(this._id)); +} + +function uf(t) { + var e = this._name, i = this._id; + typeof t != "function" && (t = Tn(t)); + for (var r = this._groups, n = r.length, o = new Array(n), s = 0; s < n; ++s) + for (var a = r[s], l = a.length, h = o[s] = new Array(l), u, f, c = 0; c < l; ++c) + (u = a[c]) && (f = t.call(u, u.__data__, c, a)) && ("__data__" in u && (f.__data__ = u.__data__), h[c] = f, pr(h[c], e, i, c, h, At(u, i))); + return new Vt(o, this._parents, e, i); +} + +function ff(t) { + var e = this._name, i = this._id; + typeof t != "function" && (t = zs(t)); + for (var r = this._groups, n = r.length, o = [], s = [], a = 0; a < n; ++a) + for (var l = r[a], h = l.length, u, f = 0; f < h; ++f) + if (u = l[f]) { + for (var c = t.call(u, u.__data__, f, l), d, m = At(u, i), S = 0, O = c.length; S < O; ++S) + (d = c[S]) && pr(d, e, i, S, c, m); + o.push(c), s.push(u); + } + return new Vt(o, s, e, i); +} + +var df = di.prototype.constructor; + +function pf() { + return new df(this._groups, this._parents); +} + +function gf(t, e) { + var i, r, n; + return function () { + var o = Ae(this, t), s = (this.style.removeProperty(t), Ae(this, t)); + return o === s ? null : o === i && s === r ? n : n = e(i = o, r = s); + }; +} + +function ha(t) { + return function () { + this.style.removeProperty(t); + }; +} + +function mf(t, e, i) { + var r, n = i + "", o; + return function () { + var s = Ae(this, t); + return s === n ? null : s === r ? o : o = e(r = s, i); + }; +} + +function yf(t, e, i) { + var r, n, o; + return function () { + var s = Ae(this, t), a = i(this), l = a + ""; + return a == null && (l = a = (this.style.removeProperty(t), Ae(this, t))), s === l ? null : s === r && l === n ? o : (n = l, o = e(r = s, a)); + }; +} + +function _f(t, e) { + var i, r, n, o = "style." + e, s = "end." + o, a; + return function () { + var l = It(this, t), h = l.on, u = l.value[o] == null ? a || (a = ha(e)) : void 0; + (h !== i || n !== u) && (r = (i = h).copy()).on(s, n = u), l.on = r; + }; +} + +function Cf(t, e, i) { + var r = (t += "") == "transform" ? bu : la; + return e == null ? this.styleTween(t, gf(t, r)).on("end.style." + t, ha(t)) : typeof e == "function" ? this.styleTween(t, yf(t, r, Fn(this, "style." + t, e))).each(_f(this._id, t)) : this.styleTween(t, mf(t, r, e), i).on("end.style." + t, null); +} + +function xf(t, e, i) { + return function (r) { + this.style.setProperty(t, e.call(this, r), i); + }; +} + +function bf(t, e, i) { + var r, n; + + function o() { + var s = e.apply(this, arguments); + return s !== n && (r = (n = s) && xf(t, s, i)), r; + } + + return o._value = e, o; +} + +function Tf(t, e, i) { + var r = "style." + (t += ""); + if (arguments.length < 2) + return (r = this.tween(r)) && r._value; + if (e == null) + return this.tween(r, null); + if (typeof e != "function") + throw new Error(); + return this.tween(r, bf(t, e, i ?? "")); +} + +function kf(t) { + return function () { + this.textContent = t; + }; +} + +function Sf(t) { + return function () { + var e = t(this); + this.textContent = e ?? ""; + }; +} + +function vf(t) { + return this.tween("text", typeof t == "function" ? Sf(Fn(this, "text", t)) : kf(t == null ? "" : t + "")); +} + +function wf(t) { + return function (e) { + this.textContent = t.call(this, e); + }; +} + +function Bf(t) { + var e, i; + + function r() { + var n = t.apply(this, arguments); + return n !== i && (e = (i = n) && wf(n)), e; + } + + return r._value = t, r; +} + +function Ff(t) { + var e = "text"; + if (arguments.length < 1) + return (e = this.tween(e)) && e._value; + if (t == null) + return this.tween(e, null); + if (typeof t != "function") + throw new Error(); + return this.tween(e, Bf(t)); +} + +function Af() { + for (var t = this._name, e = this._id, i = ca(), r = this._groups, n = r.length, o = 0; o < n; ++o) + for (var s = r[o], a = s.length, l, h = 0; h < a; ++h) + if (l = s[h]) { + var u = At(l, e); + pr(l, t, i, h, s, { + time: u.time + u.delay + u.duration, + delay: 0, + duration: u.duration, + ease: u.ease + }); + } + return new Vt(r, this._parents, t, i); +} + +function Lf() { + var t, e, i = this, r = i._id, n = i.size(); + return new Promise(function (o, s) { + var a = {value: s}, l = { + value: function () { + --n === 0 && o(); + } + }; + i.each(function () { + var h = It(this, r), u = h.on; + u !== t && (e = (t = u).copy(), e._.cancel.push(a), e._.interrupt.push(a), e._.end.push(l)), h.on = e; + }), n === 0 && o(); + }); +} + +var Ef = 0; + +function Vt(t, e, i, r) { + this._groups = t, this._parents = e, this._name = i, this._id = r; +} + +function ca() { + return ++Ef; +} + +var Ht = di.prototype; +Vt.prototype = { + constructor: Vt, + select: uf, + selectAll: ff, + selectChild: Ht.selectChild, + selectChildren: Ht.selectChildren, + filter: nf, + merge: of, + selection: pf, + transition: Af, + call: Ht.call, + nodes: Ht.nodes, + node: Ht.node, + size: Ht.size, + empty: Ht.empty, + each: Ht.each, + on: lf, + attr: zu, + attrTween: Yu, + style: Cf, + styleTween: Tf, + text: vf, + textTween: Ff, + remove: cf, + tween: $u, + delay: Xu, + duration: Ju, + ease: tf, + easeVarying: rf, + end: Lf, + [Symbol.iterator]: Ht[Symbol.iterator] +}; + +function Mf(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +} + +var Of = { + time: null, + // Set on use. + delay: 0, + duration: 250, + ease: Mf +}; + +function $f(t, e) { + for (var i; !(i = t.__transition) || !(i = i[e]);) + if (!(t = t.parentNode)) + throw new Error(`transition ${e} not found`); + return i; +} + +function If(t) { + var e, i; + t instanceof Vt ? (e = t._id, t = t._name) : (e = ca(), (i = Of).time = wn(), t = t == null ? null : t + ""); + for (var r = this._groups, n = r.length, o = 0; o < n; ++o) + for (var s = r[o], a = s.length, l, h = 0; h < a; ++h) + (l = s[h]) && pr(l, t, e, h, s, i || $f(l, e)); + return new Vt(r, this._parents, t, e); +} + +di.prototype.interrupt = Eu; +di.prototype.transition = If; +const h1 = Math.abs, c1 = Math.atan2, u1 = Math.cos, f1 = Math.max, d1 = Math.min, p1 = Math.sin, g1 = Math.sqrt, + Ro = 1e-12, An = Math.PI, Po = An / 2, m1 = 2 * An; + +function y1(t) { + return t > 1 ? 0 : t < -1 ? An : Math.acos(t); +} + +function _1(t) { + return t >= 1 ? Po : t <= -1 ? -Po : Math.asin(t); +} + +function ua(t) { + this._context = t; +} + +ua.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._point = 0; + }, + lineEnd: function () { + (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line; + }, + point: function (t, e) { + switch (t = +t, e = +e, this._point) { + case 0: + this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + default: + this._context.lineTo(t, e); + break; + } + } +}; + +function Df(t) { + return new ua(t); +} + +class fa { + constructor(e, i) { + this._context = e, this._x = i; + } + + areaStart() { + this._line = 0; + } + + areaEnd() { + this._line = NaN; + } + + lineStart() { + this._point = 0; + } + + lineEnd() { + (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line; + } + + point(e, i) { + switch (e = +e, i = +i, this._point) { + case 0: { + this._point = 1, this._line ? this._context.lineTo(e, i) : this._context.moveTo(e, i); + break; + } + case 1: + this._point = 2; + default: { + this._x ? this._context.bezierCurveTo(this._x0 = (this._x0 + e) / 2, this._y0, this._x0, i, e, i) : this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + i) / 2, e, this._y0, e, i); + break; + } + } + this._x0 = e, this._y0 = i; + } +} + +function Nf(t) { + return new fa(t, !0); +} + +function Rf(t) { + return new fa(t, !1); +} + +function ie() { +} + +function Ki(t, e, i) { + t._context.bezierCurveTo( + (2 * t._x0 + t._x1) / 3, + (2 * t._y0 + t._y1) / 3, + (t._x0 + 2 * t._x1) / 3, + (t._y0 + 2 * t._y1) / 3, + (t._x0 + 4 * t._x1 + e) / 6, + (t._y0 + 4 * t._y1 + i) / 6 + ); +} + +function gr(t) { + this._context = t; +} + +gr.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0; + }, + lineEnd: function () { + switch (this._point) { + case 3: + Ki(this, this._x1, this._y1); + case 2: + this._context.lineTo(this._x1, this._y1); + break; + } + (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line; + }, + point: function (t, e) { + switch (t = +t, e = +e, this._point) { + case 0: + this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3, this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); + default: + Ki(this, t, e); + break; + } + this._x0 = this._x1, this._x1 = t, this._y0 = this._y1, this._y1 = e; + } +}; + +function Pf(t) { + return new gr(t); +} + +function da(t) { + this._context = t; +} + +da.prototype = { + areaStart: ie, + areaEnd: ie, + lineStart: function () { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN, this._point = 0; + }, + lineEnd: function () { + switch (this._point) { + case 1: { + this._context.moveTo(this._x2, this._y2), this._context.closePath(); + break; + } + case 2: { + this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3), this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3), this._context.closePath(); + break; + } + case 3: { + this.point(this._x2, this._y2), this.point(this._x3, this._y3), this.point(this._x4, this._y4); + break; + } + } + }, + point: function (t, e) { + switch (t = +t, e = +e, this._point) { + case 0: + this._point = 1, this._x2 = t, this._y2 = e; + break; + case 1: + this._point = 2, this._x3 = t, this._y3 = e; + break; + case 2: + this._point = 3, this._x4 = t, this._y4 = e, this._context.moveTo((this._x0 + 4 * this._x1 + t) / 6, (this._y0 + 4 * this._y1 + e) / 6); + break; + default: + Ki(this, t, e); + break; + } + this._x0 = this._x1, this._x1 = t, this._y0 = this._y1, this._y1 = e; + } +}; + +function qf(t) { + return new da(t); +} + +function pa(t) { + this._context = t; +} + +pa.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0; + }, + lineEnd: function () { + (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line; + }, + point: function (t, e) { + switch (t = +t, e = +e, this._point) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + var i = (this._x0 + 4 * this._x1 + t) / 6, r = (this._y0 + 4 * this._y1 + e) / 6; + this._line ? this._context.lineTo(i, r) : this._context.moveTo(i, r); + break; + case 3: + this._point = 4; + default: + Ki(this, t, e); + break; + } + this._x0 = this._x1, this._x1 = t, this._y0 = this._y1, this._y1 = e; + } +}; + +function zf(t) { + return new pa(t); +} + +function ga(t, e) { + this._basis = new gr(t), this._beta = e; +} + +ga.prototype = { + lineStart: function () { + this._x = [], this._y = [], this._basis.lineStart(); + }, + lineEnd: function () { + var t = this._x, e = this._y, i = t.length - 1; + if (i > 0) + for (var r = t[0], n = e[0], o = t[i] - r, s = e[i] - n, a = -1, l; ++a <= i;) + l = a / i, this._basis.point( + this._beta * t[a] + (1 - this._beta) * (r + l * o), + this._beta * e[a] + (1 - this._beta) * (n + l * s) + ); + this._x = this._y = null, this._basis.lineEnd(); + }, + point: function (t, e) { + this._x.push(+t), this._y.push(+e); + } +}; +const Wf = function t(e) { + function i(r) { + return e === 1 ? new gr(r) : new ga(r, e); + } + + return i.beta = function (r) { + return t(+r); + }, i; +}(0.85); + +function Zi(t, e, i) { + t._context.bezierCurveTo( + t._x1 + t._k * (t._x2 - t._x0), + t._y1 + t._k * (t._y2 - t._y0), + t._x2 + t._k * (t._x1 - e), + t._y2 + t._k * (t._y1 - i), + t._x2, + t._y2 + ); +} + +function Ln(t, e) { + this._context = t, this._k = (1 - e) / 6; +} + +Ln.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0; + }, + lineEnd: function () { + switch (this._point) { + case 2: + this._context.lineTo(this._x2, this._y2); + break; + case 3: + Zi(this, this._x1, this._y1); + break; + } + (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line; + }, + point: function (t, e) { + switch (t = +t, e = +e, this._point) { + case 0: + this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2, this._x1 = t, this._y1 = e; + break; + case 2: + this._point = 3; + default: + Zi(this, t, e); + break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e; + } +}; +const Hf = function t(e) { + function i(r) { + return new Ln(r, e); + } + + return i.tension = function (r) { + return t(+r); + }, i; +}(0); + +function En(t, e) { + this._context = t, this._k = (1 - e) / 6; +} + +En.prototype = { + areaStart: ie, + areaEnd: ie, + lineStart: function () { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._point = 0; + }, + lineEnd: function () { + switch (this._point) { + case 1: { + this._context.moveTo(this._x3, this._y3), this._context.closePath(); + break; + } + case 2: { + this._context.lineTo(this._x3, this._y3), this._context.closePath(); + break; + } + case 3: { + this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5); + break; + } + } + }, + point: function (t, e) { + switch (t = +t, e = +e, this._point) { + case 0: + this._point = 1, this._x3 = t, this._y3 = e; + break; + case 1: + this._point = 2, this._context.moveTo(this._x4 = t, this._y4 = e); + break; + case 2: + this._point = 3, this._x5 = t, this._y5 = e; + break; + default: + Zi(this, t, e); + break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e; + } +}; +const jf = function t(e) { + function i(r) { + return new En(r, e); + } + + return i.tension = function (r) { + return t(+r); + }, i; +}(0); + +function Mn(t, e) { + this._context = t, this._k = (1 - e) / 6; +} + +Mn.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0; + }, + lineEnd: function () { + (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line; + }, + point: function (t, e) { + switch (t = +t, e = +e, this._point) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); + break; + case 3: + this._point = 4; + default: + Zi(this, t, e); + break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e; + } +}; +const Uf = function t(e) { + function i(r) { + return new Mn(r, e); + } + + return i.tension = function (r) { + return t(+r); + }, i; +}(0); + +function On(t, e, i) { + var r = t._x1, n = t._y1, o = t._x2, s = t._y2; + if (t._l01_a > Ro) { + var a = 2 * t._l01_2a + 3 * t._l01_a * t._l12_a + t._l12_2a, l = 3 * t._l01_a * (t._l01_a + t._l12_a); + r = (r * a - t._x0 * t._l12_2a + t._x2 * t._l01_2a) / l, n = (n * a - t._y0 * t._l12_2a + t._y2 * t._l01_2a) / l; + } + if (t._l23_a > Ro) { + var h = 2 * t._l23_2a + 3 * t._l23_a * t._l12_a + t._l12_2a, u = 3 * t._l23_a * (t._l23_a + t._l12_a); + o = (o * h + t._x1 * t._l23_2a - e * t._l12_2a) / u, s = (s * h + t._y1 * t._l23_2a - i * t._l12_2a) / u; + } + t._context.bezierCurveTo(r, n, o, s, t._x2, t._y2); +} + +function ma(t, e) { + this._context = t, this._alpha = e; +} + +ma.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; + }, + lineEnd: function () { + switch (this._point) { + case 2: + this._context.lineTo(this._x2, this._y2); + break; + case 3: + this.point(this._x2, this._y2); + break; + } + (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line; + }, + point: function (t, e) { + if (t = +t, e = +e, this._point) { + var i = this._x2 - t, r = this._y2 - e; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(i * i + r * r, this._alpha)); + } + switch (this._point) { + case 0: + this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + default: + On(this, t, e); + break; + } + this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e; + } +}; +const Yf = function t(e) { + function i(r) { + return e ? new ma(r, e) : new Ln(r, 0); + } + + return i.alpha = function (r) { + return t(+r); + }, i; +}(0.5); + +function ya(t, e) { + this._context = t, this._alpha = e; +} + +ya.prototype = { + areaStart: ie, + areaEnd: ie, + lineStart: function () { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; + }, + lineEnd: function () { + switch (this._point) { + case 1: { + this._context.moveTo(this._x3, this._y3), this._context.closePath(); + break; + } + case 2: { + this._context.lineTo(this._x3, this._y3), this._context.closePath(); + break; + } + case 3: { + this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5); + break; + } + } + }, + point: function (t, e) { + if (t = +t, e = +e, this._point) { + var i = this._x2 - t, r = this._y2 - e; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(i * i + r * r, this._alpha)); + } + switch (this._point) { + case 0: + this._point = 1, this._x3 = t, this._y3 = e; + break; + case 1: + this._point = 2, this._context.moveTo(this._x4 = t, this._y4 = e); + break; + case 2: + this._point = 3, this._x5 = t, this._y5 = e; + break; + default: + On(this, t, e); + break; + } + this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e; + } +}; +const Gf = function t(e) { + function i(r) { + return e ? new ya(r, e) : new En(r, 0); + } + + return i.alpha = function (r) { + return t(+r); + }, i; +}(0.5); + +function _a(t, e) { + this._context = t, this._alpha = e; +} + +_a.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; + }, + lineEnd: function () { + (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line; + }, + point: function (t, e) { + if (t = +t, e = +e, this._point) { + var i = this._x2 - t, r = this._y2 - e; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(i * i + r * r, this._alpha)); + } + switch (this._point) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); + break; + case 3: + this._point = 4; + default: + On(this, t, e); + break; + } + this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e; + } +}; +const Vf = function t(e) { + function i(r) { + return e ? new _a(r, e) : new Mn(r, 0); + } + + return i.alpha = function (r) { + return t(+r); + }, i; +}(0.5); + +function Ca(t) { + this._context = t; +} + +Ca.prototype = { + areaStart: ie, + areaEnd: ie, + lineStart: function () { + this._point = 0; + }, + lineEnd: function () { + this._point && this._context.closePath(); + }, + point: function (t, e) { + t = +t, e = +e, this._point ? this._context.lineTo(t, e) : (this._point = 1, this._context.moveTo(t, e)); + } +}; + +function Xf(t) { + return new Ca(t); +} + +function qo(t) { + return t < 0 ? -1 : 1; +} + +function zo(t, e, i) { + var r = t._x1 - t._x0, n = e - t._x1, o = (t._y1 - t._y0) / (r || n < 0 && -0), + s = (i - t._y1) / (n || r < 0 && -0), a = (o * n + s * r) / (r + n); + return (qo(o) + qo(s)) * Math.min(Math.abs(o), Math.abs(s), 0.5 * Math.abs(a)) || 0; +} + +function Wo(t, e) { + var i = t._x1 - t._x0; + return i ? (3 * (t._y1 - t._y0) / i - e) / 2 : e; +} + +function Rr(t, e, i) { + var r = t._x0, n = t._y0, o = t._x1, s = t._y1, a = (o - r) / 3; + t._context.bezierCurveTo(r + a, n + a * e, o - a, s - a * i, o, s); +} + +function Ji(t) { + this._context = t; +} + +Ji.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN, this._point = 0; + }, + lineEnd: function () { + switch (this._point) { + case 2: + this._context.lineTo(this._x1, this._y1); + break; + case 3: + Rr(this, this._t0, Wo(this, this._t0)); + break; + } + (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line; + }, + point: function (t, e) { + var i = NaN; + if (t = +t, e = +e, !(t === this._x1 && e === this._y1)) { + switch (this._point) { + case 0: + this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3, Rr(this, Wo(this, i = zo(this, t, e)), i); + break; + default: + Rr(this, this._t0, i = zo(this, t, e)); + break; + } + this._x0 = this._x1, this._x1 = t, this._y0 = this._y1, this._y1 = e, this._t0 = i; + } + } +}; + +function xa(t) { + this._context = new ba(t); +} + +(xa.prototype = Object.create(Ji.prototype)).point = function (t, e) { + Ji.prototype.point.call(this, e, t); +}; + +function ba(t) { + this._context = t; +} + +ba.prototype = { + moveTo: function (t, e) { + this._context.moveTo(e, t); + }, + closePath: function () { + this._context.closePath(); + }, + lineTo: function (t, e) { + this._context.lineTo(e, t); + }, + bezierCurveTo: function (t, e, i, r, n, o) { + this._context.bezierCurveTo(e, t, r, i, o, n); + } +}; + +function Kf(t) { + return new Ji(t); +} + +function Zf(t) { + return new xa(t); +} + +function Ta(t) { + this._context = t; +} + +Ta.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._x = [], this._y = []; + }, + lineEnd: function () { + var t = this._x, e = this._y, i = t.length; + if (i) + if (this._line ? this._context.lineTo(t[0], e[0]) : this._context.moveTo(t[0], e[0]), i === 2) + this._context.lineTo(t[1], e[1]); + else + for (var r = Ho(t), n = Ho(e), o = 0, s = 1; s < i; ++o, ++s) + this._context.bezierCurveTo(r[0][o], n[0][o], r[1][o], n[1][o], t[s], e[s]); + (this._line || this._line !== 0 && i === 1) && this._context.closePath(), this._line = 1 - this._line, this._x = this._y = null; + }, + point: function (t, e) { + this._x.push(+t), this._y.push(+e); + } +}; + +function Ho(t) { + var e, i = t.length - 1, r, n = new Array(i), o = new Array(i), s = new Array(i); + for (n[0] = 0, o[0] = 2, s[0] = t[0] + 2 * t[1], e = 1; e < i - 1; ++e) + n[e] = 1, o[e] = 4, s[e] = 4 * t[e] + 2 * t[e + 1]; + for (n[i - 1] = 2, o[i - 1] = 7, s[i - 1] = 8 * t[i - 1] + t[i], e = 1; e < i; ++e) + r = n[e] / o[e - 1], o[e] -= r, s[e] -= r * s[e - 1]; + for (n[i - 1] = s[i - 1] / o[i - 1], e = i - 2; e >= 0; --e) + n[e] = (s[e] - n[e + 1]) / o[e]; + for (o[i - 1] = (t[i] + n[i - 1]) / 2, e = 0; e < i - 1; ++e) + o[e] = 2 * t[e + 1] - n[e + 1]; + return [n, o]; +} + +function Jf(t) { + return new Ta(t); +} + +function mr(t, e) { + this._context = t, this._t = e; +} + +mr.prototype = { + areaStart: function () { + this._line = 0; + }, + areaEnd: function () { + this._line = NaN; + }, + lineStart: function () { + this._x = this._y = NaN, this._point = 0; + }, + lineEnd: function () { + 0 < this._t && this._t < 1 && this._point === 2 && this._context.lineTo(this._x, this._y), (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line >= 0 && (this._t = 1 - this._t, this._line = 1 - this._line); + }, + point: function (t, e) { + switch (t = +t, e = +e, this._point) { + case 0: + this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); + break; + case 1: + this._point = 2; + default: { + if (this._t <= 0) + this._context.lineTo(this._x, e), this._context.lineTo(t, e); + else { + var i = this._x * (1 - this._t) + t * this._t; + this._context.lineTo(i, this._y), this._context.lineTo(i, e); + } + break; + } + } + this._x = t, this._y = e; + } +}; + +function Qf(t) { + return new mr(t, 0.5); +} + +function td(t) { + return new mr(t, 0); +} + +function ed(t) { + return new mr(t, 1); +} + +function Ke(t, e, i) { + this.k = t, this.x = e, this.y = i; +} + +Ke.prototype = { + constructor: Ke, + scale: function (t) { + return t === 1 ? this : new Ke(this.k * t, this.x, this.y); + }, + translate: function (t, e) { + return t === 0 & e === 0 ? this : new Ke(this.k, this.x + this.k * t, this.y + this.k * e); + }, + apply: function (t) { + return [t[0] * this.k + this.x, t[1] * this.k + this.y]; + }, + applyX: function (t) { + return t * this.k + this.x; + }, + applyY: function (t) { + return t * this.k + this.y; + }, + invert: function (t) { + return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k]; + }, + invertX: function (t) { + return (t - this.x) / this.k; + }, + invertY: function (t) { + return (t - this.y) / this.k; + }, + rescaleX: function (t) { + return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t)); + }, + rescaleY: function (t) { + return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t)); + }, + toString: function () { + return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; + } +}; +Ke.prototype; +/*! @license DOMPurify 3.0.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.9/LICENSE */ +const { + entries: ka, + setPrototypeOf: jo, + isFrozen: id, + getPrototypeOf: rd, + getOwnPropertyDescriptor: nd +} = Object; +let { + freeze: ct, + seal: Ft, + create: Sa +} = Object, { + apply: sn, + construct: an +} = typeof Reflect < "u" && Reflect; +ct || (ct = function (e) { + return e; +}); +Ft || (Ft = function (e) { + return e; +}); +sn || (sn = function (e, i, r) { + return e.apply(i, r); +}); +an || (an = function (e, i) { + return new e(...i); +}); +const wi = _t(Array.prototype.forEach), Uo = _t(Array.prototype.pop), je = _t(Array.prototype.push), + Di = _t(String.prototype.toLowerCase), Pr = _t(String.prototype.toString), od = _t(String.prototype.match), + Ue = _t(String.prototype.replace), sd = _t(String.prototype.indexOf), ad = _t(String.prototype.trim), + vt = _t(Object.prototype.hasOwnProperty), mt = _t(RegExp.prototype.test), Ye = ld(TypeError); + +function _t(t) { + return function (e) { + for (var i = arguments.length, r = new Array(i > 1 ? i - 1 : 0), n = 1; n < i; n++) + r[n - 1] = arguments[n]; + return sn(t, e, r); + }; +} + +function ld(t) { + return function () { + for (var e = arguments.length, i = new Array(e), r = 0; r < e; r++) + i[r] = arguments[r]; + return an(t, i); + }; +} + +function q(t, e) { + let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Di; + jo && jo(t, null); + let r = e.length; + for (; r--;) { + let n = e[r]; + if (typeof n == "string") { + const o = i(n); + o !== n && (id(e) || (e[r] = o), n = o); + } + t[n] = !0; + } + return t; +} + +function hd(t) { + for (let e = 0; e < t.length; e++) + vt(t, e) || (t[e] = null); + return t; +} + +function le(t) { + const e = Sa(null); + for (const [i, r] of ka(t)) + vt(t, i) && (Array.isArray(r) ? e[i] = hd(r) : r && typeof r == "object" && r.constructor === Object ? e[i] = le(r) : e[i] = r); + return e; +} + +function Bi(t, e) { + for (; t !== null;) { + const r = nd(t, e); + if (r) { + if (r.get) + return _t(r.get); + if (typeof r.value == "function") + return _t(r.value); + } + t = rd(t); + } + + function i() { + return null; + } + + return i; +} + +const Yo = ct(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), + qr = ct(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), + zr = ct(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), + cd = ct(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), + Wr = ct(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), + ud = ct(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), + Go = ct(["#text"]), + Vo = ct(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]), + Hr = ct(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), + Xo = ct(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), + Fi = ct(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), fd = Ft(/\{\{[\w\W]*|[\w\W]*\}\}/gm), + dd = Ft(/<%[\w\W]*|[\w\W]*%>/gm), pd = Ft(/\${[\w\W]*}/gm), gd = Ft(/^data-[\-\w.\u00B7-\uFFFF]/), + md = Ft(/^aria-[\-\w]+$/), va = Ft( + /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i + // eslint-disable-line no-useless-escape + ), yd = Ft(/^(?:\w+script|data):/i), _d = Ft( + /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g + // eslint-disable-line no-control-regex + ), wa = Ft(/^html$/i); +var Ko = /* @__PURE__ */ Object.freeze({ + __proto__: null, + MUSTACHE_EXPR: fd, + ERB_EXPR: dd, + TMPLIT_EXPR: pd, + DATA_ATTR: gd, + ARIA_ATTR: md, + IS_ALLOWED_URI: va, + IS_SCRIPT_OR_DATA: yd, + ATTR_WHITESPACE: _d, + DOCTYPE_NAME: wa +}); +const Cd = function () { + return typeof window > "u" ? null : window; +}, xd = function (e, i) { + if (typeof e != "object" || typeof e.createPolicy != "function") + return null; + let r = null; + const n = "data-tt-policy-suffix"; + i && i.hasAttribute(n) && (r = i.getAttribute(n)); + const o = "dompurify" + (r ? "#" + r : ""); + try { + return e.createPolicy(o, { + createHTML(s) { + return s; + }, + createScriptURL(s) { + return s; + } + }); + } catch { + return console.warn("TrustedTypes policy " + o + " could not be created."), null; + } +}; + +function Ba() { + let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Cd(); + const e = (B) => Ba(B); + if (e.version = "3.0.9", e.removed = [], !t || !t.document || t.document.nodeType !== 9) + return e.isSupported = !1, e; + let { + document: i + } = t; + const r = i, n = r.currentScript, { + DocumentFragment: o, + HTMLTemplateElement: s, + Node: a, + Element: l, + NodeFilter: h, + NamedNodeMap: u = t.NamedNodeMap || t.MozNamedAttrMap, + HTMLFormElement: f, + DOMParser: c, + trustedTypes: d + } = t, m = l.prototype, S = Bi(m, "cloneNode"), O = Bi(m, "nextSibling"), z = Bi(m, "childNodes"), + T = Bi(m, "parentNode"); + if (typeof s == "function") { + const B = i.createElement("template"); + B.content && B.content.ownerDocument && (i = B.content.ownerDocument); + } + let R, X = ""; + const { + implementation: G, + createNodeIterator: V, + createDocumentFragment: H, + getElementsByTagName: oe + } = i, { + importNode: Kt + } = r; + let P = {}; + e.isSupported = typeof ka == "function" && typeof T == "function" && G && G.createHTMLDocument !== void 0; + const { + MUSTACHE_EXPR: W, + ERB_EXPR: Ct, + TMPLIT_EXPR: Nt, + DATA_ATTR: M, + ARIA_ATTR: k, + IS_SCRIPT_OR_DATA: C, + ATTR_WHITESPACE: w + } = Ko; + let { + IS_ALLOWED_URI: x + } = Ko, b = null; + const D = q({}, [...Yo, ...qr, ...zr, ...Wr, ...Go]); + let I = null; + const Y = q({}, [...Vo, ...Hr, ...Xo, ...Fi]); + let N = Object.seal(Sa(null, { + tagNameCheck: { + writable: !0, + configurable: !1, + enumerable: !0, + value: null + }, + attributeNameCheck: { + writable: !0, + configurable: !1, + enumerable: !0, + value: null + }, + allowCustomizedBuiltInElements: { + writable: !0, + configurable: !1, + enumerable: !0, + value: !1 + } + })), K = null, et = null, Rt = !0, St = !0, Zt = !1, Lt = !0, Z = !1, it = !1, Pt = !1, Jt = !1, xe = !1, Ci = !1, + xi = !1, eo = !0, io = !1; + const ah = "user-content-"; + let Lr = !0, qe = !1, be = {}, Te = null; + const ro = q({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]); + let no = null; + const oo = q({}, ["audio", "video", "img", "source", "image", "track"]); + let Er = null; + const so = q({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), + bi = "http://www.w3.org/1998/Math/MathML", Ti = "http://www.w3.org/2000/svg", + qt = "http://www.w3.org/1999/xhtml"; + let ke = qt, Mr = !1, Or = null; + const lh = q({}, [bi, Ti, qt], Pr); + let ze = null; + const hh = ["application/xhtml+xml", "text/html"], ch = "text/html"; + let tt = null, Se = null; + const uh = i.createElement("form"), ao = function (p) { + return p instanceof RegExp || p instanceof Function; + }, $r = function () { + let p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + if (!(Se && Se === p)) { + if ((!p || typeof p != "object") && (p = {}), p = le(p), ze = // eslint-disable-next-line unicorn/prefer-includes + hh.indexOf(p.PARSER_MEDIA_TYPE) === -1 ? ch : p.PARSER_MEDIA_TYPE, tt = ze === "application/xhtml+xml" ? Pr : Di, b = vt(p, "ALLOWED_TAGS") ? q({}, p.ALLOWED_TAGS, tt) : D, I = vt(p, "ALLOWED_ATTR") ? q({}, p.ALLOWED_ATTR, tt) : Y, Or = vt(p, "ALLOWED_NAMESPACES") ? q({}, p.ALLOWED_NAMESPACES, Pr) : lh, Er = vt(p, "ADD_URI_SAFE_ATTR") ? q( + le(so), + // eslint-disable-line indent + p.ADD_URI_SAFE_ATTR, + // eslint-disable-line indent + tt + // eslint-disable-line indent + ) : so, no = vt(p, "ADD_DATA_URI_TAGS") ? q( + le(oo), + // eslint-disable-line indent + p.ADD_DATA_URI_TAGS, + // eslint-disable-line indent + tt + // eslint-disable-line indent + ) : oo, Te = vt(p, "FORBID_CONTENTS") ? q({}, p.FORBID_CONTENTS, tt) : ro, K = vt(p, "FORBID_TAGS") ? q({}, p.FORBID_TAGS, tt) : {}, et = vt(p, "FORBID_ATTR") ? q({}, p.FORBID_ATTR, tt) : {}, be = vt(p, "USE_PROFILES") ? p.USE_PROFILES : !1, Rt = p.ALLOW_ARIA_ATTR !== !1, St = p.ALLOW_DATA_ATTR !== !1, Zt = p.ALLOW_UNKNOWN_PROTOCOLS || !1, Lt = p.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = p.SAFE_FOR_TEMPLATES || !1, it = p.WHOLE_DOCUMENT || !1, xe = p.RETURN_DOM || !1, Ci = p.RETURN_DOM_FRAGMENT || !1, xi = p.RETURN_TRUSTED_TYPE || !1, Jt = p.FORCE_BODY || !1, eo = p.SANITIZE_DOM !== !1, io = p.SANITIZE_NAMED_PROPS || !1, Lr = p.KEEP_CONTENT !== !1, qe = p.IN_PLACE || !1, x = p.ALLOWED_URI_REGEXP || va, ke = p.NAMESPACE || qt, N = p.CUSTOM_ELEMENT_HANDLING || {}, p.CUSTOM_ELEMENT_HANDLING && ao(p.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (N.tagNameCheck = p.CUSTOM_ELEMENT_HANDLING.tagNameCheck), p.CUSTOM_ELEMENT_HANDLING && ao(p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (N.attributeNameCheck = p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), p.CUSTOM_ELEMENT_HANDLING && typeof p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (N.allowCustomizedBuiltInElements = p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Z && (St = !1), Ci && (xe = !0), be && (b = q({}, Go), I = [], be.html === !0 && (q(b, Yo), q(I, Vo)), be.svg === !0 && (q(b, qr), q(I, Hr), q(I, Fi)), be.svgFilters === !0 && (q(b, zr), q(I, Hr), q(I, Fi)), be.mathMl === !0 && (q(b, Wr), q(I, Xo), q(I, Fi))), p.ADD_TAGS && (b === D && (b = le(b)), q(b, p.ADD_TAGS, tt)), p.ADD_ATTR && (I === Y && (I = le(I)), q(I, p.ADD_ATTR, tt)), p.ADD_URI_SAFE_ATTR && q(Er, p.ADD_URI_SAFE_ATTR, tt), p.FORBID_CONTENTS && (Te === ro && (Te = le(Te)), q(Te, p.FORBID_CONTENTS, tt)), Lr && (b["#text"] = !0), it && q(b, ["html", "head", "body"]), b.table && (q(b, ["tbody"]), delete K.tbody), p.TRUSTED_TYPES_POLICY) { + if (typeof p.TRUSTED_TYPES_POLICY.createHTML != "function") + throw Ye('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); + if (typeof p.TRUSTED_TYPES_POLICY.createScriptURL != "function") + throw Ye('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); + R = p.TRUSTED_TYPES_POLICY, X = R.createHTML(""); + } else + R === void 0 && (R = xd(d, n)), R !== null && typeof X == "string" && (X = R.createHTML("")); + ct && ct(p), Se = p; + } + }, lo = q({}, ["mi", "mo", "mn", "ms", "mtext"]), ho = q({}, ["foreignobject", "desc", "title", "annotation-xml"]), + fh = q({}, ["title", "style", "font", "a", "script"]), co = q({}, [...qr, ...zr, ...cd]), + uo = q({}, [...Wr, ...ud]), dh = function (p) { + let y = T(p); + (!y || !y.tagName) && (y = { + namespaceURI: ke, + tagName: "template" + }); + const v = Di(p.tagName), j = Di(y.tagName); + return Or[p.namespaceURI] ? p.namespaceURI === Ti ? y.namespaceURI === qt ? v === "svg" : y.namespaceURI === bi ? v === "svg" && (j === "annotation-xml" || lo[j]) : !!co[v] : p.namespaceURI === bi ? y.namespaceURI === qt ? v === "math" : y.namespaceURI === Ti ? v === "math" && ho[j] : !!uo[v] : p.namespaceURI === qt ? y.namespaceURI === Ti && !ho[j] || y.namespaceURI === bi && !lo[j] ? !1 : !uo[v] && (fh[v] || !co[v]) : !!(ze === "application/xhtml+xml" && Or[p.namespaceURI]) : !1; + }, se = function (p) { + je(e.removed, { + element: p + }); + try { + p.parentNode.removeChild(p); + } catch { + p.remove(); + } + }, Ir = function (p, y) { + try { + je(e.removed, { + attribute: y.getAttributeNode(p), + from: y + }); + } catch { + je(e.removed, { + attribute: null, + from: y + }); + } + if (y.removeAttribute(p), p === "is" && !I[p]) + if (xe || Ci) + try { + se(y); + } catch { + } + else + try { + y.setAttribute(p, ""); + } catch { + } + }, fo = function (p) { + let y = null, v = null; + if (Jt) + p = "" + p; + else { + const nt = od(p, /^[\r\n\t ]+/); + v = nt && nt[0]; + } + ze === "application/xhtml+xml" && ke === qt && (p = '' + p + ""); + const j = R ? R.createHTML(p) : p; + if (ke === qt) + try { + y = new c().parseFromString(j, ze); + } catch { + } + if (!y || !y.documentElement) { + y = G.createDocument(ke, "template", null); + try { + y.documentElement.innerHTML = Mr ? X : j; + } catch { + } + } + const rt = y.body || y.documentElement; + return p && v && rt.insertBefore(i.createTextNode(v), rt.childNodes[0] || null), ke === qt ? oe.call(y, it ? "html" : "body")[0] : it ? y.documentElement : rt; + }, po = function (p) { + return V.call( + p.ownerDocument || p, + p, + // eslint-disable-next-line no-bitwise + h.SHOW_ELEMENT | h.SHOW_COMMENT | h.SHOW_TEXT, + null + ); + }, ph = function (p) { + return p instanceof f && (typeof p.nodeName != "string" || typeof p.textContent != "string" || typeof p.removeChild != "function" || !(p.attributes instanceof u) || typeof p.removeAttribute != "function" || typeof p.setAttribute != "function" || typeof p.namespaceURI != "string" || typeof p.insertBefore != "function" || typeof p.hasChildNodes != "function"); + }, go = function (p) { + return typeof a == "function" && p instanceof a; + }, zt = function (p, y, v) { + P[p] && wi(P[p], (j) => { + j.call(e, y, v, Se); + }); + }, mo = function (p) { + let y = null; + if (zt("beforeSanitizeElements", p, null), ph(p)) + return se(p), !0; + const v = tt(p.nodeName); + if (zt("uponSanitizeElement", p, { + tagName: v, + allowedTags: b + }), p.hasChildNodes() && !go(p.firstElementChild) && mt(/<[/\w]/g, p.innerHTML) && mt(/<[/\w]/g, p.textContent)) + return se(p), !0; + if (!b[v] || K[v]) { + if (!K[v] && _o(v) && (N.tagNameCheck instanceof RegExp && mt(N.tagNameCheck, v) || N.tagNameCheck instanceof Function && N.tagNameCheck(v))) + return !1; + if (Lr && !Te[v]) { + const j = T(p) || p.parentNode, rt = z(p) || p.childNodes; + if (rt && j) { + const nt = rt.length; + for (let ut = nt - 1; ut >= 0; --ut) + j.insertBefore(S(rt[ut], !0), O(p)); + } + } + return se(p), !0; + } + return p instanceof l && !dh(p) || (v === "noscript" || v === "noembed" || v === "noframes") && mt(/<\/no(script|embed|frames)/i, p.innerHTML) ? (se(p), !0) : (Z && p.nodeType === 3 && (y = p.textContent, wi([W, Ct, Nt], (j) => { + y = Ue(y, j, " "); + }), p.textContent !== y && (je(e.removed, { + element: p.cloneNode() + }), p.textContent = y)), zt("afterSanitizeElements", p, null), !1); + }, yo = function (p, y, v) { + if (eo && (y === "id" || y === "name") && (v in i || v in uh)) + return !1; + if (!(St && !et[y] && mt(M, y))) { + if (!(Rt && mt(k, y))) { + if (!I[y] || et[y]) { + if ( + // First condition does a very basic check if a) it's basically a valid custom element tagname AND + // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck + // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck + !(_o(p) && (N.tagNameCheck instanceof RegExp && mt(N.tagNameCheck, p) || N.tagNameCheck instanceof Function && N.tagNameCheck(p)) && (N.attributeNameCheck instanceof RegExp && mt(N.attributeNameCheck, y) || N.attributeNameCheck instanceof Function && N.attributeNameCheck(y)) || // Alternative, second condition checks if it's an `is`-attribute, AND + // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck + y === "is" && N.allowCustomizedBuiltInElements && (N.tagNameCheck instanceof RegExp && mt(N.tagNameCheck, v) || N.tagNameCheck instanceof Function && N.tagNameCheck(v))) + ) + return !1; + } else if (!Er[y]) { + if (!mt(x, Ue(v, w, ""))) { + if (!((y === "src" || y === "xlink:href" || y === "href") && p !== "script" && sd(v, "data:") === 0 && no[p])) { + if (!(Zt && !mt(C, Ue(v, w, "")))) { + if (v) + return !1; + } + } + } + } + } + } + return !0; + }, _o = function (p) { + return p !== "annotation-xml" && p.indexOf("-") > 0; + }, Co = function (p) { + zt("beforeSanitizeAttributes", p, null); + const { + attributes: y + } = p; + if (!y) + return; + const v = { + attrName: "", + attrValue: "", + keepAttr: !0, + allowedAttributes: I + }; + let j = y.length; + for (; j--;) { + const rt = y[j], { + name: nt, + namespaceURI: ut, + value: ae + } = rt, We = tt(nt); + let ft = nt === "value" ? ae : ad(ae); + if (v.attrName = We, v.attrValue = ft, v.keepAttr = !0, v.forceKeepAttr = void 0, zt("uponSanitizeAttribute", p, v), ft = v.attrValue, v.forceKeepAttr || (Ir(nt, p), !v.keepAttr)) + continue; + if (!Lt && mt(/\/>/i, ft)) { + Ir(nt, p); + continue; + } + Z && wi([W, Ct, Nt], (bo) => { + ft = Ue(ft, bo, " "); + }); + const xo = tt(p.nodeName); + if (yo(xo, We, ft)) { + if (io && (We === "id" || We === "name") && (Ir(nt, p), ft = ah + ft), R && typeof d == "object" && typeof d.getAttributeType == "function" && !ut) + switch (d.getAttributeType(xo, We)) { + case "TrustedHTML": { + ft = R.createHTML(ft); + break; + } + case "TrustedScriptURL": { + ft = R.createScriptURL(ft); + break; + } + } + try { + ut ? p.setAttributeNS(ut, nt, ft) : p.setAttribute(nt, ft), Uo(e.removed); + } catch { + } + } + } + zt("afterSanitizeAttributes", p, null); + }, gh = function B(p) { + let y = null; + const v = po(p); + for (zt("beforeSanitizeShadowDOM", p, null); y = v.nextNode();) + zt("uponSanitizeShadowNode", y, null), !mo(y) && (y.content instanceof o && B(y.content), Co(y)); + zt("afterSanitizeShadowDOM", p, null); + }; + return e.sanitize = function (B) { + let p = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, y = null, v = null, j = null, + rt = null; + if (Mr = !B, Mr && (B = ""), typeof B != "string" && !go(B)) + if (typeof B.toString == "function") { + if (B = B.toString(), typeof B != "string") + throw Ye("dirty is not a string, aborting"); + } else + throw Ye("toString is not a function"); + if (!e.isSupported) + return B; + if (Pt || $r(p), e.removed = [], typeof B == "string" && (qe = !1), qe) { + if (B.nodeName) { + const ae = tt(B.nodeName); + if (!b[ae] || K[ae]) + throw Ye("root node is forbidden and cannot be sanitized in-place"); + } + } else if (B instanceof a) + y = fo(""), v = y.ownerDocument.importNode(B, !0), v.nodeType === 1 && v.nodeName === "BODY" || v.nodeName === "HTML" ? y = v : y.appendChild(v); + else { + if (!xe && !Z && !it && // eslint-disable-next-line unicorn/prefer-includes + B.indexOf("<") === -1) + return R && xi ? R.createHTML(B) : B; + if (y = fo(B), !y) + return xe ? null : xi ? X : ""; + } + y && Jt && se(y.firstChild); + const nt = po(qe ? B : y); + for (; j = nt.nextNode();) + mo(j) || (j.content instanceof o && gh(j.content), Co(j)); + if (qe) + return B; + if (xe) { + if (Ci) + for (rt = H.call(y.ownerDocument); y.firstChild;) + rt.appendChild(y.firstChild); + else + rt = y; + return (I.shadowroot || I.shadowrootmode) && (rt = Kt.call(r, rt, !0)), rt; + } + let ut = it ? y.outerHTML : y.innerHTML; + return it && b["!doctype"] && y.ownerDocument && y.ownerDocument.doctype && y.ownerDocument.doctype.name && mt(wa, y.ownerDocument.doctype.name) && (ut = " +` + ut), Z && wi([W, Ct, Nt], (ae) => { + ut = Ue(ut, ae, " "); + }), R && xi ? R.createHTML(ut) : ut; + }, e.setConfig = function () { + let B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + $r(B), Pt = !0; + }, e.clearConfig = function () { + Se = null, Pt = !1; + }, e.isValidAttribute = function (B, p, y) { + Se || $r({}); + const v = tt(B), j = tt(p); + return yo(v, j, y); + }, e.addHook = function (B, p) { + typeof p == "function" && (P[B] = P[B] || [], je(P[B], p)); + }, e.removeHook = function (B) { + if (P[B]) + return Uo(P[B]); + }, e.removeHooks = function (B) { + P[B] && (P[B] = []); + }, e.removeAllHooks = function () { + P = {}; + }, e; +} + +var Ee = Ba(); +const gi = //gi, bd = (t) => t ? Aa(t).replace(/\\n/g, "#br#").split("#br#") : [""], Td = (() => { + let t = !1; + return () => { + t || (kd(), t = !0); + }; +})(); + +function kd() { + const t = "data-temp-href-target"; + Ee.addHook("beforeSanitizeAttributes", (e) => { + e.tagName === "A" && e.hasAttribute("target") && e.setAttribute(t, e.getAttribute("target") || ""); + }), Ee.addHook("afterSanitizeAttributes", (e) => { + e.tagName === "A" && e.hasAttribute(t) && (e.setAttribute("target", e.getAttribute(t) || ""), e.removeAttribute(t), e.getAttribute("target") === "_blank" && e.setAttribute("rel", "noopener")); + }); +} + +const Fa = (t) => (Td(), Ee.sanitize(t)), Zo = (t, e) => { + var i; + if (((i = e.flowchart) == null ? void 0 : i.htmlLabels) !== !1) { + const r = e.securityLevel; + r === "antiscript" || r === "strict" ? t = Fa(t) : r !== "loose" && (t = Aa(t), t = t.replace(//g, ">"), t = t.replace(/=/g, "="), t = Bd(t)); + } + return t; + }, + ai = (t, e) => t && (e.dompurifyConfig ? t = Ee.sanitize(Zo(t, e), e.dompurifyConfig).toString() : t = Ee.sanitize(Zo(t, e), { + FORBID_TAGS: ["style"] + }).toString(), t), Sd = (t, e) => typeof t == "string" ? ai(t, e) : t.flat().map((i) => ai(i, e)), + vd = (t) => gi.test(t), wd = (t) => t.split(gi), Bd = (t) => t.replace(/#br#/g, "
"), + Aa = (t) => t.replace(gi, "#br#"), Fd = (t) => { + let e = ""; + return t && (e = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, e = e.replaceAll(/\(/g, "\\("), e = e.replaceAll(/\)/g, "\\)")), e; + }, La = (t) => !(t === !1 || ["false", "null", "0"].includes(String(t).trim().toLowerCase())), Ad = function (...t) { + const e = t.filter((i) => !isNaN(i)); + return Math.max(...e); + }, Ld = function (...t) { + const e = t.filter((i) => !isNaN(i)); + return Math.min(...e); + }, C1 = function (t) { + const e = t.split(/(,)/), i = []; + for (let r = 0; r < e.length; r++) { + let n = e[r]; + if (n === "," && r > 0 && r + 1 < e.length) { + const o = e[r - 1], s = e[r + 1]; + Ed(o, s) && (n = o + "," + s, r++, i.pop()); + } + i.push(Md(n)); + } + return i.join(""); + }, ln = (t, e) => Math.max(0, t.split(e).length - 1), Ed = (t, e) => { + const i = ln(t, "~"), r = ln(e, "~"); + return i === 1 && r === 1; + }, Md = (t) => { + const e = ln(t, "~"); + let i = !1; + if (e <= 1) + return t; + e % 2 !== 0 && t.startsWith("~") && (t = t.substring(1), i = !0); + const r = [...t]; + let n = r.indexOf("~"), o = r.lastIndexOf("~"); + for (; n !== -1 && o !== -1 && n !== o;) + r[n] = "<", r[o] = ">", n = r.indexOf("~"), o = r.lastIndexOf("~"); + return i && r.unshift("~"), r.join(""); + }, Jo = () => window.MathMLElement !== void 0, hn = /\$\$(.*)\$\$/g, Qo = (t) => { + var e; + return (((e = t.match(hn)) == null ? void 0 : e.length) ?? 0) > 0; + }, x1 = async (t, e) => { + t = await Od(t, e); + const i = document.createElement("div"); + i.innerHTML = t, i.id = "katex-temp", i.style.visibility = "hidden", i.style.position = "absolute", i.style.top = "0"; + const r = document.querySelector("body"); + r == null || r.insertAdjacentElement("beforeend", i); + const n = {width: i.clientWidth, height: i.clientHeight}; + return i.remove(), n; + }, Od = async (t, e) => { + if (!Qo(t)) + return t; + if (!Jo() && !e.legacyMathML) + return t.replace(hn, "MathML is unsupported in this environment."); + const {default: i} = await import("./katex-d90b6d29.js"); + return t.split(gi).map( + (r) => Qo(r) ? ` +
+ ${r} +
+ ` : `
${r}
` + ).join("").replace( + hn, + (r, n) => i.renderToString(n, { + throwOnError: !0, + displayMode: !0, + output: Jo() ? "mathml" : "htmlAndMathml" + }).replace(/\n/g, " ").replace(//g, "") + ); + }, $n = { + getRows: bd, + sanitizeText: ai, + sanitizeTextOrArray: Sd, + hasBreaks: vd, + splitBreaks: wd, + lineBreakRegex: gi, + removeScript: Fa, + getUrl: Fd, + evaluate: La, + getMax: Ad, + getMin: Ld + }, Ni = { + /* CLAMP */ + min: { + r: 0, + g: 0, + b: 0, + s: 0, + l: 0, + a: 0 + }, + max: { + r: 255, + g: 255, + b: 255, + h: 360, + s: 100, + l: 100, + a: 1 + }, + clamp: { + r: (t) => t >= 255 ? 255 : t < 0 ? 0 : t, + g: (t) => t >= 255 ? 255 : t < 0 ? 0 : t, + b: (t) => t >= 255 ? 255 : t < 0 ? 0 : t, + h: (t) => t % 360, + s: (t) => t >= 100 ? 100 : t < 0 ? 0 : t, + l: (t) => t >= 100 ? 100 : t < 0 ? 0 : t, + a: (t) => t >= 1 ? 1 : t < 0 ? 0 : t + }, + /* CONVERSION */ + //SOURCE: https://planetcalc.com/7779 + toLinear: (t) => { + const e = t / 255; + return t > 0.03928 ? Math.pow((e + 0.055) / 1.055, 2.4) : e / 12.92; + }, + //SOURCE: https://gist.github.com/mjackson/5311256 + hue2rgb: (t, e, i) => (i < 0 && (i += 1), i > 1 && (i -= 1), i < 1 / 6 ? t + (e - t) * 6 * i : i < 1 / 2 ? e : i < 2 / 3 ? t + (e - t) * (2 / 3 - i) * 6 : t), + hsl2rgb: ({h: t, s: e, l: i}, r) => { + if (!e) + return i * 2.55; + t /= 360, e /= 100, i /= 100; + const n = i < 0.5 ? i * (1 + e) : i + e - i * e, o = 2 * i - n; + switch (r) { + case "r": + return Ni.hue2rgb(o, n, t + 1 / 3) * 255; + case "g": + return Ni.hue2rgb(o, n, t) * 255; + case "b": + return Ni.hue2rgb(o, n, t - 1 / 3) * 255; + } + }, + rgb2hsl: ({r: t, g: e, b: i}, r) => { + t /= 255, e /= 255, i /= 255; + const n = Math.max(t, e, i), o = Math.min(t, e, i), s = (n + o) / 2; + if (r === "l") + return s * 100; + if (n === o) + return 0; + const a = n - o, l = s > 0.5 ? a / (2 - n - o) : a / (n + o); + if (r === "s") + return l * 100; + switch (n) { + case t: + return ((e - i) / a + (e < i ? 6 : 0)) * 60; + case e: + return ((i - t) / a + 2) * 60; + case i: + return ((t - e) / a + 4) * 60; + default: + return -1; + } + } + }, $d = Ni, Id = { + /* API */ + clamp: (t, e, i) => e > i ? Math.min(e, Math.max(i, t)) : Math.min(i, Math.max(e, t)), + round: (t) => Math.round(t * 1e10) / 1e10 + }, Dd = Id, Nd = { + /* API */ + dec2hex: (t) => { + const e = Math.round(t).toString(16); + return e.length > 1 ? e : `0${e}`; + } + }, Rd = Nd, Pd = { + channel: $d, + lang: Dd, + unit: Rd + }, $ = Pd, Qt = {}; +for (let t = 0; t <= 255; t++) + Qt[t] = $.unit.dec2hex(t); +const ot = { + ALL: 0, + RGB: 1, + HSL: 2 +}; + +class qd { + constructor() { + this.type = ot.ALL; + } + + /* API */ + get() { + return this.type; + } + + set(e) { + if (this.type && this.type !== e) + throw new Error("Cannot change both RGB and HSL channels at the same time"); + this.type = e; + } + + reset() { + this.type = ot.ALL; + } + + is(e) { + return this.type === e; + } +} + +const zd = qd; + +class Wd { + /* CONSTRUCTOR */ + constructor(e, i) { + this.color = i, this.changed = !1, this.data = e, this.type = new zd(); + } + + /* API */ + set(e, i) { + return this.color = i, this.changed = !1, this.data = e, this.type.type = ot.ALL, this; + } + + /* HELPERS */ + _ensureHSL() { + const e = this.data, {h: i, s: r, l: n} = e; + i === void 0 && (e.h = $.channel.rgb2hsl(e, "h")), r === void 0 && (e.s = $.channel.rgb2hsl(e, "s")), n === void 0 && (e.l = $.channel.rgb2hsl(e, "l")); + } + + _ensureRGB() { + const e = this.data, {r: i, g: r, b: n} = e; + i === void 0 && (e.r = $.channel.hsl2rgb(e, "r")), r === void 0 && (e.g = $.channel.hsl2rgb(e, "g")), n === void 0 && (e.b = $.channel.hsl2rgb(e, "b")); + } + + /* GETTERS */ + get r() { + const e = this.data, i = e.r; + return !this.type.is(ot.HSL) && i !== void 0 ? i : (this._ensureHSL(), $.channel.hsl2rgb(e, "r")); + } + + get g() { + const e = this.data, i = e.g; + return !this.type.is(ot.HSL) && i !== void 0 ? i : (this._ensureHSL(), $.channel.hsl2rgb(e, "g")); + } + + get b() { + const e = this.data, i = e.b; + return !this.type.is(ot.HSL) && i !== void 0 ? i : (this._ensureHSL(), $.channel.hsl2rgb(e, "b")); + } + + get h() { + const e = this.data, i = e.h; + return !this.type.is(ot.RGB) && i !== void 0 ? i : (this._ensureRGB(), $.channel.rgb2hsl(e, "h")); + } + + get s() { + const e = this.data, i = e.s; + return !this.type.is(ot.RGB) && i !== void 0 ? i : (this._ensureRGB(), $.channel.rgb2hsl(e, "s")); + } + + get l() { + const e = this.data, i = e.l; + return !this.type.is(ot.RGB) && i !== void 0 ? i : (this._ensureRGB(), $.channel.rgb2hsl(e, "l")); + } + + get a() { + return this.data.a; + } + + /* SETTERS */ + set r(e) { + this.type.set(ot.RGB), this.changed = !0, this.data.r = e; + } + + set g(e) { + this.type.set(ot.RGB), this.changed = !0, this.data.g = e; + } + + set b(e) { + this.type.set(ot.RGB), this.changed = !0, this.data.b = e; + } + + set h(e) { + this.type.set(ot.HSL), this.changed = !0, this.data.h = e; + } + + set s(e) { + this.type.set(ot.HSL), this.changed = !0, this.data.s = e; + } + + set l(e) { + this.type.set(ot.HSL), this.changed = !0, this.data.l = e; + } + + set a(e) { + this.changed = !0, this.data.a = e; + } +} + +const Hd = Wd, jd = new Hd({r: 0, g: 0, b: 0, a: 0}, "transparent"), yr = jd, Ea = { + /* VARIABLES */ + re: /^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i, + /* API */ + parse: (t) => { + if (t.charCodeAt(0) !== 35) + return; + const e = t.match(Ea.re); + if (!e) + return; + const i = e[1], r = parseInt(i, 16), n = i.length, o = n % 4 === 0, s = n > 4, a = s ? 1 : 17, l = s ? 8 : 4, + h = o ? 0 : -1, u = s ? 255 : 15; + return yr.set({ + r: (r >> l * (h + 3) & u) * a, + g: (r >> l * (h + 2) & u) * a, + b: (r >> l * (h + 1) & u) * a, + a: o ? (r & u) * a / 255 : 1 + }, t); + }, + stringify: (t) => { + const {r: e, g: i, b: r, a: n} = t; + return n < 1 ? `#${Qt[Math.round(e)]}${Qt[Math.round(i)]}${Qt[Math.round(r)]}${Qt[Math.round(n * 255)]}` : `#${Qt[Math.round(e)]}${Qt[Math.round(i)]}${Qt[Math.round(r)]}`; + } +}, Ze = Ea, Ri = { + /* VARIABLES */ + re: /^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i, + hueRe: /^(.+?)(deg|grad|rad|turn)$/i, + /* HELPERS */ + _hue2deg: (t) => { + const e = t.match(Ri.hueRe); + if (e) { + const [, i, r] = e; + switch (r) { + case "grad": + return $.channel.clamp.h(parseFloat(i) * 0.9); + case "rad": + return $.channel.clamp.h(parseFloat(i) * 180 / Math.PI); + case "turn": + return $.channel.clamp.h(parseFloat(i) * 360); + } + } + return $.channel.clamp.h(parseFloat(t)); + }, + /* API */ + parse: (t) => { + const e = t.charCodeAt(0); + if (e !== 104 && e !== 72) + return; + const i = t.match(Ri.re); + if (!i) + return; + const [, r, n, o, s, a] = i; + return yr.set({ + h: Ri._hue2deg(r), + s: $.channel.clamp.s(parseFloat(n)), + l: $.channel.clamp.l(parseFloat(o)), + a: s ? $.channel.clamp.a(a ? parseFloat(s) / 100 : parseFloat(s)) : 1 + }, t); + }, + stringify: (t) => { + const {h: e, s: i, l: r, a: n} = t; + return n < 1 ? `hsla(${$.lang.round(e)}, ${$.lang.round(i)}%, ${$.lang.round(r)}%, ${n})` : `hsl(${$.lang.round(e)}, ${$.lang.round(i)}%, ${$.lang.round(r)}%)`; + } +}, Ai = Ri, Pi = { + /* VARIABLES */ + colors: { + aliceblue: "#f0f8ff", + antiquewhite: "#faebd7", + aqua: "#00ffff", + aquamarine: "#7fffd4", + azure: "#f0ffff", + beige: "#f5f5dc", + bisque: "#ffe4c4", + black: "#000000", + blanchedalmond: "#ffebcd", + blue: "#0000ff", + blueviolet: "#8a2be2", + brown: "#a52a2a", + burlywood: "#deb887", + cadetblue: "#5f9ea0", + chartreuse: "#7fff00", + chocolate: "#d2691e", + coral: "#ff7f50", + cornflowerblue: "#6495ed", + cornsilk: "#fff8dc", + crimson: "#dc143c", + cyanaqua: "#00ffff", + darkblue: "#00008b", + darkcyan: "#008b8b", + darkgoldenrod: "#b8860b", + darkgray: "#a9a9a9", + darkgreen: "#006400", + darkgrey: "#a9a9a9", + darkkhaki: "#bdb76b", + darkmagenta: "#8b008b", + darkolivegreen: "#556b2f", + darkorange: "#ff8c00", + darkorchid: "#9932cc", + darkred: "#8b0000", + darksalmon: "#e9967a", + darkseagreen: "#8fbc8f", + darkslateblue: "#483d8b", + darkslategray: "#2f4f4f", + darkslategrey: "#2f4f4f", + darkturquoise: "#00ced1", + darkviolet: "#9400d3", + deeppink: "#ff1493", + deepskyblue: "#00bfff", + dimgray: "#696969", + dimgrey: "#696969", + dodgerblue: "#1e90ff", + firebrick: "#b22222", + floralwhite: "#fffaf0", + forestgreen: "#228b22", + fuchsia: "#ff00ff", + gainsboro: "#dcdcdc", + ghostwhite: "#f8f8ff", + gold: "#ffd700", + goldenrod: "#daa520", + gray: "#808080", + green: "#008000", + greenyellow: "#adff2f", + grey: "#808080", + honeydew: "#f0fff0", + hotpink: "#ff69b4", + indianred: "#cd5c5c", + indigo: "#4b0082", + ivory: "#fffff0", + khaki: "#f0e68c", + lavender: "#e6e6fa", + lavenderblush: "#fff0f5", + lawngreen: "#7cfc00", + lemonchiffon: "#fffacd", + lightblue: "#add8e6", + lightcoral: "#f08080", + lightcyan: "#e0ffff", + lightgoldenrodyellow: "#fafad2", + lightgray: "#d3d3d3", + lightgreen: "#90ee90", + lightgrey: "#d3d3d3", + lightpink: "#ffb6c1", + lightsalmon: "#ffa07a", + lightseagreen: "#20b2aa", + lightskyblue: "#87cefa", + lightslategray: "#778899", + lightslategrey: "#778899", + lightsteelblue: "#b0c4de", + lightyellow: "#ffffe0", + lime: "#00ff00", + limegreen: "#32cd32", + linen: "#faf0e6", + magenta: "#ff00ff", + maroon: "#800000", + mediumaquamarine: "#66cdaa", + mediumblue: "#0000cd", + mediumorchid: "#ba55d3", + mediumpurple: "#9370db", + mediumseagreen: "#3cb371", + mediumslateblue: "#7b68ee", + mediumspringgreen: "#00fa9a", + mediumturquoise: "#48d1cc", + mediumvioletred: "#c71585", + midnightblue: "#191970", + mintcream: "#f5fffa", + mistyrose: "#ffe4e1", + moccasin: "#ffe4b5", + navajowhite: "#ffdead", + navy: "#000080", + oldlace: "#fdf5e6", + olive: "#808000", + olivedrab: "#6b8e23", + orange: "#ffa500", + orangered: "#ff4500", + orchid: "#da70d6", + palegoldenrod: "#eee8aa", + palegreen: "#98fb98", + paleturquoise: "#afeeee", + palevioletred: "#db7093", + papayawhip: "#ffefd5", + peachpuff: "#ffdab9", + peru: "#cd853f", + pink: "#ffc0cb", + plum: "#dda0dd", + powderblue: "#b0e0e6", + purple: "#800080", + rebeccapurple: "#663399", + red: "#ff0000", + rosybrown: "#bc8f8f", + royalblue: "#4169e1", + saddlebrown: "#8b4513", + salmon: "#fa8072", + sandybrown: "#f4a460", + seagreen: "#2e8b57", + seashell: "#fff5ee", + sienna: "#a0522d", + silver: "#c0c0c0", + skyblue: "#87ceeb", + slateblue: "#6a5acd", + slategray: "#708090", + slategrey: "#708090", + snow: "#fffafa", + springgreen: "#00ff7f", + tan: "#d2b48c", + teal: "#008080", + thistle: "#d8bfd8", + transparent: "#00000000", + turquoise: "#40e0d0", + violet: "#ee82ee", + wheat: "#f5deb3", + white: "#ffffff", + whitesmoke: "#f5f5f5", + yellow: "#ffff00", + yellowgreen: "#9acd32" + }, + /* API */ + parse: (t) => { + t = t.toLowerCase(); + const e = Pi.colors[t]; + if (e) + return Ze.parse(e); + }, + stringify: (t) => { + const e = Ze.stringify(t); + for (const i in Pi.colors) + if (Pi.colors[i] === e) + return i; + } +}, ts = Pi, Ma = { + /* VARIABLES */ + re: /^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i, + /* API */ + parse: (t) => { + const e = t.charCodeAt(0); + if (e !== 114 && e !== 82) + return; + const i = t.match(Ma.re); + if (!i) + return; + const [, r, n, o, s, a, l, h, u] = i; + return yr.set({ + r: $.channel.clamp.r(n ? parseFloat(r) * 2.55 : parseFloat(r)), + g: $.channel.clamp.g(s ? parseFloat(o) * 2.55 : parseFloat(o)), + b: $.channel.clamp.b(l ? parseFloat(a) * 2.55 : parseFloat(a)), + a: h ? $.channel.clamp.a(u ? parseFloat(h) / 100 : parseFloat(h)) : 1 + }, t); + }, + stringify: (t) => { + const {r: e, g: i, b: r, a: n} = t; + return n < 1 ? `rgba(${$.lang.round(e)}, ${$.lang.round(i)}, ${$.lang.round(r)}, ${$.lang.round(n)})` : `rgb(${$.lang.round(e)}, ${$.lang.round(i)}, ${$.lang.round(r)})`; + } +}, Li = Ma, Ud = { + /* VARIABLES */ + format: { + keyword: ts, + hex: Ze, + rgb: Li, + rgba: Li, + hsl: Ai, + hsla: Ai + }, + /* API */ + parse: (t) => { + if (typeof t != "string") + return t; + const e = Ze.parse(t) || Li.parse(t) || Ai.parse(t) || ts.parse(t); + if (e) + return e; + throw new Error(`Unsupported color format: "${t}"`); + }, + stringify: (t) => !t.changed && t.color ? t.color : t.type.is(ot.HSL) || t.data.r === void 0 ? Ai.stringify(t) : t.a < 1 || !Number.isInteger(t.r) || !Number.isInteger(t.g) || !Number.isInteger(t.b) ? Li.stringify(t) : Ze.stringify(t) +}, Ot = Ud, Yd = (t, e) => { + const i = Ot.parse(t); + for (const r in e) + i[r] = $.channel.clamp[r](e[r]); + return Ot.stringify(i); +}, Oa = Yd, Gd = (t, e, i = 0, r = 1) => { + if (typeof t != "number") + return Oa(t, {a: e}); + const n = yr.set({ + r: $.channel.clamp.r(t), + g: $.channel.clamp.g(e), + b: $.channel.clamp.b(i), + a: $.channel.clamp.a(r) + }); + return Ot.stringify(n); +}, Je = Gd, Vd = (t) => { + const {r: e, g: i, b: r} = Ot.parse(t), + n = 0.2126 * $.channel.toLinear(e) + 0.7152 * $.channel.toLinear(i) + 0.0722 * $.channel.toLinear(r); + return $.lang.round(n); +}, Xd = Vd, Kd = (t) => Xd(t) >= 0.5, Zd = Kd, Jd = (t) => !Zd(t), mi = Jd, Qd = (t, e, i) => { + const r = Ot.parse(t), n = r[e], o = $.channel.clamp[e](n + i); + return n !== o && (r[e] = o), Ot.stringify(r); +}, $a = Qd, tp = (t, e) => $a(t, "l", e), F = tp, ep = (t, e) => $a(t, "l", -e), E = ep, ip = (t, e) => { + const i = Ot.parse(t), r = {}; + for (const n in e) + e[n] && (r[n] = i[n] + e[n]); + return Oa(t, r); +}, g = ip, rp = (t, e, i = 50) => { + const {r, g: n, b: o, a: s} = Ot.parse(t), {r: a, g: l, b: h, a: u} = Ot.parse(e), f = i / 100, c = f * 2 - 1, + d = s - u, S = ((c * d === -1 ? c : (c + d) / (1 + c * d)) + 1) / 2, O = 1 - S, z = r * S + a * O, + T = n * S + l * O, R = o * S + h * O, X = s * f + u * (1 - f); + return Je(z, T, R, X); +}, np = rp, op = (t, e = 100) => { + const i = Ot.parse(t); + return i.r = 255 - i.r, i.g = 255 - i.g, i.b = 255 - i.b, np(i, t, e); +}, _ = op, ht = (t, e) => e ? g(t, {s: -40, l: 10}) : g(t, {s: -40, l: -10}), _r = "#ffffff", Cr = "#f2f2f2"; +let sp = class { + constructor() { + this.background = "#f4f4f4", this.primaryColor = "#fff4dd", this.noteBkgColor = "#fff5ad", this.noteTextColor = "#333", this.THEME_COLOR_LIMIT = 12, this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif', this.fontSize = "16px"; + } + + updateColors() { + var i, r, n, o, s, a, l, h, u, f, c; + if (this.primaryTextColor = this.primaryTextColor || (this.darkMode ? "#eee" : "#333"), this.secondaryColor = this.secondaryColor || g(this.primaryColor, {h: -120}), this.tertiaryColor = this.tertiaryColor || g(this.primaryColor, { + h: 180, + l: 5 + }), this.primaryBorderColor = this.primaryBorderColor || ht(this.primaryColor, this.darkMode), this.secondaryBorderColor = this.secondaryBorderColor || ht(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = this.tertiaryBorderColor || ht(this.tertiaryColor, this.darkMode), this.noteBorderColor = this.noteBorderColor || ht(this.noteBkgColor, this.darkMode), this.noteBkgColor = this.noteBkgColor || "#fff5ad", this.noteTextColor = this.noteTextColor || "#333", this.secondaryTextColor = this.secondaryTextColor || _(this.secondaryColor), this.tertiaryTextColor = this.tertiaryTextColor || _(this.tertiaryColor), this.lineColor = this.lineColor || _(this.background), this.arrowheadColor = this.arrowheadColor || _(this.background), this.textColor = this.textColor || this.primaryTextColor, this.border2 = this.border2 || this.tertiaryBorderColor, this.nodeBkg = this.nodeBkg || this.primaryColor, this.mainBkg = this.mainBkg || this.primaryColor, this.nodeBorder = this.nodeBorder || this.primaryBorderColor, this.clusterBkg = this.clusterBkg || this.tertiaryColor, this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor, this.defaultLinkColor = this.defaultLinkColor || this.lineColor, this.titleColor = this.titleColor || this.tertiaryTextColor, this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? E(this.secondaryColor, 30) : this.secondaryColor), this.nodeTextColor = this.nodeTextColor || this.primaryTextColor, this.actorBorder = this.actorBorder || this.primaryBorderColor, this.actorBkg = this.actorBkg || this.mainBkg, this.actorTextColor = this.actorTextColor || this.primaryTextColor, this.actorLineColor = this.actorLineColor || "grey", this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg, this.signalColor = this.signalColor || this.textColor, this.signalTextColor = this.signalTextColor || this.textColor, this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder, this.labelTextColor = this.labelTextColor || this.actorTextColor, this.loopTextColor = this.loopTextColor || this.actorTextColor, this.activationBorderColor = this.activationBorderColor || E(this.secondaryColor, 10), this.activationBkgColor = this.activationBkgColor || this.secondaryColor, this.sequenceNumberColor = this.sequenceNumberColor || _(this.lineColor), this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor, this.altSectionBkgColor = this.altSectionBkgColor || "white", this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor, this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor, this.excludeBkgColor = this.excludeBkgColor || "#eeeeee", this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor, this.taskBkgColor = this.taskBkgColor || this.primaryColor, this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor, this.activeTaskBkgColor = this.activeTaskBkgColor || F(this.primaryColor, 23), this.gridColor = this.gridColor || "lightgrey", this.doneTaskBkgColor = this.doneTaskBkgColor || "lightgrey", this.doneTaskBorderColor = this.doneTaskBorderColor || "grey", this.critBorderColor = this.critBorderColor || "#ff8888", this.critBkgColor = this.critBkgColor || "red", this.todayLineColor = this.todayLineColor || "red", this.taskTextColor = this.taskTextColor || this.textColor, this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor, this.taskTextLightColor = this.taskTextLightColor || this.textColor, this.taskTextColor = this.taskTextColor || this.primaryTextColor, this.taskTextDarkColor = this.taskTextDarkColor || this.textColor, this.taskTextClickableColor = this.taskTextClickableColor || "#003163", this.personBorder = this.personBorder || this.primaryBorderColor, this.personBkg = this.personBkg || this.mainBkg, this.transitionColor = this.transitionColor || this.lineColor, this.transitionLabelColor = this.transitionLabelColor || this.textColor, this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor, this.stateBkg = this.stateBkg || this.mainBkg, this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg, this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor, this.altBackground = this.altBackground || this.tertiaryColor, this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg, this.compositeBorder = this.compositeBorder || this.nodeBorder, this.innerEndBackground = this.nodeBorder, this.errorBkgColor = this.errorBkgColor || this.tertiaryColor, this.errorTextColor = this.errorTextColor || this.tertiaryTextColor, this.transitionColor = this.transitionColor || this.lineColor, this.specialStateColor = this.lineColor, this.cScale0 = this.cScale0 || this.primaryColor, this.cScale1 = this.cScale1 || this.secondaryColor, this.cScale2 = this.cScale2 || this.tertiaryColor, this.cScale3 = this.cScale3 || g(this.primaryColor, {h: 30}), this.cScale4 = this.cScale4 || g(this.primaryColor, {h: 60}), this.cScale5 = this.cScale5 || g(this.primaryColor, {h: 90}), this.cScale6 = this.cScale6 || g(this.primaryColor, {h: 120}), this.cScale7 = this.cScale7 || g(this.primaryColor, {h: 150}), this.cScale8 = this.cScale8 || g(this.primaryColor, { + h: 210, + l: 150 + }), this.cScale9 = this.cScale9 || g(this.primaryColor, {h: 270}), this.cScale10 = this.cScale10 || g(this.primaryColor, {h: 300}), this.cScale11 = this.cScale11 || g(this.primaryColor, {h: 330}), this.darkMode) + for (let d = 0; d < this.THEME_COLOR_LIMIT; d++) + this["cScale" + d] = E(this["cScale" + d], 75); + else + for (let d = 0; d < this.THEME_COLOR_LIMIT; d++) + this["cScale" + d] = E(this["cScale" + d], 25); + for (let d = 0; d < this.THEME_COLOR_LIMIT; d++) + this["cScaleInv" + d] = this["cScaleInv" + d] || _(this["cScale" + d]); + for (let d = 0; d < this.THEME_COLOR_LIMIT; d++) + this.darkMode ? this["cScalePeer" + d] = this["cScalePeer" + d] || F(this["cScale" + d], 10) : this["cScalePeer" + d] = this["cScalePeer" + d] || E(this["cScale" + d], 10); + this.scaleLabelColor = this.scaleLabelColor || this.labelTextColor; + for (let d = 0; d < this.THEME_COLOR_LIMIT; d++) + this["cScaleLabel" + d] = this["cScaleLabel" + d] || this.scaleLabelColor; + const e = this.darkMode ? -4 : -1; + for (let d = 0; d < 5; d++) + this["surface" + d] = this["surface" + d] || g(this.mainBkg, { + h: 180, + s: -15, + l: e * (5 + d * 3) + }), this["surfacePeer" + d] = this["surfacePeer" + d] || g(this.mainBkg, { + h: 180, + s: -15, + l: e * (8 + d * 3) + }); + this.classText = this.classText || this.textColor, this.fillType0 = this.fillType0 || this.primaryColor, this.fillType1 = this.fillType1 || this.secondaryColor, this.fillType2 = this.fillType2 || g(this.primaryColor, {h: 64}), this.fillType3 = this.fillType3 || g(this.secondaryColor, {h: 64}), this.fillType4 = this.fillType4 || g(this.primaryColor, {h: -64}), this.fillType5 = this.fillType5 || g(this.secondaryColor, {h: -64}), this.fillType6 = this.fillType6 || g(this.primaryColor, {h: 128}), this.fillType7 = this.fillType7 || g(this.secondaryColor, {h: 128}), this.pie1 = this.pie1 || this.primaryColor, this.pie2 = this.pie2 || this.secondaryColor, this.pie3 = this.pie3 || this.tertiaryColor, this.pie4 = this.pie4 || g(this.primaryColor, {l: -10}), this.pie5 = this.pie5 || g(this.secondaryColor, {l: -10}), this.pie6 = this.pie6 || g(this.tertiaryColor, {l: -10}), this.pie7 = this.pie7 || g(this.primaryColor, { + h: 60, + l: -10 + }), this.pie8 = this.pie8 || g(this.primaryColor, { + h: -60, + l: -10 + }), this.pie9 = this.pie9 || g(this.primaryColor, { + h: 120, + l: 0 + }), this.pie10 = this.pie10 || g(this.primaryColor, { + h: 60, + l: -20 + }), this.pie11 = this.pie11 || g(this.primaryColor, { + h: -60, + l: -20 + }), this.pie12 = this.pie12 || g(this.primaryColor, { + h: 120, + l: -10 + }), this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || g(this.primaryColor, { + r: 5, + g: 5, + b: 5 + }), this.quadrant3Fill = this.quadrant3Fill || g(this.primaryColor, { + r: 10, + g: 10, + b: 10 + }), this.quadrant4Fill = this.quadrant4Fill || g(this.primaryColor, { + r: 15, + g: 15, + b: 15 + }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || g(this.primaryTextColor, { + r: -5, + g: -5, + b: -5 + }), this.quadrant3TextFill = this.quadrant3TextFill || g(this.primaryTextColor, { + r: -10, + g: -10, + b: -10 + }), this.quadrant4TextFill = this.quadrant4TextFill || g(this.primaryTextColor, { + r: -15, + g: -15, + b: -15 + }), this.quadrantPointFill = this.quadrantPointFill || mi(this.quadrant1Fill) ? F(this.quadrant1Fill) : E(this.quadrant1Fill), this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor, this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor, this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor, this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor, this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor, this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor, this.xyChart = { + backgroundColor: ((i = this.xyChart) == null ? void 0 : i.backgroundColor) || this.background, + titleColor: ((r = this.xyChart) == null ? void 0 : r.titleColor) || this.primaryTextColor, + xAxisTitleColor: ((n = this.xyChart) == null ? void 0 : n.xAxisTitleColor) || this.primaryTextColor, + xAxisLabelColor: ((o = this.xyChart) == null ? void 0 : o.xAxisLabelColor) || this.primaryTextColor, + xAxisTickColor: ((s = this.xyChart) == null ? void 0 : s.xAxisTickColor) || this.primaryTextColor, + xAxisLineColor: ((a = this.xyChart) == null ? void 0 : a.xAxisLineColor) || this.primaryTextColor, + yAxisTitleColor: ((l = this.xyChart) == null ? void 0 : l.yAxisTitleColor) || this.primaryTextColor, + yAxisLabelColor: ((h = this.xyChart) == null ? void 0 : h.yAxisLabelColor) || this.primaryTextColor, + yAxisTickColor: ((u = this.xyChart) == null ? void 0 : u.yAxisTickColor) || this.primaryTextColor, + yAxisLineColor: ((f = this.xyChart) == null ? void 0 : f.yAxisLineColor) || this.primaryTextColor, + plotColorPalette: ((c = this.xyChart) == null ? void 0 : c.plotColorPalette) || "#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0" + }, this.requirementBackground = this.requirementBackground || this.primaryColor, this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor, this.requirementBorderSize = this.requirementBorderSize || "1", this.requirementTextColor = this.requirementTextColor || this.primaryTextColor, this.relationColor = this.relationColor || this.lineColor, this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? E(this.secondaryColor, 30) : this.secondaryColor), this.relationLabelColor = this.relationLabelColor || this.actorTextColor, this.git0 = this.git0 || this.primaryColor, this.git1 = this.git1 || this.secondaryColor, this.git2 = this.git2 || this.tertiaryColor, this.git3 = this.git3 || g(this.primaryColor, {h: -30}), this.git4 = this.git4 || g(this.primaryColor, {h: -60}), this.git5 = this.git5 || g(this.primaryColor, {h: -90}), this.git6 = this.git6 || g(this.primaryColor, {h: 60}), this.git7 = this.git7 || g(this.primaryColor, {h: 120}), this.darkMode ? (this.git0 = F(this.git0, 25), this.git1 = F(this.git1, 25), this.git2 = F(this.git2, 25), this.git3 = F(this.git3, 25), this.git4 = F(this.git4, 25), this.git5 = F(this.git5, 25), this.git6 = F(this.git6, 25), this.git7 = F(this.git7, 25)) : (this.git0 = E(this.git0, 25), this.git1 = E(this.git1, 25), this.git2 = E(this.git2, 25), this.git3 = E(this.git3, 25), this.git4 = E(this.git4, 25), this.git5 = E(this.git5, 25), this.git6 = E(this.git6, 25), this.git7 = E(this.git7, 25)), this.gitInv0 = this.gitInv0 || _(this.git0), this.gitInv1 = this.gitInv1 || _(this.git1), this.gitInv2 = this.gitInv2 || _(this.git2), this.gitInv3 = this.gitInv3 || _(this.git3), this.gitInv4 = this.gitInv4 || _(this.git4), this.gitInv5 = this.gitInv5 || _(this.git5), this.gitInv6 = this.gitInv6 || _(this.git6), this.gitInv7 = this.gitInv7 || _(this.git7), this.branchLabelColor = this.branchLabelColor || (this.darkMode ? "black" : this.labelTextColor), this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor, this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor, this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor, this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor, this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor, this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor, this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor, this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor, this.tagLabelColor = this.tagLabelColor || this.primaryTextColor, this.tagLabelBackground = this.tagLabelBackground || this.primaryColor, this.tagLabelBorder = this.tagBorder || this.primaryBorderColor, this.tagLabelFontSize = this.tagLabelFontSize || "10px", this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor, this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor, this.commitLabelFontSize = this.commitLabelFontSize || "10px", this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || _r, this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || Cr; + } + + calculate(e) { + if (typeof e != "object") { + this.updateColors(); + return; + } + const i = Object.keys(e); + i.forEach((r) => { + this[r] = e[r]; + }), this.updateColors(), i.forEach((r) => { + this[r] = e[r]; + }); + } +}; +const ap = (t) => { + const e = new sp(); + return e.calculate(t), e; +}; +let lp = class { + constructor() { + this.background = "#333", this.primaryColor = "#1f2020", this.secondaryColor = F(this.primaryColor, 16), this.tertiaryColor = g(this.primaryColor, {h: -160}), this.primaryBorderColor = _(this.background), this.secondaryBorderColor = ht(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = ht(this.tertiaryColor, this.darkMode), this.primaryTextColor = _(this.primaryColor), this.secondaryTextColor = _(this.secondaryColor), this.tertiaryTextColor = _(this.tertiaryColor), this.lineColor = _(this.background), this.textColor = _(this.background), this.mainBkg = "#1f2020", this.secondBkg = "calculated", this.mainContrastColor = "lightgrey", this.darkTextColor = F(_("#323D47"), 10), this.lineColor = "calculated", this.border1 = "#81B1DB", this.border2 = Je(255, 255, 255, 0.25), this.arrowheadColor = "calculated", this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif', this.fontSize = "16px", this.labelBackground = "#181818", this.textColor = "#ccc", this.THEME_COLOR_LIMIT = 12, this.nodeBkg = "calculated", this.nodeBorder = "calculated", this.clusterBkg = "calculated", this.clusterBorder = "calculated", this.defaultLinkColor = "calculated", this.titleColor = "#F9FFFE", this.edgeLabelBackground = "calculated", this.actorBorder = "calculated", this.actorBkg = "calculated", this.actorTextColor = "calculated", this.actorLineColor = "calculated", this.signalColor = "calculated", this.signalTextColor = "calculated", this.labelBoxBkgColor = "calculated", this.labelBoxBorderColor = "calculated", this.labelTextColor = "calculated", this.loopTextColor = "calculated", this.noteBorderColor = "calculated", this.noteBkgColor = "#fff5ad", this.noteTextColor = "calculated", this.activationBorderColor = "calculated", this.activationBkgColor = "calculated", this.sequenceNumberColor = "black", this.sectionBkgColor = E("#EAE8D9", 30), this.altSectionBkgColor = "calculated", this.sectionBkgColor2 = "#EAE8D9", this.excludeBkgColor = E(this.sectionBkgColor, 10), this.taskBorderColor = Je(255, 255, 255, 70), this.taskBkgColor = "calculated", this.taskTextColor = "calculated", this.taskTextLightColor = "calculated", this.taskTextOutsideColor = "calculated", this.taskTextClickableColor = "#003163", this.activeTaskBorderColor = Je(255, 255, 255, 50), this.activeTaskBkgColor = "#81B1DB", this.gridColor = "calculated", this.doneTaskBkgColor = "calculated", this.doneTaskBorderColor = "grey", this.critBorderColor = "#E83737", this.critBkgColor = "#E83737", this.taskTextDarkColor = "calculated", this.todayLineColor = "#DB5757", this.personBorder = this.primaryBorderColor, this.personBkg = this.mainBkg, this.labelColor = "calculated", this.errorBkgColor = "#a44141", this.errorTextColor = "#ddd"; + } + + updateColors() { + var e, i, r, n, o, s, a, l, h, u, f; + this.secondBkg = F(this.mainBkg, 16), this.lineColor = this.mainContrastColor, this.arrowheadColor = this.mainContrastColor, this.nodeBkg = this.mainBkg, this.nodeBorder = this.border1, this.clusterBkg = this.secondBkg, this.clusterBorder = this.border2, this.defaultLinkColor = this.lineColor, this.edgeLabelBackground = F(this.labelBackground, 25), this.actorBorder = this.border1, this.actorBkg = this.mainBkg, this.actorTextColor = this.mainContrastColor, this.actorLineColor = this.mainContrastColor, this.signalColor = this.mainContrastColor, this.signalTextColor = this.mainContrastColor, this.labelBoxBkgColor = this.actorBkg, this.labelBoxBorderColor = this.actorBorder, this.labelTextColor = this.mainContrastColor, this.loopTextColor = this.mainContrastColor, this.noteBorderColor = this.secondaryBorderColor, this.noteBkgColor = this.secondBkg, this.noteTextColor = this.secondaryTextColor, this.activationBorderColor = this.border1, this.activationBkgColor = this.secondBkg, this.altSectionBkgColor = this.background, this.taskBkgColor = F(this.mainBkg, 23), this.taskTextColor = this.darkTextColor, this.taskTextLightColor = this.mainContrastColor, this.taskTextOutsideColor = this.taskTextLightColor, this.gridColor = this.mainContrastColor, this.doneTaskBkgColor = this.mainContrastColor, this.taskTextDarkColor = this.darkTextColor, this.transitionColor = this.transitionColor || this.lineColor, this.transitionLabelColor = this.transitionLabelColor || this.textColor, this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor, this.stateBkg = this.stateBkg || this.mainBkg, this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg, this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor, this.altBackground = this.altBackground || "#555", this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg, this.compositeBorder = this.compositeBorder || this.nodeBorder, this.innerEndBackground = this.primaryBorderColor, this.specialStateColor = "#f4f4f4", this.errorBkgColor = this.errorBkgColor || this.tertiaryColor, this.errorTextColor = this.errorTextColor || this.tertiaryTextColor, this.fillType0 = this.primaryColor, this.fillType1 = this.secondaryColor, this.fillType2 = g(this.primaryColor, {h: 64}), this.fillType3 = g(this.secondaryColor, {h: 64}), this.fillType4 = g(this.primaryColor, {h: -64}), this.fillType5 = g(this.secondaryColor, {h: -64}), this.fillType6 = g(this.primaryColor, {h: 128}), this.fillType7 = g(this.secondaryColor, {h: 128}), this.cScale1 = this.cScale1 || "#0b0000", this.cScale2 = this.cScale2 || "#4d1037", this.cScale3 = this.cScale3 || "#3f5258", this.cScale4 = this.cScale4 || "#4f2f1b", this.cScale5 = this.cScale5 || "#6e0a0a", this.cScale6 = this.cScale6 || "#3b0048", this.cScale7 = this.cScale7 || "#995a01", this.cScale8 = this.cScale8 || "#154706", this.cScale9 = this.cScale9 || "#161722", this.cScale10 = this.cScale10 || "#00296f", this.cScale11 = this.cScale11 || "#01629c", this.cScale12 = this.cScale12 || "#010029", this.cScale0 = this.cScale0 || this.primaryColor, this.cScale1 = this.cScale1 || this.secondaryColor, this.cScale2 = this.cScale2 || this.tertiaryColor, this.cScale3 = this.cScale3 || g(this.primaryColor, {h: 30}), this.cScale4 = this.cScale4 || g(this.primaryColor, {h: 60}), this.cScale5 = this.cScale5 || g(this.primaryColor, {h: 90}), this.cScale6 = this.cScale6 || g(this.primaryColor, {h: 120}), this.cScale7 = this.cScale7 || g(this.primaryColor, {h: 150}), this.cScale8 = this.cScale8 || g(this.primaryColor, {h: 210}), this.cScale9 = this.cScale9 || g(this.primaryColor, {h: 270}), this.cScale10 = this.cScale10 || g(this.primaryColor, {h: 300}), this.cScale11 = this.cScale11 || g(this.primaryColor, {h: 330}); + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScaleInv" + c] = this["cScaleInv" + c] || _(this["cScale" + c]); + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScalePeer" + c] = this["cScalePeer" + c] || F(this["cScale" + c], 10); + for (let c = 0; c < 5; c++) + this["surface" + c] = this["surface" + c] || g(this.mainBkg, { + h: 30, + s: -30, + l: -(-10 + c * 4) + }), this["surfacePeer" + c] = this["surfacePeer" + c] || g(this.mainBkg, {h: 30, s: -30, l: -(-7 + c * 4)}); + this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor); + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScaleLabel" + c] = this["cScaleLabel" + c] || this.scaleLabelColor; + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["pie" + c] = this["cScale" + c]; + this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || g(this.primaryColor, { + r: 5, + g: 5, + b: 5 + }), this.quadrant3Fill = this.quadrant3Fill || g(this.primaryColor, { + r: 10, + g: 10, + b: 10 + }), this.quadrant4Fill = this.quadrant4Fill || g(this.primaryColor, { + r: 15, + g: 15, + b: 15 + }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || g(this.primaryTextColor, { + r: -5, + g: -5, + b: -5 + }), this.quadrant3TextFill = this.quadrant3TextFill || g(this.primaryTextColor, { + r: -10, + g: -10, + b: -10 + }), this.quadrant4TextFill = this.quadrant4TextFill || g(this.primaryTextColor, { + r: -15, + g: -15, + b: -15 + }), this.quadrantPointFill = this.quadrantPointFill || mi(this.quadrant1Fill) ? F(this.quadrant1Fill) : E(this.quadrant1Fill), this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor, this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor, this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor, this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor, this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor, this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor, this.xyChart = { + backgroundColor: ((e = this.xyChart) == null ? void 0 : e.backgroundColor) || this.background, + titleColor: ((i = this.xyChart) == null ? void 0 : i.titleColor) || this.primaryTextColor, + xAxisTitleColor: ((r = this.xyChart) == null ? void 0 : r.xAxisTitleColor) || this.primaryTextColor, + xAxisLabelColor: ((n = this.xyChart) == null ? void 0 : n.xAxisLabelColor) || this.primaryTextColor, + xAxisTickColor: ((o = this.xyChart) == null ? void 0 : o.xAxisTickColor) || this.primaryTextColor, + xAxisLineColor: ((s = this.xyChart) == null ? void 0 : s.xAxisLineColor) || this.primaryTextColor, + yAxisTitleColor: ((a = this.xyChart) == null ? void 0 : a.yAxisTitleColor) || this.primaryTextColor, + yAxisLabelColor: ((l = this.xyChart) == null ? void 0 : l.yAxisLabelColor) || this.primaryTextColor, + yAxisTickColor: ((h = this.xyChart) == null ? void 0 : h.yAxisTickColor) || this.primaryTextColor, + yAxisLineColor: ((u = this.xyChart) == null ? void 0 : u.yAxisLineColor) || this.primaryTextColor, + plotColorPalette: ((f = this.xyChart) == null ? void 0 : f.plotColorPalette) || "#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22" + }, this.classText = this.primaryTextColor, this.requirementBackground = this.requirementBackground || this.primaryColor, this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor, this.requirementBorderSize = this.requirementBorderSize || "1", this.requirementTextColor = this.requirementTextColor || this.primaryTextColor, this.relationColor = this.relationColor || this.lineColor, this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? E(this.secondaryColor, 30) : this.secondaryColor), this.relationLabelColor = this.relationLabelColor || this.actorTextColor, this.git0 = F(this.secondaryColor, 20), this.git1 = F(this.pie2 || this.secondaryColor, 20), this.git2 = F(this.pie3 || this.tertiaryColor, 20), this.git3 = F(this.pie4 || g(this.primaryColor, {h: -30}), 20), this.git4 = F(this.pie5 || g(this.primaryColor, {h: -60}), 20), this.git5 = F(this.pie6 || g(this.primaryColor, {h: -90}), 10), this.git6 = F(this.pie7 || g(this.primaryColor, {h: 60}), 10), this.git7 = F(this.pie8 || g(this.primaryColor, {h: 120}), 20), this.gitInv0 = this.gitInv0 || _(this.git0), this.gitInv1 = this.gitInv1 || _(this.git1), this.gitInv2 = this.gitInv2 || _(this.git2), this.gitInv3 = this.gitInv3 || _(this.git3), this.gitInv4 = this.gitInv4 || _(this.git4), this.gitInv5 = this.gitInv5 || _(this.git5), this.gitInv6 = this.gitInv6 || _(this.git6), this.gitInv7 = this.gitInv7 || _(this.git7), this.gitBranchLabel0 = this.gitBranchLabel0 || _(this.labelTextColor), this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor, this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor, this.gitBranchLabel3 = this.gitBranchLabel3 || _(this.labelTextColor), this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor, this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor, this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor, this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor, this.tagLabelColor = this.tagLabelColor || this.primaryTextColor, this.tagLabelBackground = this.tagLabelBackground || this.primaryColor, this.tagLabelBorder = this.tagBorder || this.primaryBorderColor, this.tagLabelFontSize = this.tagLabelFontSize || "10px", this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor, this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor, this.commitLabelFontSize = this.commitLabelFontSize || "10px", this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || F(this.background, 12), this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || F(this.background, 2); + } + + calculate(e) { + if (typeof e != "object") { + this.updateColors(); + return; + } + const i = Object.keys(e); + i.forEach((r) => { + this[r] = e[r]; + }), this.updateColors(), i.forEach((r) => { + this[r] = e[r]; + }); + } +}; +const hp = (t) => { + const e = new lp(); + return e.calculate(t), e; +}; +let cp = class { + constructor() { + this.background = "#f4f4f4", this.primaryColor = "#ECECFF", this.secondaryColor = g(this.primaryColor, {h: 120}), this.secondaryColor = "#ffffde", this.tertiaryColor = g(this.primaryColor, {h: -160}), this.primaryBorderColor = ht(this.primaryColor, this.darkMode), this.secondaryBorderColor = ht(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = ht(this.tertiaryColor, this.darkMode), this.primaryTextColor = _(this.primaryColor), this.secondaryTextColor = _(this.secondaryColor), this.tertiaryTextColor = _(this.tertiaryColor), this.lineColor = _(this.background), this.textColor = _(this.background), this.background = "white", this.mainBkg = "#ECECFF", this.secondBkg = "#ffffde", this.lineColor = "#333333", this.border1 = "#9370DB", this.border2 = "#aaaa33", this.arrowheadColor = "#333333", this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif', this.fontSize = "16px", this.labelBackground = "#e8e8e8", this.textColor = "#333", this.THEME_COLOR_LIMIT = 12, this.nodeBkg = "calculated", this.nodeBorder = "calculated", this.clusterBkg = "calculated", this.clusterBorder = "calculated", this.defaultLinkColor = "calculated", this.titleColor = "calculated", this.edgeLabelBackground = "calculated", this.actorBorder = "calculated", this.actorBkg = "calculated", this.actorTextColor = "black", this.actorLineColor = "grey", this.signalColor = "calculated", this.signalTextColor = "calculated", this.labelBoxBkgColor = "calculated", this.labelBoxBorderColor = "calculated", this.labelTextColor = "calculated", this.loopTextColor = "calculated", this.noteBorderColor = "calculated", this.noteBkgColor = "#fff5ad", this.noteTextColor = "calculated", this.activationBorderColor = "#666", this.activationBkgColor = "#f4f4f4", this.sequenceNumberColor = "white", this.sectionBkgColor = "calculated", this.altSectionBkgColor = "calculated", this.sectionBkgColor2 = "calculated", this.excludeBkgColor = "#eeeeee", this.taskBorderColor = "calculated", this.taskBkgColor = "calculated", this.taskTextLightColor = "calculated", this.taskTextColor = this.taskTextLightColor, this.taskTextDarkColor = "calculated", this.taskTextOutsideColor = this.taskTextDarkColor, this.taskTextClickableColor = "calculated", this.activeTaskBorderColor = "calculated", this.activeTaskBkgColor = "calculated", this.gridColor = "calculated", this.doneTaskBkgColor = "calculated", this.doneTaskBorderColor = "calculated", this.critBorderColor = "calculated", this.critBkgColor = "calculated", this.todayLineColor = "calculated", this.sectionBkgColor = Je(102, 102, 255, 0.49), this.altSectionBkgColor = "white", this.sectionBkgColor2 = "#fff400", this.taskBorderColor = "#534fbc", this.taskBkgColor = "#8a90dd", this.taskTextLightColor = "white", this.taskTextColor = "calculated", this.taskTextDarkColor = "black", this.taskTextOutsideColor = "calculated", this.taskTextClickableColor = "#003163", this.activeTaskBorderColor = "#534fbc", this.activeTaskBkgColor = "#bfc7ff", this.gridColor = "lightgrey", this.doneTaskBkgColor = "lightgrey", this.doneTaskBorderColor = "grey", this.critBorderColor = "#ff8888", this.critBkgColor = "red", this.todayLineColor = "red", this.personBorder = this.primaryBorderColor, this.personBkg = this.mainBkg, this.labelColor = "black", this.errorBkgColor = "#552222", this.errorTextColor = "#552222", this.updateColors(); + } + + updateColors() { + var e, i, r, n, o, s, a, l, h, u, f; + this.cScale0 = this.cScale0 || this.primaryColor, this.cScale1 = this.cScale1 || this.secondaryColor, this.cScale2 = this.cScale2 || this.tertiaryColor, this.cScale3 = this.cScale3 || g(this.primaryColor, {h: 30}), this.cScale4 = this.cScale4 || g(this.primaryColor, {h: 60}), this.cScale5 = this.cScale5 || g(this.primaryColor, {h: 90}), this.cScale6 = this.cScale6 || g(this.primaryColor, {h: 120}), this.cScale7 = this.cScale7 || g(this.primaryColor, {h: 150}), this.cScale8 = this.cScale8 || g(this.primaryColor, {h: 210}), this.cScale9 = this.cScale9 || g(this.primaryColor, {h: 270}), this.cScale10 = this.cScale10 || g(this.primaryColor, {h: 300}), this.cScale11 = this.cScale11 || g(this.primaryColor, {h: 330}), this["cScalePeer1"] = this["cScalePeer1"] || E(this.secondaryColor, 45), this["cScalePeer2"] = this["cScalePeer2"] || E(this.tertiaryColor, 40); + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScale" + c] = E(this["cScale" + c], 10), this["cScalePeer" + c] = this["cScalePeer" + c] || E(this["cScale" + c], 25); + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScaleInv" + c] = this["cScaleInv" + c] || g(this["cScale" + c], {h: 180}); + for (let c = 0; c < 5; c++) + this["surface" + c] = this["surface" + c] || g(this.mainBkg, { + h: 30, + l: -(5 + c * 5) + }), this["surfacePeer" + c] = this["surfacePeer" + c] || g(this.mainBkg, {h: 30, l: -(7 + c * 5)}); + if (this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor, this.labelTextColor !== "calculated") { + this.cScaleLabel0 = this.cScaleLabel0 || _(this.labelTextColor), this.cScaleLabel3 = this.cScaleLabel3 || _(this.labelTextColor); + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScaleLabel" + c] = this["cScaleLabel" + c] || this.labelTextColor; + } + this.nodeBkg = this.mainBkg, this.nodeBorder = this.border1, this.clusterBkg = this.secondBkg, this.clusterBorder = this.border2, this.defaultLinkColor = this.lineColor, this.titleColor = this.textColor, this.edgeLabelBackground = this.labelBackground, this.actorBorder = F(this.border1, 23), this.actorBkg = this.mainBkg, this.labelBoxBkgColor = this.actorBkg, this.signalColor = this.textColor, this.signalTextColor = this.textColor, this.labelBoxBorderColor = this.actorBorder, this.labelTextColor = this.actorTextColor, this.loopTextColor = this.actorTextColor, this.noteBorderColor = this.border2, this.noteTextColor = this.actorTextColor, this.taskTextColor = this.taskTextLightColor, this.taskTextOutsideColor = this.taskTextDarkColor, this.transitionColor = this.transitionColor || this.lineColor, this.transitionLabelColor = this.transitionLabelColor || this.textColor, this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor, this.stateBkg = this.stateBkg || this.mainBkg, this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg, this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor, this.altBackground = this.altBackground || "#f0f0f0", this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg, this.compositeBorder = this.compositeBorder || this.nodeBorder, this.innerEndBackground = this.nodeBorder, this.specialStateColor = this.lineColor, this.errorBkgColor = this.errorBkgColor || this.tertiaryColor, this.errorTextColor = this.errorTextColor || this.tertiaryTextColor, this.transitionColor = this.transitionColor || this.lineColor, this.classText = this.primaryTextColor, this.fillType0 = this.primaryColor, this.fillType1 = this.secondaryColor, this.fillType2 = g(this.primaryColor, {h: 64}), this.fillType3 = g(this.secondaryColor, {h: 64}), this.fillType4 = g(this.primaryColor, {h: -64}), this.fillType5 = g(this.secondaryColor, {h: -64}), this.fillType6 = g(this.primaryColor, {h: 128}), this.fillType7 = g(this.secondaryColor, {h: 128}), this.pie1 = this.pie1 || this.primaryColor, this.pie2 = this.pie2 || this.secondaryColor, this.pie3 = this.pie3 || g(this.tertiaryColor, {l: -40}), this.pie4 = this.pie4 || g(this.primaryColor, {l: -10}), this.pie5 = this.pie5 || g(this.secondaryColor, {l: -30}), this.pie6 = this.pie6 || g(this.tertiaryColor, {l: -20}), this.pie7 = this.pie7 || g(this.primaryColor, { + h: 60, + l: -20 + }), this.pie8 = this.pie8 || g(this.primaryColor, { + h: -60, + l: -40 + }), this.pie9 = this.pie9 || g(this.primaryColor, { + h: 120, + l: -40 + }), this.pie10 = this.pie10 || g(this.primaryColor, { + h: 60, + l: -40 + }), this.pie11 = this.pie11 || g(this.primaryColor, { + h: -90, + l: -40 + }), this.pie12 = this.pie12 || g(this.primaryColor, { + h: 120, + l: -30 + }), this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || g(this.primaryColor, { + r: 5, + g: 5, + b: 5 + }), this.quadrant3Fill = this.quadrant3Fill || g(this.primaryColor, { + r: 10, + g: 10, + b: 10 + }), this.quadrant4Fill = this.quadrant4Fill || g(this.primaryColor, { + r: 15, + g: 15, + b: 15 + }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || g(this.primaryTextColor, { + r: -5, + g: -5, + b: -5 + }), this.quadrant3TextFill = this.quadrant3TextFill || g(this.primaryTextColor, { + r: -10, + g: -10, + b: -10 + }), this.quadrant4TextFill = this.quadrant4TextFill || g(this.primaryTextColor, { + r: -15, + g: -15, + b: -15 + }), this.quadrantPointFill = this.quadrantPointFill || mi(this.quadrant1Fill) ? F(this.quadrant1Fill) : E(this.quadrant1Fill), this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor, this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor, this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor, this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor, this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor, this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor, this.xyChart = { + backgroundColor: ((e = this.xyChart) == null ? void 0 : e.backgroundColor) || this.background, + titleColor: ((i = this.xyChart) == null ? void 0 : i.titleColor) || this.primaryTextColor, + xAxisTitleColor: ((r = this.xyChart) == null ? void 0 : r.xAxisTitleColor) || this.primaryTextColor, + xAxisLabelColor: ((n = this.xyChart) == null ? void 0 : n.xAxisLabelColor) || this.primaryTextColor, + xAxisTickColor: ((o = this.xyChart) == null ? void 0 : o.xAxisTickColor) || this.primaryTextColor, + xAxisLineColor: ((s = this.xyChart) == null ? void 0 : s.xAxisLineColor) || this.primaryTextColor, + yAxisTitleColor: ((a = this.xyChart) == null ? void 0 : a.yAxisTitleColor) || this.primaryTextColor, + yAxisLabelColor: ((l = this.xyChart) == null ? void 0 : l.yAxisLabelColor) || this.primaryTextColor, + yAxisTickColor: ((h = this.xyChart) == null ? void 0 : h.yAxisTickColor) || this.primaryTextColor, + yAxisLineColor: ((u = this.xyChart) == null ? void 0 : u.yAxisLineColor) || this.primaryTextColor, + plotColorPalette: ((f = this.xyChart) == null ? void 0 : f.plotColorPalette) || "#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3" + }, this.requirementBackground = this.requirementBackground || this.primaryColor, this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor, this.requirementBorderSize = this.requirementBorderSize || "1", this.requirementTextColor = this.requirementTextColor || this.primaryTextColor, this.relationColor = this.relationColor || this.lineColor, this.relationLabelBackground = this.relationLabelBackground || this.labelBackground, this.relationLabelColor = this.relationLabelColor || this.actorTextColor, this.git0 = this.git0 || this.primaryColor, this.git1 = this.git1 || this.secondaryColor, this.git2 = this.git2 || this.tertiaryColor, this.git3 = this.git3 || g(this.primaryColor, {h: -30}), this.git4 = this.git4 || g(this.primaryColor, {h: -60}), this.git5 = this.git5 || g(this.primaryColor, {h: -90}), this.git6 = this.git6 || g(this.primaryColor, {h: 60}), this.git7 = this.git7 || g(this.primaryColor, {h: 120}), this.darkMode ? (this.git0 = F(this.git0, 25), this.git1 = F(this.git1, 25), this.git2 = F(this.git2, 25), this.git3 = F(this.git3, 25), this.git4 = F(this.git4, 25), this.git5 = F(this.git5, 25), this.git6 = F(this.git6, 25), this.git7 = F(this.git7, 25)) : (this.git0 = E(this.git0, 25), this.git1 = E(this.git1, 25), this.git2 = E(this.git2, 25), this.git3 = E(this.git3, 25), this.git4 = E(this.git4, 25), this.git5 = E(this.git5, 25), this.git6 = E(this.git6, 25), this.git7 = E(this.git7, 25)), this.gitInv0 = this.gitInv0 || E(_(this.git0), 25), this.gitInv1 = this.gitInv1 || _(this.git1), this.gitInv2 = this.gitInv2 || _(this.git2), this.gitInv3 = this.gitInv3 || _(this.git3), this.gitInv4 = this.gitInv4 || _(this.git4), this.gitInv5 = this.gitInv5 || _(this.git5), this.gitInv6 = this.gitInv6 || _(this.git6), this.gitInv7 = this.gitInv7 || _(this.git7), this.gitBranchLabel0 = this.gitBranchLabel0 || _(this.labelTextColor), this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor, this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor, this.gitBranchLabel3 = this.gitBranchLabel3 || _(this.labelTextColor), this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor, this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor, this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor, this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor, this.tagLabelColor = this.tagLabelColor || this.primaryTextColor, this.tagLabelBackground = this.tagLabelBackground || this.primaryColor, this.tagLabelBorder = this.tagBorder || this.primaryBorderColor, this.tagLabelFontSize = this.tagLabelFontSize || "10px", this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor, this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor, this.commitLabelFontSize = this.commitLabelFontSize || "10px", this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || _r, this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || Cr; + } + + calculate(e) { + if (typeof e != "object") { + this.updateColors(); + return; + } + const i = Object.keys(e); + i.forEach((r) => { + this[r] = e[r]; + }), this.updateColors(), i.forEach((r) => { + this[r] = e[r]; + }); + } +}; +const up = (t) => { + const e = new cp(); + return e.calculate(t), e; +}; +let fp = class { + constructor() { + this.background = "#f4f4f4", this.primaryColor = "#cde498", this.secondaryColor = "#cdffb2", this.background = "white", this.mainBkg = "#cde498", this.secondBkg = "#cdffb2", this.lineColor = "green", this.border1 = "#13540c", this.border2 = "#6eaa49", this.arrowheadColor = "green", this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif', this.fontSize = "16px", this.tertiaryColor = F("#cde498", 10), this.primaryBorderColor = ht(this.primaryColor, this.darkMode), this.secondaryBorderColor = ht(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = ht(this.tertiaryColor, this.darkMode), this.primaryTextColor = _(this.primaryColor), this.secondaryTextColor = _(this.secondaryColor), this.tertiaryTextColor = _(this.primaryColor), this.lineColor = _(this.background), this.textColor = _(this.background), this.THEME_COLOR_LIMIT = 12, this.nodeBkg = "calculated", this.nodeBorder = "calculated", this.clusterBkg = "calculated", this.clusterBorder = "calculated", this.defaultLinkColor = "calculated", this.titleColor = "#333", this.edgeLabelBackground = "#e8e8e8", this.actorBorder = "calculated", this.actorBkg = "calculated", this.actorTextColor = "black", this.actorLineColor = "grey", this.signalColor = "#333", this.signalTextColor = "#333", this.labelBoxBkgColor = "calculated", this.labelBoxBorderColor = "#326932", this.labelTextColor = "calculated", this.loopTextColor = "calculated", this.noteBorderColor = "calculated", this.noteBkgColor = "#fff5ad", this.noteTextColor = "calculated", this.activationBorderColor = "#666", this.activationBkgColor = "#f4f4f4", this.sequenceNumberColor = "white", this.sectionBkgColor = "#6eaa49", this.altSectionBkgColor = "white", this.sectionBkgColor2 = "#6eaa49", this.excludeBkgColor = "#eeeeee", this.taskBorderColor = "calculated", this.taskBkgColor = "#487e3a", this.taskTextLightColor = "white", this.taskTextColor = "calculated", this.taskTextDarkColor = "black", this.taskTextOutsideColor = "calculated", this.taskTextClickableColor = "#003163", this.activeTaskBorderColor = "calculated", this.activeTaskBkgColor = "calculated", this.gridColor = "lightgrey", this.doneTaskBkgColor = "lightgrey", this.doneTaskBorderColor = "grey", this.critBorderColor = "#ff8888", this.critBkgColor = "red", this.todayLineColor = "red", this.personBorder = this.primaryBorderColor, this.personBkg = this.mainBkg, this.labelColor = "black", this.errorBkgColor = "#552222", this.errorTextColor = "#552222"; + } + + updateColors() { + var e, i, r, n, o, s, a, l, h, u, f; + this.actorBorder = E(this.mainBkg, 20), this.actorBkg = this.mainBkg, this.labelBoxBkgColor = this.actorBkg, this.labelTextColor = this.actorTextColor, this.loopTextColor = this.actorTextColor, this.noteBorderColor = this.border2, this.noteTextColor = this.actorTextColor, this.cScale0 = this.cScale0 || this.primaryColor, this.cScale1 = this.cScale1 || this.secondaryColor, this.cScale2 = this.cScale2 || this.tertiaryColor, this.cScale3 = this.cScale3 || g(this.primaryColor, {h: 30}), this.cScale4 = this.cScale4 || g(this.primaryColor, {h: 60}), this.cScale5 = this.cScale5 || g(this.primaryColor, {h: 90}), this.cScale6 = this.cScale6 || g(this.primaryColor, {h: 120}), this.cScale7 = this.cScale7 || g(this.primaryColor, {h: 150}), this.cScale8 = this.cScale8 || g(this.primaryColor, {h: 210}), this.cScale9 = this.cScale9 || g(this.primaryColor, {h: 270}), this.cScale10 = this.cScale10 || g(this.primaryColor, {h: 300}), this.cScale11 = this.cScale11 || g(this.primaryColor, {h: 330}), this["cScalePeer1"] = this["cScalePeer1"] || E(this.secondaryColor, 45), this["cScalePeer2"] = this["cScalePeer2"] || E(this.tertiaryColor, 40); + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScale" + c] = E(this["cScale" + c], 10), this["cScalePeer" + c] = this["cScalePeer" + c] || E(this["cScale" + c], 25); + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScaleInv" + c] = this["cScaleInv" + c] || g(this["cScale" + c], {h: 180}); + this.scaleLabelColor = this.scaleLabelColor !== "calculated" && this.scaleLabelColor ? this.scaleLabelColor : this.labelTextColor; + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScaleLabel" + c] = this["cScaleLabel" + c] || this.scaleLabelColor; + for (let c = 0; c < 5; c++) + this["surface" + c] = this["surface" + c] || g(this.mainBkg, { + h: 30, + s: -30, + l: -(5 + c * 5) + }), this["surfacePeer" + c] = this["surfacePeer" + c] || g(this.mainBkg, {h: 30, s: -30, l: -(8 + c * 5)}); + this.nodeBkg = this.mainBkg, this.nodeBorder = this.border1, this.clusterBkg = this.secondBkg, this.clusterBorder = this.border2, this.defaultLinkColor = this.lineColor, this.taskBorderColor = this.border1, this.taskTextColor = this.taskTextLightColor, this.taskTextOutsideColor = this.taskTextDarkColor, this.activeTaskBorderColor = this.taskBorderColor, this.activeTaskBkgColor = this.mainBkg, this.transitionColor = this.transitionColor || this.lineColor, this.transitionLabelColor = this.transitionLabelColor || this.textColor, this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor, this.stateBkg = this.stateBkg || this.mainBkg, this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg, this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor, this.altBackground = this.altBackground || "#f0f0f0", this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg, this.compositeBorder = this.compositeBorder || this.nodeBorder, this.innerEndBackground = this.primaryBorderColor, this.specialStateColor = this.lineColor, this.errorBkgColor = this.errorBkgColor || this.tertiaryColor, this.errorTextColor = this.errorTextColor || this.tertiaryTextColor, this.transitionColor = this.transitionColor || this.lineColor, this.classText = this.primaryTextColor, this.fillType0 = this.primaryColor, this.fillType1 = this.secondaryColor, this.fillType2 = g(this.primaryColor, {h: 64}), this.fillType3 = g(this.secondaryColor, {h: 64}), this.fillType4 = g(this.primaryColor, {h: -64}), this.fillType5 = g(this.secondaryColor, {h: -64}), this.fillType6 = g(this.primaryColor, {h: 128}), this.fillType7 = g(this.secondaryColor, {h: 128}), this.pie1 = this.pie1 || this.primaryColor, this.pie2 = this.pie2 || this.secondaryColor, this.pie3 = this.pie3 || this.tertiaryColor, this.pie4 = this.pie4 || g(this.primaryColor, {l: -30}), this.pie5 = this.pie5 || g(this.secondaryColor, {l: -30}), this.pie6 = this.pie6 || g(this.tertiaryColor, { + h: 40, + l: -40 + }), this.pie7 = this.pie7 || g(this.primaryColor, { + h: 60, + l: -10 + }), this.pie8 = this.pie8 || g(this.primaryColor, { + h: -60, + l: -10 + }), this.pie9 = this.pie9 || g(this.primaryColor, { + h: 120, + l: 0 + }), this.pie10 = this.pie10 || g(this.primaryColor, { + h: 60, + l: -50 + }), this.pie11 = this.pie11 || g(this.primaryColor, { + h: -60, + l: -50 + }), this.pie12 = this.pie12 || g(this.primaryColor, { + h: 120, + l: -50 + }), this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || g(this.primaryColor, { + r: 5, + g: 5, + b: 5 + }), this.quadrant3Fill = this.quadrant3Fill || g(this.primaryColor, { + r: 10, + g: 10, + b: 10 + }), this.quadrant4Fill = this.quadrant4Fill || g(this.primaryColor, { + r: 15, + g: 15, + b: 15 + }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || g(this.primaryTextColor, { + r: -5, + g: -5, + b: -5 + }), this.quadrant3TextFill = this.quadrant3TextFill || g(this.primaryTextColor, { + r: -10, + g: -10, + b: -10 + }), this.quadrant4TextFill = this.quadrant4TextFill || g(this.primaryTextColor, { + r: -15, + g: -15, + b: -15 + }), this.quadrantPointFill = this.quadrantPointFill || mi(this.quadrant1Fill) ? F(this.quadrant1Fill) : E(this.quadrant1Fill), this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor, this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor, this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor, this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor, this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor, this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor, this.xyChart = { + backgroundColor: ((e = this.xyChart) == null ? void 0 : e.backgroundColor) || this.background, + titleColor: ((i = this.xyChart) == null ? void 0 : i.titleColor) || this.primaryTextColor, + xAxisTitleColor: ((r = this.xyChart) == null ? void 0 : r.xAxisTitleColor) || this.primaryTextColor, + xAxisLabelColor: ((n = this.xyChart) == null ? void 0 : n.xAxisLabelColor) || this.primaryTextColor, + xAxisTickColor: ((o = this.xyChart) == null ? void 0 : o.xAxisTickColor) || this.primaryTextColor, + xAxisLineColor: ((s = this.xyChart) == null ? void 0 : s.xAxisLineColor) || this.primaryTextColor, + yAxisTitleColor: ((a = this.xyChart) == null ? void 0 : a.yAxisTitleColor) || this.primaryTextColor, + yAxisLabelColor: ((l = this.xyChart) == null ? void 0 : l.yAxisLabelColor) || this.primaryTextColor, + yAxisTickColor: ((h = this.xyChart) == null ? void 0 : h.yAxisTickColor) || this.primaryTextColor, + yAxisLineColor: ((u = this.xyChart) == null ? void 0 : u.yAxisLineColor) || this.primaryTextColor, + plotColorPalette: ((f = this.xyChart) == null ? void 0 : f.plotColorPalette) || "#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176" + }, this.requirementBackground = this.requirementBackground || this.primaryColor, this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor, this.requirementBorderSize = this.requirementBorderSize || "1", this.requirementTextColor = this.requirementTextColor || this.primaryTextColor, this.relationColor = this.relationColor || this.lineColor, this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground, this.relationLabelColor = this.relationLabelColor || this.actorTextColor, this.git0 = this.git0 || this.primaryColor, this.git1 = this.git1 || this.secondaryColor, this.git2 = this.git2 || this.tertiaryColor, this.git3 = this.git3 || g(this.primaryColor, {h: -30}), this.git4 = this.git4 || g(this.primaryColor, {h: -60}), this.git5 = this.git5 || g(this.primaryColor, {h: -90}), this.git6 = this.git6 || g(this.primaryColor, {h: 60}), this.git7 = this.git7 || g(this.primaryColor, {h: 120}), this.darkMode ? (this.git0 = F(this.git0, 25), this.git1 = F(this.git1, 25), this.git2 = F(this.git2, 25), this.git3 = F(this.git3, 25), this.git4 = F(this.git4, 25), this.git5 = F(this.git5, 25), this.git6 = F(this.git6, 25), this.git7 = F(this.git7, 25)) : (this.git0 = E(this.git0, 25), this.git1 = E(this.git1, 25), this.git2 = E(this.git2, 25), this.git3 = E(this.git3, 25), this.git4 = E(this.git4, 25), this.git5 = E(this.git5, 25), this.git6 = E(this.git6, 25), this.git7 = E(this.git7, 25)), this.gitInv0 = this.gitInv0 || _(this.git0), this.gitInv1 = this.gitInv1 || _(this.git1), this.gitInv2 = this.gitInv2 || _(this.git2), this.gitInv3 = this.gitInv3 || _(this.git3), this.gitInv4 = this.gitInv4 || _(this.git4), this.gitInv5 = this.gitInv5 || _(this.git5), this.gitInv6 = this.gitInv6 || _(this.git6), this.gitInv7 = this.gitInv7 || _(this.git7), this.gitBranchLabel0 = this.gitBranchLabel0 || _(this.labelTextColor), this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor, this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor, this.gitBranchLabel3 = this.gitBranchLabel3 || _(this.labelTextColor), this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor, this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor, this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor, this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor, this.tagLabelColor = this.tagLabelColor || this.primaryTextColor, this.tagLabelBackground = this.tagLabelBackground || this.primaryColor, this.tagLabelBorder = this.tagBorder || this.primaryBorderColor, this.tagLabelFontSize = this.tagLabelFontSize || "10px", this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor, this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor, this.commitLabelFontSize = this.commitLabelFontSize || "10px", this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || _r, this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || Cr; + } + + calculate(e) { + if (typeof e != "object") { + this.updateColors(); + return; + } + const i = Object.keys(e); + i.forEach((r) => { + this[r] = e[r]; + }), this.updateColors(), i.forEach((r) => { + this[r] = e[r]; + }); + } +}; +const dp = (t) => { + const e = new fp(); + return e.calculate(t), e; +}; + +class pp { + constructor() { + this.primaryColor = "#eee", this.contrast = "#707070", this.secondaryColor = F(this.contrast, 55), this.background = "#ffffff", this.tertiaryColor = g(this.primaryColor, {h: -160}), this.primaryBorderColor = ht(this.primaryColor, this.darkMode), this.secondaryBorderColor = ht(this.secondaryColor, this.darkMode), this.tertiaryBorderColor = ht(this.tertiaryColor, this.darkMode), this.primaryTextColor = _(this.primaryColor), this.secondaryTextColor = _(this.secondaryColor), this.tertiaryTextColor = _(this.tertiaryColor), this.lineColor = _(this.background), this.textColor = _(this.background), this.mainBkg = "#eee", this.secondBkg = "calculated", this.lineColor = "#666", this.border1 = "#999", this.border2 = "calculated", this.note = "#ffa", this.text = "#333", this.critical = "#d42", this.done = "#bbb", this.arrowheadColor = "#333333", this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif', this.fontSize = "16px", this.THEME_COLOR_LIMIT = 12, this.nodeBkg = "calculated", this.nodeBorder = "calculated", this.clusterBkg = "calculated", this.clusterBorder = "calculated", this.defaultLinkColor = "calculated", this.titleColor = "calculated", this.edgeLabelBackground = "white", this.actorBorder = "calculated", this.actorBkg = "calculated", this.actorTextColor = "calculated", this.actorLineColor = "calculated", this.signalColor = "calculated", this.signalTextColor = "calculated", this.labelBoxBkgColor = "calculated", this.labelBoxBorderColor = "calculated", this.labelTextColor = "calculated", this.loopTextColor = "calculated", this.noteBorderColor = "calculated", this.noteBkgColor = "calculated", this.noteTextColor = "calculated", this.activationBorderColor = "#666", this.activationBkgColor = "#f4f4f4", this.sequenceNumberColor = "white", this.sectionBkgColor = "calculated", this.altSectionBkgColor = "white", this.sectionBkgColor2 = "calculated", this.excludeBkgColor = "#eeeeee", this.taskBorderColor = "calculated", this.taskBkgColor = "calculated", this.taskTextLightColor = "white", this.taskTextColor = "calculated", this.taskTextDarkColor = "calculated", this.taskTextOutsideColor = "calculated", this.taskTextClickableColor = "#003163", this.activeTaskBorderColor = "calculated", this.activeTaskBkgColor = "calculated", this.gridColor = "calculated", this.doneTaskBkgColor = "calculated", this.doneTaskBorderColor = "calculated", this.critBkgColor = "calculated", this.critBorderColor = "calculated", this.todayLineColor = "calculated", this.personBorder = this.primaryBorderColor, this.personBkg = this.mainBkg, this.labelColor = "black", this.errorBkgColor = "#552222", this.errorTextColor = "#552222"; + } + + updateColors() { + var e, i, r, n, o, s, a, l, h, u, f; + this.secondBkg = F(this.contrast, 55), this.border2 = this.contrast, this.actorBorder = F(this.border1, 23), this.actorBkg = this.mainBkg, this.actorTextColor = this.text, this.actorLineColor = this.lineColor, this.signalColor = this.text, this.signalTextColor = this.text, this.labelBoxBkgColor = this.actorBkg, this.labelBoxBorderColor = this.actorBorder, this.labelTextColor = this.text, this.loopTextColor = this.text, this.noteBorderColor = "#999", this.noteBkgColor = "#666", this.noteTextColor = "#fff", this.cScale0 = this.cScale0 || "#555", this.cScale1 = this.cScale1 || "#F4F4F4", this.cScale2 = this.cScale2 || "#555", this.cScale3 = this.cScale3 || "#BBB", this.cScale4 = this.cScale4 || "#777", this.cScale5 = this.cScale5 || "#999", this.cScale6 = this.cScale6 || "#DDD", this.cScale7 = this.cScale7 || "#FFF", this.cScale8 = this.cScale8 || "#DDD", this.cScale9 = this.cScale9 || "#BBB", this.cScale10 = this.cScale10 || "#999", this.cScale11 = this.cScale11 || "#777"; + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScaleInv" + c] = this["cScaleInv" + c] || _(this["cScale" + c]); + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this.darkMode ? this["cScalePeer" + c] = this["cScalePeer" + c] || F(this["cScale" + c], 10) : this["cScalePeer" + c] = this["cScalePeer" + c] || E(this["cScale" + c], 10); + this.scaleLabelColor = this.scaleLabelColor || (this.darkMode ? "black" : this.labelTextColor), this.cScaleLabel0 = this.cScaleLabel0 || this.cScale1, this.cScaleLabel2 = this.cScaleLabel2 || this.cScale1; + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["cScaleLabel" + c] = this["cScaleLabel" + c] || this.scaleLabelColor; + for (let c = 0; c < 5; c++) + this["surface" + c] = this["surface" + c] || g(this.mainBkg, {l: -(5 + c * 5)}), this["surfacePeer" + c] = this["surfacePeer" + c] || g(this.mainBkg, {l: -(8 + c * 5)}); + this.nodeBkg = this.mainBkg, this.nodeBorder = this.border1, this.clusterBkg = this.secondBkg, this.clusterBorder = this.border2, this.defaultLinkColor = this.lineColor, this.titleColor = this.text, this.sectionBkgColor = F(this.contrast, 30), this.sectionBkgColor2 = F(this.contrast, 30), this.taskBorderColor = E(this.contrast, 10), this.taskBkgColor = this.contrast, this.taskTextColor = this.taskTextLightColor, this.taskTextDarkColor = this.text, this.taskTextOutsideColor = this.taskTextDarkColor, this.activeTaskBorderColor = this.taskBorderColor, this.activeTaskBkgColor = this.mainBkg, this.gridColor = F(this.border1, 30), this.doneTaskBkgColor = this.done, this.doneTaskBorderColor = this.lineColor, this.critBkgColor = this.critical, this.critBorderColor = E(this.critBkgColor, 10), this.todayLineColor = this.critBkgColor, this.transitionColor = this.transitionColor || "#000", this.transitionLabelColor = this.transitionLabelColor || this.textColor, this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor, this.stateBkg = this.stateBkg || this.mainBkg, this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg, this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor, this.altBackground = this.altBackground || "#f4f4f4", this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg, this.stateBorder = this.stateBorder || "#000", this.innerEndBackground = this.primaryBorderColor, this.specialStateColor = "#222", this.errorBkgColor = this.errorBkgColor || this.tertiaryColor, this.errorTextColor = this.errorTextColor || this.tertiaryTextColor, this.classText = this.primaryTextColor, this.fillType0 = this.primaryColor, this.fillType1 = this.secondaryColor, this.fillType2 = g(this.primaryColor, {h: 64}), this.fillType3 = g(this.secondaryColor, {h: 64}), this.fillType4 = g(this.primaryColor, {h: -64}), this.fillType5 = g(this.secondaryColor, {h: -64}), this.fillType6 = g(this.primaryColor, {h: 128}), this.fillType7 = g(this.secondaryColor, {h: 128}); + for (let c = 0; c < this.THEME_COLOR_LIMIT; c++) + this["pie" + c] = this["cScale" + c]; + this.pie12 = this.pie0, this.pieTitleTextSize = this.pieTitleTextSize || "25px", this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor, this.pieSectionTextSize = this.pieSectionTextSize || "17px", this.pieSectionTextColor = this.pieSectionTextColor || this.textColor, this.pieLegendTextSize = this.pieLegendTextSize || "17px", this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor, this.pieStrokeColor = this.pieStrokeColor || "black", this.pieStrokeWidth = this.pieStrokeWidth || "2px", this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px", this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black", this.pieOpacity = this.pieOpacity || "0.7", this.quadrant1Fill = this.quadrant1Fill || this.primaryColor, this.quadrant2Fill = this.quadrant2Fill || g(this.primaryColor, { + r: 5, + g: 5, + b: 5 + }), this.quadrant3Fill = this.quadrant3Fill || g(this.primaryColor, { + r: 10, + g: 10, + b: 10 + }), this.quadrant4Fill = this.quadrant4Fill || g(this.primaryColor, { + r: 15, + g: 15, + b: 15 + }), this.quadrant1TextFill = this.quadrant1TextFill || this.primaryTextColor, this.quadrant2TextFill = this.quadrant2TextFill || g(this.primaryTextColor, { + r: -5, + g: -5, + b: -5 + }), this.quadrant3TextFill = this.quadrant3TextFill || g(this.primaryTextColor, { + r: -10, + g: -10, + b: -10 + }), this.quadrant4TextFill = this.quadrant4TextFill || g(this.primaryTextColor, { + r: -15, + g: -15, + b: -15 + }), this.quadrantPointFill = this.quadrantPointFill || mi(this.quadrant1Fill) ? F(this.quadrant1Fill) : E(this.quadrant1Fill), this.quadrantPointTextFill = this.quadrantPointTextFill || this.primaryTextColor, this.quadrantXAxisTextFill = this.quadrantXAxisTextFill || this.primaryTextColor, this.quadrantYAxisTextFill = this.quadrantYAxisTextFill || this.primaryTextColor, this.quadrantInternalBorderStrokeFill = this.quadrantInternalBorderStrokeFill || this.primaryBorderColor, this.quadrantExternalBorderStrokeFill = this.quadrantExternalBorderStrokeFill || this.primaryBorderColor, this.quadrantTitleFill = this.quadrantTitleFill || this.primaryTextColor, this.xyChart = { + backgroundColor: ((e = this.xyChart) == null ? void 0 : e.backgroundColor) || this.background, + titleColor: ((i = this.xyChart) == null ? void 0 : i.titleColor) || this.primaryTextColor, + xAxisTitleColor: ((r = this.xyChart) == null ? void 0 : r.xAxisTitleColor) || this.primaryTextColor, + xAxisLabelColor: ((n = this.xyChart) == null ? void 0 : n.xAxisLabelColor) || this.primaryTextColor, + xAxisTickColor: ((o = this.xyChart) == null ? void 0 : o.xAxisTickColor) || this.primaryTextColor, + xAxisLineColor: ((s = this.xyChart) == null ? void 0 : s.xAxisLineColor) || this.primaryTextColor, + yAxisTitleColor: ((a = this.xyChart) == null ? void 0 : a.yAxisTitleColor) || this.primaryTextColor, + yAxisLabelColor: ((l = this.xyChart) == null ? void 0 : l.yAxisLabelColor) || this.primaryTextColor, + yAxisTickColor: ((h = this.xyChart) == null ? void 0 : h.yAxisTickColor) || this.primaryTextColor, + yAxisLineColor: ((u = this.xyChart) == null ? void 0 : u.yAxisLineColor) || this.primaryTextColor, + plotColorPalette: ((f = this.xyChart) == null ? void 0 : f.plotColorPalette) || "#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0" + }, this.requirementBackground = this.requirementBackground || this.primaryColor, this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor, this.requirementBorderSize = this.requirementBorderSize || "1", this.requirementTextColor = this.requirementTextColor || this.primaryTextColor, this.relationColor = this.relationColor || this.lineColor, this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground, this.relationLabelColor = this.relationLabelColor || this.actorTextColor, this.git0 = E(this.pie1, 25) || this.primaryColor, this.git1 = this.pie2 || this.secondaryColor, this.git2 = this.pie3 || this.tertiaryColor, this.git3 = this.pie4 || g(this.primaryColor, {h: -30}), this.git4 = this.pie5 || g(this.primaryColor, {h: -60}), this.git5 = this.pie6 || g(this.primaryColor, {h: -90}), this.git6 = this.pie7 || g(this.primaryColor, {h: 60}), this.git7 = this.pie8 || g(this.primaryColor, {h: 120}), this.gitInv0 = this.gitInv0 || _(this.git0), this.gitInv1 = this.gitInv1 || _(this.git1), this.gitInv2 = this.gitInv2 || _(this.git2), this.gitInv3 = this.gitInv3 || _(this.git3), this.gitInv4 = this.gitInv4 || _(this.git4), this.gitInv5 = this.gitInv5 || _(this.git5), this.gitInv6 = this.gitInv6 || _(this.git6), this.gitInv7 = this.gitInv7 || _(this.git7), this.branchLabelColor = this.branchLabelColor || this.labelTextColor, this.gitBranchLabel0 = this.branchLabelColor, this.gitBranchLabel1 = "white", this.gitBranchLabel2 = this.branchLabelColor, this.gitBranchLabel3 = "white", this.gitBranchLabel4 = this.branchLabelColor, this.gitBranchLabel5 = this.branchLabelColor, this.gitBranchLabel6 = this.branchLabelColor, this.gitBranchLabel7 = this.branchLabelColor, this.tagLabelColor = this.tagLabelColor || this.primaryTextColor, this.tagLabelBackground = this.tagLabelBackground || this.primaryColor, this.tagLabelBorder = this.tagBorder || this.primaryBorderColor, this.tagLabelFontSize = this.tagLabelFontSize || "10px", this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor, this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor, this.commitLabelFontSize = this.commitLabelFontSize || "10px", this.attributeBackgroundColorOdd = this.attributeBackgroundColorOdd || _r, this.attributeBackgroundColorEven = this.attributeBackgroundColorEven || Cr; + } + + calculate(e) { + if (typeof e != "object") { + this.updateColors(); + return; + } + const i = Object.keys(e); + i.forEach((r) => { + this[r] = e[r]; + }), this.updateColors(), i.forEach((r) => { + this[r] = e[r]; + }); + } +} + +const gp = (t) => { + const e = new pp(); + return e.calculate(t), e; + }, Gt = { + base: { + getThemeVariables: ap + }, + dark: { + getThemeVariables: hp + }, + default: { + getThemeVariables: up + }, + forest: { + getThemeVariables: dp + }, + neutral: { + getThemeVariables: gp + } + }, jt = { + flowchart: { + useMaxWidth: !0, + titleTopMargin: 25, + subGraphTitleMargin: { + top: 0, + bottom: 0 + }, + diagramPadding: 8, + htmlLabels: !0, + nodeSpacing: 50, + rankSpacing: 50, + curve: "basis", + padding: 15, + defaultRenderer: "dagre-wrapper", + wrappingWidth: 200 + }, + sequence: { + useMaxWidth: !0, + hideUnusedParticipants: !1, + activationWidth: 10, + diagramMarginX: 50, + diagramMarginY: 10, + actorMargin: 50, + width: 150, + height: 65, + boxMargin: 10, + boxTextMargin: 5, + noteMargin: 10, + messageMargin: 35, + messageAlign: "center", + mirrorActors: !0, + forceMenus: !1, + bottomMarginAdj: 1, + rightAngles: !1, + showSequenceNumbers: !1, + actorFontSize: 14, + actorFontFamily: '"Open Sans", sans-serif', + actorFontWeight: 400, + noteFontSize: 14, + noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif', + noteFontWeight: 400, + noteAlign: "center", + messageFontSize: 16, + messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif', + messageFontWeight: 400, + wrap: !1, + wrapPadding: 10, + labelBoxWidth: 50, + labelBoxHeight: 20 + }, + gantt: { + useMaxWidth: !0, + titleTopMargin: 25, + barHeight: 20, + barGap: 4, + topPadding: 50, + rightPadding: 75, + leftPadding: 75, + gridLineStartPadding: 35, + fontSize: 11, + sectionFontSize: 11, + numberSectionStyles: 4, + axisFormat: "%Y-%m-%d", + topAxis: !1, + displayMode: "", + weekday: "sunday" + }, + journey: { + useMaxWidth: !0, + diagramMarginX: 50, + diagramMarginY: 10, + leftMargin: 150, + width: 150, + height: 50, + boxMargin: 10, + boxTextMargin: 5, + noteMargin: 10, + messageMargin: 35, + messageAlign: "center", + bottomMarginAdj: 1, + rightAngles: !1, + taskFontSize: 14, + taskFontFamily: '"Open Sans", sans-serif', + taskMargin: 50, + activationWidth: 10, + textPlacement: "fo", + actorColours: [ + "#8FBC8F", + "#7CFC00", + "#00FFFF", + "#20B2AA", + "#B0E0E6", + "#FFFFE0" + ], + sectionFills: [ + "#191970", + "#8B008B", + "#4B0082", + "#2F4F4F", + "#800000", + "#8B4513", + "#00008B" + ], + sectionColours: [ + "#fff" + ] + }, + class: { + useMaxWidth: !0, + titleTopMargin: 25, + arrowMarkerAbsolute: !1, + dividerMargin: 10, + padding: 5, + textHeight: 10, + defaultRenderer: "dagre-wrapper", + htmlLabels: !1 + }, + state: { + useMaxWidth: !0, + titleTopMargin: 25, + dividerMargin: 10, + sizeUnit: 5, + padding: 8, + textHeight: 10, + titleShift: -15, + noteMargin: 10, + forkWidth: 70, + forkHeight: 7, + miniPadding: 2, + fontSizeFactor: 5.02, + fontSize: 24, + labelHeight: 16, + edgeLengthFactor: "20", + compositTitleSize: 35, + radius: 5, + defaultRenderer: "dagre-wrapper" + }, + er: { + useMaxWidth: !0, + titleTopMargin: 25, + diagramPadding: 20, + layoutDirection: "TB", + minEntityWidth: 100, + minEntityHeight: 75, + entityPadding: 15, + stroke: "gray", + fill: "honeydew", + fontSize: 12 + }, + pie: { + useMaxWidth: !0, + textPosition: 0.75 + }, + quadrantChart: { + useMaxWidth: !0, + chartWidth: 500, + chartHeight: 500, + titleFontSize: 20, + titlePadding: 10, + quadrantPadding: 5, + xAxisLabelPadding: 5, + yAxisLabelPadding: 5, + xAxisLabelFontSize: 16, + yAxisLabelFontSize: 16, + quadrantLabelFontSize: 16, + quadrantTextTopPadding: 5, + pointTextPadding: 5, + pointLabelFontSize: 12, + pointRadius: 5, + xAxisPosition: "top", + yAxisPosition: "left", + quadrantInternalBorderStrokeWidth: 1, + quadrantExternalBorderStrokeWidth: 2 + }, + xyChart: { + useMaxWidth: !0, + width: 700, + height: 500, + titleFontSize: 20, + titlePadding: 10, + showTitle: !0, + xAxis: { + $ref: "#/$defs/XYChartAxisConfig", + showLabel: !0, + labelFontSize: 14, + labelPadding: 5, + showTitle: !0, + titleFontSize: 16, + titlePadding: 5, + showTick: !0, + tickLength: 5, + tickWidth: 2, + showAxisLine: !0, + axisLineWidth: 2 + }, + yAxis: { + $ref: "#/$defs/XYChartAxisConfig", + showLabel: !0, + labelFontSize: 14, + labelPadding: 5, + showTitle: !0, + titleFontSize: 16, + titlePadding: 5, + showTick: !0, + tickLength: 5, + tickWidth: 2, + showAxisLine: !0, + axisLineWidth: 2 + }, + chartOrientation: "vertical", + plotReservedSpacePercent: 50 + }, + requirement: { + useMaxWidth: !0, + rect_fill: "#f9f9f9", + text_color: "#333", + rect_border_size: "0.5px", + rect_border_color: "#bbb", + rect_min_width: 200, + rect_min_height: 200, + fontSize: 14, + rect_padding: 10, + line_height: 20 + }, + mindmap: { + useMaxWidth: !0, + padding: 10, + maxNodeWidth: 200 + }, + timeline: { + useMaxWidth: !0, + diagramMarginX: 50, + diagramMarginY: 10, + leftMargin: 150, + width: 150, + height: 50, + boxMargin: 10, + boxTextMargin: 5, + noteMargin: 10, + messageMargin: 35, + messageAlign: "center", + bottomMarginAdj: 1, + rightAngles: !1, + taskFontSize: 14, + taskFontFamily: '"Open Sans", sans-serif', + taskMargin: 50, + activationWidth: 10, + textPlacement: "fo", + actorColours: [ + "#8FBC8F", + "#7CFC00", + "#00FFFF", + "#20B2AA", + "#B0E0E6", + "#FFFFE0" + ], + sectionFills: [ + "#191970", + "#8B008B", + "#4B0082", + "#2F4F4F", + "#800000", + "#8B4513", + "#00008B" + ], + sectionColours: [ + "#fff" + ], + disableMulticolor: !1 + }, + gitGraph: { + useMaxWidth: !0, + titleTopMargin: 25, + diagramPadding: 8, + nodeLabel: { + width: 75, + height: 100, + x: -25, + y: 0 + }, + mainBranchName: "main", + mainBranchOrder: 0, + showCommitLabel: !0, + showBranches: !0, + rotateCommitLabel: !0, + parallelCommits: !1, + arrowMarkerAbsolute: !1 + }, + c4: { + useMaxWidth: !0, + diagramMarginX: 50, + diagramMarginY: 10, + c4ShapeMargin: 50, + c4ShapePadding: 20, + width: 216, + height: 60, + boxMargin: 10, + c4ShapeInRow: 4, + nextLinePaddingX: 0, + c4BoundaryInRow: 2, + personFontSize: 14, + personFontFamily: '"Open Sans", sans-serif', + personFontWeight: "normal", + external_personFontSize: 14, + external_personFontFamily: '"Open Sans", sans-serif', + external_personFontWeight: "normal", + systemFontSize: 14, + systemFontFamily: '"Open Sans", sans-serif', + systemFontWeight: "normal", + external_systemFontSize: 14, + external_systemFontFamily: '"Open Sans", sans-serif', + external_systemFontWeight: "normal", + system_dbFontSize: 14, + system_dbFontFamily: '"Open Sans", sans-serif', + system_dbFontWeight: "normal", + external_system_dbFontSize: 14, + external_system_dbFontFamily: '"Open Sans", sans-serif', + external_system_dbFontWeight: "normal", + system_queueFontSize: 14, + system_queueFontFamily: '"Open Sans", sans-serif', + system_queueFontWeight: "normal", + external_system_queueFontSize: 14, + external_system_queueFontFamily: '"Open Sans", sans-serif', + external_system_queueFontWeight: "normal", + boundaryFontSize: 14, + boundaryFontFamily: '"Open Sans", sans-serif', + boundaryFontWeight: "normal", + messageFontSize: 12, + messageFontFamily: '"Open Sans", sans-serif', + messageFontWeight: "normal", + containerFontSize: 14, + containerFontFamily: '"Open Sans", sans-serif', + containerFontWeight: "normal", + external_containerFontSize: 14, + external_containerFontFamily: '"Open Sans", sans-serif', + external_containerFontWeight: "normal", + container_dbFontSize: 14, + container_dbFontFamily: '"Open Sans", sans-serif', + container_dbFontWeight: "normal", + external_container_dbFontSize: 14, + external_container_dbFontFamily: '"Open Sans", sans-serif', + external_container_dbFontWeight: "normal", + container_queueFontSize: 14, + container_queueFontFamily: '"Open Sans", sans-serif', + container_queueFontWeight: "normal", + external_container_queueFontSize: 14, + external_container_queueFontFamily: '"Open Sans", sans-serif', + external_container_queueFontWeight: "normal", + componentFontSize: 14, + componentFontFamily: '"Open Sans", sans-serif', + componentFontWeight: "normal", + external_componentFontSize: 14, + external_componentFontFamily: '"Open Sans", sans-serif', + external_componentFontWeight: "normal", + component_dbFontSize: 14, + component_dbFontFamily: '"Open Sans", sans-serif', + component_dbFontWeight: "normal", + external_component_dbFontSize: 14, + external_component_dbFontFamily: '"Open Sans", sans-serif', + external_component_dbFontWeight: "normal", + component_queueFontSize: 14, + component_queueFontFamily: '"Open Sans", sans-serif', + component_queueFontWeight: "normal", + external_component_queueFontSize: 14, + external_component_queueFontFamily: '"Open Sans", sans-serif', + external_component_queueFontWeight: "normal", + wrap: !0, + wrapPadding: 10, + person_bg_color: "#08427B", + person_border_color: "#073B6F", + external_person_bg_color: "#686868", + external_person_border_color: "#8A8A8A", + system_bg_color: "#1168BD", + system_border_color: "#3C7FC0", + system_db_bg_color: "#1168BD", + system_db_border_color: "#3C7FC0", + system_queue_bg_color: "#1168BD", + system_queue_border_color: "#3C7FC0", + external_system_bg_color: "#999999", + external_system_border_color: "#8A8A8A", + external_system_db_bg_color: "#999999", + external_system_db_border_color: "#8A8A8A", + external_system_queue_bg_color: "#999999", + external_system_queue_border_color: "#8A8A8A", + container_bg_color: "#438DD5", + container_border_color: "#3C7FC0", + container_db_bg_color: "#438DD5", + container_db_border_color: "#3C7FC0", + container_queue_bg_color: "#438DD5", + container_queue_border_color: "#3C7FC0", + external_container_bg_color: "#B3B3B3", + external_container_border_color: "#A6A6A6", + external_container_db_bg_color: "#B3B3B3", + external_container_db_border_color: "#A6A6A6", + external_container_queue_bg_color: "#B3B3B3", + external_container_queue_border_color: "#A6A6A6", + component_bg_color: "#85BBF0", + component_border_color: "#78A8D8", + component_db_bg_color: "#85BBF0", + component_db_border_color: "#78A8D8", + component_queue_bg_color: "#85BBF0", + component_queue_border_color: "#78A8D8", + external_component_bg_color: "#CCCCCC", + external_component_border_color: "#BFBFBF", + external_component_db_bg_color: "#CCCCCC", + external_component_db_border_color: "#BFBFBF", + external_component_queue_bg_color: "#CCCCCC", + external_component_queue_border_color: "#BFBFBF" + }, + sankey: { + useMaxWidth: !0, + width: 600, + height: 400, + linkColor: "gradient", + nodeAlignment: "justify", + showValues: !0, + prefix: "", + suffix: "" + }, + block: { + useMaxWidth: !0, + padding: 8 + }, + theme: "default", + maxTextSize: 5e4, + maxEdges: 500, + darkMode: !1, + fontFamily: '"trebuchet ms", verdana, arial, sans-serif;', + logLevel: 5, + securityLevel: "strict", + startOnLoad: !0, + arrowMarkerAbsolute: !1, + secure: [ + "secure", + "securityLevel", + "startOnLoad", + "maxTextSize", + "maxEdges" + ], + legacyMathML: !1, + deterministicIds: !1, + fontSize: 16 + }, Ia = { + ...jt, + // Set, even though they're `undefined` so that `configKeys` finds these keys + // TODO: Should we replace these with `null` so that they can go in the JSON Schema? + deterministicIDSeed: void 0, + themeCSS: void 0, + // add non-JSON default config values + themeVariables: Gt.default.getThemeVariables(), + sequence: { + ...jt.sequence, + messageFont: function () { + return { + fontFamily: this.messageFontFamily, + fontSize: this.messageFontSize, + fontWeight: this.messageFontWeight + }; + }, + noteFont: function () { + return { + fontFamily: this.noteFontFamily, + fontSize: this.noteFontSize, + fontWeight: this.noteFontWeight + }; + }, + actorFont: function () { + return { + fontFamily: this.actorFontFamily, + fontSize: this.actorFontSize, + fontWeight: this.actorFontWeight + }; + } + }, + gantt: { + ...jt.gantt, + tickInterval: void 0, + useWidth: void 0 + // can probably be removed since `configKeys` already includes this + }, + c4: { + ...jt.c4, + useWidth: void 0, + personFont: function () { + return { + fontFamily: this.personFontFamily, + fontSize: this.personFontSize, + fontWeight: this.personFontWeight + }; + }, + external_personFont: function () { + return { + fontFamily: this.external_personFontFamily, + fontSize: this.external_personFontSize, + fontWeight: this.external_personFontWeight + }; + }, + systemFont: function () { + return { + fontFamily: this.systemFontFamily, + fontSize: this.systemFontSize, + fontWeight: this.systemFontWeight + }; + }, + external_systemFont: function () { + return { + fontFamily: this.external_systemFontFamily, + fontSize: this.external_systemFontSize, + fontWeight: this.external_systemFontWeight + }; + }, + system_dbFont: function () { + return { + fontFamily: this.system_dbFontFamily, + fontSize: this.system_dbFontSize, + fontWeight: this.system_dbFontWeight + }; + }, + external_system_dbFont: function () { + return { + fontFamily: this.external_system_dbFontFamily, + fontSize: this.external_system_dbFontSize, + fontWeight: this.external_system_dbFontWeight + }; + }, + system_queueFont: function () { + return { + fontFamily: this.system_queueFontFamily, + fontSize: this.system_queueFontSize, + fontWeight: this.system_queueFontWeight + }; + }, + external_system_queueFont: function () { + return { + fontFamily: this.external_system_queueFontFamily, + fontSize: this.external_system_queueFontSize, + fontWeight: this.external_system_queueFontWeight + }; + }, + containerFont: function () { + return { + fontFamily: this.containerFontFamily, + fontSize: this.containerFontSize, + fontWeight: this.containerFontWeight + }; + }, + external_containerFont: function () { + return { + fontFamily: this.external_containerFontFamily, + fontSize: this.external_containerFontSize, + fontWeight: this.external_containerFontWeight + }; + }, + container_dbFont: function () { + return { + fontFamily: this.container_dbFontFamily, + fontSize: this.container_dbFontSize, + fontWeight: this.container_dbFontWeight + }; + }, + external_container_dbFont: function () { + return { + fontFamily: this.external_container_dbFontFamily, + fontSize: this.external_container_dbFontSize, + fontWeight: this.external_container_dbFontWeight + }; + }, + container_queueFont: function () { + return { + fontFamily: this.container_queueFontFamily, + fontSize: this.container_queueFontSize, + fontWeight: this.container_queueFontWeight + }; + }, + external_container_queueFont: function () { + return { + fontFamily: this.external_container_queueFontFamily, + fontSize: this.external_container_queueFontSize, + fontWeight: this.external_container_queueFontWeight + }; + }, + componentFont: function () { + return { + fontFamily: this.componentFontFamily, + fontSize: this.componentFontSize, + fontWeight: this.componentFontWeight + }; + }, + external_componentFont: function () { + return { + fontFamily: this.external_componentFontFamily, + fontSize: this.external_componentFontSize, + fontWeight: this.external_componentFontWeight + }; + }, + component_dbFont: function () { + return { + fontFamily: this.component_dbFontFamily, + fontSize: this.component_dbFontSize, + fontWeight: this.component_dbFontWeight + }; + }, + external_component_dbFont: function () { + return { + fontFamily: this.external_component_dbFontFamily, + fontSize: this.external_component_dbFontSize, + fontWeight: this.external_component_dbFontWeight + }; + }, + component_queueFont: function () { + return { + fontFamily: this.component_queueFontFamily, + fontSize: this.component_queueFontSize, + fontWeight: this.component_queueFontWeight + }; + }, + external_component_queueFont: function () { + return { + fontFamily: this.external_component_queueFontFamily, + fontSize: this.external_component_queueFontSize, + fontWeight: this.external_component_queueFontWeight + }; + }, + boundaryFont: function () { + return { + fontFamily: this.boundaryFontFamily, + fontSize: this.boundaryFontSize, + fontWeight: this.boundaryFontWeight + }; + }, + messageFont: function () { + return { + fontFamily: this.messageFontFamily, + fontSize: this.messageFontSize, + fontWeight: this.messageFontWeight + }; + } + }, + pie: { + ...jt.pie, + useWidth: 984 + }, + xyChart: { + ...jt.xyChart, + useWidth: void 0 + }, + requirement: { + ...jt.requirement, + useWidth: void 0 + }, + gitGraph: { + ...jt.gitGraph, + // TODO: This is a temporary override for `gitGraph`, since every other + // diagram does have `useMaxWidth`, but instead sets it to `true`. + // Should we set this to `true` instead? + useMaxWidth: !1 + }, + sankey: { + ...jt.sankey, + // this is false, unlike every other diagram (other than gitGraph) + // TODO: can we make this default to `true` instead? + useMaxWidth: !1 + } + }, + Da = (t, e = "") => Object.keys(t).reduce((i, r) => Array.isArray(t[r]) ? i : typeof t[r] == "object" && t[r] !== null ? [...i, e + r, ...Da(t[r], "")] : [...i, e + r], []), + mp = new Set(Da(Ia, "")), yp = Ia, Qi = (t) => { + if (L.debug("sanitizeDirective called with", t), !(typeof t != "object" || t == null)) { + if (Array.isArray(t)) { + t.forEach((e) => Qi(e)); + return; + } + for (const e of Object.keys(t)) { + if (L.debug("Checking key", e), e.startsWith("__") || e.includes("proto") || e.includes("constr") || !mp.has(e) || t[e] == null) { + L.debug("sanitize deleting key: ", e), delete t[e]; + continue; + } + if (typeof t[e] == "object") { + L.debug("sanitizing object", e), Qi(t[e]); + continue; + } + const i = ["themeCSS", "fontFamily", "altFontFamily"]; + for (const r of i) + e.includes(r) && (L.debug("sanitizing css option", e), t[e] = _p(t[e])); + } + if (t.themeVariables) + for (const e of Object.keys(t.themeVariables)) { + const i = t.themeVariables[e]; + i != null && i.match && !i.match(/^[\d "#%(),.;A-Za-z]+$/) && (t.themeVariables[e] = ""); + } + L.debug("After sanitization", t); + } + }, _p = (t) => { + let e = 0, i = 0; + for (const r of t) { + if (e < i) + return "{ /* ERROR: Unbalanced CSS */ }"; + r === "{" ? e++ : r === "}" && i++; + } + return e !== i ? "{ /* ERROR: Unbalanced CSS */ }" : t; + }, Na = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s, + Qe = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi, Cp = /\s*%%.*\n/gm; + +class Ra extends Error { + constructor(e) { + super(e), this.name = "UnknownDiagramError"; + } +} + +const Me = {}, xr = function (t, e) { + t = t.replace(Na, "").replace(Qe, "").replace(Cp, ` +`); + for (const [i, {detector: r}] of Object.entries(Me)) + if (r(t, e)) + return i; + throw new Ra( + `No diagram type detected matching given configuration for text: ${t}` + ); +}, Pa = (...t) => { + for (const {id: e, detector: i, loader: r} of t) + qa(e, i, r); +}, qa = (t, e, i) => { + Me[t] ? L.error(`Detector with key ${t} already exists`) : Me[t] = { + detector: e, + loader: i + }, L.debug(`Detector with key ${t} added${i ? " with loader" : ""}`); +}, xp = (t) => Me[t].loader, cn = (t, e, {depth: i = 2, clobber: r = !1} = {}) => { + const n = {depth: i, clobber: r}; + return Array.isArray(e) && !Array.isArray(t) ? (e.forEach((o) => cn(t, o, n)), t) : Array.isArray(e) && Array.isArray(t) ? (e.forEach((o) => { + t.includes(o) || t.push(o); + }), t) : t === void 0 || i <= 0 ? t != null && typeof t == "object" && typeof e == "object" ? Object.assign(t, e) : e : (e !== void 0 && typeof t == "object" && typeof e == "object" && Object.keys(e).forEach((o) => { + typeof e[o] == "object" && (t[o] === void 0 || typeof t[o] == "object") ? (t[o] === void 0 && (t[o] = Array.isArray(e[o]) ? [] : {}), t[o] = cn(t[o], e[o], { + depth: i - 1, + clobber: r + })) : (r || typeof t[o] != "object" && typeof e[o] != "object") && (t[o] = e[o]); + }), t); +}, st = cn; +var bp = typeof global == "object" && global && global.Object === Object && global; +const za = bp; +var Tp = typeof self == "object" && self && self.Object === Object && self, kp = za || Tp || Function("return this")(); +const Dt = kp; +var Sp = Dt.Symbol; +const tr = Sp; +var Wa = Object.prototype, vp = Wa.hasOwnProperty, wp = Wa.toString, Ge = tr ? tr.toStringTag : void 0; + +function Bp(t) { + var e = vp.call(t, Ge), i = t[Ge]; + try { + t[Ge] = void 0; + var r = !0; + } catch { + } + var n = wp.call(t); + return r && (e ? t[Ge] = i : delete t[Ge]), n; +} + +var Fp = Object.prototype, Ap = Fp.toString; + +function Lp(t) { + return Ap.call(t); +} + +var Ep = "[object Null]", Mp = "[object Undefined]", es = tr ? tr.toStringTag : void 0; + +function Ne(t) { + return t == null ? t === void 0 ? Mp : Ep : es && es in Object(t) ? Bp(t) : Lp(t); +} + +function ye(t) { + var e = typeof t; + return t != null && (e == "object" || e == "function"); +} + +var Op = "[object AsyncFunction]", $p = "[object Function]", Ip = "[object GeneratorFunction]", Dp = "[object Proxy]"; + +function In(t) { + if (!ye(t)) + return !1; + var e = Ne(t); + return e == $p || e == Ip || e == Op || e == Dp; +} + +var Np = Dt["__core-js_shared__"]; +const jr = Np; +var is = function () { + var t = /[^.]+$/.exec(jr && jr.keys && jr.keys.IE_PROTO || ""); + return t ? "Symbol(src)_1." + t : ""; +}(); + +function Rp(t) { + return !!is && is in t; +} + +var Pp = Function.prototype, qp = Pp.toString; + +function _e(t) { + if (t != null) { + try { + return qp.call(t); + } catch { + } + try { + return t + ""; + } catch { + } + } + return ""; +} + +var zp = /[\\^$.*+?()[\]{}|]/g, Wp = /^\[object .+?Constructor\]$/, Hp = Function.prototype, jp = Object.prototype, + Up = Hp.toString, Yp = jp.hasOwnProperty, Gp = RegExp( + "^" + Up.call(Yp).replace(zp, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + +function Vp(t) { + if (!ye(t) || Rp(t)) + return !1; + var e = In(t) ? Gp : Wp; + return e.test(_e(t)); +} + +function Xp(t, e) { + return t == null ? void 0 : t[e]; +} + +function Ce(t, e) { + var i = Xp(t, e); + return Vp(i) ? i : void 0; +} + +var Kp = Ce(Object, "create"); +const li = Kp; + +function Zp() { + this.__data__ = li ? li(null) : {}, this.size = 0; +} + +function Jp(t) { + var e = this.has(t) && delete this.__data__[t]; + return this.size -= e ? 1 : 0, e; +} + +var Qp = "__lodash_hash_undefined__", tg = Object.prototype, eg = tg.hasOwnProperty; + +function ig(t) { + var e = this.__data__; + if (li) { + var i = e[t]; + return i === Qp ? void 0 : i; + } + return eg.call(e, t) ? e[t] : void 0; +} + +var rg = Object.prototype, ng = rg.hasOwnProperty; + +function og(t) { + var e = this.__data__; + return li ? e[t] !== void 0 : ng.call(e, t); +} + +var sg = "__lodash_hash_undefined__"; + +function ag(t, e) { + var i = this.__data__; + return this.size += this.has(t) ? 0 : 1, i[t] = li && e === void 0 ? sg : e, this; +} + +function ge(t) { + var e = -1, i = t == null ? 0 : t.length; + for (this.clear(); ++e < i;) { + var r = t[e]; + this.set(r[0], r[1]); + } +} + +ge.prototype.clear = Zp; +ge.prototype.delete = Jp; +ge.prototype.get = ig; +ge.prototype.has = og; +ge.prototype.set = ag; + +function lg() { + this.__data__ = [], this.size = 0; +} + +function br(t, e) { + return t === e || t !== t && e !== e; +} + +function Tr(t, e) { + for (var i = t.length; i--;) + if (br(t[i][0], e)) + return i; + return -1; +} + +var hg = Array.prototype, cg = hg.splice; + +function ug(t) { + var e = this.__data__, i = Tr(e, t); + if (i < 0) + return !1; + var r = e.length - 1; + return i == r ? e.pop() : cg.call(e, i, 1), --this.size, !0; +} + +function fg(t) { + var e = this.__data__, i = Tr(e, t); + return i < 0 ? void 0 : e[i][1]; +} + +function dg(t) { + return Tr(this.__data__, t) > -1; +} + +function pg(t, e) { + var i = this.__data__, r = Tr(i, t); + return r < 0 ? (++this.size, i.push([t, e])) : i[r][1] = e, this; +} + +function Xt(t) { + var e = -1, i = t == null ? 0 : t.length; + for (this.clear(); ++e < i;) { + var r = t[e]; + this.set(r[0], r[1]); + } +} + +Xt.prototype.clear = lg; +Xt.prototype.delete = ug; +Xt.prototype.get = fg; +Xt.prototype.has = dg; +Xt.prototype.set = pg; +var gg = Ce(Dt, "Map"); +const hi = gg; + +function mg() { + this.size = 0, this.__data__ = { + hash: new ge(), + map: new (hi || Xt)(), + string: new ge() + }; +} + +function yg(t) { + var e = typeof t; + return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null; +} + +function kr(t, e) { + var i = t.__data__; + return yg(e) ? i[typeof e == "string" ? "string" : "hash"] : i.map; +} + +function _g(t) { + var e = kr(this, t).delete(t); + return this.size -= e ? 1 : 0, e; +} + +function Cg(t) { + return kr(this, t).get(t); +} + +function xg(t) { + return kr(this, t).has(t); +} + +function bg(t, e) { + var i = kr(this, t), r = i.size; + return i.set(t, e), this.size += i.size == r ? 0 : 1, this; +} + +function ne(t) { + var e = -1, i = t == null ? 0 : t.length; + for (this.clear(); ++e < i;) { + var r = t[e]; + this.set(r[0], r[1]); + } +} + +ne.prototype.clear = mg; +ne.prototype.delete = _g; +ne.prototype.get = Cg; +ne.prototype.has = xg; +ne.prototype.set = bg; +var Tg = "Expected a function"; + +function yi(t, e) { + if (typeof t != "function" || e != null && typeof e != "function") + throw new TypeError(Tg); + var i = function () { + var r = arguments, n = e ? e.apply(this, r) : r[0], o = i.cache; + if (o.has(n)) + return o.get(n); + var s = t.apply(this, r); + return i.cache = o.set(n, s) || o, s; + }; + return i.cache = new (yi.Cache || ne)(), i; +} + +yi.Cache = ne; + +function kg() { + this.__data__ = new Xt(), this.size = 0; +} + +function Sg(t) { + var e = this.__data__, i = e.delete(t); + return this.size = e.size, i; +} + +function vg(t) { + return this.__data__.get(t); +} + +function wg(t) { + return this.__data__.has(t); +} + +var Bg = 200; + +function Fg(t, e) { + var i = this.__data__; + if (i instanceof Xt) { + var r = i.__data__; + if (!hi || r.length < Bg - 1) + return r.push([t, e]), this.size = ++i.size, this; + i = this.__data__ = new ne(r); + } + return i.set(t, e), this.size = i.size, this; +} + +function Re(t) { + var e = this.__data__ = new Xt(t); + this.size = e.size; +} + +Re.prototype.clear = kg; +Re.prototype.delete = Sg; +Re.prototype.get = vg; +Re.prototype.has = wg; +Re.prototype.set = Fg; +var Ag = function () { + try { + var t = Ce(Object, "defineProperty"); + return t({}, "", {}), t; + } catch { + } +}(); +const er = Ag; + +function Dn(t, e, i) { + e == "__proto__" && er ? er(t, e, { + configurable: !0, + enumerable: !0, + value: i, + writable: !0 + }) : t[e] = i; +} + +function un(t, e, i) { + (i !== void 0 && !br(t[e], i) || i === void 0 && !(e in t)) && Dn(t, e, i); +} + +function Lg(t) { + return function (e, i, r) { + for (var n = -1, o = Object(e), s = r(e), a = s.length; a--;) { + var l = s[t ? a : ++n]; + if (i(o[l], l, o) === !1) + break; + } + return e; + }; +} + +var Eg = Lg(); +const Mg = Eg; +var Ha = typeof exports == "object" && exports && !exports.nodeType && exports, + rs = Ha && typeof module == "object" && module && !module.nodeType && module, Og = rs && rs.exports === Ha, + ns = Og ? Dt.Buffer : void 0, os = ns ? ns.allocUnsafe : void 0; + +function $g(t, e) { + if (e) + return t.slice(); + var i = t.length, r = os ? os(i) : new t.constructor(i); + return t.copy(r), r; +} + +var Ig = Dt.Uint8Array; +const ss = Ig; + +function Dg(t) { + var e = new t.constructor(t.byteLength); + return new ss(e).set(new ss(t)), e; +} + +function Ng(t, e) { + var i = e ? Dg(t.buffer) : t.buffer; + return new t.constructor(i, t.byteOffset, t.length); +} + +function Rg(t, e) { + var i = -1, r = t.length; + for (e || (e = Array(r)); ++i < r;) + e[i] = t[i]; + return e; +} + +var as = Object.create, Pg = function () { + function t() { + } + + return function (e) { + if (!ye(e)) + return {}; + if (as) + return as(e); + t.prototype = e; + var i = new t(); + return t.prototype = void 0, i; + }; +}(); +const qg = Pg; + +function ja(t, e) { + return function (i) { + return t(e(i)); + }; +} + +var zg = ja(Object.getPrototypeOf, Object); +const Ua = zg; +var Wg = Object.prototype; + +function Sr(t) { + var e = t && t.constructor, i = typeof e == "function" && e.prototype || Wg; + return t === i; +} + +function Hg(t) { + return typeof t.constructor == "function" && !Sr(t) ? qg(Ua(t)) : {}; +} + +function _i(t) { + return t != null && typeof t == "object"; +} + +var jg = "[object Arguments]"; + +function ls(t) { + return _i(t) && Ne(t) == jg; +} + +var Ya = Object.prototype, Ug = Ya.hasOwnProperty, Yg = Ya.propertyIsEnumerable, Gg = ls(function () { + return arguments; +}()) ? ls : function (t) { + return _i(t) && Ug.call(t, "callee") && !Yg.call(t, "callee"); +}; +const ir = Gg; +var Vg = Array.isArray; +const rr = Vg; +var Xg = 9007199254740991; + +function Ga(t) { + return typeof t == "number" && t > -1 && t % 1 == 0 && t <= Xg; +} + +function vr(t) { + return t != null && Ga(t.length) && !In(t); +} + +function Kg(t) { + return _i(t) && vr(t); +} + +function Zg() { + return !1; +} + +var Va = typeof exports == "object" && exports && !exports.nodeType && exports, + hs = Va && typeof module == "object" && module && !module.nodeType && module, Jg = hs && hs.exports === Va, + cs = Jg ? Dt.Buffer : void 0, Qg = cs ? cs.isBuffer : void 0, tm = Qg || Zg; +const Nn = tm; +var em = "[object Object]", im = Function.prototype, rm = Object.prototype, Xa = im.toString, nm = rm.hasOwnProperty, + om = Xa.call(Object); + +function sm(t) { + if (!_i(t) || Ne(t) != em) + return !1; + var e = Ua(t); + if (e === null) + return !0; + var i = nm.call(e, "constructor") && e.constructor; + return typeof i == "function" && i instanceof i && Xa.call(i) == om; +} + +var am = "[object Arguments]", lm = "[object Array]", hm = "[object Boolean]", cm = "[object Date]", + um = "[object Error]", fm = "[object Function]", dm = "[object Map]", pm = "[object Number]", + gm = "[object Object]", mm = "[object RegExp]", ym = "[object Set]", _m = "[object String]", + Cm = "[object WeakMap]", xm = "[object ArrayBuffer]", bm = "[object DataView]", Tm = "[object Float32Array]", + km = "[object Float64Array]", Sm = "[object Int8Array]", vm = "[object Int16Array]", wm = "[object Int32Array]", + Bm = "[object Uint8Array]", Fm = "[object Uint8ClampedArray]", Am = "[object Uint16Array]", + Lm = "[object Uint32Array]", U = {}; +U[Tm] = U[km] = U[Sm] = U[vm] = U[wm] = U[Bm] = U[Fm] = U[Am] = U[Lm] = !0; +U[am] = U[lm] = U[xm] = U[hm] = U[bm] = U[cm] = U[um] = U[fm] = U[dm] = U[pm] = U[gm] = U[mm] = U[ym] = U[_m] = U[Cm] = !1; + +function Em(t) { + return _i(t) && Ga(t.length) && !!U[Ne(t)]; +} + +function Mm(t) { + return function (e) { + return t(e); + }; +} + +var Ka = typeof exports == "object" && exports && !exports.nodeType && exports, + ti = Ka && typeof module == "object" && module && !module.nodeType && module, Om = ti && ti.exports === Ka, + Ur = Om && za.process, $m = function () { + try { + var t = ti && ti.require && ti.require("util").types; + return t || Ur && Ur.binding && Ur.binding("util"); + } catch { + } + }(); +const us = $m; +var fs = us && us.isTypedArray, Im = fs ? Mm(fs) : Em; +const Rn = Im; + +function fn(t, e) { + if (!(e === "constructor" && typeof t[e] == "function") && e != "__proto__") + return t[e]; +} + +var Dm = Object.prototype, Nm = Dm.hasOwnProperty; + +function Rm(t, e, i) { + var r = t[e]; + (!(Nm.call(t, e) && br(r, i)) || i === void 0 && !(e in t)) && Dn(t, e, i); +} + +function Pm(t, e, i, r) { + var n = !i; + i || (i = {}); + for (var o = -1, s = e.length; ++o < s;) { + var a = e[o], l = r ? r(i[a], t[a], a, i, t) : void 0; + l === void 0 && (l = t[a]), n ? Dn(i, a, l) : Rm(i, a, l); + } + return i; +} + +function qm(t, e) { + for (var i = -1, r = Array(t); ++i < t;) + r[i] = e(i); + return r; +} + +var zm = 9007199254740991, Wm = /^(?:0|[1-9]\d*)$/; + +function Za(t, e) { + var i = typeof t; + return e = e ?? zm, !!e && (i == "number" || i != "symbol" && Wm.test(t)) && t > -1 && t % 1 == 0 && t < e; +} + +var Hm = Object.prototype, jm = Hm.hasOwnProperty; + +function Um(t, e) { + var i = rr(t), r = !i && ir(t), n = !i && !r && Nn(t), o = !i && !r && !n && Rn(t), s = i || r || n || o, + a = s ? qm(t.length, String) : [], l = a.length; + for (var h in t) + (e || jm.call(t, h)) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode. + (h == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. + n && (h == "offset" || h == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. + o && (h == "buffer" || h == "byteLength" || h == "byteOffset") || // Skip index properties. + Za(h, l))) && a.push(h); + return a; +} + +function Ym(t) { + var e = []; + if (t != null) + for (var i in Object(t)) + e.push(i); + return e; +} + +var Gm = Object.prototype, Vm = Gm.hasOwnProperty; + +function Xm(t) { + if (!ye(t)) + return Ym(t); + var e = Sr(t), i = []; + for (var r in t) + r == "constructor" && (e || !Vm.call(t, r)) || i.push(r); + return i; +} + +function Ja(t) { + return vr(t) ? Um(t, !0) : Xm(t); +} + +function Km(t) { + return Pm(t, Ja(t)); +} + +function Zm(t, e, i, r, n, o, s) { + var a = fn(t, i), l = fn(e, i), h = s.get(l); + if (h) { + un(t, i, h); + return; + } + var u = o ? o(a, l, i + "", t, e, s) : void 0, f = u === void 0; + if (f) { + var c = rr(l), d = !c && Nn(l), m = !c && !d && Rn(l); + u = l, c || d || m ? rr(a) ? u = a : Kg(a) ? u = Rg(a) : d ? (f = !1, u = $g(l, !0)) : m ? (f = !1, u = Ng(l, !0)) : u = [] : sm(l) || ir(l) ? (u = a, ir(a) ? u = Km(a) : (!ye(a) || In(a)) && (u = Hg(l))) : f = !1; + } + f && (s.set(l, u), n(u, l, r, o, s), s.delete(l)), un(t, i, u); +} + +function Qa(t, e, i, r, n) { + t !== e && Mg(e, function (o, s) { + if (n || (n = new Re()), ye(o)) + Zm(t, e, s, i, Qa, r, n); + else { + var a = r ? r(fn(t, s), o, s + "", t, e, n) : void 0; + a === void 0 && (a = o), un(t, s, a); + } + }, Ja); +} + +function tl(t) { + return t; +} + +function Jm(t, e, i) { + switch (i.length) { + case 0: + return t.call(e); + case 1: + return t.call(e, i[0]); + case 2: + return t.call(e, i[0], i[1]); + case 3: + return t.call(e, i[0], i[1], i[2]); + } + return t.apply(e, i); +} + +var ds = Math.max; + +function Qm(t, e, i) { + return e = ds(e === void 0 ? t.length - 1 : e, 0), function () { + for (var r = arguments, n = -1, o = ds(r.length - e, 0), s = Array(o); ++n < o;) + s[n] = r[e + n]; + n = -1; + for (var a = Array(e + 1); ++n < e;) + a[n] = r[n]; + return a[e] = i(s), Jm(t, this, a); + }; +} + +function t0(t) { + return function () { + return t; + }; +} + +var e0 = er ? function (t, e) { + return er(t, "toString", { + configurable: !0, + enumerable: !1, + value: t0(e), + writable: !0 + }); +} : tl; +const i0 = e0; +var r0 = 800, n0 = 16, o0 = Date.now; + +function s0(t) { + var e = 0, i = 0; + return function () { + var r = o0(), n = n0 - (r - i); + if (i = r, n > 0) { + if (++e >= r0) + return arguments[0]; + } else + e = 0; + return t.apply(void 0, arguments); + }; +} + +var a0 = s0(i0); +const l0 = a0; + +function h0(t, e) { + return l0(Qm(t, e, tl), t + ""); +} + +function c0(t, e, i) { + if (!ye(i)) + return !1; + var r = typeof e; + return (r == "number" ? vr(i) && Za(e, i.length) : r == "string" && e in i) ? br(i[e], t) : !1; +} + +function u0(t) { + return h0(function (e, i) { + var r = -1, n = i.length, o = n > 1 ? i[n - 1] : void 0, s = n > 2 ? i[2] : void 0; + for (o = t.length > 3 && typeof o == "function" ? (n--, o) : void 0, s && c0(i[0], i[1], s) && (o = n < 3 ? void 0 : o, n = 1), e = Object(e); ++r < n;) { + var a = i[r]; + a && t(e, a, r, o); + } + return e; + }); +} + +var f0 = u0(function (t, e, i) { + Qa(t, e, i); +}); +const d0 = f0, p0 = "​", g0 = { + curveBasis: Pf, + curveBasisClosed: qf, + curveBasisOpen: zf, + curveBumpX: Nf, + curveBumpY: Rf, + curveBundle: Wf, + curveCardinalClosed: jf, + curveCardinalOpen: Uf, + curveCardinal: Hf, + curveCatmullRomClosed: Gf, + curveCatmullRomOpen: Vf, + curveCatmullRom: Yf, + curveLinear: Df, + curveLinearClosed: Xf, + curveMonotoneX: Kf, + curveMonotoneY: Zf, + curveNatural: Jf, + curveStep: Qf, + curveStepAfter: ed, + curveStepBefore: td +}, m0 = /\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi, y0 = function (t, e) { + const i = el(t, /(?:init\b)|(?:initialize\b)/); + let r = {}; + if (Array.isArray(i)) { + const s = i.map((a) => a.args); + Qi(s), r = st(r, [...s]); + } else + r = i.args; + if (!r) + return; + let n = xr(t, e); + const o = "config"; + return r[o] !== void 0 && (n === "flowchart-v2" && (n = "flowchart"), r[n] = r[o], delete r[o]), r; +}, el = function (t, e = null) { + try { + const i = new RegExp( + `[%]{2}(?![{]${m0.source})(?=[}][%]{2}).* +`, + "ig" + ); + t = t.trim().replace(i, "").replace(/'/gm, '"'), L.debug( + `Detecting diagram directive${e !== null ? " type:" + e : ""} based on the text:${t}` + ); + let r; + const n = []; + for (; (r = Qe.exec(t)) !== null;) + if (r.index === Qe.lastIndex && Qe.lastIndex++, r && !e || e && r[1] && r[1].match(e) || e && r[2] && r[2].match(e)) { + const o = r[1] ? r[1] : r[2], s = r[3] ? r[3].trim() : r[4] ? JSON.parse(r[4].trim()) : null; + n.push({type: o, args: s}); + } + return n.length === 0 ? {type: t, args: null} : n.length === 1 ? n[0] : n; + } catch (i) { + return L.error( + `ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'` + ), {type: void 0, args: null}; + } +}, _0 = function (t) { + return t.replace(Qe, ""); +}, C0 = function (t, e) { + for (const [i, r] of e.entries()) + if (r.match(t)) + return i; + return -1; +}; + +function x0(t, e) { + if (!t) + return e; + const i = `curve${t.charAt(0).toUpperCase() + t.slice(1)}`; + return g0[i] ?? e; +} + +function b0(t, e) { + const i = t.trim(); + if (i) + return e.securityLevel !== "loose" ? Rs.sanitizeUrl(i) : i; +} + +const T0 = (t, ...e) => { + const i = t.split("."), r = i.length - 1, n = i[r]; + let o = window; + for (let s = 0; s < r; s++) + if (o = o[i[s]], !o) { + L.error(`Function name: ${t} not found in window`); + return; + } + o[n](...e); +}; + +function il(t, e) { + return !t || !e ? 0 : Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)); +} + +function k0(t) { + let e, i = 0; + t.forEach((n) => { + i += il(n, e), e = n; + }); + const r = i / 2; + return Pn(t, r); +} + +function S0(t) { + return t.length === 1 ? t[0] : k0(t); +} + +const ps = (t, e = 2) => { + const i = Math.pow(10, e); + return Math.round(t * i) / i; +}, Pn = (t, e) => { + let i, r = e; + for (const n of t) { + if (i) { + const o = il(n, i); + if (o < r) + r -= o; + else { + const s = r / o; + if (s <= 0) + return i; + if (s >= 1) + return {x: n.x, y: n.y}; + if (s > 0 && s < 1) + return { + x: ps((1 - s) * i.x + s * n.x, 5), + y: ps((1 - s) * i.y + s * n.y, 5) + }; + } + } + i = n; + } + throw new Error("Could not find a suitable point for the given distance"); +}, v0 = (t, e, i) => { + L.info(`our points ${JSON.stringify(e)}`), e[0] !== i && (e = e.reverse()); + const n = Pn(e, 25), o = t ? 10 : 5, s = Math.atan2(e[0].y - n.y, e[0].x - n.x), a = {x: 0, y: 0}; + return a.x = Math.sin(s) * o + (e[0].x + n.x) / 2, a.y = -Math.cos(s) * o + (e[0].y + n.y) / 2, a; +}; + +function w0(t, e, i) { + const r = structuredClone(i); + L.info("our points", r), e !== "start_left" && e !== "start_right" && r.reverse(); + const n = 25 + t, o = Pn(r, n), s = 10 + t * 0.5, a = Math.atan2(r[0].y - o.y, r[0].x - o.x), l = {x: 0, y: 0}; + return e === "start_left" ? (l.x = Math.sin(a + Math.PI) * s + (r[0].x + o.x) / 2, l.y = -Math.cos(a + Math.PI) * s + (r[0].y + o.y) / 2) : e === "end_right" ? (l.x = Math.sin(a - Math.PI) * s + (r[0].x + o.x) / 2 - 5, l.y = -Math.cos(a - Math.PI) * s + (r[0].y + o.y) / 2 - 5) : e === "end_left" ? (l.x = Math.sin(a) * s + (r[0].x + o.x) / 2 - 5, l.y = -Math.cos(a) * s + (r[0].y + o.y) / 2 - 5) : (l.x = Math.sin(a) * s + (r[0].x + o.x) / 2, l.y = -Math.cos(a) * s + (r[0].y + o.y) / 2), l; +} + +function B0(t) { + let e = "", i = ""; + for (const r of t) + r !== void 0 && (r.startsWith("color:") || r.startsWith("text-align:") ? i = i + r + ";" : e = e + r + ";"); + return {style: e, labelStyle: i}; +} + +let gs = 0; +const F0 = () => (gs++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + gs); + +function A0(t) { + let e = ""; + const i = "0123456789abcdef", r = i.length; + for (let n = 0; n < t; n++) + e += i.charAt(Math.floor(Math.random() * r)); + return e; +} + +const L0 = (t) => A0(t.length), E0 = function () { + return { + x: 0, + y: 0, + fill: void 0, + anchor: "start", + style: "#666", + width: 100, + height: 100, + textMargin: 0, + rx: 0, + ry: 0, + valign: void 0, + text: "" + }; +}, M0 = function (t, e) { + const i = e.text.replace($n.lineBreakRegex, " "), [, r] = zn(e.fontSize), n = t.append("text"); + n.attr("x", e.x), n.attr("y", e.y), n.style("text-anchor", e.anchor), n.style("font-family", e.fontFamily), n.style("font-size", r), n.style("font-weight", e.fontWeight), n.attr("fill", e.fill), e.class !== void 0 && n.attr("class", e.class); + const o = n.append("tspan"); + return o.attr("x", e.x + e.textMargin * 2), o.attr("fill", e.fill), o.text(i), n; +}, O0 = yi( + (t, e, i) => { + if (!t || (i = Object.assign( + {fontSize: 12, fontWeight: 400, fontFamily: "Arial", joinWith: "
"}, + i + ), $n.lineBreakRegex.test(t))) + return t; + const r = t.split(" "), n = []; + let o = ""; + return r.forEach((s, a) => { + const l = nr(`${s} `, i), h = nr(o, i); + if (l > e) { + const {hyphenatedStrings: c, remainingWord: d} = $0(s, e, "-", i); + n.push(o, ...c), o = d; + } else + h + l >= e ? (n.push(o), o = s) : o = [o, s].filter(Boolean).join(" "); + a + 1 === r.length && n.push(o); + }), n.filter((s) => s !== "").join(i.joinWith); + }, + (t, e, i) => `${t}${e}${i.fontSize}${i.fontWeight}${i.fontFamily}${i.joinWith}` +), $0 = yi( + (t, e, i = "-", r) => { + r = Object.assign( + {fontSize: 12, fontWeight: 400, fontFamily: "Arial", margin: 0}, + r + ); + const n = [...t], o = []; + let s = ""; + return n.forEach((a, l) => { + const h = `${s}${a}`; + if (nr(h, r) >= e) { + const f = l + 1, c = n.length === f, d = `${h}${i}`; + o.push(c ? h : d), s = ""; + } else + s = h; + }), {hyphenatedStrings: o, remainingWord: s}; + }, + (t, e, i = "-", r) => `${t}${e}${i}${r.fontSize}${r.fontWeight}${r.fontFamily}` +); + +function I0(t, e) { + return qn(t, e).height; +} + +function nr(t, e) { + return qn(t, e).width; +} + +const qn = yi( + (t, e) => { + const {fontSize: i = 12, fontFamily: r = "Arial", fontWeight: n = 400} = e; + if (!t) + return {width: 0, height: 0}; + const [, o] = zn(i), s = ["sans-serif", r], a = t.split($n.lineBreakRegex), l = [], h = bt("body"); + if (!h.remove) + return {width: 0, height: 0, lineHeight: 0}; + const u = h.append("svg"); + for (const c of s) { + let d = 0; + const m = {width: 0, height: 0, lineHeight: 0}; + for (const S of a) { + const O = E0(); + O.text = S || p0; + const z = M0(u, O).style("font-size", o).style("font-weight", n).style("font-family", c), + T = (z._groups || z)[0][0].getBBox(); + if (T.width === 0 && T.height === 0) + throw new Error("svg element not in render tree"); + m.width = Math.round(Math.max(m.width, T.width)), d = Math.round(T.height), m.height += d, m.lineHeight = Math.round(Math.max(m.lineHeight, d)); + } + l.push(m); + } + u.remove(); + const f = isNaN(l[1].height) || isNaN(l[1].width) || isNaN(l[1].lineHeight) || l[0].height > l[1].height && l[0].width > l[1].width && l[0].lineHeight > l[1].lineHeight ? 0 : 1; + return l[f]; + }, + (t, e) => `${t}${e.fontSize}${e.fontWeight}${e.fontFamily}` +); + +class D0 { + constructor(e = !1, i) { + this.count = 0, this.count = i ? i.length : 0, this.next = e ? () => this.count++ : () => Date.now(); + } +} + +let Ei; +const N0 = function (t) { + return Ei = Ei || document.createElement("div"), t = escape(t).replace(/%26/g, "&").replace(/%23/g, "#").replace(/%3B/g, ";"), Ei.innerHTML = t, unescape(Ei.textContent); +}; + +function rl(t) { + return "str" in t; +} + +const R0 = (t, e, i, r) => { + var o; + if (!r) + return; + const n = (o = t.node()) == null ? void 0 : o.getBBox(); + n && t.append("text").text(r).attr("x", n.x + n.width / 2).attr("y", -i).attr("class", e); +}, zn = (t) => { + if (typeof t == "number") + return [t, t + "px"]; + const e = parseInt(t ?? "", 10); + return Number.isNaN(e) ? [void 0, void 0] : t === String(e) ? [e, t + "px"] : [e, t]; +}; + +function nl(t, e) { + return d0({}, t, e); +} + +const ei = { + assignWithDepth: st, + wrapLabel: O0, + calculateTextHeight: I0, + calculateTextWidth: nr, + calculateTextDimensions: qn, + cleanAndMerge: nl, + detectInit: y0, + detectDirective: el, + isSubstringInArray: C0, + interpolateToCurve: x0, + calcLabelPosition: S0, + calcCardinalityPosition: v0, + calcTerminalLabelPosition: w0, + formatUrl: b0, + getStylesFromArray: B0, + generateId: F0, + random: L0, + runFunc: T0, + entityDecode: N0, + insertTitle: R0, + parseFontSize: zn, + InitIDGenerator: D0 +}, P0 = function (t) { + let e = t; + return e = e.replace(/style.*:\S*#.*;/g, function (i) { + return i.substring(0, i.length - 1); + }), e = e.replace(/classDef.*:\S*#.*;/g, function (i) { + return i.substring(0, i.length - 1); + }), e = e.replace(/#\w+;/g, function (i) { + const r = i.substring(1, i.length - 1); + return /^\+?\d+$/.test(r) ? "fl°°" + r + "¶ß" : "fl°" + r + "¶ß"; + }), e; +}, q0 = function (t) { + return t.replace(/fl°°/g, "&#").replace(/fl°/g, "&").replace(/¶ß/g, ";"); +}; +var ol = "comm", sl = "rule", al = "decl", z0 = "@import", W0 = "@keyframes", H0 = "@layer", ll = Math.abs, + Wn = String.fromCharCode; + +function hl(t) { + return t.trim(); +} + +function qi(t, e, i) { + return t.replace(e, i); +} + +function j0(t, e, i) { + return t.indexOf(e, i); +} + +function ci(t, e) { + return t.charCodeAt(e) | 0; +} + +function ui(t, e, i) { + return t.slice(e, i); +} + +function Ut(t) { + return t.length; +} + +function U0(t) { + return t.length; +} + +function Mi(t, e) { + return e.push(t), t; +} + +var wr = 1, Oe = 1, cl = 0, kt = 0, J = 0, Pe = ""; + +function Hn(t, e, i, r, n, o, s, a) { + return { + value: t, + root: e, + parent: i, + type: r, + props: n, + children: o, + line: wr, + column: Oe, + length: s, + return: "", + siblings: a + }; +} + +function Y0() { + return J; +} + +function G0() { + return J = kt > 0 ? ci(Pe, --kt) : 0, Oe--, J === 10 && (Oe = 1, wr--), J; +} + +function Bt() { + return J = kt < cl ? ci(Pe, kt++) : 0, Oe++, J === 10 && (Oe = 1, wr++), J; +} + +function fe() { + return ci(Pe, kt); +} + +function zi() { + return kt; +} + +function Br(t, e) { + return ui(Pe, t, e); +} + +function dn(t) { + switch (t) { + case 0: + case 9: + case 10: + case 13: + case 32: + return 5; + case 33: + case 43: + case 44: + case 47: + case 62: + case 64: + case 126: + case 59: + case 123: + case 125: + return 4; + case 58: + return 3; + case 34: + case 39: + case 40: + case 91: + return 2; + case 41: + case 93: + return 1; + } + return 0; +} + +function V0(t) { + return wr = Oe = 1, cl = Ut(Pe = t), kt = 0, []; +} + +function X0(t) { + return Pe = "", t; +} + +function Yr(t) { + return hl(Br(kt - 1, pn(t === 91 ? t + 2 : t === 40 ? t + 1 : t))); +} + +function K0(t) { + for (; (J = fe()) && J < 33;) + Bt(); + return dn(t) > 2 || dn(J) > 3 ? "" : " "; +} + +function Z0(t, e) { + for (; --e && Bt() && !(J < 48 || J > 102 || J > 57 && J < 65 || J > 70 && J < 97);) + ; + return Br(t, zi() + (e < 6 && fe() == 32 && Bt() == 32)); +} + +function pn(t) { + for (; Bt();) + switch (J) { + case t: + return kt; + case 34: + case 39: + t !== 34 && t !== 39 && pn(J); + break; + case 40: + t === 41 && pn(t); + break; + case 92: + Bt(); + break; + } + return kt; +} + +function J0(t, e) { + for (; Bt() && t + J !== 47 + 10;) + if (t + J === 42 + 42 && fe() === 47) + break; + return "/*" + Br(e, kt - 1) + "*" + Wn(t === 47 ? t : Bt()); +} + +function Q0(t) { + for (; !dn(fe());) + Bt(); + return Br(t, kt); +} + +function ty(t) { + return X0(Wi("", null, null, null, [""], t = V0(t), 0, [0], t)); +} + +function Wi(t, e, i, r, n, o, s, a, l) { + for (var h = 0, u = 0, f = s, c = 0, d = 0, m = 0, S = 1, O = 1, z = 1, T = 0, R = "", X = n, G = o, V = r, H = R; O;) + switch (m = T, T = Bt()) { + case 40: + if (m != 108 && ci(H, f - 1) == 58) { + j0(H += qi(Yr(T), "&", "&\f"), "&\f", ll(h ? a[h - 1] : 0)) != -1 && (z = -1); + break; + } + case 34: + case 39: + case 91: + H += Yr(T); + break; + case 9: + case 10: + case 13: + case 32: + H += K0(m); + break; + case 92: + H += Z0(zi() - 1, 7); + continue; + case 47: + switch (fe()) { + case 42: + case 47: + Mi(ey(J0(Bt(), zi()), e, i, l), l); + break; + default: + H += "/"; + } + break; + case 123 * S: + a[h++] = Ut(H) * z; + case 125 * S: + case 59: + case 0: + switch (T) { + case 0: + case 125: + O = 0; + case 59 + u: + z == -1 && (H = qi(H, /\f/g, "")), d > 0 && Ut(H) - f && Mi(d > 32 ? ys(H + ";", r, i, f - 1, l) : ys(qi(H, " ", "") + ";", r, i, f - 2, l), l); + break; + case 59: + H += ";"; + default: + if (Mi(V = ms(H, e, i, h, u, n, a, R, X = [], G = [], f, o), o), T === 123) + if (u === 0) + Wi(H, e, V, V, X, o, f, a, G); + else + switch (c === 99 && ci(H, 3) === 110 ? 100 : c) { + case 100: + case 108: + case 109: + case 115: + Wi(t, V, V, r && Mi(ms(t, V, V, 0, 0, n, a, R, n, X = [], f, G), G), n, G, f, a, r ? X : G); + break; + default: + Wi(H, V, V, V, [""], G, 0, a, G); + } + } + h = u = d = 0, S = z = 1, R = H = "", f = s; + break; + case 58: + f = 1 + Ut(H), d = m; + default: + if (S < 1) { + if (T == 123) + --S; + else if (T == 125 && S++ == 0 && G0() == 125) + continue; + } + switch (H += Wn(T), T * S) { + case 38: + z = u > 0 ? 1 : (H += "\f", -1); + break; + case 44: + a[h++] = (Ut(H) - 1) * z, z = 1; + break; + case 64: + fe() === 45 && (H += Yr(Bt())), c = fe(), u = f = Ut(R = H += Q0(zi())), T++; + break; + case 45: + m === 45 && Ut(H) == 2 && (S = 0); + } + } + return o; +} + +function ms(t, e, i, r, n, o, s, a, l, h, u, f) { + for (var c = n - 1, d = n === 0 ? o : [""], m = U0(d), S = 0, O = 0, z = 0; S < r; ++S) + for (var T = 0, R = ui(t, c + 1, c = ll(O = s[S])), X = t; T < m; ++T) + (X = hl(O > 0 ? d[T] + " " + R : qi(R, /&\f/g, d[T]))) && (l[z++] = X); + return Hn(t, e, i, n === 0 ? sl : a, l, h, u, f); +} + +function ey(t, e, i, r) { + return Hn(t, e, i, ol, Wn(Y0()), ui(t, 2, -2), 0, r); +} + +function ys(t, e, i, r, n) { + return Hn(t, e, i, al, ui(t, 0, r), ui(t, r + 1, -1), r, n); +} + +function gn(t, e) { + for (var i = "", r = 0; r < t.length; r++) + i += e(t[r], r, t, e) || ""; + return i; +} + +function iy(t, e, i, r) { + switch (t.type) { + case H0: + if (t.children.length) + break; + case z0: + case al: + return t.return = t.return || t.value; + case ol: + return ""; + case W0: + return t.return = t.value + "{" + gn(t.children, r) + "}"; + case sl: + if (!Ut(t.value = t.props.join(","))) + return ""; + } + return Ut(i = gn(t.children, r)) ? t.return = t.value + "{" + i + "}" : ""; +} + +const _s = "10.9.1", $e = Object.freeze(yp); +let dt = st({}, $e), ul, Ie = [], ii = st({}, $e); +const Fr = (t, e) => { + let i = st({}, t), r = {}; + for (const n of e) + pl(n), r = st(r, n); + if (i = st(i, r), r.theme && r.theme in Gt) { + const n = st({}, ul), o = st( + n.themeVariables || {}, + r.themeVariables + ); + i.theme && i.theme in Gt && (i.themeVariables = Gt[i.theme].getThemeVariables(o)); + } + return ii = i, gl(ii), ii; + }, + ry = (t) => (dt = st({}, $e), dt = st(dt, t), t.theme && Gt[t.theme] && (dt.themeVariables = Gt[t.theme].getThemeVariables(t.themeVariables)), Fr(dt, Ie), dt), + ny = (t) => { + ul = st({}, t); + }, oy = (t) => (dt = st(dt, t), Fr(dt, Ie), dt), fl = () => st({}, dt), dl = (t) => (gl(t), st(ii, t), $t()), + $t = () => st({}, ii), pl = (t) => { + t && (["secure", ...dt.secure ?? []].forEach((e) => { + Object.hasOwn(t, e) && (L.debug(`Denied attempt to modify a secure key ${e}`, t[e]), delete t[e]); + }), Object.keys(t).forEach((e) => { + e.startsWith("__") && delete t[e]; + }), Object.keys(t).forEach((e) => { + typeof t[e] == "string" && (t[e].includes("<") || t[e].includes(">") || t[e].includes("url(data:")) && delete t[e], typeof t[e] == "object" && pl(t[e]); + })); + }, sy = (t) => { + Qi(t), t.fontFamily && (!t.themeVariables || !t.themeVariables.fontFamily) && (t.themeVariables = {fontFamily: t.fontFamily}), Ie.push(t), Fr(dt, Ie); + }, or = (t = dt) => { + Ie = [], Fr(t, Ie); + }, ay = { + LAZY_LOAD_DEPRECATED: "The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead." + }, Cs = {}, ly = (t) => { + Cs[t] || (L.warn(ay[t]), Cs[t] = !0); + }, gl = (t) => { + t && (t.lazyLoadedDiagrams || t.loadExternalDiagramsAtStartup) && ly("LAZY_LOAD_DEPRECATED"); + }, ml = "c4", hy = (t) => /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t), cy = async () => { + const {diagram: t} = await import("./c4Diagram-1e775db3.js"); + return {id: ml, diagram: t}; + }, uy = { + id: ml, + detector: hy, + loader: cy + }, fy = uy, yl = "flowchart", dy = (t, e) => { + var i, r; + return ((i = e == null ? void 0 : e.flowchart) == null ? void 0 : i.defaultRenderer) === "dagre-wrapper" || ((r = e == null ? void 0 : e.flowchart) == null ? void 0 : r.defaultRenderer) === "elk" ? !1 : /^\s*graph/.test(t); + }, py = async () => { + const {diagram: t} = await import("./flowDiagram-aadb13b0.js"); + return {id: yl, diagram: t}; + }, gy = { + id: yl, + detector: dy, + loader: py + }, my = gy, _l = "flowchart-v2", yy = (t, e) => { + var i, r, n; + return ((i = e == null ? void 0 : e.flowchart) == null ? void 0 : i.defaultRenderer) === "dagre-d3" || ((r = e == null ? void 0 : e.flowchart) == null ? void 0 : r.defaultRenderer) === "elk" ? !1 : /^\s*graph/.test(t) && ((n = e == null ? void 0 : e.flowchart) == null ? void 0 : n.defaultRenderer) === "dagre-wrapper" ? !0 : /^\s*flowchart/.test(t); + }, _y = async () => { + const {diagram: t} = await import("./flowDiagram-v2-f2119625.js"); + return {id: _l, diagram: t}; + }, Cy = { + id: _l, + detector: yy, + loader: _y + }, xy = Cy, Cl = "er", by = (t) => /^\s*erDiagram/.test(t), Ty = async () => { + const {diagram: t} = await import("./erDiagram-c7ff1bec.js"); + return {id: Cl, diagram: t}; + }, ky = { + id: Cl, + detector: by, + loader: Ty + }, Sy = ky, xl = "gitGraph", vy = (t) => /^\s*gitGraph/.test(t), wy = async () => { + const {diagram: t} = await import("./gitGraphDiagram-c3a0619c.js"); + return {id: xl, diagram: t}; + }, By = { + id: xl, + detector: vy, + loader: wy + }, Fy = By, bl = "gantt", Ay = (t) => /^\s*gantt/.test(t), Ly = async () => { + const {diagram: t} = await import("./ganttDiagram-3c2fde2b.js"); + return {id: bl, diagram: t}; + }, Ey = { + id: bl, + detector: Ay, + loader: Ly + }, My = Ey, Tl = "info", Oy = (t) => /^\s*info/.test(t), $y = async () => { + const {diagram: t} = await import("./infoDiagram-2f5c50c0.js"); + return {id: Tl, diagram: t}; + }, Iy = { + id: Tl, + detector: Oy, + loader: $y + }, kl = "pie", Dy = (t) => /^\s*pie/.test(t), Ny = async () => { + const {diagram: t} = await import("./pieDiagram-828dae43.js"); + return {id: kl, diagram: t}; + }, Ry = { + id: kl, + detector: Dy, + loader: Ny + }, Sl = "quadrantChart", Py = (t) => /^\s*quadrantChart/.test(t), qy = async () => { + const {diagram: t} = await import("./quadrantDiagram-5fa00455.js"); + return {id: Sl, diagram: t}; + }, zy = { + id: Sl, + detector: Py, + loader: qy + }, Wy = zy, vl = "xychart", Hy = (t) => /^\s*xychart-beta/.test(t), jy = async () => { + const {diagram: t} = await import("./xychartDiagram-e5e6b652.js"); + return {id: vl, diagram: t}; + }, Uy = { + id: vl, + detector: Hy, + loader: jy + }, Yy = Uy, wl = "requirement", Gy = (t) => /^\s*requirement(Diagram)?/.test(t), Vy = async () => { + const {diagram: t} = await import("./requirementDiagram-03163dc4.js"); + return {id: wl, diagram: t}; + }, Xy = { + id: wl, + detector: Gy, + loader: Vy + }, Ky = Xy, Bl = "sequence", Zy = (t) => /^\s*sequenceDiagram/.test(t), Jy = async () => { + const {diagram: t} = await import("./sequenceDiagram-b517d154.js"); + return {id: Bl, diagram: t}; + }, Qy = { + id: Bl, + detector: Zy, + loader: Jy + }, t_ = Qy, Fl = "class", e_ = (t, e) => { + var i; + return ((i = e == null ? void 0 : e.class) == null ? void 0 : i.defaultRenderer) === "dagre-wrapper" ? !1 : /^\s*classDiagram/.test(t); + }, i_ = async () => { + const {diagram: t} = await import("./classDiagram-f52caa06.js"); + return {id: Fl, diagram: t}; + }, r_ = { + id: Fl, + detector: e_, + loader: i_ + }, n_ = r_, Al = "classDiagram", o_ = (t, e) => { + var i; + return /^\s*classDiagram/.test(t) && ((i = e == null ? void 0 : e.class) == null ? void 0 : i.defaultRenderer) === "dagre-wrapper" ? !0 : /^\s*classDiagram-v2/.test(t); + }, s_ = async () => { + const {diagram: t} = await import("./classDiagram-v2-640c694e.js"); + return {id: Al, diagram: t}; + }, a_ = { + id: Al, + detector: o_, + loader: s_ + }, l_ = a_, Ll = "state", h_ = (t, e) => { + var i; + return ((i = e == null ? void 0 : e.state) == null ? void 0 : i.defaultRenderer) === "dagre-wrapper" ? !1 : /^\s*stateDiagram/.test(t); + }, c_ = async () => { + const {diagram: t} = await import("./stateDiagram-fca82b5b.js"); + return {id: Ll, diagram: t}; + }, u_ = { + id: Ll, + detector: h_, + loader: c_ + }, f_ = u_, El = "stateDiagram", d_ = (t, e) => { + var i; + return !!(/^\s*stateDiagram-v2/.test(t) || /^\s*stateDiagram/.test(t) && ((i = e == null ? void 0 : e.state) == null ? void 0 : i.defaultRenderer) === "dagre-wrapper"); + }, p_ = async () => { + const {diagram: t} = await import("./stateDiagram-v2-ed04200a.js"); + return {id: El, diagram: t}; + }, g_ = { + id: El, + detector: d_, + loader: p_ + }, m_ = g_, Ml = "journey", y_ = (t) => /^\s*journey/.test(t), __ = async () => { + const {diagram: t} = await import("./journeyDiagram-14fe341a.js"); + return {id: Ml, diagram: t}; + }, C_ = { + id: Ml, + detector: y_, + loader: __ + }, x_ = C_, b_ = function (t, e) { + for (let i of e) + t.attr(i[0], i[1]); + }, T_ = function (t, e, i) { + let r = /* @__PURE__ */ new Map(); + return i ? (r.set("width", "100%"), r.set("style", `max-width: ${e}px;`)) : (r.set("height", t), r.set("width", e)), r; + }, Ol = function (t, e, i, r) { + const n = T_(e, i, r); + b_(t, n); + }, k_ = function (t, e, i, r) { + const n = e.node().getBBox(), o = n.width, s = n.height; + L.info(`SVG bounds: ${o}x${s}`, n); + let a = 0, l = 0; + L.info(`Graph bounds: ${a}x${l}`, t), a = o + i * 2, l = s + i * 2, L.info(`Calculated bounds: ${a}x${l}`), Ol(e, l, a, r); + const h = `${n.x - i} ${n.y - i} ${n.width + 2 * i} ${n.height + 2 * i}`; + e.attr("viewBox", h); + }, Hi = {}, S_ = (t, e, i) => { + let r = ""; + return t in Hi && Hi[t] ? r = Hi[t](i) : L.warn(`No theme found for ${t}`), ` & { + font-family: ${i.fontFamily}; + font-size: ${i.fontSize}; + fill: ${i.textColor} + } + + /* Classes common for multiple diagrams */ + + & .error-icon { + fill: ${i.errorBkgColor}; + } + & .error-text { + fill: ${i.errorTextColor}; + stroke: ${i.errorTextColor}; + } + + & .edge-thickness-normal { + stroke-width: 2px; + } + & .edge-thickness-thick { + stroke-width: 3.5px + } + & .edge-pattern-solid { + stroke-dasharray: 0; + } + + & .edge-pattern-dashed{ + stroke-dasharray: 3; + } + .edge-pattern-dotted { + stroke-dasharray: 2; + } + + & .marker { + fill: ${i.lineColor}; + stroke: ${i.lineColor}; + } + & .marker.cross { + stroke: ${i.lineColor}; + } + + & svg { + font-family: ${i.fontFamily}; + font-size: ${i.fontSize}; + } + + ${r} + + ${e} +`; + }, v_ = (t, e) => { + e !== void 0 && (Hi[t] = e); + }, w_ = S_; +let jn = "", Un = "", Yn = ""; +const Gn = (t) => ai(t, $t()), B_ = () => { + jn = "", Yn = "", Un = ""; + }, F_ = (t) => { + jn = Gn(t).replace(/^\s+/g, ""); + }, A_ = () => jn, L_ = (t) => { + Yn = Gn(t).replace(/\n\s+/g, ` +`); + }, E_ = () => Yn, M_ = (t) => { + Un = Gn(t); + }, O_ = () => Un, $_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + clear: B_, + getAccDescription: E_, + getAccTitle: A_, + getDiagramTitle: O_, + setAccDescription: L_, + setAccTitle: F_, + setDiagramTitle: M_ + }, Symbol.toStringTag, {value: "Module"})), I_ = L, D_ = bn, Vn = $t, v1 = dl, w1 = $e, N_ = (t) => ai(t, Vn()), + R_ = k_, P_ = () => $_, sr = {}, ar = (t, e, i) => { + var r; + if (sr[t]) + throw new Error(`Diagram ${t} already registered.`); + sr[t] = e, i && qa(t, i), v_(t, e.styles), (r = e.injectUtils) == null || r.call( + e, + I_, + D_, + Vn, + N_, + R_, + P_(), + () => { + } + ); + }, Xn = (t) => { + if (t in sr) + return sr[t]; + throw new q_(t); + }; + +class q_ extends Error { + constructor(e) { + super(`Diagram ${e} not found.`); + } +} + +const z_ = (t) => { + var n; + const {securityLevel: e} = Vn(); + let i = bt("body"); + if (e === "sandbox") { + const s = ((n = bt(`#i${t}`).node()) == null ? void 0 : n.contentDocument) ?? document; + i = bt(s.body); + } + return i.select(`#${t}`); +}, W_ = (t, e, i) => { + L.debug(`rendering svg for syntax error +`); + const r = z_(e), n = r.append("g"); + r.attr("viewBox", "0 0 2412 512"), Ol(r, 100, 512, !0), n.append("path").attr("class", "error-icon").attr( + "d", + "m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z" + ), n.append("path").attr("class", "error-icon").attr( + "d", + "m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z" + ), n.append("path").attr("class", "error-icon").attr( + "d", + "m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z" + ), n.append("path").attr("class", "error-icon").attr( + "d", + "m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z" + ), n.append("path").attr("class", "error-icon").attr( + "d", + "m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z" + ), n.append("path").attr("class", "error-icon").attr( + "d", + "m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z" + ), n.append("text").attr("class", "error-text").attr("x", 1440).attr("y", 250).attr("font-size", "150px").style("text-anchor", "middle").text("Syntax error in text"), n.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${i}`); +}, $l = {draw: W_}, H_ = $l, j_ = { + db: {}, + renderer: $l, + parser: { + parser: {yy: {}}, + parse: () => { + } + } +}, U_ = j_, Il = "flowchart-elk", Y_ = (t, e) => { + var i; + return ( + // If diagram explicitly states flowchart-elk + !!(/^\s*flowchart-elk/.test(t) || // If a flowchart/graph diagram has their default renderer set to elk + /^\s*flowchart|graph/.test(t) && ((i = e == null ? void 0 : e.flowchart) == null ? void 0 : i.defaultRenderer) === "elk") + ); +}, G_ = async () => { + const {diagram: t} = await import("./flowchart-elk-definition-cf813a97.js"); + return {id: Il, diagram: t}; +}, V_ = { + id: Il, + detector: Y_, + loader: G_ +}, X_ = V_, Dl = "timeline", K_ = (t) => /^\s*timeline/.test(t), Z_ = async () => { + const {diagram: t} = await import("./timeline-definition-4ee9bff4.js"); + return {id: Dl, diagram: t}; +}, J_ = { + id: Dl, + detector: K_, + loader: Z_ +}, Q_ = J_, Nl = "mindmap", tC = (t) => /^\s*mindmap/.test(t), eC = async () => { + const {diagram: t} = await import("./mindmap-definition-9399c7e6.js"); + return {id: Nl, diagram: t}; +}, iC = { + id: Nl, + detector: tC, + loader: eC +}, rC = iC, Rl = "sankey", nC = (t) => /^\s*sankey-beta/.test(t), oC = async () => { + const {diagram: t} = await import("./sankeyDiagram-52ec8976.js"); + return {id: Rl, diagram: t}; +}, sC = { + id: Rl, + detector: nC, + loader: oC +}, aC = sC, Pl = "block", lC = (t) => /^\s*block-beta/.test(t), hC = async () => { + const {diagram: t} = await import("./blockDiagram-5dc23a45.js"); + return {id: Pl, diagram: t}; +}, cC = { + id: Pl, + detector: lC, + loader: hC +}, uC = cC; +let xs = !1; +const Kn = () => { + xs || (xs = !0, ar("error", U_, (t) => t.toLowerCase().trim() === "error"), ar( + "---", + // --- diagram type may appear if YAML front-matter is not parsed correctly + { + db: { + clear: () => { + } + }, + styles: {}, + // should never be used + renderer: { + draw: () => { + } + }, + parser: { + parser: {yy: {}}, + parse: () => { + throw new Error( + "Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks" + ); + } + }, + init: () => null + // no op + }, + (t) => t.toLowerCase().trimStart().startsWith("---") + ), Pa( + fy, + l_, + n_, + Sy, + My, + Iy, + Ry, + Ky, + t_, + X_, + xy, + my, + rC, + Q_, + Fy, + m_, + f_, + x_, + Wy, + aC, + Yy, + uC + )); +}; + +class ql { + constructor(e, i = {}) { + this.text = e, this.metadata = i, this.type = "graph", this.text = P0(e), this.text += ` +`; + const r = $t(); + try { + this.type = xr(e, r); + } catch (o) { + this.type = "error", this.detectError = o; + } + const n = Xn(this.type); + L.debug("Type " + this.type), this.db = n.db, this.renderer = n.renderer, this.parser = n.parser, this.parser.parser.yy = this.db, this.init = n.init, this.parse(); + } + + parse() { + var i, r, n, o, s; + if (this.detectError) + throw this.detectError; + (r = (i = this.db).clear) == null || r.call(i); + const e = $t(); + (n = this.init) == null || n.call(this, e), this.metadata.title && ((s = (o = this.db).setDiagramTitle) == null || s.call(o, this.metadata.title)), this.parser.parse(this.text); + } + + async render(e, i) { + await this.renderer.draw(this.text, e, i, this); + } + + getParser() { + return this.parser; + } + + getType() { + return this.type; + } +} + +const fC = async (t, e = {}) => { + const i = xr(t, $t()); + try { + Xn(i); + } catch { + const n = xp(i); + if (!n) + throw new Ra(`Diagram ${i} not found.`); + const {id: o, diagram: s} = await n(); + ar(o, s); + } + return new ql(t, e); +}; +let bs = []; +const dC = () => { + bs.forEach((t) => { + t(); + }), bs = []; +}; +var pC = ja(Object.keys, Object); +const gC = pC; +var mC = Object.prototype, yC = mC.hasOwnProperty; + +function _C(t) { + if (!Sr(t)) + return gC(t); + var e = []; + for (var i in Object(t)) + yC.call(t, i) && i != "constructor" && e.push(i); + return e; +} + +var CC = Ce(Dt, "DataView"); +const mn = CC; +var xC = Ce(Dt, "Promise"); +const yn = xC; +var bC = Ce(Dt, "Set"); +const _n = bC; +var TC = Ce(Dt, "WeakMap"); +const Cn = TC; +var Ts = "[object Map]", kC = "[object Object]", ks = "[object Promise]", Ss = "[object Set]", vs = "[object WeakMap]", + ws = "[object DataView]", SC = _e(mn), vC = _e(hi), wC = _e(yn), BC = _e(_n), FC = _e(Cn), he = Ne; +(mn && he(new mn(new ArrayBuffer(1))) != ws || hi && he(new hi()) != Ts || yn && he(yn.resolve()) != ks || _n && he(new _n()) != Ss || Cn && he(new Cn()) != vs) && (he = function (t) { + var e = Ne(t), i = e == kC ? t.constructor : void 0, r = i ? _e(i) : ""; + if (r) + switch (r) { + case SC: + return ws; + case vC: + return Ts; + case wC: + return ks; + case BC: + return Ss; + case FC: + return vs; + } + return e; +}); +const AC = he; +var LC = "[object Map]", EC = "[object Set]", MC = Object.prototype, OC = MC.hasOwnProperty; + +function Gr(t) { + if (t == null) + return !0; + if (vr(t) && (rr(t) || typeof t == "string" || typeof t.splice == "function" || Nn(t) || Rn(t) || ir(t))) + return !t.length; + var e = AC(t); + if (e == LC || e == EC) + return !t.size; + if (Sr(t)) + return !_C(t).length; + for (var i in t) + if (OC.call(t, i)) + return !1; + return !0; +} + +const $C = "graphics-document document"; + +function IC(t, e) { + t.attr("role", $C), e !== "" && t.attr("aria-roledescription", e); +} + +function DC(t, e, i, r) { + if (t.insert !== void 0) { + if (i) { + const n = `chart-desc-${r}`; + t.attr("aria-describedby", n), t.insert("desc", ":first-child").attr("id", n).text(i); + } + if (e) { + const n = `chart-title-${r}`; + t.attr("aria-labelledby", n), t.insert("title", ":first-child").attr("id", n).text(e); + } + } +} + +const NC = (t) => t.replace(/^\s*%%(?!{)[^\n]+\n?/gm, "").trimStart(); + +/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ +function zl(t) { + return typeof t > "u" || t === null; +} + +function RC(t) { + return typeof t == "object" && t !== null; +} + +function PC(t) { + return Array.isArray(t) ? t : zl(t) ? [] : [t]; +} + +function qC(t, e) { + var i, r, n, o; + if (e) + for (o = Object.keys(e), i = 0, r = o.length; i < r; i += 1) + n = o[i], t[n] = e[n]; + return t; +} + +function zC(t, e) { + var i = "", r; + for (r = 0; r < e; r += 1) + i += t; + return i; +} + +function WC(t) { + return t === 0 && Number.NEGATIVE_INFINITY === 1 / t; +} + +var HC = zl, jC = RC, UC = PC, YC = zC, GC = WC, VC = qC, lt = { + isNothing: HC, + isObject: jC, + toArray: UC, + repeat: YC, + isNegativeZero: GC, + extend: VC +}; + +function Wl(t, e) { + var i = "", r = t.reason || "(unknown reason)"; + return t.mark ? (t.mark.name && (i += 'in "' + t.mark.name + '" '), i += "(" + (t.mark.line + 1) + ":" + (t.mark.column + 1) + ")", !e && t.mark.snippet && (i += ` + +` + t.mark.snippet), r + " " + i) : r; +} + +function fi(t, e) { + Error.call(this), this.name = "YAMLException", this.reason = t, this.mark = e, this.message = Wl(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || ""; +} + +fi.prototype = Object.create(Error.prototype); +fi.prototype.constructor = fi; +fi.prototype.toString = function (e) { + return this.name + ": " + Wl(this, e); +}; +var Yt = fi; + +function Vr(t, e, i, r, n) { + var o = "", s = "", a = Math.floor(n / 2) - 1; + return r - e > a && (o = " ... ", e = r - a + o.length), i - r > a && (s = " ...", i = r + a - s.length), { + str: o + t.slice(e, i).replace(/\t/g, "→") + s, + pos: r - e + o.length + // relative position + }; +} + +function Xr(t, e) { + return lt.repeat(" ", e - t.length) + t; +} + +function XC(t, e) { + if (e = Object.create(e || null), !t.buffer) + return null; + e.maxLength || (e.maxLength = 79), typeof e.indent != "number" && (e.indent = 1), typeof e.linesBefore != "number" && (e.linesBefore = 3), typeof e.linesAfter != "number" && (e.linesAfter = 2); + for (var i = /\r?\n|\r|\0/g, r = [0], n = [], o, s = -1; o = i.exec(t.buffer);) + n.push(o.index), r.push(o.index + o[0].length), t.position <= o.index && s < 0 && (s = r.length - 2); + s < 0 && (s = r.length - 1); + var a = "", l, h, u = Math.min(t.line + e.linesAfter, n.length).toString().length, + f = e.maxLength - (e.indent + u + 3); + for (l = 1; l <= e.linesBefore && !(s - l < 0); l++) + h = Vr( + t.buffer, + r[s - l], + n[s - l], + t.position - (r[s] - r[s - l]), + f + ), a = lt.repeat(" ", e.indent) + Xr((t.line - l + 1).toString(), u) + " | " + h.str + ` +` + a; + for (h = Vr(t.buffer, r[s], n[s], t.position, f), a += lt.repeat(" ", e.indent) + Xr((t.line + 1).toString(), u) + " | " + h.str + ` +`, a += lt.repeat("-", e.indent + u + 3 + h.pos) + `^ +`, l = 1; l <= e.linesAfter && !(s + l >= n.length); l++) + h = Vr( + t.buffer, + r[s + l], + n[s + l], + t.position - (r[s] - r[s + l]), + f + ), a += lt.repeat(" ", e.indent) + Xr((t.line + l + 1).toString(), u) + " | " + h.str + ` +`; + return a.replace(/\n$/, ""); +} + +var KC = XC, ZC = [ + "kind", + "multi", + "resolve", + "construct", + "instanceOf", + "predicate", + "represent", + "representName", + "defaultStyle", + "styleAliases" +], JC = [ + "scalar", + "sequence", + "mapping" +]; + +function QC(t) { + var e = {}; + return t !== null && Object.keys(t).forEach(function (i) { + t[i].forEach(function (r) { + e[String(r)] = i; + }); + }), e; +} + +function tx(t, e) { + if (e = e || {}, Object.keys(e).forEach(function (i) { + if (ZC.indexOf(i) === -1) + throw new Yt('Unknown option "' + i + '" is met in definition of "' + t + '" YAML type.'); + }), this.options = e, this.tag = t, this.kind = e.kind || null, this.resolve = e.resolve || function () { + return !0; + }, this.construct = e.construct || function (i) { + return i; + }, this.instanceOf = e.instanceOf || null, this.predicate = e.predicate || null, this.represent = e.represent || null, this.representName = e.representName || null, this.defaultStyle = e.defaultStyle || null, this.multi = e.multi || !1, this.styleAliases = QC(e.styleAliases || null), JC.indexOf(this.kind) === -1) + throw new Yt('Unknown kind "' + this.kind + '" is specified for "' + t + '" YAML type.'); +} + +var at = tx; + +function Bs(t, e) { + var i = []; + return t[e].forEach(function (r) { + var n = i.length; + i.forEach(function (o, s) { + o.tag === r.tag && o.kind === r.kind && o.multi === r.multi && (n = s); + }), i[n] = r; + }), i; +} + +function ex() { + var t = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, e, i; + + function r(n) { + n.multi ? (t.multi[n.kind].push(n), t.multi.fallback.push(n)) : t[n.kind][n.tag] = t.fallback[n.tag] = n; + } + + for (e = 0, i = arguments.length; e < i; e += 1) + arguments[e].forEach(r); + return t; +} + +function xn(t) { + return this.extend(t); +} + +xn.prototype.extend = function (e) { + var i = [], r = []; + if (e instanceof at) + r.push(e); + else if (Array.isArray(e)) + r = r.concat(e); + else if (e && (Array.isArray(e.implicit) || Array.isArray(e.explicit))) + e.implicit && (i = i.concat(e.implicit)), e.explicit && (r = r.concat(e.explicit)); + else + throw new Yt("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); + i.forEach(function (o) { + if (!(o instanceof at)) + throw new Yt("Specified list of YAML types (or a single Type object) contains a non-Type object."); + if (o.loadKind && o.loadKind !== "scalar") + throw new Yt("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + if (o.multi) + throw new Yt("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); + }), r.forEach(function (o) { + if (!(o instanceof at)) + throw new Yt("Specified list of YAML types (or a single Type object) contains a non-Type object."); + }); + var n = Object.create(xn.prototype); + return n.implicit = (this.implicit || []).concat(i), n.explicit = (this.explicit || []).concat(r), n.compiledImplicit = Bs(n, "implicit"), n.compiledExplicit = Bs(n, "explicit"), n.compiledTypeMap = ex(n.compiledImplicit, n.compiledExplicit), n; +}; +var ix = xn, rx = new at("tag:yaml.org,2002:str", { + kind: "scalar", + construct: function (t) { + return t !== null ? t : ""; + } +}), nx = new at("tag:yaml.org,2002:seq", { + kind: "sequence", + construct: function (t) { + return t !== null ? t : []; + } +}), ox = new at("tag:yaml.org,2002:map", { + kind: "mapping", + construct: function (t) { + return t !== null ? t : {}; + } +}), sx = new ix({ + explicit: [ + rx, + nx, + ox + ] +}); + +function ax(t) { + if (t === null) + return !0; + var e = t.length; + return e === 1 && t === "~" || e === 4 && (t === "null" || t === "Null" || t === "NULL"); +} + +function lx() { + return null; +} + +function hx(t) { + return t === null; +} + +var cx = new at("tag:yaml.org,2002:null", { + kind: "scalar", + resolve: ax, + construct: lx, + predicate: hx, + represent: { + canonical: function () { + return "~"; + }, + lowercase: function () { + return "null"; + }, + uppercase: function () { + return "NULL"; + }, + camelcase: function () { + return "Null"; + }, + empty: function () { + return ""; + } + }, + defaultStyle: "lowercase" +}); + +function ux(t) { + if (t === null) + return !1; + var e = t.length; + return e === 4 && (t === "true" || t === "True" || t === "TRUE") || e === 5 && (t === "false" || t === "False" || t === "FALSE"); +} + +function fx(t) { + return t === "true" || t === "True" || t === "TRUE"; +} + +function dx(t) { + return Object.prototype.toString.call(t) === "[object Boolean]"; +} + +var px = new at("tag:yaml.org,2002:bool", { + kind: "scalar", + resolve: ux, + construct: fx, + predicate: dx, + represent: { + lowercase: function (t) { + return t ? "true" : "false"; + }, + uppercase: function (t) { + return t ? "TRUE" : "FALSE"; + }, + camelcase: function (t) { + return t ? "True" : "False"; + } + }, + defaultStyle: "lowercase" +}); + +function gx(t) { + return 48 <= t && t <= 57 || 65 <= t && t <= 70 || 97 <= t && t <= 102; +} + +function mx(t) { + return 48 <= t && t <= 55; +} + +function yx(t) { + return 48 <= t && t <= 57; +} + +function _x(t) { + if (t === null) + return !1; + var e = t.length, i = 0, r = !1, n; + if (!e) + return !1; + if (n = t[i], (n === "-" || n === "+") && (n = t[++i]), n === "0") { + if (i + 1 === e) + return !0; + if (n = t[++i], n === "b") { + for (i++; i < e; i++) + if (n = t[i], n !== "_") { + if (n !== "0" && n !== "1") + return !1; + r = !0; + } + return r && n !== "_"; + } + if (n === "x") { + for (i++; i < e; i++) + if (n = t[i], n !== "_") { + if (!gx(t.charCodeAt(i))) + return !1; + r = !0; + } + return r && n !== "_"; + } + if (n === "o") { + for (i++; i < e; i++) + if (n = t[i], n !== "_") { + if (!mx(t.charCodeAt(i))) + return !1; + r = !0; + } + return r && n !== "_"; + } + } + if (n === "_") + return !1; + for (; i < e; i++) + if (n = t[i], n !== "_") { + if (!yx(t.charCodeAt(i))) + return !1; + r = !0; + } + return !(!r || n === "_"); +} + +function Cx(t) { + var e = t, i = 1, r; + if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), r = e[0], (r === "-" || r === "+") && (r === "-" && (i = -1), e = e.slice(1), r = e[0]), e === "0") + return 0; + if (r === "0") { + if (e[1] === "b") + return i * parseInt(e.slice(2), 2); + if (e[1] === "x") + return i * parseInt(e.slice(2), 16); + if (e[1] === "o") + return i * parseInt(e.slice(2), 8); + } + return i * parseInt(e, 10); +} + +function xx(t) { + return Object.prototype.toString.call(t) === "[object Number]" && t % 1 === 0 && !lt.isNegativeZero(t); +} + +var bx = new at("tag:yaml.org,2002:int", { + kind: "scalar", + resolve: _x, + construct: Cx, + predicate: xx, + represent: { + binary: function (t) { + return t >= 0 ? "0b" + t.toString(2) : "-0b" + t.toString(2).slice(1); + }, + octal: function (t) { + return t >= 0 ? "0o" + t.toString(8) : "-0o" + t.toString(8).slice(1); + }, + decimal: function (t) { + return t.toString(10); + }, + /* eslint-disable max-len */ + hexadecimal: function (t) { + return t >= 0 ? "0x" + t.toString(16).toUpperCase() : "-0x" + t.toString(16).toUpperCase().slice(1); + } + }, + defaultStyle: "decimal", + styleAliases: { + binary: [2, "bin"], + octal: [8, "oct"], + decimal: [10, "dec"], + hexadecimal: [16, "hex"] + } +}), Tx = new RegExp( + // 2.5e4, 2.5 and integers + "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" +); + +function kx(t) { + return !(t === null || !Tx.test(t) || // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + t[t.length - 1] === "_"); +} + +function Sx(t) { + var e, i; + return e = t.replace(/_/g, "").toLowerCase(), i = e[0] === "-" ? -1 : 1, "+-".indexOf(e[0]) >= 0 && (e = e.slice(1)), e === ".inf" ? i === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : e === ".nan" ? NaN : i * parseFloat(e, 10); +} + +var vx = /^[-+]?[0-9]+e/; + +function wx(t, e) { + var i; + if (isNaN(t)) + switch (e) { + case "lowercase": + return ".nan"; + case "uppercase": + return ".NAN"; + case "camelcase": + return ".NaN"; + } + else if (Number.POSITIVE_INFINITY === t) + switch (e) { + case "lowercase": + return ".inf"; + case "uppercase": + return ".INF"; + case "camelcase": + return ".Inf"; + } + else if (Number.NEGATIVE_INFINITY === t) + switch (e) { + case "lowercase": + return "-.inf"; + case "uppercase": + return "-.INF"; + case "camelcase": + return "-.Inf"; + } + else if (lt.isNegativeZero(t)) + return "-0.0"; + return i = t.toString(10), vx.test(i) ? i.replace("e", ".e") : i; +} + +function Bx(t) { + return Object.prototype.toString.call(t) === "[object Number]" && (t % 1 !== 0 || lt.isNegativeZero(t)); +} + +var Fx = new at("tag:yaml.org,2002:float", { + kind: "scalar", + resolve: kx, + construct: Sx, + predicate: Bx, + represent: wx, + defaultStyle: "lowercase" +}), Hl = sx.extend({ + implicit: [ + cx, + px, + bx, + Fx + ] +}), Ax = Hl, jl = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" +), Ul = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$" +); + +function Lx(t) { + return t === null ? !1 : jl.exec(t) !== null || Ul.exec(t) !== null; +} + +function Ex(t) { + var e, i, r, n, o, s, a, l = 0, h = null, u, f, c; + if (e = jl.exec(t), e === null && (e = Ul.exec(t)), e === null) + throw new Error("Date resolve error"); + if (i = +e[1], r = +e[2] - 1, n = +e[3], !e[4]) + return new Date(Date.UTC(i, r, n)); + if (o = +e[4], s = +e[5], a = +e[6], e[7]) { + for (l = e[7].slice(0, 3); l.length < 3;) + l += "0"; + l = +l; + } + return e[9] && (u = +e[10], f = +(e[11] || 0), h = (u * 60 + f) * 6e4, e[9] === "-" && (h = -h)), c = new Date(Date.UTC(i, r, n, o, s, a, l)), h && c.setTime(c.getTime() - h), c; +} + +function Mx(t) { + return t.toISOString(); +} + +var Ox = new at("tag:yaml.org,2002:timestamp", { + kind: "scalar", + resolve: Lx, + construct: Ex, + instanceOf: Date, + represent: Mx +}); + +function $x(t) { + return t === "<<" || t === null; +} + +var Ix = new at("tag:yaml.org,2002:merge", { + kind: "scalar", + resolve: $x +}), Zn = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`; + +function Dx(t) { + if (t === null) + return !1; + var e, i, r = 0, n = t.length, o = Zn; + for (i = 0; i < n; i++) + if (e = o.indexOf(t.charAt(i)), !(e > 64)) { + if (e < 0) + return !1; + r += 6; + } + return r % 8 === 0; +} + +function Nx(t) { + var e, i, r = t.replace(/[\r\n=]/g, ""), n = r.length, o = Zn, s = 0, a = []; + for (e = 0; e < n; e++) + e % 4 === 0 && e && (a.push(s >> 16 & 255), a.push(s >> 8 & 255), a.push(s & 255)), s = s << 6 | o.indexOf(r.charAt(e)); + return i = n % 4 * 6, i === 0 ? (a.push(s >> 16 & 255), a.push(s >> 8 & 255), a.push(s & 255)) : i === 18 ? (a.push(s >> 10 & 255), a.push(s >> 2 & 255)) : i === 12 && a.push(s >> 4 & 255), new Uint8Array(a); +} + +function Rx(t) { + var e = "", i = 0, r, n, o = t.length, s = Zn; + for (r = 0; r < o; r++) + r % 3 === 0 && r && (e += s[i >> 18 & 63], e += s[i >> 12 & 63], e += s[i >> 6 & 63], e += s[i & 63]), i = (i << 8) + t[r]; + return n = o % 3, n === 0 ? (e += s[i >> 18 & 63], e += s[i >> 12 & 63], e += s[i >> 6 & 63], e += s[i & 63]) : n === 2 ? (e += s[i >> 10 & 63], e += s[i >> 4 & 63], e += s[i << 2 & 63], e += s[64]) : n === 1 && (e += s[i >> 2 & 63], e += s[i << 4 & 63], e += s[64], e += s[64]), e; +} + +function Px(t) { + return Object.prototype.toString.call(t) === "[object Uint8Array]"; +} + +var qx = new at("tag:yaml.org,2002:binary", { + kind: "scalar", + resolve: Dx, + construct: Nx, + predicate: Px, + represent: Rx +}), zx = Object.prototype.hasOwnProperty, Wx = Object.prototype.toString; + +function Hx(t) { + if (t === null) + return !0; + var e = [], i, r, n, o, s, a = t; + for (i = 0, r = a.length; i < r; i += 1) { + if (n = a[i], s = !1, Wx.call(n) !== "[object Object]") + return !1; + for (o in n) + if (zx.call(n, o)) + if (!s) + s = !0; + else + return !1; + if (!s) + return !1; + if (e.indexOf(o) === -1) + e.push(o); + else + return !1; + } + return !0; +} + +function jx(t) { + return t !== null ? t : []; +} + +var Ux = new at("tag:yaml.org,2002:omap", { + kind: "sequence", + resolve: Hx, + construct: jx +}), Yx = Object.prototype.toString; + +function Gx(t) { + if (t === null) + return !0; + var e, i, r, n, o, s = t; + for (o = new Array(s.length), e = 0, i = s.length; e < i; e += 1) { + if (r = s[e], Yx.call(r) !== "[object Object]" || (n = Object.keys(r), n.length !== 1)) + return !1; + o[e] = [n[0], r[n[0]]]; + } + return !0; +} + +function Vx(t) { + if (t === null) + return []; + var e, i, r, n, o, s = t; + for (o = new Array(s.length), e = 0, i = s.length; e < i; e += 1) + r = s[e], n = Object.keys(r), o[e] = [n[0], r[n[0]]]; + return o; +} + +var Xx = new at("tag:yaml.org,2002:pairs", { + kind: "sequence", + resolve: Gx, + construct: Vx +}), Kx = Object.prototype.hasOwnProperty; + +function Zx(t) { + if (t === null) + return !0; + var e, i = t; + for (e in i) + if (Kx.call(i, e) && i[e] !== null) + return !1; + return !0; +} + +function Jx(t) { + return t !== null ? t : {}; +} + +var Qx = new at("tag:yaml.org,2002:set", { + kind: "mapping", + resolve: Zx, + construct: Jx + }), tb = Ax.extend({ + implicit: [ + Ox, + Ix + ], + explicit: [ + qx, + Ux, + Xx, + Qx + ] + }), re = Object.prototype.hasOwnProperty, lr = 1, Yl = 2, Gl = 3, hr = 4, Kr = 1, eb = 2, Fs = 3, + ib = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, + rb = /[\x85\u2028\u2029]/, nb = /[,\[\]\{\}]/, Vl = /^(?:!|!!|![a-z\-]+!)$/i, + Xl = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + +function As(t) { + return Object.prototype.toString.call(t); +} + +function Mt(t) { + return t === 10 || t === 13; +} + +function de(t) { + return t === 9 || t === 32; +} + +function gt(t) { + return t === 9 || t === 32 || t === 10 || t === 13; +} + +function we(t) { + return t === 44 || t === 91 || t === 93 || t === 123 || t === 125; +} + +function ob(t) { + var e; + return 48 <= t && t <= 57 ? t - 48 : (e = t | 32, 97 <= e && e <= 102 ? e - 97 + 10 : -1); +} + +function sb(t) { + return t === 120 ? 2 : t === 117 ? 4 : t === 85 ? 8 : 0; +} + +function ab(t) { + return 48 <= t && t <= 57 ? t - 48 : -1; +} + +function Ls(t) { + return t === 48 ? "\0" : t === 97 ? "\x07" : t === 98 ? "\b" : t === 116 || t === 9 ? " " : t === 110 ? ` +` : t === 118 ? "\v" : t === 102 ? "\f" : t === 114 ? "\r" : t === 101 ? "\x1B" : t === 32 ? " " : t === 34 ? '"' : t === 47 ? "/" : t === 92 ? "\\" : t === 78 ? "…" : t === 95 ? " " : t === 76 ? "\u2028" : t === 80 ? "\u2029" : ""; +} + +function lb(t) { + return t <= 65535 ? String.fromCharCode(t) : String.fromCharCode( + (t - 65536 >> 10) + 55296, + (t - 65536 & 1023) + 56320 + ); +} + +var Kl = new Array(256), Zl = new Array(256); +for (var ve = 0; ve < 256; ve++) + Kl[ve] = Ls(ve) ? 1 : 0, Zl[ve] = Ls(ve); + +function hb(t, e) { + this.input = t, this.filename = e.filename || null, this.schema = e.schema || tb, this.onWarning = e.onWarning || null, this.legacy = e.legacy || !1, this.json = e.json || !1, this.listener = e.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = t.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = []; +} + +function Jl(t, e) { + var i = { + name: t.filename, + buffer: t.input.slice(0, -1), + // omit trailing \0 + position: t.position, + line: t.line, + column: t.position - t.lineStart + }; + return i.snippet = KC(i), new Yt(e, i); +} + +function A(t, e) { + throw Jl(t, e); +} + +function cr(t, e) { + t.onWarning && t.onWarning.call(null, Jl(t, e)); +} + +var Es = { + YAML: function (e, i, r) { + var n, o, s; + e.version !== null && A(e, "duplication of %YAML directive"), r.length !== 1 && A(e, "YAML directive accepts exactly one argument"), n = /^([0-9]+)\.([0-9]+)$/.exec(r[0]), n === null && A(e, "ill-formed argument of the YAML directive"), o = parseInt(n[1], 10), s = parseInt(n[2], 10), o !== 1 && A(e, "unacceptable YAML version of the document"), e.version = r[0], e.checkLineBreaks = s < 2, s !== 1 && s !== 2 && cr(e, "unsupported YAML version of the document"); + }, + TAG: function (e, i, r) { + var n, o; + r.length !== 2 && A(e, "TAG directive accepts exactly two arguments"), n = r[0], o = r[1], Vl.test(n) || A(e, "ill-formed tag handle (first argument) of the TAG directive"), re.call(e.tagMap, n) && A(e, 'there is a previously declared suffix for "' + n + '" tag handle'), Xl.test(o) || A(e, "ill-formed tag prefix (second argument) of the TAG directive"); + try { + o = decodeURIComponent(o); + } catch { + A(e, "tag prefix is malformed: " + o); + } + e.tagMap[n] = o; + } +}; + +function ee(t, e, i, r) { + var n, o, s, a; + if (e < i) { + if (a = t.input.slice(e, i), r) + for (n = 0, o = a.length; n < o; n += 1) + s = a.charCodeAt(n), s === 9 || 32 <= s && s <= 1114111 || A(t, "expected valid JSON character"); + else + ib.test(a) && A(t, "the stream contains non-printable characters"); + t.result += a; + } +} + +function Ms(t, e, i, r) { + var n, o, s, a; + for (lt.isObject(i) || A(t, "cannot merge mappings; the provided source object is unacceptable"), n = Object.keys(i), s = 0, a = n.length; s < a; s += 1) + o = n[s], re.call(e, o) || (e[o] = i[o], r[o] = !0); +} + +function Be(t, e, i, r, n, o, s, a, l) { + var h, u; + if (Array.isArray(n)) + for (n = Array.prototype.slice.call(n), h = 0, u = n.length; h < u; h += 1) + Array.isArray(n[h]) && A(t, "nested arrays are not supported inside keys"), typeof n == "object" && As(n[h]) === "[object Object]" && (n[h] = "[object Object]"); + if (typeof n == "object" && As(n) === "[object Object]" && (n = "[object Object]"), n = String(n), e === null && (e = {}), r === "tag:yaml.org,2002:merge") + if (Array.isArray(o)) + for (h = 0, u = o.length; h < u; h += 1) + Ms(t, e, o[h], i); + else + Ms(t, e, o, i); + else + !t.json && !re.call(i, n) && re.call(e, n) && (t.line = s || t.line, t.lineStart = a || t.lineStart, t.position = l || t.position, A(t, "duplicated mapping key")), n === "__proto__" ? Object.defineProperty(e, n, { + configurable: !0, + enumerable: !0, + writable: !0, + value: o + }) : e[n] = o, delete i[n]; + return e; +} + +function Jn(t) { + var e; + e = t.input.charCodeAt(t.position), e === 10 ? t.position++ : e === 13 ? (t.position++, t.input.charCodeAt(t.position) === 10 && t.position++) : A(t, "a line break is expected"), t.line += 1, t.lineStart = t.position, t.firstTabInLine = -1; +} + +function Q(t, e, i) { + for (var r = 0, n = t.input.charCodeAt(t.position); n !== 0;) { + for (; de(n);) + n === 9 && t.firstTabInLine === -1 && (t.firstTabInLine = t.position), n = t.input.charCodeAt(++t.position); + if (e && n === 35) + do + n = t.input.charCodeAt(++t.position); + while (n !== 10 && n !== 13 && n !== 0); + if (Mt(n)) + for (Jn(t), n = t.input.charCodeAt(t.position), r++, t.lineIndent = 0; n === 32;) + t.lineIndent++, n = t.input.charCodeAt(++t.position); + else + break; + } + return i !== -1 && r !== 0 && t.lineIndent < i && cr(t, "deficient indentation"), r; +} + +function Ar(t) { + var e = t.position, i; + return i = t.input.charCodeAt(e), !!((i === 45 || i === 46) && i === t.input.charCodeAt(e + 1) && i === t.input.charCodeAt(e + 2) && (e += 3, i = t.input.charCodeAt(e), i === 0 || gt(i))); +} + +function Qn(t, e) { + e === 1 ? t.result += " " : e > 1 && (t.result += lt.repeat(` +`, e - 1)); +} + +function cb(t, e, i) { + var r, n, o, s, a, l, h, u, f = t.kind, c = t.result, d; + if (d = t.input.charCodeAt(t.position), gt(d) || we(d) || d === 35 || d === 38 || d === 42 || d === 33 || d === 124 || d === 62 || d === 39 || d === 34 || d === 37 || d === 64 || d === 96 || (d === 63 || d === 45) && (n = t.input.charCodeAt(t.position + 1), gt(n) || i && we(n))) + return !1; + for (t.kind = "scalar", t.result = "", o = s = t.position, a = !1; d !== 0;) { + if (d === 58) { + if (n = t.input.charCodeAt(t.position + 1), gt(n) || i && we(n)) + break; + } else if (d === 35) { + if (r = t.input.charCodeAt(t.position - 1), gt(r)) + break; + } else { + if (t.position === t.lineStart && Ar(t) || i && we(d)) + break; + if (Mt(d)) + if (l = t.line, h = t.lineStart, u = t.lineIndent, Q(t, !1, -1), t.lineIndent >= e) { + a = !0, d = t.input.charCodeAt(t.position); + continue; + } else { + t.position = s, t.line = l, t.lineStart = h, t.lineIndent = u; + break; + } + } + a && (ee(t, o, s, !1), Qn(t, t.line - l), o = s = t.position, a = !1), de(d) || (s = t.position + 1), d = t.input.charCodeAt(++t.position); + } + return ee(t, o, s, !1), t.result ? !0 : (t.kind = f, t.result = c, !1); +} + +function ub(t, e) { + var i, r, n; + if (i = t.input.charCodeAt(t.position), i !== 39) + return !1; + for (t.kind = "scalar", t.result = "", t.position++, r = n = t.position; (i = t.input.charCodeAt(t.position)) !== 0;) + if (i === 39) + if (ee(t, r, t.position, !0), i = t.input.charCodeAt(++t.position), i === 39) + r = t.position, t.position++, n = t.position; + else + return !0; + else + Mt(i) ? (ee(t, r, n, !0), Qn(t, Q(t, !1, e)), r = n = t.position) : t.position === t.lineStart && Ar(t) ? A(t, "unexpected end of the document within a single quoted scalar") : (t.position++, n = t.position); + A(t, "unexpected end of the stream within a single quoted scalar"); +} + +function fb(t, e) { + var i, r, n, o, s, a; + if (a = t.input.charCodeAt(t.position), a !== 34) + return !1; + for (t.kind = "scalar", t.result = "", t.position++, i = r = t.position; (a = t.input.charCodeAt(t.position)) !== 0;) { + if (a === 34) + return ee(t, i, t.position, !0), t.position++, !0; + if (a === 92) { + if (ee(t, i, t.position, !0), a = t.input.charCodeAt(++t.position), Mt(a)) + Q(t, !1, e); + else if (a < 256 && Kl[a]) + t.result += Zl[a], t.position++; + else if ((s = sb(a)) > 0) { + for (n = s, o = 0; n > 0; n--) + a = t.input.charCodeAt(++t.position), (s = ob(a)) >= 0 ? o = (o << 4) + s : A(t, "expected hexadecimal character"); + t.result += lb(o), t.position++; + } else + A(t, "unknown escape sequence"); + i = r = t.position; + } else + Mt(a) ? (ee(t, i, r, !0), Qn(t, Q(t, !1, e)), i = r = t.position) : t.position === t.lineStart && Ar(t) ? A(t, "unexpected end of the document within a double quoted scalar") : (t.position++, r = t.position); + } + A(t, "unexpected end of the stream within a double quoted scalar"); +} + +function db(t, e) { + var i = !0, r, n, o, s = t.tag, a, l = t.anchor, h, u, f, c, d, m = /* @__PURE__ */ Object.create(null), S, O, z, T; + if (T = t.input.charCodeAt(t.position), T === 91) + u = 93, d = !1, a = []; + else if (T === 123) + u = 125, d = !0, a = {}; + else + return !1; + for (t.anchor !== null && (t.anchorMap[t.anchor] = a), T = t.input.charCodeAt(++t.position); T !== 0;) { + if (Q(t, !0, e), T = t.input.charCodeAt(t.position), T === u) + return t.position++, t.tag = s, t.anchor = l, t.kind = d ? "mapping" : "sequence", t.result = a, !0; + i ? T === 44 && A(t, "expected the node content, but found ','") : A(t, "missed comma between flow collection entries"), O = S = z = null, f = c = !1, T === 63 && (h = t.input.charCodeAt(t.position + 1), gt(h) && (f = c = !0, t.position++, Q(t, !0, e))), r = t.line, n = t.lineStart, o = t.position, De(t, e, lr, !1, !0), O = t.tag, S = t.result, Q(t, !0, e), T = t.input.charCodeAt(t.position), (c || t.line === r) && T === 58 && (f = !0, T = t.input.charCodeAt(++t.position), Q(t, !0, e), De(t, e, lr, !1, !0), z = t.result), d ? Be(t, a, m, O, S, z, r, n, o) : f ? a.push(Be(t, null, m, O, S, z, r, n, o)) : a.push(S), Q(t, !0, e), T = t.input.charCodeAt(t.position), T === 44 ? (i = !0, T = t.input.charCodeAt(++t.position)) : i = !1; + } + A(t, "unexpected end of the stream within a flow collection"); +} + +function pb(t, e) { + var i, r, n = Kr, o = !1, s = !1, a = e, l = 0, h = !1, u, f; + if (f = t.input.charCodeAt(t.position), f === 124) + r = !1; + else if (f === 62) + r = !0; + else + return !1; + for (t.kind = "scalar", t.result = ""; f !== 0;) + if (f = t.input.charCodeAt(++t.position), f === 43 || f === 45) + Kr === n ? n = f === 43 ? Fs : eb : A(t, "repeat of a chomping mode identifier"); + else if ((u = ab(f)) >= 0) + u === 0 ? A(t, "bad explicit indentation width of a block scalar; it cannot be less than one") : s ? A(t, "repeat of an indentation width identifier") : (a = e + u - 1, s = !0); + else + break; + if (de(f)) { + do + f = t.input.charCodeAt(++t.position); + while (de(f)); + if (f === 35) + do + f = t.input.charCodeAt(++t.position); + while (!Mt(f) && f !== 0); + } + for (; f !== 0;) { + for (Jn(t), t.lineIndent = 0, f = t.input.charCodeAt(t.position); (!s || t.lineIndent < a) && f === 32;) + t.lineIndent++, f = t.input.charCodeAt(++t.position); + if (!s && t.lineIndent > a && (a = t.lineIndent), Mt(f)) { + l++; + continue; + } + if (t.lineIndent < a) { + n === Fs ? t.result += lt.repeat(` +`, o ? 1 + l : l) : n === Kr && o && (t.result += ` +`); + break; + } + for (r ? de(f) ? (h = !0, t.result += lt.repeat(` +`, o ? 1 + l : l)) : h ? (h = !1, t.result += lt.repeat(` +`, l + 1)) : l === 0 ? o && (t.result += " ") : t.result += lt.repeat(` +`, l) : t.result += lt.repeat(` +`, o ? 1 + l : l), o = !0, s = !0, l = 0, i = t.position; !Mt(f) && f !== 0;) + f = t.input.charCodeAt(++t.position); + ee(t, i, t.position, !1); + } + return !0; +} + +function Os(t, e) { + var i, r = t.tag, n = t.anchor, o = [], s, a = !1, l; + if (t.firstTabInLine !== -1) + return !1; + for (t.anchor !== null && (t.anchorMap[t.anchor] = o), l = t.input.charCodeAt(t.position); l !== 0 && (t.firstTabInLine !== -1 && (t.position = t.firstTabInLine, A(t, "tab characters must not be used in indentation")), !(l !== 45 || (s = t.input.charCodeAt(t.position + 1), !gt(s))));) { + if (a = !0, t.position++, Q(t, !0, -1) && t.lineIndent <= e) { + o.push(null), l = t.input.charCodeAt(t.position); + continue; + } + if (i = t.line, De(t, e, Gl, !1, !0), o.push(t.result), Q(t, !0, -1), l = t.input.charCodeAt(t.position), (t.line === i || t.lineIndent > e) && l !== 0) + A(t, "bad indentation of a sequence entry"); + else if (t.lineIndent < e) + break; + } + return a ? (t.tag = r, t.anchor = n, t.kind = "sequence", t.result = o, !0) : !1; +} + +function gb(t, e, i) { + var r, n, o, s, a, l, h = t.tag, u = t.anchor, f = {}, c = /* @__PURE__ */ Object.create(null), d = null, m = null, + S = null, O = !1, z = !1, T; + if (t.firstTabInLine !== -1) + return !1; + for (t.anchor !== null && (t.anchorMap[t.anchor] = f), T = t.input.charCodeAt(t.position); T !== 0;) { + if (!O && t.firstTabInLine !== -1 && (t.position = t.firstTabInLine, A(t, "tab characters must not be used in indentation")), r = t.input.charCodeAt(t.position + 1), o = t.line, (T === 63 || T === 58) && gt(r)) + T === 63 ? (O && (Be(t, f, c, d, m, null, s, a, l), d = m = S = null), z = !0, O = !0, n = !0) : O ? (O = !1, n = !0) : A(t, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), t.position += 1, T = r; + else { + if (s = t.line, a = t.lineStart, l = t.position, !De(t, i, Yl, !1, !0)) + break; + if (t.line === o) { + for (T = t.input.charCodeAt(t.position); de(T);) + T = t.input.charCodeAt(++t.position); + if (T === 58) + T = t.input.charCodeAt(++t.position), gt(T) || A(t, "a whitespace character is expected after the key-value separator within a block mapping"), O && (Be(t, f, c, d, m, null, s, a, l), d = m = S = null), z = !0, O = !1, n = !1, d = t.tag, m = t.result; + else if (z) + A(t, "can not read an implicit mapping pair; a colon is missed"); + else + return t.tag = h, t.anchor = u, !0; + } else if (z) + A(t, "can not read a block mapping entry; a multiline key may not be an implicit key"); + else + return t.tag = h, t.anchor = u, !0; + } + if ((t.line === o || t.lineIndent > e) && (O && (s = t.line, a = t.lineStart, l = t.position), De(t, e, hr, !0, n) && (O ? m = t.result : S = t.result), O || (Be(t, f, c, d, m, S, s, a, l), d = m = S = null), Q(t, !0, -1), T = t.input.charCodeAt(t.position)), (t.line === o || t.lineIndent > e) && T !== 0) + A(t, "bad indentation of a mapping entry"); + else if (t.lineIndent < e) + break; + } + return O && Be(t, f, c, d, m, null, s, a, l), z && (t.tag = h, t.anchor = u, t.kind = "mapping", t.result = f), z; +} + +function mb(t) { + var e, i = !1, r = !1, n, o, s; + if (s = t.input.charCodeAt(t.position), s !== 33) + return !1; + if (t.tag !== null && A(t, "duplication of a tag property"), s = t.input.charCodeAt(++t.position), s === 60 ? (i = !0, s = t.input.charCodeAt(++t.position)) : s === 33 ? (r = !0, n = "!!", s = t.input.charCodeAt(++t.position)) : n = "!", e = t.position, i) { + do + s = t.input.charCodeAt(++t.position); + while (s !== 0 && s !== 62); + t.position < t.length ? (o = t.input.slice(e, t.position), s = t.input.charCodeAt(++t.position)) : A(t, "unexpected end of the stream within a verbatim tag"); + } else { + for (; s !== 0 && !gt(s);) + s === 33 && (r ? A(t, "tag suffix cannot contain exclamation marks") : (n = t.input.slice(e - 1, t.position + 1), Vl.test(n) || A(t, "named tag handle cannot contain such characters"), r = !0, e = t.position + 1)), s = t.input.charCodeAt(++t.position); + o = t.input.slice(e, t.position), nb.test(o) && A(t, "tag suffix cannot contain flow indicator characters"); + } + o && !Xl.test(o) && A(t, "tag name cannot contain such characters: " + o); + try { + o = decodeURIComponent(o); + } catch { + A(t, "tag name is malformed: " + o); + } + return i ? t.tag = o : re.call(t.tagMap, n) ? t.tag = t.tagMap[n] + o : n === "!" ? t.tag = "!" + o : n === "!!" ? t.tag = "tag:yaml.org,2002:" + o : A(t, 'undeclared tag handle "' + n + '"'), !0; +} + +function yb(t) { + var e, i; + if (i = t.input.charCodeAt(t.position), i !== 38) + return !1; + for (t.anchor !== null && A(t, "duplication of an anchor property"), i = t.input.charCodeAt(++t.position), e = t.position; i !== 0 && !gt(i) && !we(i);) + i = t.input.charCodeAt(++t.position); + return t.position === e && A(t, "name of an anchor node must contain at least one character"), t.anchor = t.input.slice(e, t.position), !0; +} + +function _b(t) { + var e, i, r; + if (r = t.input.charCodeAt(t.position), r !== 42) + return !1; + for (r = t.input.charCodeAt(++t.position), e = t.position; r !== 0 && !gt(r) && !we(r);) + r = t.input.charCodeAt(++t.position); + return t.position === e && A(t, "name of an alias node must contain at least one character"), i = t.input.slice(e, t.position), re.call(t.anchorMap, i) || A(t, 'unidentified alias "' + i + '"'), t.result = t.anchorMap[i], Q(t, !0, -1), !0; +} + +function De(t, e, i, r, n) { + var o, s, a, l = 1, h = !1, u = !1, f, c, d, m, S, O; + if (t.listener !== null && t.listener("open", t), t.tag = null, t.anchor = null, t.kind = null, t.result = null, o = s = a = hr === i || Gl === i, r && Q(t, !0, -1) && (h = !0, t.lineIndent > e ? l = 1 : t.lineIndent === e ? l = 0 : t.lineIndent < e && (l = -1)), l === 1) + for (; mb(t) || yb(t);) + Q(t, !0, -1) ? (h = !0, a = o, t.lineIndent > e ? l = 1 : t.lineIndent === e ? l = 0 : t.lineIndent < e && (l = -1)) : a = !1; + if (a && (a = h || n), (l === 1 || hr === i) && (lr === i || Yl === i ? S = e : S = e + 1, O = t.position - t.lineStart, l === 1 ? a && (Os(t, O) || gb(t, O, S)) || db(t, S) ? u = !0 : (s && pb(t, S) || ub(t, S) || fb(t, S) ? u = !0 : _b(t) ? (u = !0, (t.tag !== null || t.anchor !== null) && A(t, "alias node should not have any properties")) : cb(t, S, lr === i) && (u = !0, t.tag === null && (t.tag = "?")), t.anchor !== null && (t.anchorMap[t.anchor] = t.result)) : l === 0 && (u = a && Os(t, O))), t.tag === null) + t.anchor !== null && (t.anchorMap[t.anchor] = t.result); + else if (t.tag === "?") { + for (t.result !== null && t.kind !== "scalar" && A(t, 'unacceptable node kind for ! tag; it should be "scalar", not "' + t.kind + '"'), f = 0, c = t.implicitTypes.length; f < c; f += 1) + if (m = t.implicitTypes[f], m.resolve(t.result)) { + t.result = m.construct(t.result), t.tag = m.tag, t.anchor !== null && (t.anchorMap[t.anchor] = t.result); + break; + } + } else if (t.tag !== "!") { + if (re.call(t.typeMap[t.kind || "fallback"], t.tag)) + m = t.typeMap[t.kind || "fallback"][t.tag]; + else + for (m = null, d = t.typeMap.multi[t.kind || "fallback"], f = 0, c = d.length; f < c; f += 1) + if (t.tag.slice(0, d[f].tag.length) === d[f].tag) { + m = d[f]; + break; + } + m || A(t, "unknown tag !<" + t.tag + ">"), t.result !== null && m.kind !== t.kind && A(t, "unacceptable node kind for !<" + t.tag + '> tag; it should be "' + m.kind + '", not "' + t.kind + '"'), m.resolve(t.result, t.tag) ? (t.result = m.construct(t.result, t.tag), t.anchor !== null && (t.anchorMap[t.anchor] = t.result)) : A(t, "cannot resolve a node with !<" + t.tag + "> explicit tag"); + } + return t.listener !== null && t.listener("close", t), t.tag !== null || t.anchor !== null || u; +} + +function Cb(t) { + var e = t.position, i, r, n, o = !1, s; + for (t.version = null, t.checkLineBreaks = t.legacy, t.tagMap = /* @__PURE__ */ Object.create(null), t.anchorMap = /* @__PURE__ */ Object.create(null); (s = t.input.charCodeAt(t.position)) !== 0 && (Q(t, !0, -1), s = t.input.charCodeAt(t.position), !(t.lineIndent > 0 || s !== 37));) { + for (o = !0, s = t.input.charCodeAt(++t.position), i = t.position; s !== 0 && !gt(s);) + s = t.input.charCodeAt(++t.position); + for (r = t.input.slice(i, t.position), n = [], r.length < 1 && A(t, "directive name must not be less than one character in length"); s !== 0;) { + for (; de(s);) + s = t.input.charCodeAt(++t.position); + if (s === 35) { + do + s = t.input.charCodeAt(++t.position); + while (s !== 0 && !Mt(s)); + break; + } + if (Mt(s)) + break; + for (i = t.position; s !== 0 && !gt(s);) + s = t.input.charCodeAt(++t.position); + n.push(t.input.slice(i, t.position)); + } + s !== 0 && Jn(t), re.call(Es, r) ? Es[r](t, r, n) : cr(t, 'unknown document directive "' + r + '"'); + } + if (Q(t, !0, -1), t.lineIndent === 0 && t.input.charCodeAt(t.position) === 45 && t.input.charCodeAt(t.position + 1) === 45 && t.input.charCodeAt(t.position + 2) === 45 ? (t.position += 3, Q(t, !0, -1)) : o && A(t, "directives end mark is expected"), De(t, t.lineIndent - 1, hr, !1, !0), Q(t, !0, -1), t.checkLineBreaks && rb.test(t.input.slice(e, t.position)) && cr(t, "non-ASCII line breaks are interpreted as content"), t.documents.push(t.result), t.position === t.lineStart && Ar(t)) { + t.input.charCodeAt(t.position) === 46 && (t.position += 3, Q(t, !0, -1)); + return; + } + if (t.position < t.length - 1) + A(t, "end of the stream or a document separator is expected"); + else + return; +} + +function Ql(t, e) { + t = String(t), e = e || {}, t.length !== 0 && (t.charCodeAt(t.length - 1) !== 10 && t.charCodeAt(t.length - 1) !== 13 && (t += ` +`), t.charCodeAt(0) === 65279 && (t = t.slice(1))); + var i = new hb(t, e), r = t.indexOf("\0"); + for (r !== -1 && (i.position = r, A(i, "null byte is not allowed in input")), i.input += "\0"; i.input.charCodeAt(i.position) === 32;) + i.lineIndent += 1, i.position += 1; + for (; i.position < i.length - 1;) + Cb(i); + return i.documents; +} + +function xb(t, e, i) { + e !== null && typeof e == "object" && typeof i > "u" && (i = e, e = null); + var r = Ql(t, i); + if (typeof e != "function") + return r; + for (var n = 0, o = r.length; n < o; n += 1) + e(r[n]); +} + +function bb(t, e) { + var i = Ql(t, e); + if (i.length !== 0) { + if (i.length === 1) + return i[0]; + throw new Yt("expected a single document in the stream, but found more"); + } +} + +var Tb = xb, kb = bb, Sb = { + loadAll: Tb, + load: kb +}, vb = Hl, wb = Sb.load; + +function Bb(t) { + const e = t.match(Na); + if (!e) + return { + text: t, + metadata: {} + }; + let i = wb(e[1], { + // To support config, we need JSON schema. + // https://www.yaml.org/spec/1.2/spec.html#id2803231 + schema: vb + }) ?? {}; + i = typeof i == "object" && !Array.isArray(i) ? i : {}; + const r = {}; + return i.displayMode && (r.displayMode = i.displayMode.toString()), i.title && (r.title = i.title.toString()), i.config && (r.config = i.config), { + text: t.slice(e[0].length), + metadata: r + }; +} + +const Fb = (t) => t.replace(/\r\n?/g, ` +`).replace( + /<(\w+)([^>]*)>/g, + (e, i, r) => "<" + i + r.replace(/="([^"]*)"/g, "='$1'") + ">" +), Ab = (t) => { + const {text: e, metadata: i} = Bb(t), {displayMode: r, title: n, config: o = {}} = i; + return r && (o.gantt || (o.gantt = {}), o.gantt.displayMode = r), {title: n, config: o, text: e}; +}, Lb = (t) => { + const e = ei.detectInit(t) ?? {}, i = ei.detectDirective(t, "wrap"); + return Array.isArray(i) ? e.wrap = i.some(({type: r}) => { + }) : (i == null ? void 0 : i.type) === "wrap" && (e.wrap = !0), { + text: _0(t), + directive: e + }; +}; + +function th(t) { + const e = Fb(t), i = Ab(e), r = Lb(i.text), n = nl(i.config, r.directive); + return t = NC(r.text), { + code: t, + title: i.title, + config: n + }; +} + +const Eb = 5e4, Mb = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa", Ob = "sandbox", + $b = "loose", Ib = "http://www.w3.org/2000/svg", Db = "http://www.w3.org/1999/xlink", + Nb = "http://www.w3.org/1999/xhtml", Rb = "100%", Pb = "100%", qb = "border:0;margin:0;", zb = "margin:0", + Wb = "allow-top-navigation-by-user-activation allow-popups", + Hb = 'The "iframe" tag is not supported by your browser.', jb = ["foreignobject"], Ub = ["dominant-baseline"]; + +function eh(t) { + const e = th(t); + return or(), sy(e.config ?? {}), e; +} + +async function Yb(t, e) { + Kn(), t = eh(t).code; + try { + await to(t); + } catch (i) { + if (e != null && e.suppressErrors) + return !1; + throw i; + } + return !0; +} + +const $s = (t, e, i = []) => ` +.${t} ${e} { ${i.join(" !important; ")} !important; }`, Gb = (t, e = {}) => { + var r; + let i = ""; + if (t.themeCSS !== void 0 && (i += ` +${t.themeCSS}`), t.fontFamily !== void 0 && (i += ` +:root { --mermaid-font-family: ${t.fontFamily}}`), t.altFontFamily !== void 0 && (i += ` +:root { --mermaid-alt-font-family: ${t.altFontFamily}}`), !Gr(e)) { + const a = t.htmlLabels || ((r = t.flowchart) == null ? void 0 : r.htmlLabels) ? ["> *", "span"] : ["rect", "polygon", "ellipse", "circle", "path"]; + for (const l in e) { + const h = e[l]; + Gr(h.styles) || a.forEach((u) => { + i += $s(h.id, u, h.styles); + }), Gr(h.textStyles) || (i += $s(h.id, "tspan", h.textStyles)); + } + } + return i; +}, Vb = (t, e, i, r) => { + const n = Gb(t, i), o = w_(e, n, t.themeVariables); + return gn(ty(`${r}{${o}}`), iy); +}, Xb = (t = "", e, i) => { + let r = t; + return !i && !e && (r = r.replace( + /marker-end="url\([\d+./:=?A-Za-z-]*?#/g, + 'marker-end="url(#' + )), r = q0(r), r = r.replace(/
/g, "
"), r; +}, Kb = (t = "", e) => { + var n, o; + const i = (o = (n = e == null ? void 0 : e.viewBox) == null ? void 0 : n.baseVal) != null && o.height ? e.viewBox.baseVal.height + "px" : Pb, + r = btoa('' + t + ""); + return ``; +}, Is = (t, e, i, r, n) => { + const o = t.append("div"); + o.attr("id", i), r && o.attr("style", r); + const s = o.append("svg").attr("id", e).attr("width", "100%").attr("xmlns", Ib); + return n && s.attr("xmlns:xlink", n), s.append("g"), t; +}; + +function Ds(t, e) { + return t.append("iframe").attr("id", e).attr("style", "width: 100%; height: 100%;").attr("sandbox", ""); +} + +const Zb = (t, e, i, r) => { + var n, o, s; + (n = t.getElementById(e)) == null || n.remove(), (o = t.getElementById(i)) == null || o.remove(), (s = t.getElementById(r)) == null || s.remove(); +}, Jb = async function (t, e, i) { + var Nt, M, k, C, w, x; + Kn(); + const r = eh(e); + e = r.code; + const n = $t(); + L.debug(n), e.length > ((n == null ? void 0 : n.maxTextSize) ?? Eb) && (e = Mb); + const o = "#" + t, s = "i" + t, a = "#" + s, l = "d" + t, h = "#" + l; + let u = bt("body"); + const f = n.securityLevel === Ob, c = n.securityLevel === $b, d = n.fontFamily; + if (i !== void 0) { + if (i && (i.innerHTML = ""), f) { + const b = Ds(bt(i), s); + u = bt(b.nodes()[0].contentDocument.body), u.node().style.margin = 0; + } else + u = bt(i); + Is(u, t, l, `font-family: ${d}`, Db); + } else { + if (Zb(document, t, l, s), f) { + const b = Ds(bt("body"), s); + u = bt(b.nodes()[0].contentDocument.body), u.node().style.margin = 0; + } else + u = bt("body"); + Is(u, t, l); + } + let m, S; + try { + m = await to(e, {title: r.title}); + } catch (b) { + m = new ql("error"), S = b; + } + const O = u.select(h).node(), z = m.type, T = O.firstChild, R = T.firstChild, + X = (M = (Nt = m.renderer).getClasses) == null ? void 0 : M.call(Nt, e, m), G = Vb(n, z, X, o), + V = document.createElement("style"); + V.innerHTML = G, T.insertBefore(V, R); + try { + await m.renderer.draw(e, t, _s, m); + } catch (b) { + throw H_.draw(e, t, _s), b; + } + const H = u.select(`${h} svg`), oe = (C = (k = m.db).getAccTitle) == null ? void 0 : C.call(k), + Kt = (x = (w = m.db).getAccDescription) == null ? void 0 : x.call(w); + t1(z, H, oe, Kt), u.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns", Nb); + let P = u.select(h).node().innerHTML; + if (L.debug("config.arrowMarkerAbsolute", n.arrowMarkerAbsolute), P = Xb(P, f, La(n.arrowMarkerAbsolute)), f) { + const b = u.select(h + " svg").node(); + P = Kb(P, b); + } else + c || (P = Ee.sanitize(P, { + ADD_TAGS: jb, + ADD_ATTR: Ub + })); + if (dC(), S) + throw S; + const Ct = bt(f ? a : h).node(); + return Ct && "remove" in Ct && Ct.remove(), { + svg: P, + bindFunctions: m.db.bindFunctions + }; +}; + +function Qb(t = {}) { + var i; + t != null && t.fontFamily && !((i = t.themeVariables) != null && i.fontFamily) && (t.themeVariables || (t.themeVariables = {}), t.themeVariables.fontFamily = t.fontFamily), ny(t), t != null && t.theme && t.theme in Gt ? t.themeVariables = Gt[t.theme].getThemeVariables( + t.themeVariables + ) : t && (t.themeVariables = Gt.default.getThemeVariables(t.themeVariables)); + const e = typeof t == "object" ? ry(t) : fl(); + bn(e.logLevel), Kn(); +} + +const to = (t, e = {}) => { + const {code: i} = th(t); + return fC(i, e); +}; + +function t1(t, e, i, r) { + IC(e, t), DC(e, i, r, e.attr("id")); +} + +const me = Object.freeze({ + render: Jb, + parse: Yb, + getDiagramFromText: to, + initialize: Qb, + getConfig: $t, + setConfig: dl, + getSiteConfig: fl, + updateSiteConfig: oy, + reset: () => { + or(); + }, + globalReset: () => { + or($e); + }, + defaultConfig: $e +}); +bn($t().logLevel); +or($t()); +const e1 = async () => { + L.debug("Loading registered diagrams"); + const e = (await Promise.allSettled( + Object.entries(Me).map(async ([i, {detector: r, loader: n}]) => { + if (n) + try { + Xn(i); + } catch { + try { + const {diagram: s, id: a} = await n(); + ar(a, s, r); + } catch (s) { + throw L.error(`Failed to load external diagram with key ${i}. Removing from detectors.`), delete Me[i], s; + } + } + }) + )).filter((i) => i.status === "rejected"); + if (e.length > 0) { + L.error(`Failed to load ${e.length} external diagrams`); + for (const i of e) + L.error(i); + throw new Error(`Failed to load ${e.length} external diagrams`); + } +}, i1 = (t, e, i) => { + L.warn(t), rl(t) ? (i && i(t.str, t.hash), e.push({ + ...t, + message: t.str, + error: t + })) : (i && i(t), t instanceof Error && e.push({ + str: t.message, + message: t.message, + hash: t.name, + error: t + })); +}, ih = async function (t = { + querySelector: ".mermaid" +}) { + try { + await r1(t); + } catch (e) { + if (rl(e) && L.error(e.str), Tt.parseError && Tt.parseError(e), !t.suppressErrors) + throw L.error("Use the suppressErrors option to suppress these errors"), e; + } +}, r1 = async function ({postRenderCallback: t, querySelector: e, nodes: i} = { + querySelector: ".mermaid" +}) { + const r = me.getConfig(); + L.debug(`${t ? "" : "No "}Callback function found`); + let n; + if (i) + n = i; + else if (e) + n = document.querySelectorAll(e); + else + throw new Error("Nodes and querySelector are both undefined"); + L.debug(`Found ${n.length} diagrams`), (r == null ? void 0 : r.startOnLoad) !== void 0 && (L.debug("Start On Load: " + (r == null ? void 0 : r.startOnLoad)), me.updateSiteConfig({startOnLoad: r == null ? void 0 : r.startOnLoad})); + const o = new ei.InitIDGenerator(r.deterministicIds, r.deterministicIDSeed); + let s; + const a = []; + for (const l of Array.from(n)) { + L.info("Rendering diagram: " + l.id); + /*! Check if previously processed */ + if (l.getAttribute("data-processed")) + continue; + l.setAttribute("data-processed", "true"); + const h = `mermaid-${o.next()}`; + s = l.innerHTML, s = mh(ei.entityDecode(s)).trim().replace(//gi, "
"); + const u = ei.detectInit(s); + u && L.debug("Detected early reinit: ", u); + try { + const {svg: f, bindFunctions: c} = await sh(h, s, l); + l.innerHTML = f, t && await t(h), c && c(l); + } catch (f) { + i1(f, a, Tt.parseError); + } + } + if (a.length > 0) + throw a[0]; +}, rh = function (t) { + me.initialize(t); +}, n1 = async function (t, e, i) { + L.warn("mermaid.init is deprecated. Please use run instead."), t && rh(t); + const r = {postRenderCallback: i, querySelector: ".mermaid"}; + typeof e == "string" ? r.querySelector = e : e && (e instanceof HTMLElement ? r.nodes = [e] : r.nodes = e), await ih(r); +}, o1 = async (t, { + lazyLoad: e = !0 +} = {}) => { + Pa(...t), e === !1 && await e1(); +}, nh = function () { + if (Tt.startOnLoad) { + const {startOnLoad: t} = me.getConfig(); + t && Tt.run().catch((e) => L.error("Mermaid failed to initialize", e)); + } +}; +if (typeof document < "u") { + /*! + * Wait for document loaded before starting the execution + */ + window.addEventListener("load", nh, !1); +} +const s1 = function (t) { + Tt.parseError = t; +}, ur = []; +let Zr = !1; +const oh = async () => { + if (!Zr) { + for (Zr = !0; ur.length > 0;) { + const t = ur.shift(); + if (t) + try { + await t(); + } catch (e) { + L.error("Error executing queue", e); + } + } + Zr = !1; + } +}, a1 = async (t, e) => new Promise((i, r) => { + const n = () => new Promise((o, s) => { + me.parse(t, e).then( + (a) => { + o(a), i(a); + }, + (a) => { + var l; + L.error("Error parsing", a), (l = Tt.parseError) == null || l.call(Tt, a), s(a), r(a); + } + ); + }); + ur.push(n), oh().catch(r); +}), sh = (t, e, i) => new Promise((r, n) => { + const o = () => new Promise((s, a) => { + me.render(t, e, i).then( + (l) => { + s(l), r(l); + }, + (l) => { + var h; + L.error("Error parsing", l), (h = Tt.parseError) == null || h.call(Tt, l), a(l), n(l); + } + ); + }); + ur.push(o), oh().catch(n); +}), Tt = { + startOnLoad: !0, + mermaidAPI: me, + parse: a1, + render: sh, + init: n1, + run: ih, + registerExternalDiagrams: o1, + initialize: rh, + parseError: void 0, + contentLoaded: nh, + setParseErrorHandler: s1, + detectType: xr +}; +export { + vn as $, + ei as A, + Je as B, + M_ as C, + O_ as D, + B_ as E, + Pf as F, + C1 as G, + L0 as H, + R_ as I, + Sn as J, + Js as K, + pi as L, + uu as M, + ea as N, + l1 as O, + yh as P, + _h as Q, + pt as R, + yt as S, + xh as T, + z_ as U, + m1 as V, + yp as W, + nl as X, + zn as Y, + up as Z, + $t as _, + E_ as a, + Re as a$, + te as a0, + oi as a1, + Mo as a2, + _u as a3, + Qo as a4, + p0 as a5, + x1 as a6, + F0 as a7, + ye as a8, + l0 as a9, + Ro as aA, + g1 as aB, + d1 as aC, + h1 as aD, + c1 as aE, + _1 as aF, + y1 as aG, + f1 as aH, + $ as aI, + Ot as aJ, + _i as aK, + Ne as aL, + tr as aM, + Um as aN, + _C as aO, + yi as aP, + ir as aQ, + Pm as aR, + Ua as aS, + Dg as aT, + Ng as aU, + AC as aV, + us as aW, + Rg as aX, + Nn as aY, + $g as aZ, + Hg as a_, + Qm as aa, + Dt as ab, + h0 as ac, + c0 as ad, + Ja as ae, + br as af, + vr as ag, + rr as ah, + Mg as ai, + Dn as aj, + tl as ak, + Za as al, + Rm as am, + Mm as an, + t0 as ao, + d0 as ap, + gi as aq, + w1 as ar, + $_ as as, + mi as at, + F as au, + E as av, + An as aw, + u1 as ax, + p1 as ay, + Po as az, + L_ as b, + ne as b0, + ss as b1, + Rn as b2, + Ga as b3, + _n as b4, + Kg as b5, + Gr as b6, + q0 as b7, + mh as b8, + Tt as b9, + Vn as c, + ai as d, + Rs as e, + $n as f, + A_ as g, + st as h, + nr as i, + bt as j, + Ol as k, + L as l, + I0 as m, + Df as n, + B0 as o, + La as p, + x0 as q, + Od as r, + F_ as s, + k_ as t, + v1 as u, + Zs as v, + O0 as w, + Fh as x, + sm as y, + In as z +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/mermaid.esm.min.mjs b/BlazorApp/wwwroot/js/lib/mermaid/mermaid.esm.min.mjs new file mode 100644 index 00000000..97265626 --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/mermaid.esm.min.mjs @@ -0,0 +1,5 @@ +import {b9 as f} from "./mermaid-9f2aa176.js"; + +export { + f as default +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/path-428ebac9.js b/BlazorApp/wwwroot/js/lib/mermaid/path-428ebac9.js new file mode 100644 index 00000000..d97f57d6 --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/path-428ebac9.js @@ -0,0 +1,107 @@ +const c = Math.PI, x = 2 * c, u = 1e-6, m = x - u; + +function E(e) { + this._ += e[0]; + for (let t = 1, h = e.length; t < h; ++t) + this._ += arguments[t] + e[t]; +} + +function A(e) { + let t = Math.floor(e); + if (!(t >= 0)) + throw new Error(`invalid digits: ${e}`); + if (t > 15) + return E; + const h = 10 ** t; + return function (i) { + this._ += i[0]; + for (let s = 1, n = i.length; s < n; ++s) + this._ += Math.round(arguments[s] * h) / h + i[s]; + }; +} + +class L { + constructor(t) { + this._x0 = this._y0 = // start of current subpath + this._x1 = this._y1 = null, this._ = "", this._append = t == null ? E : A(t); + } + + moveTo(t, h) { + this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}`; + } + + closePath() { + this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`); + } + + lineTo(t, h) { + this._append`L${this._x1 = +t},${this._y1 = +h}`; + } + + quadraticCurveTo(t, h, i, s) { + this._append`Q${+t},${+h},${this._x1 = +i},${this._y1 = +s}`; + } + + bezierCurveTo(t, h, i, s, n, $) { + this._append`C${+t},${+h},${+i},${+s},${this._x1 = +n},${this._y1 = +$}`; + } + + arcTo(t, h, i, s, n) { + if (t = +t, h = +h, i = +i, s = +s, n = +n, n < 0) + throw new Error(`negative radius: ${n}`); + let $ = this._x1, r = this._y1, p = i - t, l = s - h, _ = $ - t, o = r - h, a = _ * _ + o * o; + if (this._x1 === null) + this._append`M${this._x1 = t},${this._y1 = h}`; + else if (a > u) + if (!(Math.abs(o * p - l * _) > u) || !n) + this._append`L${this._x1 = t},${this._y1 = h}`; + else { + let d = i - $, f = s - r, y = p * p + l * l, T = d * d + f * f, g = Math.sqrt(y), v = Math.sqrt(a), + w = n * Math.tan((c - Math.acos((y + a - T) / (2 * g * v))) / 2), M = w / v, b = w / g; + Math.abs(M - 1) > u && this._append`L${t + M * _},${h + M * o}`, this._append`A${n},${n},0,0,${+(o * d > _ * f)},${this._x1 = t + b * p},${this._y1 = h + b * l}`; + } + } + + arc(t, h, i, s, n, $) { + if (t = +t, h = +h, i = +i, $ = !!$, i < 0) + throw new Error(`negative radius: ${i}`); + let r = i * Math.cos(s), p = i * Math.sin(s), l = t + r, _ = h + p, o = 1 ^ $, a = $ ? s - n : n - s; + this._x1 === null ? this._append`M${l},${_}` : (Math.abs(this._x1 - l) > u || Math.abs(this._y1 - _) > u) && this._append`L${l},${_}`, i && (a < 0 && (a = a % x + x), a > m ? this._append`A${i},${i},0,1,${o},${t - r},${h - p}A${i},${i},0,1,${o},${this._x1 = l},${this._y1 = _}` : a > u && this._append`A${i},${i},0,${+(a >= c)},${o},${this._x1 = t + i * Math.cos(n)},${this._y1 = h + i * Math.sin(n)}`); + } + + rect(t, h, i, s) { + this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +h}h${i = +i}v${+s}h${-i}Z`; + } + + toString() { + return this._; + } +} + +function P(e) { + return function () { + return e; + }; +} + +function q(e) { + let t = 3; + return e.digits = function (h) { + if (!arguments.length) + return t; + if (h == null) + t = null; + else { + const i = Math.floor(h); + if (!(i >= 0)) + throw new RangeError(`invalid digits: ${h}`); + t = i; + } + return e; + }, () => new L(t); +} + +export { + P as c, + q as w +}; diff --git a/BlazorApp/wwwroot/js/lib/mermaid/styles-e75131e4.js b/BlazorApp/wwwroot/js/lib/mermaid/styles-e75131e4.js new file mode 100644 index 00000000..8762b04e --- /dev/null +++ b/BlazorApp/wwwroot/js/lib/mermaid/styles-e75131e4.js @@ -0,0 +1,462 @@ +import {G as R} from "./graph-0ee63739.js"; +import { + A as W, + B as J, + c as v, + f as G, + j as C, + l as g, + n as L, + o as N, + p as K, + q as E, + r as q, + S as z, + t as X, + v as F, + x as j, + y as U, + z as H +} from "./mermaid-9f2aa176.js"; +import {r as Q} from "./index-bb6d8841.js"; +import {c as Y} from "./channel-ebbc4130.js"; + +function Z(e) { + return typeof e == "string" ? new z([document.querySelectorAll(e)], [document.documentElement]) : new z([j(e)], F); +} + +function fe(e, l) { + return !!e.children(l).length; +} + +function pe(e) { + return A(e.v) + ":" + A(e.w) + ":" + A(e.name); +} + +var O = /:/g; + +function A(e) { + return e ? String(e).replace(O, "\\:") : ""; +} + +function ee(e, l) { + l && e.attr("style", l); +} + +function be(e, l, c) { + l && e.attr("class", l).attr("class", c + " " + e.attr("class")); +} + +function ue(e, l) { + var c = l.graph(); + if (U(c)) { + var a = c.transition; + if (H(a)) + return a(e); + } + return e; +} + +function te(e, l) { + var c = e.append("foreignObject").attr("width", "100000"), a = c.append("xhtml:div"); + a.attr("xmlns", "http://www.w3.org/1999/xhtml"); + var i = l.label; + switch (typeof i) { + case "function": + a.insert(i); + break; + case "object": + a.insert(function () { + return i; + }); + break; + default: + a.html(i); + } + ee(a, l.labelStyle), a.style("display", "inline-block"), a.style("white-space", "nowrap"); + var d = a.node().getBoundingClientRect(); + return c.attr("width", d.width).attr("height", d.height), c; +} + +const P = {}, re = function (e) { + const l = Object.keys(e); + for (const c of l) + P[c] = e[c]; +}, V = async function (e, l, c, a, i, d) { + const u = a.select(`[id="${c}"]`), o = Object.keys(e); + for (const f of o) { + const r = e[f]; + let y = "default"; + r.classes.length > 0 && (y = r.classes.join(" ")), y = y + " flowchart-label"; + const w = N(r.styles); + let t = r.text !== void 0 ? r.text : r.id, s; + if (g.info("vertex", r, r.labelType), r.labelType === "markdown") + g.info("vertex", r, r.labelType); + else if (K(v().flowchart.htmlLabels)) + s = te(u, { + label: t + }).node(), s.parentNode.removeChild(s); + else { + const k = i.createElementNS("http://www.w3.org/2000/svg", "text"); + k.setAttribute("style", w.labelStyle.replace("color:", "fill:")); + const _ = t.split(G.lineBreakRegex); + for (const $ of _) { + const S = i.createElementNS("http://www.w3.org/2000/svg", "tspan"); + S.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), S.setAttribute("dy", "1em"), S.setAttribute("x", "1"), S.textContent = $, k.appendChild(S); + } + s = k; + } + let p = 0, n = ""; + switch (r.type) { + case "round": + p = 5, n = "rect"; + break; + case "square": + n = "rect"; + break; + case "diamond": + n = "question"; + break; + case "hexagon": + n = "hexagon"; + break; + case "odd": + n = "rect_left_inv_arrow"; + break; + case "lean_right": + n = "lean_right"; + break; + case "lean_left": + n = "lean_left"; + break; + case "trapezoid": + n = "trapezoid"; + break; + case "inv_trapezoid": + n = "inv_trapezoid"; + break; + case "odd_right": + n = "rect_left_inv_arrow"; + break; + case "circle": + n = "circle"; + break; + case "ellipse": + n = "ellipse"; + break; + case "stadium": + n = "stadium"; + break; + case "subroutine": + n = "subroutine"; + break; + case "cylinder": + n = "cylinder"; + break; + case "group": + n = "rect"; + break; + case "doublecircle": + n = "doublecircle"; + break; + default: + n = "rect"; + } + const T = await q(t, v()); + l.setNode(r.id, { + labelStyle: w.labelStyle, + shape: n, + labelText: T, + labelType: r.labelType, + rx: p, + ry: p, + class: y, + style: w.style, + id: r.id, + link: r.link, + linkTarget: r.linkTarget, + tooltip: d.db.getTooltip(r.id) || "", + domId: d.db.lookUpDomId(r.id), + haveCallback: r.haveCallback, + width: r.type === "group" ? 500 : void 0, + dir: r.dir, + type: r.type, + props: r.props, + padding: v().flowchart.padding + }), g.info("setNode", { + labelStyle: w.labelStyle, + labelType: r.labelType, + shape: n, + labelText: T, + rx: p, + ry: p, + class: y, + style: w.style, + id: r.id, + domId: d.db.lookUpDomId(r.id), + width: r.type === "group" ? 500 : void 0, + type: r.type, + dir: r.dir, + props: r.props, + padding: v().flowchart.padding + }); + } +}, M = async function (e, l, c) { + g.info("abc78 edges = ", e); + let a = 0, i = {}, d, u; + if (e.defaultStyle !== void 0) { + const o = N(e.defaultStyle); + d = o.style, u = o.labelStyle; + } + for (const o of e) { + a++; + const f = "L-" + o.start + "-" + o.end; + i[f] === void 0 ? (i[f] = 0, g.info("abc78 new entry", f, i[f])) : (i[f]++, g.info("abc78 new entry", f, i[f])); + let r = f + "-" + i[f]; + g.info("abc78 new link id to be used is", f, r, i[f]); + const y = "LS-" + o.start, w = "LE-" + o.end, t = {style: "", labelStyle: ""}; + switch (t.minlen = o.length || 1, o.type === "arrow_open" ? t.arrowhead = "none" : t.arrowhead = "normal", t.arrowTypeStart = "arrow_open", t.arrowTypeEnd = "arrow_open", o.type) { + case "double_arrow_cross": + t.arrowTypeStart = "arrow_cross"; + case "arrow_cross": + t.arrowTypeEnd = "arrow_cross"; + break; + case "double_arrow_point": + t.arrowTypeStart = "arrow_point"; + case "arrow_point": + t.arrowTypeEnd = "arrow_point"; + break; + case "double_arrow_circle": + t.arrowTypeStart = "arrow_circle"; + case "arrow_circle": + t.arrowTypeEnd = "arrow_circle"; + break; + } + let s = "", p = ""; + switch (o.stroke) { + case "normal": + s = "fill:none;", d !== void 0 && (s = d), u !== void 0 && (p = u), t.thickness = "normal", t.pattern = "solid"; + break; + case "dotted": + t.thickness = "normal", t.pattern = "dotted", t.style = "fill:none;stroke-width:2px;stroke-dasharray:3;"; + break; + case "thick": + t.thickness = "thick", t.pattern = "solid", t.style = "stroke-width: 3.5px;fill:none;"; + break; + case "invisible": + t.thickness = "invisible", t.pattern = "solid", t.style = "stroke-width: 0;fill:none;"; + break; + } + if (o.style !== void 0) { + const n = N(o.style); + s = n.style, p = n.labelStyle; + } + t.style = t.style += s, t.labelStyle = t.labelStyle += p, o.interpolate !== void 0 ? t.curve = E(o.interpolate, L) : e.defaultInterpolate !== void 0 ? t.curve = E(e.defaultInterpolate, L) : t.curve = E(P.curve, L), o.text === void 0 ? o.style !== void 0 && (t.arrowheadStyle = "fill: #333") : (t.arrowheadStyle = "fill: #333", t.labelpos = "c"), t.labelType = o.labelType, t.label = await q(o.text.replace(G.lineBreakRegex, ` +`), v()), o.style === void 0 && (t.style = t.style || "stroke: #333; stroke-width: 1.5px;fill:none;"), t.labelStyle = t.labelStyle.replace("color:", "fill:"), t.id = r, t.classes = "flowchart-link " + y + " " + w, l.setEdge(o.start, o.end, t, a); + } +}, le = function (e, l) { + return l.db.getClasses(); +}, ae = async function (e, l, c, a) { + g.info("Drawing flowchart"); + let i = a.db.getDirection(); + i === void 0 && (i = "TD"); + const {securityLevel: d, flowchart: u} = v(), o = u.nodeSpacing || 50, f = u.rankSpacing || 50; + let r; + d === "sandbox" && (r = C("#i" + l)); + const y = d === "sandbox" ? C(r.nodes()[0].contentDocument.body) : C("body"), + w = d === "sandbox" ? r.nodes()[0].contentDocument : document, t = new R({ + multigraph: !0, + compound: !0 + }).setGraph({ + rankdir: i, + nodesep: o, + ranksep: f, + marginx: 0, + marginy: 0 + }).setDefaultEdgeLabel(function () { + return {}; + }); + let s; + const p = a.db.getSubGraphs(); + g.info("Subgraphs - ", p); + for (let b = p.length - 1; b >= 0; b--) + s = p[b], g.info("Subgraph - ", s), a.db.addVertex( + s.id, + {text: s.title, type: s.labelType}, + "group", + void 0, + s.classes, + s.dir + ); + const n = a.db.getVertices(), T = a.db.getEdges(); + g.info("Edges", T); + let k = 0; + for (k = p.length - 1; k >= 0; k--) { + s = p[k], Z("cluster").append("text"); + for (let b = 0; b < s.nodes.length; b++) + g.info("Setting up subgraphs", s.nodes[b], s.id), t.setParent(s.nodes[b], s.id); + } + await V(n, t, l, y, w, a), await M(T, t); + const _ = y.select(`[id="${l}"]`), $ = y.select("#" + l + " g"); + if (await Q($, t, ["point", "circle", "cross"], "flowchart", l), W.insertTitle(_, "flowchartTitleText", u.titleTopMargin, a.db.getDiagramTitle()), X(t, _, u.diagramPadding, u.useMaxWidth), a.db.indexNodes("subGraph" + k), !u.htmlLabels) { + const b = w.querySelectorAll('[id="' + l + '"] .edgeLabel .label'); + for (const x of b) { + const m = x.getBBox(), h = w.createElementNS("http://www.w3.org/2000/svg", "rect"); + h.setAttribute("rx", 0), h.setAttribute("ry", 0), h.setAttribute("width", m.width), h.setAttribute("height", m.height), x.insertBefore(h, x.firstChild); + } + } + Object.keys(n).forEach(function (b) { + const x = n[b]; + if (x.link) { + const m = C("#" + l + ' [id="' + b + '"]'); + if (m) { + const h = w.createElementNS("http://www.w3.org/2000/svg", "a"); + h.setAttributeNS("http://www.w3.org/2000/svg", "class", x.classes.join(" ")), h.setAttributeNS("http://www.w3.org/2000/svg", "href", x.link), h.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), d === "sandbox" ? h.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : x.linkTarget && h.setAttributeNS("http://www.w3.org/2000/svg", "target", x.linkTarget); + const B = m.insert(function () { + return h; + }, ":first-child"), I = m.select(".label-container"); + I && B.append(function () { + return I.node(); + }); + const D = m.select(".label"); + D && B.append(function () { + return D.node(); + }); + } + } + }); +}, we = { + setConf: re, + addVertices: V, + addEdges: M, + getClasses: le, + draw: ae +}, ne = (e, l) => { + const c = Y, a = c(e, "r"), i = c(e, "g"), d = c(e, "b"); + return J(a, i, d, l); +}, oe = (e) => `.label { + font-family: ${e.fontFamily}; + color: ${e.nodeTextColor || e.textColor}; + } + .cluster-label text { + fill: ${e.titleColor}; + } + .cluster-label span,p { + color: ${e.titleColor}; + } + + .label text,span,p { + fill: ${e.nodeTextColor || e.textColor}; + color: ${e.nodeTextColor || e.textColor}; + } + + .node rect, + .node circle, + .node ellipse, + .node polygon, + .node path { + fill: ${e.mainBkg}; + stroke: ${e.nodeBorder}; + stroke-width: 1px; + } + .flowchart-label text { + text-anchor: middle; + } + // .flowchart-label .text-outer-tspan { + // text-anchor: middle; + // } + // .flowchart-label .text-inner-tspan { + // text-anchor: start; + // } + + .node .katex path { + fill: #000; + stroke: #000; + stroke-width: 1px; + } + + .node .label { + text-align: center; + } + .node.clickable { + cursor: pointer; + } + + .arrowheadPath { + fill: ${e.arrowheadColor}; + } + + .edgePath .path { + stroke: ${e.lineColor}; + stroke-width: 2.0px; + } + + .flowchart-link { + stroke: ${e.lineColor}; + fill: none; + } + + .edgeLabel { + background-color: ${e.edgeLabelBackground}; + rect { + opacity: 0.5; + background-color: ${e.edgeLabelBackground}; + fill: ${e.edgeLabelBackground}; + } + text-align: center; + } + + /* For html labels only */ + .labelBkg { + background-color: ${ne(e.edgeLabelBackground, 0.5)}; + // background-color: + } + + .cluster rect { + fill: ${e.clusterBkg}; + stroke: ${e.clusterBorder}; + stroke-width: 1px; + } + + .cluster text { + fill: ${e.titleColor}; + } + + .cluster span,p { + color: ${e.titleColor}; + } + /* .cluster div { + color: ${e.titleColor}; + } */ + + div.mermaidTooltip { + position: absolute; + text-align: center; + max-width: 200px; + padding: 2px; + font-family: ${e.fontFamily}; + font-size: 12px; + background: ${e.tertiaryColor}; + border: 1px solid ${e.border2}; + border-radius: 2px; + pointer-events: none; + z-index: 100; + } + + .flowchartTitleText { + text-anchor: middle; + font-size: 18px; + fill: ${e.textColor}; + } +`, he = oe; +export { + ee as a, + te as b, + ue as c, + be as d, + pe as e, + we as f, + he as g, + fe as i, + Z as s +};