From aca05107219e14f0d25d3ccccf32a662665a5162 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 5 Sep 2024 12:55:47 +0000 Subject: [PATCH] chore(release): 1.1.17 [skip ci] ## [1.1.17](https://github.com/gethinode/mod-mermaid/compare/v1.1.16...v1.1.17) (2024-09-05) ### Bug Fixes * **deps-dev:** bump hugo-bin from 0.130.1 to 0.131.0 ([bac888b](https://github.com/gethinode/mod-mermaid/commit/bac888b0bbc7c77694139caf3e3720cea04c45b4)) * **deps-dev:** bump mermaid from 11.0.2 to 11.1.0 ([aa82cfe](https://github.com/gethinode/mod-mermaid/commit/aa82cfedc9609ddc03e1274ad1b71bae15713751)) * update Hugo module dependencies ([09efb79](https://github.com/gethinode/mod-mermaid/commit/09efb79862fc0f5d04016b2e1044d2ebda4c1c94)) --- dist/mermaid.js | 16901 +++++++++++++++++++++++++++++++++++--------- package-lock.json | 4 +- package.json | 2 +- 3 files changed, 13518 insertions(+), 3389 deletions(-) diff --git a/dist/mermaid.js b/dist/mermaid.js index d7afa41..41e393a 100644 --- a/dist/mermaid.js +++ b/dist/mermaid.js @@ -36,55 +36,9 @@ var __esbuild_esm_mermaid = (() => { )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - // ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js - function dedent(templ) { - var values2 = []; - for (var _i = 1; _i < arguments.length; _i++) { - values2[_i - 1] = arguments[_i]; - } - var strings = Array.from(typeof templ === "string" ? [templ] : templ); - strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, ""); - var indentLengths = strings.reduce(function(arr, str2) { - var matches33 = str2.match(/\n([\t ]+|(?!\s).)/g); - if (matches33) { - return arr.concat(matches33.map(function(match2) { - var _a, _b; - return (_b = (_a = match2.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; - })); - } - return arr; - }, []); - if (indentLengths.length) { - var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g"); - strings = strings.map(function(str2) { - return str2.replace(pattern_1, "\n"); - }); - } - strings[0] = strings[0].replace(/^\r?\n/, ""); - var string3 = strings[0]; - values2.forEach(function(value2, i2) { - var endentations = string3.match(/(?:^|\n)( *)$/); - var endentation = endentations ? endentations[1] : ""; - var indentedValue = value2; - if (typeof value2 === "string" && value2.includes("\n")) { - indentedValue = String(value2).split("\n").map(function(str2, i3) { - return i3 === 0 ? str2 : "" + endentation + str2; - }).join("\n"); - } - string3 += indentedValue + strings[i2 + 1]; - }); - return string3; - } - var init_esm = __esm({ - "../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js"() { - "use strict"; - __name(dedent, "dedent"); - } - }); - - // ../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/dayjs.min.js + // ../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js var require_dayjs_min = __commonJS({ - "../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/dayjs.min.js"(exports2, module2) { + "../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js"(exports2, module2) { "use strict"; !function(t4, e3) { "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e3() : "function" == typeof define && define.amd ? define(e3) : (t4 = "undefined" != typeof globalThis ? globalThis : t4 || self).dayjs = e3(); @@ -439,6 +393,1091 @@ var __esbuild_esm_mermaid = (() => { } }); + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/defaults.mjs + var defaultIconDimensions, defaultIconTransformations, defaultIconProps, defaultExtendedIconProps; + var init_defaults = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/defaults.mjs"() { + "use strict"; + defaultIconDimensions = Object.freeze( + { + left: 0, + top: 0, + width: 16, + height: 16 + } + ); + defaultIconTransformations = Object.freeze({ + rotate: 0, + vFlip: false, + hFlip: false + }); + defaultIconProps = Object.freeze({ + ...defaultIconDimensions, + ...defaultIconTransformations + }); + defaultExtendedIconProps = Object.freeze({ + ...defaultIconProps, + body: "", + hidden: false + }); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/customisations/defaults.mjs + var defaultIconSizeCustomisations, defaultIconCustomisations; + var init_defaults2 = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/customisations/defaults.mjs"() { + "use strict"; + init_defaults(); + defaultIconSizeCustomisations = Object.freeze({ + width: null, + height: null + }); + defaultIconCustomisations = Object.freeze({ + // Dimensions + ...defaultIconSizeCustomisations, + // Transformations + ...defaultIconTransformations + }); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/name.mjs + var matchIconName, stringToIcon, validateIconName; + var init_name = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/name.mjs"() { + "use strict"; + matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/; + stringToIcon = /* @__PURE__ */ __name((value2, validate2, allowSimpleName, provider = "") => { + const colonSeparated = value2.split(":"); + if (value2.slice(0, 1) === "@") { + if (colonSeparated.length < 2 || colonSeparated.length > 3) { + return null; + } + provider = colonSeparated.shift().slice(1); + } + if (colonSeparated.length > 3 || !colonSeparated.length) { + return null; + } + if (colonSeparated.length > 1) { + const name2 = colonSeparated.pop(); + const prefix = colonSeparated.pop(); + const result = { + // Allow provider without '@': "provider:prefix:name" + provider: colonSeparated.length > 0 ? colonSeparated[0] : provider, + prefix, + name: name2 + }; + return validate2 && !validateIconName(result) ? null : result; + } + const name = colonSeparated[0]; + const dashSeparated = name.split("-"); + if (dashSeparated.length > 1) { + const result = { + provider, + prefix: dashSeparated.shift(), + name: dashSeparated.join("-") + }; + return validate2 && !validateIconName(result) ? null : result; + } + if (allowSimpleName && provider === "") { + const result = { + provider, + prefix: "", + name + }; + return validate2 && !validateIconName(result, allowSimpleName) ? null : result; + } + return null; + }, "stringToIcon"); + validateIconName = /* @__PURE__ */ __name((icon, allowSimpleName) => { + if (!icon) { + return false; + } + return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName)); + }, "validateIconName"); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/transformations.mjs + function mergeIconTransformations(obj1, obj2) { + const result = {}; + if (!obj1.hFlip !== !obj2.hFlip) { + result.hFlip = true; + } + if (!obj1.vFlip !== !obj2.vFlip) { + result.vFlip = true; + } + const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4; + if (rotate) { + result.rotate = rotate; + } + return result; + } + var init_transformations = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/transformations.mjs"() { + "use strict"; + __name(mergeIconTransformations, "mergeIconTransformations"); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/merge.mjs + function mergeIconData(parent4, child) { + const result = mergeIconTransformations(parent4, child); + for (const key in defaultExtendedIconProps) { + if (key in defaultIconTransformations) { + if (key in parent4 && !(key in result)) { + result[key] = defaultIconTransformations[key]; + } + } else if (key in child) { + result[key] = child[key]; + } else if (key in parent4) { + result[key] = parent4[key]; + } + } + return result; + } + var init_merge = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon/merge.mjs"() { + "use strict"; + init_defaults(); + init_transformations(); + __name(mergeIconData, "mergeIconData"); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/tree.mjs + function getIconsTree(data5, names) { + const icons = data5.icons; + const aliases = data5.aliases || /* @__PURE__ */ Object.create(null); + const resolved = /* @__PURE__ */ Object.create(null); + function resolve3(name) { + if (icons[name]) { + return resolved[name] = []; + } + if (!(name in resolved)) { + resolved[name] = null; + const parent4 = aliases[name] && aliases[name].parent; + const value2 = parent4 && resolve3(parent4); + if (value2) { + resolved[name] = [parent4].concat(value2); + } + } + return resolved[name]; + } + __name(resolve3, "resolve"); + (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve3); + return resolved; + } + var init_tree = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/tree.mjs"() { + "use strict"; + __name(getIconsTree, "getIconsTree"); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs + function internalGetIconData(data5, name, tree) { + const icons = data5.icons; + const aliases = data5.aliases || /* @__PURE__ */ Object.create(null); + let currentProps = {}; + function parse8(name2) { + currentProps = mergeIconData( + icons[name2] || aliases[name2], + currentProps + ); + } + __name(parse8, "parse"); + parse8(name); + tree.forEach(parse8); + return mergeIconData(data5, currentProps); + } + function getIconData(data5, name) { + if (data5.icons[name]) { + return internalGetIconData(data5, name, []); + } + const tree = getIconsTree(data5, [name])[name]; + return tree ? internalGetIconData(data5, name, tree) : null; + } + var init_get_icon = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs"() { + "use strict"; + init_merge(); + init_tree(); + __name(internalGetIconData, "internalGetIconData"); + __name(getIconData, "getIconData"); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/size.mjs + function calculateSize(size5, ratio, precision) { + if (ratio === 1) { + return size5; + } + precision = precision || 100; + if (typeof size5 === "number") { + return Math.ceil(size5 * ratio * precision) / precision; + } + if (typeof size5 !== "string") { + return size5; + } + const oldParts = size5.split(unitsSplit); + if (oldParts === null || !oldParts.length) { + return size5; + } + const newParts = []; + let code = oldParts.shift(); + let isNumber = unitsTest.test(code); + while (true) { + if (isNumber) { + const num = parseFloat(code); + if (isNaN(num)) { + newParts.push(code); + } else { + newParts.push(Math.ceil(num * ratio * precision) / precision); + } + } else { + newParts.push(code); + } + code = oldParts.shift(); + if (code === void 0) { + return newParts.join(""); + } + isNumber = !isNumber; + } + } + var unitsSplit, unitsTest; + var init_size = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/size.mjs"() { + "use strict"; + unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g; + unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g; + __name(calculateSize, "calculateSize"); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/defs.mjs + function splitSVGDefs(content, tag2 = "defs") { + let defs2 = ""; + const index = content.indexOf("<" + tag2); + while (index >= 0) { + const start3 = content.indexOf(">", index); + const end2 = content.indexOf("", end2); + if (endEnd === -1) { + break; + } + defs2 += content.slice(start3 + 1, end2).trim(); + content = content.slice(0, index).trim() + content.slice(endEnd + 1); + } + return { + defs: defs2, + content + }; + } + function mergeDefsAndContent(defs2, content) { + return defs2 ? "" + defs2 + "" + content : content; + } + function wrapSVGContent(body, start3, end2) { + const split = splitSVGDefs(body); + return mergeDefsAndContent(split.defs, start3 + split.content + end2); + } + var init_defs = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/defs.mjs"() { + "use strict"; + __name(splitSVGDefs, "splitSVGDefs"); + __name(mergeDefsAndContent, "mergeDefsAndContent"); + __name(wrapSVGContent, "wrapSVGContent"); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/build.mjs + function iconToSVG(icon, customisations) { + const fullIcon = { + ...defaultIconProps, + ...icon + }; + const fullCustomisations = { + ...defaultIconCustomisations, + ...customisations + }; + const box = { + left: fullIcon.left, + top: fullIcon.top, + width: fullIcon.width, + height: fullIcon.height + }; + let body = fullIcon.body; + [fullIcon, fullCustomisations].forEach((props) => { + const transformations = []; + const hFlip = props.hFlip; + const vFlip = props.vFlip; + let rotation = props.rotate; + if (hFlip) { + if (vFlip) { + rotation += 2; + } else { + transformations.push( + "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")" + ); + transformations.push("scale(-1 1)"); + box.top = box.left = 0; + } + } else if (vFlip) { + transformations.push( + "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")" + ); + transformations.push("scale(1 -1)"); + box.top = box.left = 0; + } + let tempValue; + if (rotation < 0) { + rotation -= Math.floor(rotation / 4) * 4; + } + rotation = rotation % 4; + switch (rotation) { + case 1: + tempValue = box.height / 2 + box.top; + transformations.unshift( + "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")" + ); + break; + case 2: + transformations.unshift( + "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")" + ); + break; + case 3: + tempValue = box.width / 2 + box.left; + transformations.unshift( + "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")" + ); + break; + } + if (rotation % 2 === 1) { + if (box.left !== box.top) { + tempValue = box.left; + box.left = box.top; + box.top = tempValue; + } + if (box.width !== box.height) { + tempValue = box.width; + box.width = box.height; + box.height = tempValue; + } + } + if (transformations.length) { + body = wrapSVGContent( + body, + '', + "" + ); + } + }); + const customisationsWidth = fullCustomisations.width; + const customisationsHeight = fullCustomisations.height; + const boxWidth = box.width; + const boxHeight = box.height; + let width3; + let height2; + if (customisationsWidth === null) { + height2 = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight; + width3 = calculateSize(height2, boxWidth / boxHeight); + } else { + width3 = customisationsWidth === "auto" ? boxWidth : customisationsWidth; + height2 = customisationsHeight === null ? calculateSize(width3, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight; + } + const attributes = {}; + const setAttr = /* @__PURE__ */ __name((prop, value2) => { + if (!isUnsetKeyword(value2)) { + attributes[prop] = value2.toString(); + } + }, "setAttr"); + setAttr("width", width3); + setAttr("height", height2); + const viewBox = [box.left, box.top, boxWidth, boxHeight]; + attributes.viewBox = viewBox.join(" "); + return { + attributes, + viewBox, + body + }; + } + var isUnsetKeyword; + var init_build = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/build.mjs"() { + "use strict"; + init_defaults(); + init_defaults2(); + init_size(); + init_defs(); + isUnsetKeyword = /* @__PURE__ */ __name((value2) => value2 === "unset" || value2 === "undefined" || value2 === "none", "isUnsetKeyword"); + __name(iconToSVG, "iconToSVG"); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/id.mjs + function replaceIDs(body, prefix = randomPrefix) { + const ids = []; + let match2; + while (match2 = regex.exec(body)) { + ids.push(match2[1]); + } + if (!ids.length) { + return body; + } + const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16); + ids.forEach((id27) => { + const newID = typeof prefix === "function" ? prefix(id27) : prefix + (counter++).toString(); + const escapedID = id27.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + body = body.replace( + // Allowed characters before id: [#;"] + // Allowed characters after id: [)"], .[a-z] + new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"), + "$1" + newID + suffix + "$3" + ); + }); + body = body.replace(new RegExp(suffix, "g"), ""); + return body; + } + var regex, randomPrefix, counter; + var init_id = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/id.mjs"() { + "use strict"; + regex = /\sid="(\S+)"/g; + randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16); + counter = 0; + __name(replaceIDs, "replaceIDs"); + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/html.mjs + function iconToHTML(body, attributes) { + let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"'; + for (const attr in attributes) { + renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"'; + } + return '" + body + ""; + } + var init_html = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/svg/html.mjs"() { + "use strict"; + __name(iconToHTML, "iconToHTML"); + } + }); + + // ../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js + var require_ms = __commonJS({ + "../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports2, module2) { + "use strict"; + var s2 = 1e3; + var m2 = s2 * 60; + var h2 = m2 * 60; + var d2 = h2 * 24; + var w3 = d2 * 7; + var y5 = d2 * 365.25; + module2.exports = function(val, options3) { + options3 = options3 || {}; + var type3 = typeof val; + if (type3 === "string" && val.length > 0) { + return parse8(val); + } else if (type3 === "number" && isFinite(val)) { + return options3.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) + ); + }; + function parse8(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; + } + var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match2) { + return; + } + var n2 = parseFloat(match2[1]); + var type3 = (match2[2] || "ms").toLowerCase(); + switch (type3) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n2 * y5; + case "weeks": + case "week": + case "w": + return n2 * w3; + case "days": + case "day": + case "d": + return n2 * d2; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n2 * h2; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n2 * m2; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n2 * s2; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n2; + default: + return void 0; + } + } + __name(parse8, "parse"); + function fmtShort(ms3) { + var msAbs = Math.abs(ms3); + if (msAbs >= d2) { + return Math.round(ms3 / d2) + "d"; + } + if (msAbs >= h2) { + return Math.round(ms3 / h2) + "h"; + } + if (msAbs >= m2) { + return Math.round(ms3 / m2) + "m"; + } + if (msAbs >= s2) { + return Math.round(ms3 / s2) + "s"; + } + return ms3 + "ms"; + } + __name(fmtShort, "fmtShort"); + function fmtLong(ms3) { + var msAbs = Math.abs(ms3); + if (msAbs >= d2) { + return plural(ms3, msAbs, d2, "day"); + } + if (msAbs >= h2) { + return plural(ms3, msAbs, h2, "hour"); + } + if (msAbs >= m2) { + return plural(ms3, msAbs, m2, "minute"); + } + if (msAbs >= s2) { + return plural(ms3, msAbs, s2, "second"); + } + return ms3 + " ms"; + } + __name(fmtLong, "fmtLong"); + function plural(ms3, msAbs, n2, name) { + var isPlural = msAbs >= n2 * 1.5; + return Math.round(ms3 / n2) + " " + name + (isPlural ? "s" : ""); + } + __name(plural, "plural"); + } + }); + + // ../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/common.js + var require_common = __commonJS({ + "../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/common.js"(exports2, module2) { + "use strict"; + function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require_ms(); + createDebug.destroy = destroy2; + Object.keys(env).forEach((key) => { + createDebug[key] = env[key]; + }); + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i2 = 0; i2 < namespace.length; i2++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i2); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + __name(selectColor, "selectColor"); + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug(...args) { + if (!debug.enabled) { + return; + } + const self2 = debug; + const curr = Number(/* @__PURE__ */ new Date()); + const ms3 = curr - (prevTime || curr); + self2.diff = ms3; + self2.prev = prevTime; + self2.curr = curr; + prevTime = curr; + args[0] = createDebug.coerce(args[0]); + if (typeof args[0] !== "string") { + args.unshift("%O"); + } + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format3) => { + if (match2 === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format3]; + if (typeof formatter === "function") { + const val = args[index]; + match2 = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match2; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + __name(debug, "debug"); + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend5; + debug.destroy = createDebug.destroy; + Object.defineProperty(debug, "enabled", { + enumerable: true, + configurable: false, + get: /* @__PURE__ */ __name(() => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + return enabledCache; + }, "get"), + set: /* @__PURE__ */ __name((v3) => { + enableOverride = v3; + }, "set") + }); + if (typeof createDebug.init === "function") { + createDebug.init(debug); + } + return debug; + } + __name(createDebug, "createDebug"); + function extend5(namespace, delimiter3) { + const newDebug = createDebug(this.namespace + (typeof delimiter3 === "undefined" ? ":" : delimiter3) + namespace); + newDebug.log = this.log; + return newDebug; + } + __name(extend5, "extend"); + function enable(namespaces2) { + createDebug.save(namespaces2); + createDebug.namespaces = namespaces2; + createDebug.names = []; + createDebug.skips = []; + let i2; + const split = (typeof namespaces2 === "string" ? namespaces2 : "").split(/[\s,]+/); + const len = split.length; + for (i2 = 0; i2 < len; i2++) { + if (!split[i2]) { + continue; + } + namespaces2 = split[i2].replace(/\*/g, ".*?"); + if (namespaces2[0] === "-") { + createDebug.skips.push(new RegExp("^" + namespaces2.slice(1) + "$")); + } else { + createDebug.names.push(new RegExp("^" + namespaces2 + "$")); + } + } + } + __name(enable, "enable"); + function disable() { + const namespaces2 = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces2; + } + __name(disable, "disable"); + function enabled(name) { + if (name[name.length - 1] === "*") { + return true; + } + let i2; + let len; + for (i2 = 0, len = createDebug.skips.length; i2 < len; i2++) { + if (createDebug.skips[i2].test(name)) { + return false; + } + } + for (i2 = 0, len = createDebug.names.length; i2 < len; i2++) { + if (createDebug.names[i2].test(name)) { + return true; + } + } + return false; + } + __name(enabled, "enabled"); + function toNamespace(regexp) { + return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); + } + __name(toNamespace, "toNamespace"); + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + __name(coerce, "coerce"); + function destroy2() { + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + __name(destroy2, "destroy"); + createDebug.enable(createDebug.load()); + return createDebug; + } + __name(setup, "setup"); + module2.exports = setup; + } + }); + + // ../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/browser.js + var require_browser = __commonJS({ + "../../node_modules/.pnpm/debug@4.3.6_supports-color@8.1.1/node_modules/debug/src/browser.js"(exports2, module2) { + "use strict"; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.storage = localstorage(); + exports2.destroy = /* @__PURE__ */ (() => { + let warned = false; + return () => { + if (!warned) { + warned = true; + console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); + } + }; + })(); + exports2.colors = [ + "#0000CC", + "#0000FF", + "#0033CC", + "#0033FF", + "#0066CC", + "#0066FF", + "#0099CC", + "#0099FF", + "#00CC00", + "#00CC33", + "#00CC66", + "#00CC99", + "#00CCCC", + "#00CCFF", + "#3300CC", + "#3300FF", + "#3333CC", + "#3333FF", + "#3366CC", + "#3366FF", + "#3399CC", + "#3399FF", + "#33CC00", + "#33CC33", + "#33CC66", + "#33CC99", + "#33CCCC", + "#33CCFF", + "#6600CC", + "#6600FF", + "#6633CC", + "#6633FF", + "#66CC00", + "#66CC33", + "#9900CC", + "#9900FF", + "#9933CC", + "#9933FF", + "#99CC00", + "#99CC33", + "#CC0000", + "#CC0033", + "#CC0066", + "#CC0099", + "#CC00CC", + "#CC00FF", + "#CC3300", + "#CC3333", + "#CC3366", + "#CC3399", + "#CC33CC", + "#CC33FF", + "#CC6600", + "#CC6633", + "#CC9900", + "#CC9933", + "#CCCC00", + "#CCCC33", + "#FF0000", + "#FF0033", + "#FF0066", + "#FF0099", + "#FF00CC", + "#FF00FF", + "#FF3300", + "#FF3333", + "#FF3366", + "#FF3399", + "#FF33CC", + "#FF33FF", + "#FF6600", + "#FF6633", + "#FF9900", + "#FF9933", + "#FFCC00", + "#FFCC33" + ]; + function useColors() { + if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { + return true; + } + if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + let m2; + return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 + typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + typeof navigator !== "undefined" && navigator.userAgent && (m2 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m2[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker + typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); + } + __name(useColors, "useColors"); + function formatArgs(args) { + args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); + if (!this.useColors) { + return; + } + const c3 = "color: " + this.color; + args.splice(1, 0, c3, "color: inherit"); + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match2) => { + if (match2 === "%%") { + return; + } + index++; + if (match2 === "%c") { + lastC = index; + } + }); + args.splice(lastC, 0, c3); + } + __name(formatArgs, "formatArgs"); + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces2) { + try { + if (namespaces2) { + exports2.storage.setItem("debug", namespaces2); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { + } + } + __name(save, "save"); + function load2() { + let r2; + try { + r2 = exports2.storage.getItem("debug"); + } catch (error3) { + } + if (!r2 && typeof process !== "undefined" && "env" in process) { + r2 = process.env.DEBUG; + } + return r2; + } + __name(load2, "load"); + function localstorage() { + try { + return localStorage; + } catch (error3) { + } + } + __name(localstorage, "localstorage"); + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v3) { + try { + return JSON.stringify(v3); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; + } + }; + } + }); + + // ../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/index.mjs + var import_debug; + var init_lib = __esm({ + "../../node_modules/.pnpm/@iconify+utils@2.1.32/node_modules/@iconify/utils/lib/index.mjs"() { + "use strict"; + init_name(); + init_get_icon(); + init_build(); + init_id(); + init_html(); + import_debug = __toESM(require_browser(), 1); + } + }); + + // src/rendering-util/icons.ts + var unknownIcon, iconsStore, loaderStore, registerIconPacks, getRegisteredIconData, getIconSVG; + var init_icons = __esm({ + "src/rendering-util/icons.ts"() { + "use strict"; + init_logger(); + init_lib(); + unknownIcon = { + body: '?', + height: 80, + width: 80 + }; + iconsStore = /* @__PURE__ */ new Map(); + loaderStore = /* @__PURE__ */ new Map(); + registerIconPacks = /* @__PURE__ */ __name((iconLoaders) => { + for (const iconLoader of iconLoaders) { + if (!iconLoader.name) { + throw new Error( + 'Invalid icon loader. Must have a "name" property with non-empty string value.' + ); + } + log.debug("Registering icon pack:", iconLoader.name); + if ("loader" in iconLoader) { + loaderStore.set(iconLoader.name, iconLoader.loader); + } else if ("icons" in iconLoader) { + iconsStore.set(iconLoader.name, iconLoader.icons); + } else { + log.error("Invalid icon loader:", iconLoader); + throw new Error('Invalid icon loader. Must have either "icons" or "loader" property.'); + } + } + }, "registerIconPacks"); + getRegisteredIconData = /* @__PURE__ */ __name(async (iconName, fallbackPrefix) => { + const data5 = stringToIcon(iconName, true, fallbackPrefix !== void 0); + if (!data5) { + throw new Error(`Invalid icon name: ${iconName}`); + } + const prefix = data5.prefix || fallbackPrefix; + if (!prefix) { + throw new Error(`Icon name must contain a prefix: ${iconName}`); + } + let icons = iconsStore.get(prefix); + if (!icons) { + const loader26 = loaderStore.get(prefix); + if (!loader26) { + throw new Error(`Icon set not found: ${data5.prefix}`); + } + try { + const loaded = await loader26(); + icons = { ...loaded, prefix }; + iconsStore.set(prefix, icons); + } catch (e3) { + log.error(e3); + throw new Error(`Failed to load icon set: ${data5.prefix}`); + } + } + const iconData = getIconData(icons, data5.name); + if (!iconData) { + throw new Error(`Icon not found: ${iconName}`); + } + return iconData; + }, "getRegisteredIconData"); + getIconSVG = /* @__PURE__ */ __name(async (iconName, customisations) => { + let iconData; + try { + iconData = await getRegisteredIconData(iconName, customisations?.fallbackPrefix); + } catch (e3) { + log.error(e3); + iconData = unknownIcon; + } + const renderData = iconToSVG(iconData, customisations); + const svg = iconToHTML(replaceIDs(renderData.body), renderData.attributes); + return svg; + }, "getIconSVG"); + } + }); + + // ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js + function dedent(templ) { + var values2 = []; + for (var _i = 1; _i < arguments.length; _i++) { + values2[_i - 1] = arguments[_i]; + } + var strings = Array.from(typeof templ === "string" ? [templ] : templ); + strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, ""); + var indentLengths = strings.reduce(function(arr, str2) { + var matches33 = str2.match(/\n([\t ]+|(?!\s).)/g); + if (matches33) { + return arr.concat(matches33.map(function(match2) { + var _a, _b; + return (_b = (_a = match2.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; + })); + } + return arr; + }, []); + if (indentLengths.length) { + var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g"); + strings = strings.map(function(str2) { + return str2.replace(pattern_1, "\n"); + }); + } + strings[0] = strings[0].replace(/^\r?\n/, ""); + var string3 = strings[0]; + values2.forEach(function(value2, i2) { + var endentations = string3.match(/(?:^|\n)( *)$/); + var endentation = endentations ? endentations[1] : ""; + var indentedValue = value2; + if (typeof value2 === "string" && value2.includes("\n")) { + indentedValue = String(value2).split("\n").map(function(str2, i3) { + return i3 === 0 ? str2 : "" + endentation + str2; + }).join("\n"); + } + string3 += indentedValue + strings[i2 + 1]; + }); + return string3; + } + var init_esm = __esm({ + "../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js"() { + "use strict"; + __name(dedent, "dedent"); + } + }); + // src/diagram-api/regexes.ts var frontMatterRegex, directiveRegex, anyCommentRegex; var init_regexes = __esm({ @@ -478,9 +1517,9 @@ var __esbuild_esm_mermaid = (() => { detectors = {}; detectType = /* @__PURE__ */ __name(function(text2, config6) { text2 = text2.replace(frontMatterRegex, "").replace(directiveRegex, "").replace(anyCommentRegex, "\n"); - for (const [key, { detector: detector24 }] of Object.entries(detectors)) { - const diagram23 = detector24(text2, config6); - if (diagram23) { + for (const [key, { detector: detector25 }] of Object.entries(detectors)) { + const diagram24 = detector25(text2, config6); + if (diagram24) { return key; } } @@ -489,16 +1528,16 @@ var __esbuild_esm_mermaid = (() => { ); }, "detectType"); registerLazyLoadedDiagrams = /* @__PURE__ */ __name((...diagrams2) => { - for (const { id: id26, detector: detector24, loader: loader25 } of diagrams2) { - addDetector(id26, detector24, loader25); + for (const { id: id27, detector: detector25, loader: loader26 } of diagrams2) { + addDetector(id27, detector25, loader26); } }, "registerLazyLoadedDiagrams"); - addDetector = /* @__PURE__ */ __name((key, detector24, loader25) => { + addDetector = /* @__PURE__ */ __name((key, detector25, loader26) => { if (detectors[key]) { log.warn(`Detector with key ${key} already exists. Overwriting.`); } - detectors[key] = { detector: detector24, loader: loader25 }; - log.debug(`Detector with key ${key} added${loader25 ? " with loader" : ""}`); + detectors[key] = { detector: detector25, loader: loader26 }; + log.debug(`Detector with key ${key} added${loader26 ? " with loader" : ""}`); }, "addDetector"); getDiagramLoader = /* @__PURE__ */ __name((key) => { return detectors[key].loader; @@ -516,7 +1555,7 @@ var __esbuild_esm_mermaid = (() => { for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 24], $V1 = [1, 25], $V2 = [1, 26], $V3 = [1, 27], $V4 = [1, 28], $V5 = [1, 63], $V6 = [1, 64], $V7 = [1, 65], $V8 = [1, 66], $V9 = [1, 67], $Va = [1, 68], $Vb = [1, 69], $Vc = [1, 29], $Vd = [1, 30], $Ve = [1, 31], $Vf = [1, 32], $Vg = [1, 33], $Vh = [1, 34], $Vi = [1, 35], $Vj = [1, 36], $Vk = [1, 37], $Vl = [1, 38], $Vm = [1, 39], $Vn = [1, 40], $Vo = [1, 41], $Vp = [1, 42], $Vq = [1, 43], $Vr = [1, 44], $Vs = [1, 45], $Vt = [1, 46], $Vu = [1, 47], $Vv = [1, 48], $Vw = [1, 50], $Vx = [1, 51], $Vy = [1, 52], $Vz = [1, 53], $VA = [1, 54], $VB = [1, 55], $VC = [1, 56], $VD = [1, 57], $VE = [1, 58], $VF = [1, 59], $VG = [1, 60], $VH = [14, 42], $VI = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VJ = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], $VK = [1, 82], $VL = [1, 83], $VM = [1, 84], $VN = [1, 85], $VO = [12, 14, 42], $VP = [12, 14, 33, 42], $VQ = [12, 14, 33, 42, 76, 77, 79, 80], $VR = [12, 33], $VS = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -796,21 +1835,21 @@ var __esbuild_esm_mermaid = (() => { return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -829,7 +1868,7 @@ var __esbuild_esm_mermaid = (() => { }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -1493,13 +2532,13 @@ var __esbuild_esm_mermaid = (() => { }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser.parser = parser; @@ -2687,6 +3726,11 @@ var __esbuild_esm_mermaid = (() => { this.pieOuterStrokeWidth = this.pieOuterStrokeWidth || "2px"; this.pieOuterStrokeColor = this.pieOuterStrokeColor || "black"; this.pieOpacity = this.pieOpacity || "0.7"; + this.archEdgeColor = this.archEdgeColor || "#777"; + this.archEdgeArrowColor = this.archEdgeArrowColor || "#777"; + this.archEdgeWidth = this.archEdgeWidth || "3"; + this.archGroupBorderColor = this.archGroupBorderColor || "#000"; + this.archGroupBorderWidth = this.archGroupBorderWidth || "2px"; this.quadrant1Fill = this.quadrant1Fill || this.primaryColor; this.quadrant2Fill = this.quadrant2Fill || adjust_default(this.primaryColor, { r: 5, g: 5, b: 5 }); this.quadrant3Fill = this.quadrant3Fill || adjust_default(this.primaryColor, { r: 10, g: 10, b: 10 }); @@ -2880,6 +3924,11 @@ var __esbuild_esm_mermaid = (() => { this.todayLineColor = "#DB5757"; this.personBorder = this.primaryBorderColor; this.personBkg = this.mainBkg; + this.archEdgeColor = "calculated"; + this.archEdgeArrowColor = "calculated"; + this.archEdgeWidth = "3"; + this.archGroupBorderColor = this.primaryBorderColor; + this.archGroupBorderWidth = "2px"; this.labelColor = "calculated"; this.errorBkgColor = "#a44141"; this.errorTextColor = "#ddd"; @@ -2917,6 +3966,8 @@ var __esbuild_esm_mermaid = (() => { this.gridColor = this.mainContrastColor; this.doneTaskBkgColor = this.mainContrastColor; this.taskTextDarkColor = this.darkTextColor; + this.archEdgeColor = this.lineColor; + this.archEdgeArrowColor = this.lineColor; this.transitionColor = this.transitionColor || this.lineColor; this.transitionLabelColor = this.transitionLabelColor || this.textColor; this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; @@ -3192,6 +4243,11 @@ var __esbuild_esm_mermaid = (() => { this.todayLineColor = "red"; this.personBorder = this.primaryBorderColor; this.personBkg = this.mainBkg; + this.archEdgeColor = "calculated"; + this.archEdgeArrowColor = "calculated"; + this.archEdgeWidth = "3"; + this.archGroupBorderColor = this.primaryBorderColor; + this.archGroupBorderWidth = "2px"; this.labelColor = "black"; this.errorBkgColor = "#552222"; this.errorTextColor = "#552222"; @@ -3251,6 +4307,8 @@ var __esbuild_esm_mermaid = (() => { this.actorLineColor = this.actorBorder; this.taskTextColor = this.taskTextLightColor; this.taskTextOutsideColor = this.taskTextDarkColor; + this.archEdgeColor = this.lineColor; + this.archEdgeArrowColor = this.lineColor; this.transitionColor = this.transitionColor || this.lineColor; this.transitionLabelColor = this.transitionLabelColor || this.textColor; this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; @@ -3487,6 +4545,11 @@ var __esbuild_esm_mermaid = (() => { this.todayLineColor = "red"; this.personBorder = this.primaryBorderColor; this.personBkg = this.mainBkg; + this.archEdgeColor = "calculated"; + this.archEdgeArrowColor = "calculated"; + this.archEdgeWidth = "3"; + this.archGroupBorderColor = this.primaryBorderColor; + this.archGroupBorderWidth = "2px"; this.labelColor = "black"; this.errorBkgColor = "#552222"; this.errorTextColor = "#552222"; @@ -3539,6 +4602,8 @@ var __esbuild_esm_mermaid = (() => { this.taskTextOutsideColor = this.taskTextDarkColor; this.activeTaskBorderColor = this.taskBorderColor; this.activeTaskBkgColor = this.mainBkg; + this.archEdgeColor = this.lineColor; + this.archEdgeArrowColor = this.lineColor; this.transitionColor = this.transitionColor || this.lineColor; this.transitionLabelColor = this.transitionLabelColor || this.textColor; this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; @@ -3787,6 +4852,11 @@ var __esbuild_esm_mermaid = (() => { this.todayLineColor = "calculated"; this.personBorder = this.primaryBorderColor; this.personBkg = this.mainBkg; + this.archEdgeColor = "calculated"; + this.archEdgeArrowColor = "calculated"; + this.archEdgeWidth = "3"; + this.archGroupBorderColor = this.primaryBorderColor; + this.archGroupBorderWidth = "2px"; this.labelColor = "black"; this.errorBkgColor = "#552222"; this.errorTextColor = "#552222"; @@ -3860,6 +4930,8 @@ var __esbuild_esm_mermaid = (() => { this.critBkgColor = this.critical; this.critBorderColor = darken_default(this.critBkgColor, 10); this.todayLineColor = this.critBkgColor; + this.archEdgeColor = this.lineColor; + this.archEdgeArrowColor = this.lineColor; this.transitionColor = this.transitionColor || "#000"; this.transitionLabelColor = this.transitionLabelColor || this.textColor; this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; @@ -4458,6 +5530,12 @@ var __esbuild_esm_mermaid = (() => { "paddingX": 5, "paddingY": 5 }, + "architecture": { + "useMaxWidth": true, + "padding": 40, + "iconSize": 80, + "fontSize": 16 + }, "theme": "default", "look": "classic", "handDrawnSeed": 0, @@ -6233,39 +7311,39 @@ var __esbuild_esm_mermaid = (() => { } return node2; } - function cdArrow(arrowChar, labels, parser21) { + function cdArrow(arrowChar, labels, parser22) { var funcName = cdArrowFunctionName[arrowChar]; switch (funcName) { case "\\\\cdrightarrow": case "\\\\cdleftarrow": - return parser21.callFunction(funcName, [labels[0]], [labels[1]]); + return parser22.callFunction(funcName, [labels[0]], [labels[1]]); case "\\uparrow": case "\\downarrow": { - var leftLabel = parser21.callFunction("\\\\cdleft", [labels[0]], []); + var leftLabel = parser22.callFunction("\\\\cdleft", [labels[0]], []); var bareArrow = { type: "atom", text: funcName, mode: "math", family: "rel" }; - var sizedArrow = parser21.callFunction("\\Big", [bareArrow], []); - var rightLabel = parser21.callFunction("\\\\cdright", [labels[1]], []); + var sizedArrow = parser22.callFunction("\\Big", [bareArrow], []); + var rightLabel = parser22.callFunction("\\\\cdright", [labels[1]], []); var arrowGroup = { type: "ordgroup", mode: "math", body: [leftLabel, sizedArrow, rightLabel] }; - return parser21.callFunction("\\\\cdparent", [arrowGroup], []); + return parser22.callFunction("\\\\cdparent", [arrowGroup], []); } case "\\\\cdlongequal": - return parser21.callFunction("\\\\cdlongequal", [], []); + return parser22.callFunction("\\\\cdlongequal", [], []); case "\\Vert": { var arrow = { type: "textord", text: "\\Vert", mode: "math" }; - return parser21.callFunction("\\Big", [arrow], []); + return parser22.callFunction("\\Big", [arrow], []); } default: return { @@ -6275,25 +7353,25 @@ var __esbuild_esm_mermaid = (() => { }; } } - function parseCD(parser21) { + function parseCD(parser22) { var parsedRows = []; - parser21.gullet.beginGroup(); - parser21.gullet.macros.set("\\cr", "\\\\\\relax"); - parser21.gullet.beginGroup(); + parser22.gullet.beginGroup(); + parser22.gullet.macros.set("\\cr", "\\\\\\relax"); + parser22.gullet.beginGroup(); while (true) { - parsedRows.push(parser21.parseExpression(false, "\\\\")); - parser21.gullet.endGroup(); - parser21.gullet.beginGroup(); - var next3 = parser21.fetch().text; + parsedRows.push(parser22.parseExpression(false, "\\\\")); + parser22.gullet.endGroup(); + parser22.gullet.beginGroup(); + var next3 = parser22.fetch().text; if (next3 === "&" || next3 === "\\\\") { - parser21.consume(); + parser22.consume(); } else if (next3 === "\\end") { if (parsedRows[parsedRows.length - 1].length === 0) { parsedRows.pop(); } break; } else { - throw new ParseError("Expected \\\\ or \\cr or \\end", parser21.nextToken); + throw new ParseError("Expected \\\\ or \\cr or \\end", parser22.nextToken); } } var row = []; @@ -6341,7 +7419,7 @@ var __esbuild_esm_mermaid = (() => { } else { throw new ParseError('Expected one of "<>AV=|." after @', rowNodes[j2]); } - var arrow = cdArrow(arrowChar, labels, parser21); + var arrow = cdArrow(arrowChar, labels, parser22); var wrappedArrow = { type: "styling", body: [arrow], @@ -6361,8 +7439,8 @@ var __esbuild_esm_mermaid = (() => { row = []; body.push(row); } - parser21.gullet.endGroup(); - parser21.gullet.endGroup(); + parser22.gullet.endGroup(); + parser22.gullet.endGroup(); var cols = new Array(body[0].length).fill({ type: "align", align: "c", @@ -6427,20 +7505,20 @@ var __esbuild_esm_mermaid = (() => { function defineMacro(name, body) { _macros[name] = body; } - function getHLines(parser21) { + function getHLines(parser22) { var hlineInfo = []; - parser21.consumeSpaces(); - var nxt = parser21.fetch().text; + parser22.consumeSpaces(); + var nxt = parser22.fetch().text; if (nxt === "\\relax") { - parser21.consume(); - parser21.consumeSpaces(); - nxt = parser21.fetch().text; + parser22.consume(); + parser22.consumeSpaces(); + nxt = parser22.fetch().text; } while (nxt === "\\hline" || nxt === "\\hdashline") { - parser21.consume(); + parser22.consume(); hlineInfo.push(nxt === "\\hdashline"); - parser21.consumeSpaces(); - nxt = parser21.fetch().text; + parser22.consumeSpaces(); + nxt = parser22.fetch().text; } return hlineInfo; } @@ -6449,7 +7527,7 @@ var __esbuild_esm_mermaid = (() => { return name.indexOf("*") === -1; } } - function parseArray(parser21, _ref, style3) { + function parseArray(parser22, _ref, style3) { var { hskipBeforeAndAfter, addJot, @@ -6462,12 +7540,12 @@ var __esbuild_esm_mermaid = (() => { maxNumCols, leqno } = _ref; - parser21.gullet.beginGroup(); + parser22.gullet.beginGroup(); if (!singleRow) { - parser21.gullet.macros.set("\\cr", "\\\\\\relax"); + parser22.gullet.macros.set("\\cr", "\\\\\\relax"); } if (!arraystretch) { - var stretch = parser21.gullet.expandMacroAsText("\\arraystretch"); + var stretch = parser22.gullet.expandMacroAsText("\\arraystretch"); if (stretch == null) { arraystretch = 1; } else { @@ -6477,7 +7555,7 @@ var __esbuild_esm_mermaid = (() => { } } } - parser21.gullet.beginGroup(); + parser22.gullet.beginGroup(); var row = []; var body = [row]; var rowGaps = []; @@ -6485,51 +7563,51 @@ var __esbuild_esm_mermaid = (() => { var tags2 = autoTag != null ? [] : void 0; function beginRow() { if (autoTag) { - parser21.gullet.macros.set("\\@eqnsw", "1", true); + parser22.gullet.macros.set("\\@eqnsw", "1", true); } } __name(beginRow, "beginRow"); function endRow() { if (tags2) { - if (parser21.gullet.macros.get("\\df@tag")) { - tags2.push(parser21.subparse([new Token("\\df@tag")])); - parser21.gullet.macros.set("\\df@tag", void 0, true); + if (parser22.gullet.macros.get("\\df@tag")) { + tags2.push(parser22.subparse([new Token("\\df@tag")])); + parser22.gullet.macros.set("\\df@tag", void 0, true); } else { - tags2.push(Boolean(autoTag) && parser21.gullet.macros.get("\\@eqnsw") === "1"); + tags2.push(Boolean(autoTag) && parser22.gullet.macros.get("\\@eqnsw") === "1"); } } } __name(endRow, "endRow"); beginRow(); - hLinesBeforeRow.push(getHLines(parser21)); + hLinesBeforeRow.push(getHLines(parser22)); while (true) { - var cell = parser21.parseExpression(false, singleRow ? "\\end" : "\\\\"); - parser21.gullet.endGroup(); - parser21.gullet.beginGroup(); + var cell = parser22.parseExpression(false, singleRow ? "\\end" : "\\\\"); + parser22.gullet.endGroup(); + parser22.gullet.beginGroup(); cell = { type: "ordgroup", - mode: parser21.mode, + mode: parser22.mode, body: cell }; if (style3) { cell = { type: "styling", - mode: parser21.mode, + mode: parser22.mode, style: style3, body: [cell] }; } row.push(cell); - var next3 = parser21.fetch().text; + var next3 = parser22.fetch().text; if (next3 === "&") { if (maxNumCols && row.length === maxNumCols) { if (singleRow || colSeparationType) { - throw new ParseError("Too many tab characters: &", parser21.nextToken); + throw new ParseError("Too many tab characters: &", parser22.nextToken); } else { - parser21.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument."); + parser22.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument."); } } - parser21.consume(); + parser22.consume(); } else if (next3 === "\\end") { endRow(); if (row.length === 1 && cell.type === "styling" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow)) { @@ -6540,26 +7618,26 @@ var __esbuild_esm_mermaid = (() => { } break; } else if (next3 === "\\\\") { - parser21.consume(); + parser22.consume(); var size5 = void 0; - if (parser21.gullet.future().text !== " ") { - size5 = parser21.parseSizeGroup(true); + if (parser22.gullet.future().text !== " ") { + size5 = parser22.parseSizeGroup(true); } rowGaps.push(size5 ? size5.value : null); endRow(); - hLinesBeforeRow.push(getHLines(parser21)); + hLinesBeforeRow.push(getHLines(parser22)); row = []; body.push(row); beginRow(); } else { - throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser21.nextToken); + throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser22.nextToken); } } - parser21.gullet.endGroup(); - parser21.gullet.endGroup(); + parser22.gullet.endGroup(); + parser22.gullet.endGroup(); return { type: "array", - mode: parser21.mode, + mode: parser22.mode, addJot, arraystretch, body, @@ -6594,7 +7672,7 @@ var __esbuild_esm_mermaid = (() => { } return buildCommon.makeFragment(inner2); } - var SourceLocation, Token, ParseError, contains, deflt, uppercase, hyphenate, ESCAPE_LOOKUP, ESCAPE_REGEX, getBaseElem, isCharacterBox, assert, protocolFromUrl, utils, SETTINGS_SCHEMA, Settings, Style, D, Dc, T, Tc, S, Sc, SS, SSc, styles, sup, sub, fracNum, fracDen, cramp, text$1, Style$1, scriptData, allBlocks, hLinePad, sqrtMain, sqrtSize1, sqrtSize2, sqrtSize3, sqrtSize4, phasePath, sqrtTall, sqrtPath, innerPath, path, tallDelim, DocumentFragment, fontMetricsData, sigmasAndXis, extraCharacterMap, fontMetricsBySizeIndex, sizeStyleMap, sizeMultipliers, sizeAtStyle, Options, ptPerUnit, relativeUnit, validUnit, calculateSize, makeEm, createClass, initNode, toNode, toMarkup, Span, Anchor, Img, iCombinations, SymbolNode, SvgNode, PathNode, LineNode, ATOMS, NON_ATOMS, symbols, math, text, main, ams, accent, bin, close, inner, mathord, op, open, punct, rel, spacing, textord, ligatures, mathTextSymbols, ch, i2, textSymbols, _ch, _i, letters, _ch2, _i2, wideChar, _ch3, _i3, _ch4, _i4, extraLatin, _ch5, _i5, wideLatinLetterData, wideNumeralData, wideCharacterFont, lookupSymbol, makeSymbol, mathsym, boldsymbol, makeOrd, canCombine, tryCombineChars, sizeElementFromChildren, makeSpan$2, makeSvgSpan, makeLineSpan, makeAnchor, makeFragment, wrapFragment, getVListChildrenAndDepth, makeVList, makeGlue, retrieveTextFontName, fontMap, svgData, staticSvg, buildCommon, thinspace, mediumspace, thickspace, spacings, tightSpacings, _functions, _htmlGroupBuilders, _mathmlGroupBuilders, normalizeArgument, ordargument, makeSpan$1, binLeftCanceller, binRightCanceller, styleMap$1, DomEnum, buildExpression$1, traverseNonSpaceNodes, checkPartialGroup, getOutermostNode, getTypeOfDomTree, makeNullDelimiter, buildGroup$1, MathNode, TextNode, SpaceNode, mathMLTree, makeText, makeRow, getVariant, buildExpression2, buildExpressionRow, buildGroup2, optionsFromSettings, displayWrap, buildTree, buildHTMLTree, stretchyCodePoint, mathMLnode, katexImagesData, groupLength, svgSpan, encloseSpan, stretchy, htmlBuilder$a, mathmlBuilder$9, NON_STRETCHY_ACCENT_REGEX, paddedNode, makeSpan2, binrelClass, cdArrowFunctionName, newCell, isStartOfArrow, isLabelEnd, htmlBuilder$8, mathmlBuilder$7, globalMap, checkControlSequence, getRHS, letCommand, getMetrics, styleWrap, centerSpan, makeSmallDelim, mathrmSize, makeLargeDelim, makeGlyphSpan, makeInner, lapInEms, lap, verts, doubleVerts, makeStackedDelim, vbPad, emPad, sqrtSvg, makeSqrtImage, stackLargeDelimiters, stackAlwaysDelimiters, stackNeverDelimiters, sizeToMaxHeight, makeSizedDelim, stackNeverDelimiterSequence, stackAlwaysDelimiterSequence, stackLargeDelimiterSequence, delimTypeToFont, traverseSequence, makeCustomSizedDelim, makeLeftRightDelim, delimiter, delimiterSizes, delimiters, htmlBuilder$7, mathmlBuilder$6, _environments, _macros, validateAmsEnvironmentContext, htmlBuilder$6, alignMap, mathmlBuilder$5, alignedHandler, environments, htmlBuilder$5, mathmlBuilder$4, fontAliases, adjustStyle, htmlBuilder$4, mathmlBuilder$3, stylArray, delimFromValue, htmlBuilder$3, mathmlBuilder$2, sizeData, chooseMathStyle, assembleSupSub, noSuccessor, htmlBuilder$2, mathmlBuilder$1, singleCharBigOps, singleCharIntegrals, htmlBuilder$1, mathmlBuilder2, sizeFuncs, htmlBuilder2, styleMap, htmlBuilderDelegate, defaultVariant, cssSpace, regularSpace, pad, textFontFamilies, textFontWeights, textFontShapes, optionsWithFont, makeVerb, functions, spaceRegexString, controlWordRegexString, controlSymbolRegexString, controlWordWhitespaceRegexString, controlSpaceRegexString, combiningDiacriticalMarkString, combiningDiacriticalMarksEndRegex, tokenRegexString, Lexer, Namespace, macros, digitToNumber, newcommand, dotsByToken, spaceAfterDots, latexRaiseA, braketHelper, implicitCommands, MacroExpander, unicodeSubRegEx, uSubsAndSups, unicodeAccents, unicodeSymbols, Parser, parseTree, render, renderToString, generateParseTree, renderError, renderToDomTree, renderToHTMLTree, katex; + var SourceLocation, Token, ParseError, contains, deflt, uppercase, hyphenate, ESCAPE_LOOKUP, ESCAPE_REGEX, getBaseElem, isCharacterBox, assert, protocolFromUrl, utils, SETTINGS_SCHEMA, Settings, Style, D, Dc, T, Tc, S, Sc, SS, SSc, styles, sup, sub, fracNum, fracDen, cramp, text$1, Style$1, scriptData, allBlocks, hLinePad, sqrtMain, sqrtSize1, sqrtSize2, sqrtSize3, sqrtSize4, phasePath, sqrtTall, sqrtPath, innerPath, path, tallDelim, DocumentFragment, fontMetricsData, sigmasAndXis, extraCharacterMap, fontMetricsBySizeIndex, sizeStyleMap, sizeMultipliers, sizeAtStyle, Options, ptPerUnit, relativeUnit, validUnit, calculateSize2, makeEm, createClass, initNode, toNode, toMarkup, Span, Anchor, Img, iCombinations, SymbolNode, SvgNode, PathNode, LineNode, ATOMS, NON_ATOMS, symbols, math, text, main, ams, accent, bin, close, inner, mathord, op, open, punct, rel, spacing, textord, ligatures, mathTextSymbols, ch, i2, textSymbols, _ch, _i, letters, _ch2, _i2, wideChar, _ch3, _i3, _ch4, _i4, extraLatin, _ch5, _i5, wideLatinLetterData, wideNumeralData, wideCharacterFont, lookupSymbol, makeSymbol, mathsym, boldsymbol, makeOrd, canCombine, tryCombineChars, sizeElementFromChildren, makeSpan$2, makeSvgSpan, makeLineSpan, makeAnchor, makeFragment, wrapFragment, getVListChildrenAndDepth, makeVList, makeGlue, retrieveTextFontName, fontMap, svgData, staticSvg, buildCommon, thinspace, mediumspace, thickspace, spacings, tightSpacings, _functions, _htmlGroupBuilders, _mathmlGroupBuilders, normalizeArgument, ordargument, makeSpan$1, binLeftCanceller, binRightCanceller, styleMap$1, DomEnum, buildExpression$1, traverseNonSpaceNodes, checkPartialGroup, getOutermostNode, getTypeOfDomTree, makeNullDelimiter, buildGroup$1, MathNode, TextNode, SpaceNode, mathMLTree, makeText, makeRow, getVariant, buildExpression2, buildExpressionRow, buildGroup2, optionsFromSettings, displayWrap, buildTree, buildHTMLTree, stretchyCodePoint, mathMLnode, katexImagesData, groupLength, svgSpan, encloseSpan, stretchy, htmlBuilder$a, mathmlBuilder$9, NON_STRETCHY_ACCENT_REGEX, paddedNode, makeSpan2, binrelClass, cdArrowFunctionName, newCell, isStartOfArrow, isLabelEnd, htmlBuilder$8, mathmlBuilder$7, globalMap, checkControlSequence, getRHS, letCommand, getMetrics, styleWrap, centerSpan, makeSmallDelim, mathrmSize, makeLargeDelim, makeGlyphSpan, makeInner, lapInEms, lap, verts, doubleVerts, makeStackedDelim, vbPad, emPad, sqrtSvg, makeSqrtImage, stackLargeDelimiters, stackAlwaysDelimiters, stackNeverDelimiters, sizeToMaxHeight, makeSizedDelim, stackNeverDelimiterSequence, stackAlwaysDelimiterSequence, stackLargeDelimiterSequence, delimTypeToFont, traverseSequence, makeCustomSizedDelim, makeLeftRightDelim, delimiter, delimiterSizes, delimiters, htmlBuilder$7, mathmlBuilder$6, _environments, _macros, validateAmsEnvironmentContext, htmlBuilder$6, alignMap, mathmlBuilder$5, alignedHandler, environments, htmlBuilder$5, mathmlBuilder$4, fontAliases, adjustStyle, htmlBuilder$4, mathmlBuilder$3, stylArray, delimFromValue, htmlBuilder$3, mathmlBuilder$2, sizeData, chooseMathStyle, assembleSupSub, noSuccessor, htmlBuilder$2, mathmlBuilder$1, singleCharBigOps, singleCharIntegrals, htmlBuilder$1, mathmlBuilder2, sizeFuncs, htmlBuilder2, styleMap, htmlBuilderDelegate, defaultVariant, cssSpace, regularSpace, pad, textFontFamilies, textFontWeights, textFontShapes, optionsWithFont, makeVerb, functions, spaceRegexString, controlWordRegexString, controlSymbolRegexString, controlWordWhitespaceRegexString, controlSpaceRegexString, combiningDiacriticalMarkString, combiningDiacriticalMarksEndRegex, tokenRegexString, Lexer, Namespace, macros, digitToNumber, newcommand, dotsByToken, spaceAfterDots, latexRaiseA, braketHelper, implicitCommands, MacroExpander, unicodeSubRegEx, uSubsAndSups, unicodeAccents, unicodeSymbols, Parser, parseTree, render, renderToString, generateParseTree, renderError, renderToDomTree, renderToHTMLTree, katex; var init_katex = __esm({ "../../node_modules/.pnpm/katex@0.16.11/node_modules/katex/dist/katex.mjs"() { "use strict"; @@ -6966,11 +8044,11 @@ var __esbuild_esm_mermaid = (() => { static { __name(this, "Style"); } - constructor(id26, size5, cramped) { + constructor(id27, size5, cramped) { this.id = void 0; this.size = void 0; this.cramped = void 0; - this.id = id26; + this.id = id27; this.size = size5; this.cramped = cramped; } @@ -9882,7 +10960,7 @@ var __esbuild_esm_mermaid = (() => { } return unit2 in ptPerUnit || unit2 in relativeUnit || unit2 === "ex"; }, "validUnit"); - calculateSize = /* @__PURE__ */ __name(function calculateSize2(sizeValue, options3) { + calculateSize2 = /* @__PURE__ */ __name(function calculateSize3(sizeValue, options3) { var scale; if (sizeValue.unit in ptPerUnit) { scale = ptPerUnit[sizeValue.unit] / options3.fontMetrics().ptPerEm / options3.sizeMultiplier; @@ -11417,7 +12495,7 @@ var __esbuild_esm_mermaid = (() => { }, "makeVList"); makeGlue = /* @__PURE__ */ __name((measurement, options3) => { var rule = makeSpan$2(["mspace"], [], options3); - var size5 = calculateSize(measurement, options3); + var size5 = calculateSize2(measurement, options3); rule.style.marginRight = makeEm(size5); return rule; }, "makeGlue"); @@ -12569,13 +13647,13 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21, + parser: parser22, funcName } = _ref; var base = args[0]; return { type: "accentUnder", - mode: parser21.mode, + mode: parser22.mode, label: funcName, base }; @@ -12652,12 +13730,12 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args, optArgs) { var { - parser: parser21, + parser: parser22, funcName } = _ref; return { type: "xArrow", - mode: parser21.mode, + mode: parser22.mode, label: funcName, body: args[0], below: optArgs[0] @@ -12753,13 +13831,13 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21, + parser: parser22, funcName } = _ref; var body = args[0]; return { type: "mclass", - mode: parser21.mode, + mode: parser22.mode, mclass: "m" + funcName.slice(5), // TODO(kevinb): don't prefix with 'm' body: ordargument(body), @@ -12785,11 +13863,11 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref2, args) { var { - parser: parser21 + parser: parser22 } = _ref2; return { type: "mclass", - mode: parser21.mode, + mode: parser22.mode, mclass: binrelClass(args[0]), body: ordargument(args[1]), isCharacterBox: utils.isCharacterBox(args[1]) @@ -12804,7 +13882,7 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref3, args) { var { - parser: parser21, + parser: parser22, funcName } = _ref3; var baseArg = args[1]; @@ -12834,7 +13912,7 @@ var __esbuild_esm_mermaid = (() => { }; return { type: "mclass", - mode: parser21.mode, + mode: parser22.mode, mclass, body: [supsub], isCharacterBox: utils.isCharacterBox(supsub) @@ -12852,11 +13930,11 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21 + parser: parser22 } = _ref; return { type: "pmb", - mode: parser21.mode, + mode: parser22.mode, mclass: binrelClass(args[0]), body: ordargument(args[0]) }; @@ -12907,12 +13985,12 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21, + parser: parser22, funcName } = _ref; return { type: "cdlabel", - mode: parser21.mode, + mode: parser22.mode, side: funcName.slice(4), label: args[0] }; @@ -12948,11 +14026,11 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref2, args) { var { - parser: parser21 + parser: parser22 } = _ref2; return { type: "cdlabelparent", - mode: parser21.mode, + mode: parser22.mode, fragment: args[0] }; }, @@ -12974,7 +14052,7 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21 + parser: parser22 } = _ref; var arg = assertNodeType(args[0], "ordgroup"); var group2 = arg.body; @@ -12997,7 +14075,7 @@ var __esbuild_esm_mermaid = (() => { } return { type: "textord", - mode: parser21.mode, + mode: parser22.mode, text: text2 }; } @@ -13022,13 +14100,13 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21 + parser: parser22 } = _ref; var color2 = assertNodeType(args[0], "color-token").color; var body = args[1]; return { type: "color", - mode: parser21.mode, + mode: parser22.mode, color: color2, body: ordargument(body) }; @@ -13046,15 +14124,15 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref2, args) { var { - parser: parser21, + parser: parser22, breakOnTokenText } = _ref2; var color2 = assertNodeType(args[0], "color-token").color; - parser21.gullet.macros.set("\\current@color", color2); - var body = parser21.parseExpression(true, breakOnTokenText); + parser22.gullet.macros.set("\\current@color", color2); + var body = parser22.parseExpression(true, breakOnTokenText); return { type: "color", - mode: parser21.mode, + mode: parser22.mode, color: color2, body }; @@ -13072,13 +14150,13 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args, optArgs) { var { - parser: parser21 + parser: parser22 } = _ref; - var size5 = parser21.gullet.future().text === "[" ? parser21.parseSizeGroup(true) : null; - var newLine = !parser21.settings.displayMode || !parser21.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode"); + var size5 = parser22.gullet.future().text === "[" ? parser22.parseSizeGroup(true) : null; + var newLine = !parser22.settings.displayMode || !parser22.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode"); return { type: "cr", - mode: parser21.mode, + mode: parser22.mode, newLine, size: size5 && assertNodeType(size5, "size").value }; @@ -13090,7 +14168,7 @@ var __esbuild_esm_mermaid = (() => { if (group2.newLine) { span.classes.push("newline"); if (group2.size) { - span.style.marginTop = makeEm(calculateSize(group2.size, options3)); + span.style.marginTop = makeEm(calculateSize2(group2.size, options3)); } } return span; @@ -13100,7 +14178,7 @@ var __esbuild_esm_mermaid = (() => { if (group2.newLine) { node2.setAttribute("linebreak", "newline"); if (group2.size) { - node2.setAttribute("height", makeEm(calculateSize(group2.size, options3))); + node2.setAttribute("height", makeEm(calculateSize2(group2.size, options3))); } } return node2; @@ -13124,28 +14202,28 @@ var __esbuild_esm_mermaid = (() => { } return name; }, "checkControlSequence"); - getRHS = /* @__PURE__ */ __name((parser21) => { - var tok = parser21.gullet.popToken(); + getRHS = /* @__PURE__ */ __name((parser22) => { + var tok = parser22.gullet.popToken(); if (tok.text === "=") { - tok = parser21.gullet.popToken(); + tok = parser22.gullet.popToken(); if (tok.text === " ") { - tok = parser21.gullet.popToken(); + tok = parser22.gullet.popToken(); } } return tok; }, "getRHS"); - letCommand = /* @__PURE__ */ __name((parser21, name, tok, global2) => { - var macro = parser21.gullet.macros.get(tok.text); + letCommand = /* @__PURE__ */ __name((parser22, name, tok, global2) => { + var macro = parser22.gullet.macros.get(tok.text); if (macro == null) { tok.noexpand = true; macro = { tokens: [tok], numArgs: 0, // reproduce the same behavior in expansion - unexpandable: !parser21.gullet.isExpandable(tok.text) + unexpandable: !parser22.gullet.isExpandable(tok.text) }; } - parser21.gullet.macros.set(name, macro, global2); + parser22.gullet.macros.set(name, macro, global2); }, "letCommand"); defineFunction({ type: "internal", @@ -13161,16 +14239,16 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref) { var { - parser: parser21, + parser: parser22, funcName } = _ref; - parser21.consumeSpaces(); - var token2 = parser21.fetch(); + parser22.consumeSpaces(); + var token2 = parser22.fetch(); if (globalMap[token2.text]) { if (funcName === "\\global" || funcName === "\\\\globallong") { token2.text = globalMap[token2.text]; } - return assertNodeType(parser21.parseFunction(), "internal"); + return assertNodeType(parser22.parseFunction(), "internal"); } throw new ParseError("Invalid token after macro prefix", token2); } @@ -13185,10 +14263,10 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref2) { var { - parser: parser21, + parser: parser22, funcName } = _ref2; - var tok = parser21.gullet.popToken(); + var tok = parser22.gullet.popToken(); var name = tok.text; if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) { throw new ParseError("Expected a control sequence", tok); @@ -13196,15 +14274,15 @@ var __esbuild_esm_mermaid = (() => { var numArgs = 0; var insert; var delimiters2 = [[]]; - while (parser21.gullet.future().text !== "{") { - tok = parser21.gullet.popToken(); + while (parser22.gullet.future().text !== "{") { + tok = parser22.gullet.popToken(); if (tok.text === "#") { - if (parser21.gullet.future().text === "{") { - insert = parser21.gullet.future(); + if (parser22.gullet.future().text === "{") { + insert = parser22.gullet.future(); delimiters2[numArgs].push("{"); break; } - tok = parser21.gullet.popToken(); + tok = parser22.gullet.popToken(); if (!/^[1-9]$/.test(tok.text)) { throw new ParseError('Invalid argument number "' + tok.text + '"'); } @@ -13221,22 +14299,22 @@ var __esbuild_esm_mermaid = (() => { } var { tokens: tokens2 - } = parser21.gullet.consumeArg(); + } = parser22.gullet.consumeArg(); if (insert) { tokens2.unshift(insert); } if (funcName === "\\edef" || funcName === "\\xdef") { - tokens2 = parser21.gullet.expandTokens(tokens2); + tokens2 = parser22.gullet.expandTokens(tokens2); tokens2.reverse(); } - parser21.gullet.macros.set(name, { + parser22.gullet.macros.set(name, { tokens: tokens2, numArgs, delimiters: delimiters2 }, funcName === globalMap[funcName]); return { type: "internal", - mode: parser21.mode + mode: parser22.mode }; } }); @@ -13254,16 +14332,16 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref3) { var { - parser: parser21, + parser: parser22, funcName } = _ref3; - var name = checkControlSequence(parser21.gullet.popToken()); - parser21.gullet.consumeSpaces(); - var tok = getRHS(parser21); - letCommand(parser21, name, tok, funcName === "\\\\globallet"); + var name = checkControlSequence(parser22.gullet.popToken()); + parser22.gullet.consumeSpaces(); + var tok = getRHS(parser22); + letCommand(parser22, name, tok, funcName === "\\\\globallet"); return { type: "internal", - mode: parser21.mode + mode: parser22.mode }; } }); @@ -13281,18 +14359,18 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref4) { var { - parser: parser21, + parser: parser22, funcName } = _ref4; - var name = checkControlSequence(parser21.gullet.popToken()); - var middle = parser21.gullet.popToken(); - var tok = parser21.gullet.popToken(); - letCommand(parser21, name, tok, funcName === "\\\\globalfuture"); - parser21.gullet.pushToken(tok); - parser21.gullet.pushToken(middle); + var name = checkControlSequence(parser22.gullet.popToken()); + var middle = parser22.gullet.popToken(); + var tok = parser22.gullet.popToken(); + letCommand(parser22, name, tok, funcName === "\\\\globalfuture"); + parser22.gullet.pushToken(tok); + parser22.gullet.pushToken(middle); return { type: "internal", - mode: parser21.mode + mode: parser22.mode }; } }); @@ -13924,15 +15002,15 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((context, args) => { var delim = checkDelimiter(args[0], context); - var parser21 = context.parser; - ++parser21.leftrightDepth; - var body = parser21.parseExpression(false); - --parser21.leftrightDepth; - parser21.expect("\\right", false); - var right3 = assertNodeType(parser21.parseFunction(), "leftright-right"); + var parser22 = context.parser; + ++parser22.leftrightDepth; + var body = parser22.parseExpression(false); + --parser22.leftrightDepth; + parser22.expect("\\right", false); + var right3 = assertNodeType(parser22.parseFunction(), "leftright-right"); return { type: "leftright", - mode: parser21.mode, + mode: parser22.mode, body, left: delim.text, right: right3.delim, @@ -14053,11 +15131,11 @@ var __esbuild_esm_mermaid = (() => { img.height = options3.fontMetrics().defaultRuleThickness / scale; imgShift = -0.5 * options3.fontMetrics().xHeight; } else if (label === "phase") { - var lineWeight = calculateSize({ + var lineWeight = calculateSize2({ number: 0.6, unit: "pt" }, options3); - var clearance = calculateSize({ + var clearance = calculateSize2({ number: 0.35, unit: "ex" }, options3); @@ -14228,14 +15306,14 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args, optArgs) { var { - parser: parser21, + parser: parser22, funcName } = _ref; var color2 = assertNodeType(args[0], "color-token").color; var body = args[1]; return { type: "enclose", - mode: parser21.mode, + mode: parser22.mode, label: funcName, backgroundColor: color2, body @@ -14254,7 +15332,7 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref2, args, optArgs) { var { - parser: parser21, + parser: parser22, funcName } = _ref2; var borderColor = assertNodeType(args[0], "color-token").color; @@ -14262,7 +15340,7 @@ var __esbuild_esm_mermaid = (() => { var body = args[2]; return { type: "enclose", - mode: parser21.mode, + mode: parser22.mode, label: funcName, backgroundColor, borderColor, @@ -14282,11 +15360,11 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref3, args) { var { - parser: parser21 + parser: parser22 } = _ref3; return { type: "enclose", - mode: parser21.mode, + mode: parser22.mode, label: "\\fbox", body: args[0] }; @@ -14300,13 +15378,13 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref4, args) { var { - parser: parser21, + parser: parser22, funcName } = _ref4; var body = args[0]; return { type: "enclose", - mode: parser21.mode, + mode: parser22.mode, label: funcName, body }; @@ -14324,11 +15402,11 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref5, args) { var { - parser: parser21 + parser: parser22 } = _ref5; return { type: "enclose", - mode: parser21.mode, + mode: parser22.mode, label: "\\angl", body: args[0] }; @@ -14368,7 +15446,7 @@ var __esbuild_esm_mermaid = (() => { var localMultiplier = options3.havingStyle(Style$1.SCRIPT).sizeMultiplier; arraycolsep = 0.2778 * (localMultiplier / options3.sizeMultiplier); } - var baselineskip = group2.colSeparationType === "CD" ? calculateSize({ + var baselineskip = group2.colSeparationType === "CD" ? calculateSize2({ number: 3, unit: "ex" }, options3) : 12 * pt; @@ -14411,7 +15489,7 @@ var __esbuild_esm_mermaid = (() => { var rowGap = group2.rowGaps[r2]; var gap = 0; if (rowGap) { - gap = calculateSize(rowGap, options3); + gap = calculateSize2(rowGap, options3); if (gap > 0) { gap += arstrutDepth; if (depth < gap) { @@ -14809,19 +15887,19 @@ var __esbuild_esm_mermaid = (() => { }] }; if (context.envName.charAt(context.envName.length - 1) === "*") { - var parser21 = context.parser; - parser21.consumeSpaces(); - if (parser21.fetch().text === "[") { - parser21.consume(); - parser21.consumeSpaces(); - colAlign = parser21.fetch().text; + var parser22 = context.parser; + parser22.consumeSpaces(); + if (parser22.fetch().text === "[") { + parser22.consume(); + parser22.consumeSpaces(); + colAlign = parser22.fetch().text; if ("lcr".indexOf(colAlign) === -1) { - throw new ParseError("Expected l or c or r", parser21.nextToken); + throw new ParseError("Expected l or c or r", parser22.nextToken); } - parser21.consume(); - parser21.consumeSpaces(); - parser21.expect("]"); - parser21.consume(); + parser22.consume(); + parser22.consumeSpaces(); + parser22.expect("]"); + parser22.consume(); payload.cols = [{ type: "align", align: colAlign @@ -15044,7 +16122,7 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21, + parser: parser22, funcName } = _ref; var nameGroup = args[0]; @@ -15063,16 +16141,16 @@ var __esbuild_esm_mermaid = (() => { var { args: _args, optArgs - } = parser21.parseArguments("\\begin{" + envName + "}", env); + } = parser22.parseArguments("\\begin{" + envName + "}", env); var context = { - mode: parser21.mode, + mode: parser22.mode, envName, - parser: parser21 + parser: parser22 }; var result = env.handler(context, _args, optArgs); - parser21.expect("\\end", false); - var endNameToken = parser21.nextToken; - var end2 = assertNodeType(parser21.parseFunction(), "environment"); + parser22.expect("\\end", false); + var endNameToken = parser22.nextToken; + var end2 = assertNodeType(parser22.parseFunction(), "environment"); if (end2.name !== envName) { throw new ParseError("Mismatch: \\begin{" + envName + "} matched by \\end{" + end2.name + "}", endNameToken); } @@ -15080,7 +16158,7 @@ var __esbuild_esm_mermaid = (() => { } return { type: "environment", - mode: parser21.mode, + mode: parser22.mode, name: envName, nameGroup }; @@ -15128,7 +16206,7 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21, + parser: parser22, funcName } = _ref; var body = normalizeArgument(args[0]); @@ -15138,7 +16216,7 @@ var __esbuild_esm_mermaid = (() => { } return { type: "font", - mode: parser21.mode, + mode: parser22.mode, font: func.slice(1), body }; @@ -15154,17 +16232,17 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref2, args) => { var { - parser: parser21 + parser: parser22 } = _ref2; var body = args[0]; var isCharacterBox3 = utils.isCharacterBox(body); return { type: "mclass", - mode: parser21.mode, + mode: parser22.mode, mclass: binrelClass(body), body: [{ type: "font", - mode: parser21.mode, + mode: parser22.mode, font: "boldsymbol", body }], @@ -15181,14 +16259,14 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref3, args) => { var { - parser: parser21, + parser: parser22, funcName, breakOnTokenText } = _ref3; var { mode - } = parser21; - var body = parser21.parseExpression(true, breakOnTokenText); + } = parser22; + var body = parser22.parseExpression(true, breakOnTokenText); var style3 = "math" + funcName.slice(1); return { type: "font", @@ -15196,7 +16274,7 @@ var __esbuild_esm_mermaid = (() => { font: style3, body: { type: "ordgroup", - mode: parser21.mode, + mode: parser22.mode, body } }; @@ -15237,7 +16315,7 @@ var __esbuild_esm_mermaid = (() => { var ruleSpacing; if (group2.hasBarLine) { if (group2.barSize) { - ruleWidth = calculateSize(group2.barSize, options3); + ruleWidth = calculateSize2(group2.barSize, options3); rule = buildCommon.makeLineSpan("frac-line", options3, ruleWidth); } else { rule = buildCommon.makeLineSpan("frac-line", options3); @@ -15347,7 +16425,7 @@ var __esbuild_esm_mermaid = (() => { if (!group2.hasBarLine) { node2.setAttribute("linethickness", "0px"); } else if (group2.barSize) { - var ruleWidth = calculateSize(group2.barSize, options3); + var ruleWidth = calculateSize2(group2.barSize, options3); node2.setAttribute("linethickness", makeEm(ruleWidth)); } var style3 = adjustStyle(group2.size, options3.style); @@ -15395,7 +16473,7 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21, + parser: parser22, funcName } = _ref; var numer = args[0]; @@ -15445,7 +16523,7 @@ var __esbuild_esm_mermaid = (() => { } return { type: "genfrac", - mode: parser21.mode, + mode: parser22.mode, continued: false, numer, denom, @@ -15467,14 +16545,14 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref2, args) => { var { - parser: parser21, + parser: parser22, funcName } = _ref2; var numer = args[0]; var denom = args[1]; return { type: "genfrac", - mode: parser21.mode, + mode: parser22.mode, continued: true, numer, denom, @@ -15495,7 +16573,7 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref3) { var { - parser: parser21, + parser: parser22, funcName, token: token2 } = _ref3; @@ -15521,7 +16599,7 @@ var __esbuild_esm_mermaid = (() => { } return { type: "infix", - mode: parser21.mode, + mode: parser22.mode, replaceWith, token: token2 }; @@ -15546,7 +16624,7 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref4, args) { var { - parser: parser21 + parser: parser22 } = _ref4; var numer = args[4]; var denom = args[5]; @@ -15576,7 +16654,7 @@ var __esbuild_esm_mermaid = (() => { } return { type: "genfrac", - mode: parser21.mode, + mode: parser22.mode, numer, denom, continued: false, @@ -15600,13 +16678,13 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref5, args) { var { - parser: parser21, + parser: parser22, funcName, token: token2 } = _ref5; return { type: "infix", - mode: parser21.mode, + mode: parser22.mode, replaceWith: "\\\\abovefrac", size: assertNodeType(args[0], "size").value, token: token2 @@ -15622,7 +16700,7 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref6, args) => { var { - parser: parser21, + parser: parser22, funcName } = _ref6; var numer = args[0]; @@ -15631,7 +16709,7 @@ var __esbuild_esm_mermaid = (() => { var hasBarLine = barSize.number > 0; return { type: "genfrac", - mode: parser21.mode, + mode: parser22.mode, numer, denom, continued: false, @@ -15737,12 +16815,12 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21, + parser: parser22, funcName } = _ref; return { type: "horizBrace", - mode: parser21.mode, + mode: parser22.mode, label: funcName, isOver: /^\\over/.test(funcName), base: args[0] @@ -15761,19 +16839,19 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21 + parser: parser22 } = _ref; var body = args[1]; var href = assertNodeType(args[0], "url").url; - if (!parser21.settings.isTrusted({ + if (!parser22.settings.isTrusted({ command: "\\href", url: href })) { - return parser21.formatUnsupportedCmd("\\href"); + return parser22.formatUnsupportedCmd("\\href"); } return { type: "href", - mode: parser21.mode, + mode: parser22.mode, href, body: ordargument(body) }; @@ -15801,14 +16879,14 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref2, args) => { var { - parser: parser21 + parser: parser22 } = _ref2; var href = assertNodeType(args[0], "url").url; - if (!parser21.settings.isTrusted({ + if (!parser22.settings.isTrusted({ command: "\\url", url: href })) { - return parser21.formatUnsupportedCmd("\\url"); + return parser22.formatUnsupportedCmd("\\url"); } var chars = []; for (var i2 = 0; i2 < href.length; i2++) { @@ -15824,13 +16902,13 @@ var __esbuild_esm_mermaid = (() => { } var body = { type: "text", - mode: parser21.mode, + mode: parser22.mode, font: "\\texttt", body: chars }; return { type: "href", - mode: parser21.mode, + mode: parser22.mode, href, body: ordargument(body) }; @@ -15847,11 +16925,11 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21 + parser: parser22 } = _ref; return { type: "hbox", - mode: parser21.mode, + mode: parser22.mode, body: ordargument(args[0]) }; }, @@ -15873,14 +16951,14 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21, + parser: parser22, funcName, token: token2 } = _ref; var value2 = assertNodeType(args[0], "raw").string; var body = args[1]; - if (parser21.settings.strict) { - parser21.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode"); + if (parser22.settings.strict) { + parser22.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode"); } var trustContext; var attributes = {}; @@ -15924,12 +17002,12 @@ var __esbuild_esm_mermaid = (() => { default: throw new Error("Unrecognized html command"); } - if (!parser21.settings.isTrusted(trustContext)) { - return parser21.formatUnsupportedCmd(funcName); + if (!parser22.settings.isTrusted(trustContext)) { + return parser22.formatUnsupportedCmd(funcName); } return { type: "html", - mode: parser21.mode, + mode: parser22.mode, attributes, body: ordargument(body) }; @@ -15961,11 +17039,11 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21 + parser: parser22 } = _ref; return { type: "htmlmathml", - mode: parser21.mode, + mode: parser22.mode, html: ordargument(args[0]), mathml: ordargument(args[1]) }; @@ -16011,7 +17089,7 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args, optArgs) => { var { - parser: parser21 + parser: parser22 } = _ref; var width3 = { number: 0, @@ -16058,15 +17136,15 @@ var __esbuild_esm_mermaid = (() => { alt = alt.replace(/^.*[\\/]/, ""); alt = alt.substring(0, alt.lastIndexOf(".")); } - if (!parser21.settings.isTrusted({ + if (!parser22.settings.isTrusted({ command: "\\includegraphics", url: src })) { - return parser21.formatUnsupportedCmd("\\includegraphics"); + return parser22.formatUnsupportedCmd("\\includegraphics"); } return { type: "includegraphics", - mode: parser21.mode, + mode: parser22.mode, alt, width: width3, height: height2, @@ -16075,14 +17153,14 @@ var __esbuild_esm_mermaid = (() => { }; }, "handler"), htmlBuilder: /* @__PURE__ */ __name((group2, options3) => { - var height2 = calculateSize(group2.height, options3); + var height2 = calculateSize2(group2.height, options3); var depth = 0; if (group2.totalheight.number > 0) { - depth = calculateSize(group2.totalheight, options3) - height2; + depth = calculateSize2(group2.totalheight, options3) - height2; } var width3 = 0; if (group2.width.number > 0) { - width3 = calculateSize(group2.width, options3); + width3 = calculateSize2(group2.width, options3); } var style3 = { height: makeEm(height2 + depth) @@ -16101,15 +17179,15 @@ var __esbuild_esm_mermaid = (() => { mathmlBuilder: /* @__PURE__ */ __name((group2, options3) => { var node2 = new mathMLTree.MathNode("mglyph", []); node2.setAttribute("alt", group2.alt); - var height2 = calculateSize(group2.height, options3); + var height2 = calculateSize2(group2.height, options3); var depth = 0; if (group2.totalheight.number > 0) { - depth = calculateSize(group2.totalheight, options3) - height2; + depth = calculateSize2(group2.totalheight, options3) - height2; node2.setAttribute("valign", makeEm(-depth)); } node2.setAttribute("height", makeEm(height2 + depth)); if (group2.width.number > 0) { - var width3 = calculateSize(group2.width, options3); + var width3 = calculateSize2(group2.width, options3); node2.setAttribute("width", makeEm(width3)); } node2.setAttribute("src", group2.src); @@ -16127,29 +17205,29 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21, + parser: parser22, funcName } = _ref; var size5 = assertNodeType(args[0], "size"); - if (parser21.settings.strict) { + if (parser22.settings.strict) { var mathFunction = funcName[1] === "m"; var muUnit = size5.value.unit === "mu"; if (mathFunction) { if (!muUnit) { - parser21.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size5.value.unit + " units")); + parser22.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size5.value.unit + " units")); } - if (parser21.mode !== "math") { - parser21.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode"); + if (parser22.mode !== "math") { + parser22.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode"); } } else { if (muUnit) { - parser21.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units"); + parser22.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units"); } } } return { type: "kern", - mode: parser21.mode, + mode: parser22.mode, dimension: size5.value }; }, @@ -16157,7 +17235,7 @@ var __esbuild_esm_mermaid = (() => { return buildCommon.makeGlue(group2.dimension, options3); }, mathmlBuilder(group2, options3) { - var dimension = calculateSize(group2.dimension, options3); + var dimension = calculateSize2(group2.dimension, options3); return new mathMLTree.SpaceNode(dimension); } }); @@ -16170,13 +17248,13 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21, + parser: parser22, funcName } = _ref; var body = args[0]; return { type: "lap", - mode: parser21.mode, + mode: parser22.mode, alignment: funcName.slice(5), body }; @@ -16221,17 +17299,17 @@ var __esbuild_esm_mermaid = (() => { handler(_ref, args) { var { funcName, - parser: parser21 + parser: parser22 } = _ref; - var outerMode = parser21.mode; - parser21.switchMode("math"); + var outerMode = parser22.mode; + parser22.switchMode("math"); var close2 = funcName === "\\(" ? "\\)" : "$"; - var body = parser21.parseExpression(false, close2); - parser21.expect(close2); - parser21.switchMode(outerMode); + var body = parser22.parseExpression(false, close2); + parser22.expect(close2); + parser22.switchMode(outerMode); return { type: "styling", - mode: parser21.mode, + mode: parser22.mode, style: "text", body }; @@ -16273,11 +17351,11 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21 + parser: parser22 } = _ref; return { type: "mathchoice", - mode: parser21.mode, + mode: parser22.mode, display: ordargument(args[0]), text: ordargument(args[1]), script: ordargument(args[2]), @@ -16515,7 +17593,7 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21, + parser: parser22, funcName } = _ref; var fName = funcName; @@ -16524,7 +17602,7 @@ var __esbuild_esm_mermaid = (() => { } return { type: "op", - mode: parser21.mode, + mode: parser22.mode, limits: true, parentIsSupSub: false, symbol: true, @@ -16543,12 +17621,12 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref2, args) => { var { - parser: parser21 + parser: parser22 } = _ref2; var body = args[0]; return { type: "op", - mode: parser21.mode, + mode: parser22.mode, limits: false, parentIsSupSub: false, symbol: false, @@ -16574,12 +17652,12 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref3) { var { - parser: parser21, + parser: parser22, funcName } = _ref3; return { type: "op", - mode: parser21.mode, + mode: parser22.mode, limits: false, parentIsSupSub: false, symbol: false, @@ -16597,12 +17675,12 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref4) { var { - parser: parser21, + parser: parser22, funcName } = _ref4; return { type: "op", - mode: parser21.mode, + mode: parser22.mode, limits: true, parentIsSupSub: false, symbol: false, @@ -16620,7 +17698,7 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref5) { var { - parser: parser21, + parser: parser22, funcName } = _ref5; var fName = funcName; @@ -16629,7 +17707,7 @@ var __esbuild_esm_mermaid = (() => { } return { type: "op", - mode: parser21.mode, + mode: parser22.mode, limits: false, parentIsSupSub: false, symbol: true, @@ -16734,13 +17812,13 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21, + parser: parser22, funcName } = _ref; var body = args[0]; return { type: "operatorname", - mode: parser21.mode, + mode: parser22.mode, body: ordargument(body), alwaysHandleSupSub: funcName === "\\operatornamewithlimits", limits: false, @@ -16771,12 +17849,12 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21 + parser: parser22 } = _ref; var body = args[0]; return { type: "overline", - mode: parser21.mode, + mode: parser22.mode, body }; }, @@ -16819,12 +17897,12 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args) => { var { - parser: parser21 + parser: parser22 } = _ref; var body = args[0]; return { type: "phantom", - mode: parser21.mode, + mode: parser22.mode, body: ordargument(body) }; }, "handler"), @@ -16846,12 +17924,12 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref2, args) => { var { - parser: parser21 + parser: parser22 } = _ref2; var body = args[0]; return { type: "hphantom", - mode: parser21.mode, + mode: parser22.mode, body }; }, "handler"), @@ -16892,12 +17970,12 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref3, args) => { var { - parser: parser21 + parser: parser22 } = _ref3; var body = args[0]; return { type: "vphantom", - mode: parser21.mode, + mode: parser22.mode, body }; }, "handler"), @@ -16924,20 +18002,20 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21 + parser: parser22 } = _ref; var amount = assertNodeType(args[0], "size").value; var body = args[1]; return { type: "raisebox", - mode: parser21.mode, + mode: parser22.mode, dy: amount, body }; }, htmlBuilder(group2, options3) { var body = buildGroup$1(group2.body, options3); - var dy = calculateSize(group2.dy, options3); + var dy = calculateSize2(group2.dy, options3); return buildCommon.makeVList({ positionType: "shift", positionData: -dy, @@ -16963,11 +18041,11 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref) { var { - parser: parser21 + parser: parser22 } = _ref; return { type: "internal", - mode: parser21.mode + mode: parser22.mode }; } }); @@ -16981,14 +18059,14 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args, optArgs) { var { - parser: parser21 + parser: parser22 } = _ref; var shift2 = optArgs[0]; var width3 = assertNodeType(args[0], "size"); var height2 = assertNodeType(args[1], "size"); return { type: "rule", - mode: parser21.mode, + mode: parser22.mode, shift: shift2 && assertNodeType(shift2, "size").value, width: width3.value, height: height2.value @@ -16996,9 +18074,9 @@ var __esbuild_esm_mermaid = (() => { }, htmlBuilder(group2, options3) { var rule = buildCommon.makeSpan(["mord", "rule"], [], options3); - var width3 = calculateSize(group2.width, options3); - var height2 = calculateSize(group2.height, options3); - var shift2 = group2.shift ? calculateSize(group2.shift, options3) : 0; + var width3 = calculateSize2(group2.width, options3); + var height2 = calculateSize2(group2.height, options3); + var shift2 = group2.shift ? calculateSize2(group2.shift, options3) : 0; rule.style.borderRightWidth = makeEm(width3); rule.style.borderTopWidth = makeEm(height2); rule.style.bottom = makeEm(shift2); @@ -17009,9 +18087,9 @@ var __esbuild_esm_mermaid = (() => { return rule; }, mathmlBuilder(group2, options3) { - var width3 = calculateSize(group2.width, options3); - var height2 = calculateSize(group2.height, options3); - var shift2 = group2.shift ? calculateSize(group2.shift, options3) : 0; + var width3 = calculateSize2(group2.width, options3); + var height2 = calculateSize2(group2.height, options3); + var shift2 = group2.shift ? calculateSize2(group2.shift, options3) : 0; var color2 = options3.color && options3.getColor() || "black"; var rule = new mathMLTree.MathNode("mspace"); rule.setAttribute("mathbackground", color2); @@ -17045,12 +18123,12 @@ var __esbuild_esm_mermaid = (() => { var { breakOnTokenText, funcName, - parser: parser21 + parser: parser22 } = _ref; - var body = parser21.parseExpression(false, breakOnTokenText); + var body = parser22.parseExpression(false, breakOnTokenText); return { type: "sizing", - mode: parser21.mode, + mode: parser22.mode, // Figure out what size to use based on the list of functions above size: sizeFuncs.indexOf(funcName) + 1, body @@ -17075,7 +18153,7 @@ var __esbuild_esm_mermaid = (() => { }, handler: /* @__PURE__ */ __name((_ref, args, optArgs) => { var { - parser: parser21 + parser: parser22 } = _ref; var smashHeight = false; var smashDepth = false; @@ -17102,7 +18180,7 @@ var __esbuild_esm_mermaid = (() => { var body = args[0]; return { type: "smash", - mode: parser21.mode, + mode: parser22.mode, body, smashHeight, smashDepth @@ -17158,13 +18236,13 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args, optArgs) { var { - parser: parser21 + parser: parser22 } = _ref; var index = optArgs[0]; var body = args[0]; return { type: "sqrt", - mode: parser21.mode, + mode: parser22.mode, body, index }; @@ -17255,13 +18333,13 @@ var __esbuild_esm_mermaid = (() => { var { breakOnTokenText, funcName, - parser: parser21 + parser: parser22 } = _ref; - var body = parser21.parseExpression(true, breakOnTokenText); + var body = parser22.parseExpression(true, breakOnTokenText); var style3 = funcName.slice(1, funcName.length - 5); return { type: "styling", - mode: parser21.mode, + mode: parser22.mode, // Figure out what style to use by pulling out the style from // the function name style: style3, @@ -17648,13 +18726,13 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21, + parser: parser22, funcName } = _ref; var body = args[0]; return { type: "text", - mode: parser21.mode, + mode: parser22.mode, body: ordargument(body), font: funcName }; @@ -17678,11 +18756,11 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21 + parser: parser22 } = _ref; return { type: "underline", - mode: parser21.mode, + mode: parser22.mode, body: args[0] }; }, @@ -17728,11 +18806,11 @@ var __esbuild_esm_mermaid = (() => { }, handler(_ref, args) { var { - parser: parser21 + parser: parser22 } = _ref; return { type: "vcenter", - mode: parser21.mode, + mode: parser22.mode, body: args[0] }; }, @@ -19999,12 +21077,12 @@ var __esbuild_esm_mermaid = (() => { * whose concatenated strings match `regex`. Returns the string * formed by the tokens plus some position information. */ - parseRegexGroup(regex, modeName) { + parseRegexGroup(regex2, modeName) { var firstToken = this.fetch(); var lastToken = firstToken; var str2 = ""; var nextToken; - while ((nextToken = this.fetch()).text !== "EOF" && regex.test(str2 + nextToken.text)) { + while ((nextToken = this.fetch()).text !== "EOF" && regex2.test(str2 + nextToken.text)) { lastToken = nextToken; str2 += lastToken.text; this.consume(); @@ -20319,12 +21397,12 @@ var __esbuild_esm_mermaid = (() => { if (!(typeof toParse === "string" || toParse instanceof String)) { throw new TypeError("KaTeX can only parse string typed expression"); } - var parser21 = new Parser(toParse, settings); - delete parser21.gullet.macros.current["\\df@tag"]; - var tree = parser21.parse(); - delete parser21.gullet.macros.current["\\current@color"]; - delete parser21.gullet.macros.current["\\color"]; - if (parser21.gullet.macros.get("\\df@tag")) { + var parser22 = new Parser(toParse, settings); + delete parser22.gullet.macros.current["\\df@tag"]; + var tree = parser22.parse(); + delete parser22.gullet.macros.current["\\current@color"]; + delete parser22.gullet.macros.current["\\color"]; + if (parser22.gullet.macros.get("\\df@tag")) { if (!settings.displayMode) { throw new ParseError("\\tag works only in display equations"); } @@ -20332,7 +21410,7 @@ var __esbuild_esm_mermaid = (() => { type: "tag", mode: "text", body: tree, - tag: parser21.subparse([new Token("\\df@tag")]) + tag: parser22.subparse([new Token("\\df@tag")]) }]; } return tree; @@ -20877,16 +21955,16 @@ var __esbuild_esm_mermaid = (() => { return commonDb_exports; }, "getCommonDb"); diagrams = {}; - registerDiagram = /* @__PURE__ */ __name((id26, diagram23, detector24) => { - if (diagrams[id26]) { - log2.warn(`Diagram with id ${id26} already registered. Overwriting.`); + registerDiagram = /* @__PURE__ */ __name((id27, diagram24, detector25) => { + if (diagrams[id27]) { + log2.warn(`Diagram with id ${id27} already registered. Overwriting.`); } - diagrams[id26] = diagram23; - if (detector24) { - addDetector(id26, detector24); + diagrams[id27] = diagram24; + if (detector25) { + addDetector(id27, detector25); } - addStylesForDiagram(id26, diagram23.styles); - diagram23.injectUtils?.( + addStylesForDiagram(id27, diagram24.styles); + diagram24.injectUtils?.( log2, setLogLevel2, getConfig2, @@ -22571,7 +23649,7 @@ var __esbuild_esm_mermaid = (() => { } return new Selection(merges, this._parents); } - var init_merge = __esm({ + var init_merge2 = __esm({ "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js"() { "use strict"; init_selection(); @@ -22675,7 +23753,7 @@ var __esbuild_esm_mermaid = (() => { for (const node2 of this) ++size5; return size5; } - var init_size = __esm({ + var init_size2 = __esm({ "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js"() { "use strict"; __name(size_default, "default"); @@ -22967,7 +24045,7 @@ var __esbuild_esm_mermaid = (() => { function html_default(value2) { return arguments.length ? this.each(value2 == null ? htmlRemove : (typeof value2 === "function" ? htmlFunction : htmlConstant)(value2)) : this.node().innerHTML; } - var init_html = __esm({ + var init_html2 = __esm({ "../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js"() { "use strict"; __name(htmlRemove, "htmlRemove"); @@ -23238,13 +24316,13 @@ var __esbuild_esm_mermaid = (() => { init_enter(); init_exit(); init_join(); - init_merge(); + init_merge2(); init_order(); init_sort(); init_call(); init_nodes(); init_node(); - init_size(); + init_size2(); init_empty(); init_each(); init_attr(); @@ -23252,7 +24330,7 @@ var __esbuild_esm_mermaid = (() => { init_property(); init_classed(); init_text(); - init_html(); + init_html2(); init_raise(); init_lower(); init_append(); @@ -24478,11 +25556,11 @@ var __esbuild_esm_mermaid = (() => { }); // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js - function schedule_default(node2, name, id26, index, group2, timing) { + function schedule_default(node2, name, id27, index, group2, timing) { var schedules = node2.__transition; if (!schedules) node2.__transition = {}; - else if (id26 in schedules) return; - create(node2, id26, { + else if (id27 in schedules) return; + create(node2, id27, { name, index, // For context during callback. @@ -24498,24 +25576,24 @@ var __esbuild_esm_mermaid = (() => { state: CREATED }); } - function init(node2, id26) { - var schedule = get2(node2, id26); + function init(node2, id27) { + var schedule = get2(node2, id27); if (schedule.state > CREATED) throw new Error("too late; already scheduled"); return schedule; } - function set2(node2, id26) { - var schedule = get2(node2, id26); + function set2(node2, id27) { + var schedule = get2(node2, id27); if (schedule.state > STARTED) throw new Error("too late; already running"); return schedule; } - function get2(node2, id26) { + function get2(node2, id27) { var schedule = node2.__transition; - if (!schedule || !(schedule = schedule[id26])) throw new Error("transition not found"); + if (!schedule || !(schedule = schedule[id27])) throw new Error("transition not found"); return schedule; } - function create(node2, id26, self2) { + function create(node2, id27, self2) { var schedules = node2.__transition, tween; - schedules[id26] = self2; + schedules[id27] = self2; self2.timer = timer(schedule, 0, self2.time); function schedule(elapsed) { self2.state = SCHEDULED; @@ -24535,7 +25613,7 @@ var __esbuild_esm_mermaid = (() => { o2.timer.stop(); o2.on.call("interrupt", node2, node2.__data__, o2.index, o2.group); delete schedules[i2]; - } else if (+i2 < id26) { + } else if (+i2 < id27) { o2.state = ENDED; o2.timer.stop(); o2.on.call("cancel", node2, node2.__data__, o2.index, o2.group); @@ -24576,7 +25654,7 @@ var __esbuild_esm_mermaid = (() => { function stop5() { self2.state = ENDED; self2.timer.stop(); - delete schedules[id26]; + delete schedules[id27]; for (var i2 in schedules) return; delete node2.__transition; } @@ -24646,10 +25724,10 @@ var __esbuild_esm_mermaid = (() => { }); // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js - function tweenRemove(id26, name) { + function tweenRemove(id27, name) { var tween0, tween1; return function() { - var schedule = set2(this, id26), tween = schedule.tween; + var schedule = set2(this, id27), tween = schedule.tween; if (tween !== tween0) { tween1 = tween0 = tween; for (var i2 = 0, n2 = tween1.length; i2 < n2; ++i2) { @@ -24663,11 +25741,11 @@ var __esbuild_esm_mermaid = (() => { schedule.tween = tween1; }; } - function tweenFunction(id26, name, value2) { + function tweenFunction(id27, name, value2) { var tween0, tween1; if (typeof value2 !== "function") throw new Error(); return function() { - var schedule = set2(this, id26), tween = schedule.tween; + var schedule = set2(this, id27), tween = schedule.tween; if (tween !== tween0) { tween1 = (tween0 = tween).slice(); for (var t4 = { name, value: value2 }, i2 = 0, n2 = tween1.length; i2 < n2; ++i2) { @@ -24682,10 +25760,10 @@ var __esbuild_esm_mermaid = (() => { }; } function tween_default(name, value2) { - var id26 = this._id; + var id27 = this._id; name += ""; if (arguments.length < 2) { - var tween = get2(this.node(), id26).tween; + var tween = get2(this.node(), id27).tween; for (var i2 = 0, n2 = tween.length, t4; i2 < n2; ++i2) { if ((t4 = tween[i2]).name === name) { return t4.value; @@ -24693,16 +25771,16 @@ var __esbuild_esm_mermaid = (() => { } return null; } - return this.each((value2 == null ? tweenRemove : tweenFunction)(id26, name, value2)); + return this.each((value2 == null ? tweenRemove : tweenFunction)(id27, name, value2)); } function tweenValue(transition2, name, value2) { - var id26 = transition2._id; + var id27 = transition2._id; transition2.each(function() { - var schedule = set2(this, id26); + var schedule = set2(this, id27); (schedule.value || (schedule.value = {}))[name] = value2.apply(this, arguments); }); return function(node2) { - return get2(node2, id26).value[name]; + return get2(node2, id27).value[name]; }; } var init_tween = __esm({ @@ -24850,19 +25928,19 @@ var __esbuild_esm_mermaid = (() => { }); // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js - function delayFunction(id26, value2) { + function delayFunction(id27, value2) { return function() { - init(this, id26).delay = +value2.apply(this, arguments); + init(this, id27).delay = +value2.apply(this, arguments); }; } - function delayConstant(id26, value2) { + function delayConstant(id27, value2) { return value2 = +value2, function() { - init(this, id26).delay = value2; + init(this, id27).delay = value2; }; } function delay_default(value2) { - var id26 = this._id; - return arguments.length ? this.each((typeof value2 === "function" ? delayFunction : delayConstant)(id26, value2)) : get2(this.node(), id26).delay; + var id27 = this._id; + return arguments.length ? this.each((typeof value2 === "function" ? delayFunction : delayConstant)(id27, value2)) : get2(this.node(), id27).delay; } var init_delay = __esm({ "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js"() { @@ -24875,19 +25953,19 @@ var __esbuild_esm_mermaid = (() => { }); // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js - function durationFunction(id26, value2) { + function durationFunction(id27, value2) { return function() { - set2(this, id26).duration = +value2.apply(this, arguments); + set2(this, id27).duration = +value2.apply(this, arguments); }; } - function durationConstant(id26, value2) { + function durationConstant(id27, value2) { return value2 = +value2, function() { - set2(this, id26).duration = value2; + set2(this, id27).duration = value2; }; } function duration_default(value2) { - var id26 = this._id; - return arguments.length ? this.each((typeof value2 === "function" ? durationFunction : durationConstant)(id26, value2)) : get2(this.node(), id26).duration; + var id27 = this._id; + return arguments.length ? this.each((typeof value2 === "function" ? durationFunction : durationConstant)(id27, value2)) : get2(this.node(), id27).duration; } var init_duration = __esm({ "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js"() { @@ -24900,15 +25978,15 @@ var __esbuild_esm_mermaid = (() => { }); // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js - function easeConstant(id26, value2) { + function easeConstant(id27, value2) { if (typeof value2 !== "function") throw new Error(); return function() { - set2(this, id26).ease = value2; + set2(this, id27).ease = value2; }; } function ease_default(value2) { - var id26 = this._id; - return arguments.length ? this.each(easeConstant(id26, value2)) : get2(this.node(), id26).ease; + var id27 = this._id; + return arguments.length ? this.each(easeConstant(id27, value2)) : get2(this.node(), id27).ease; } var init_ease = __esm({ "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js"() { @@ -24920,11 +25998,11 @@ var __esbuild_esm_mermaid = (() => { }); // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js - function easeVarying(id26, value2) { + function easeVarying(id27, value2) { return function() { var v3 = value2.apply(this, arguments); if (typeof v3 !== "function") throw new Error(); - set2(this, id26).ease = v3; + set2(this, id27).ease = v3; }; } function easeVarying_default(value2) { @@ -24976,7 +26054,7 @@ var __esbuild_esm_mermaid = (() => { } return new Transition(merges, this._parents, this._name, this._id); } - var init_merge2 = __esm({ + var init_merge3 = __esm({ "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js"() { "use strict"; init_transition2(); @@ -24992,17 +26070,17 @@ var __esbuild_esm_mermaid = (() => { return !t4 || t4 === "start"; }); } - function onFunction(id26, name, listener) { + function onFunction(id27, name, listener) { var on0, on1, sit = start(name) ? init : set2; return function() { - var schedule = sit(this, id26), on3 = schedule.on; + var schedule = sit(this, id27), on3 = schedule.on; if (on3 !== on0) (on1 = (on0 = on3).copy()).on(name, listener); schedule.on = on1; }; } function on_default2(name, listener) { - var id26 = this._id; - return arguments.length < 2 ? get2(this.node(), id26).on.on(name) : this.each(onFunction(id26, name, listener)); + var id27 = this._id; + return arguments.length < 2 ? get2(this.node(), id27).on.on(name) : this.each(onFunction(id27, name, listener)); } var init_on2 = __esm({ "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js"() { @@ -25015,10 +26093,10 @@ var __esbuild_esm_mermaid = (() => { }); // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js - function removeFunction(id26) { + function removeFunction(id27) { return function() { var parent4 = this.parentNode; - for (var i2 in this.__transition) if (+i2 !== id26) return; + for (var i2 in this.__transition) if (+i2 !== id27) return; if (parent4) parent4.removeChild(this); }; } @@ -25035,18 +26113,18 @@ var __esbuild_esm_mermaid = (() => { // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js function select_default3(select) { - var name = this._name, id26 = this._id; + var name = this._name, id27 = this._id; if (typeof select !== "function") select = selector_default(select); for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j2 = 0; j2 < m2; ++j2) { for (var group2 = groups[j2], n2 = group2.length, subgroup = subgroups[j2] = new Array(n2), node2, subnode, i2 = 0; i2 < n2; ++i2) { if ((node2 = group2[i2]) && (subnode = select.call(node2, node2.__data__, i2, group2))) { if ("__data__" in node2) subnode.__data__ = node2.__data__; subgroup[i2] = subnode; - schedule_default(subgroup[i2], name, id26, i2, subgroup, get2(node2, id26)); + schedule_default(subgroup[i2], name, id27, i2, subgroup, get2(node2, id27)); } } } - return new Transition(subgroups, this._parents, name, id26); + return new Transition(subgroups, this._parents, name, id27); } var init_select3 = __esm({ "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js"() { @@ -25060,14 +26138,14 @@ var __esbuild_esm_mermaid = (() => { // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js function selectAll_default2(select) { - var name = this._name, id26 = this._id; + var name = this._name, id27 = this._id; if (typeof select !== "function") select = selectorAll_default(select); for (var groups = this._groups, m2 = groups.length, subgroups = [], parents4 = [], j2 = 0; j2 < m2; ++j2) { for (var group2 = groups[j2], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) { if (node2 = group2[i2]) { - for (var children2 = select.call(node2, node2.__data__, i2, group2), child, inherit2 = get2(node2, id26), k2 = 0, l2 = children2.length; k2 < l2; ++k2) { + for (var children2 = select.call(node2, node2.__data__, i2, group2), child, inherit2 = get2(node2, id27), k2 = 0, l2 = children2.length; k2 < l2; ++k2) { if (child = children2[k2]) { - schedule_default(child, name, id26, k2, children2, inherit2); + schedule_default(child, name, id27, k2, children2, inherit2); } } subgroups.push(children2); @@ -25075,7 +26153,7 @@ var __esbuild_esm_mermaid = (() => { } } } - return new Transition(subgroups, parents4, name, id26); + return new Transition(subgroups, parents4, name, id27); } var init_selectAll2 = __esm({ "../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js"() { @@ -25129,10 +26207,10 @@ var __esbuild_esm_mermaid = (() => { return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); }; } - function styleMaybeRemove(id26, name) { + function styleMaybeRemove(id27, name) { var on0, on1, listener0, key = "style." + name, event3 = "end." + key, remove3; return function() { - var schedule = set2(this, id26), on3 = schedule.on, listener = schedule.value[key] == null ? remove3 || (remove3 = styleRemove2(name)) : void 0; + var schedule = set2(this, id27), on3 = schedule.on, listener = schedule.value[key] == null ? remove3 || (remove3 = styleRemove2(name)) : void 0; if (on3 !== on0 || listener0 !== listener) (on1 = (on0 = on3).copy()).on(event3, listener0 = listener); schedule.on = on1; }; @@ -25278,13 +26356,13 @@ var __esbuild_esm_mermaid = (() => { // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js function end_default() { - var on0, on1, that = this, id26 = that._id, size5 = that.size(); + var on0, on1, that = this, id27 = that._id, size5 = that.size(); return new Promise(function(resolve3, reject3) { var cancel = { value: reject3 }, end2 = { value: /* @__PURE__ */ __name(function() { if (--size5 === 0) resolve3(); }, "value") }; that.each(function() { - var schedule = set2(this, id26), on3 = schedule.on; + var schedule = set2(this, id27), on3 = schedule.on; if (on3 !== on0) { on1 = (on0 = on3).copy(); on1._.cancel.push(cancel); @@ -25305,11 +26383,11 @@ var __esbuild_esm_mermaid = (() => { }); // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js - function Transition(groups, parents4, name, id26) { + function Transition(groups, parents4, name, id27) { this._groups = groups; this._parents = parents4; this._name = name; - this._id = id26; + this._id = id27; } function transition(name) { return selection_default().transition(name); @@ -25329,7 +26407,7 @@ var __esbuild_esm_mermaid = (() => { init_ease(); init_easeVarying(); init_filter2(); - init_merge2(); + init_merge3(); init_on2(); init_remove2(); init_select3(); @@ -25402,30 +26480,30 @@ var __esbuild_esm_mermaid = (() => { }); // ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js - function inherit(node2, id26) { + function inherit(node2, id27) { var timing; - while (!(timing = node2.__transition) || !(timing = timing[id26])) { + while (!(timing = node2.__transition) || !(timing = timing[id27])) { if (!(node2 = node2.parentNode)) { - throw new Error(`transition ${id26} not found`); + throw new Error(`transition ${id27} not found`); } } return timing; } function transition_default2(name) { - var id26, timing; + var id27, timing; if (name instanceof Transition) { - id26 = name._id, name = name._name; + id27 = name._id, name = name._name; } else { - id26 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; + id27 = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; } for (var groups = this._groups, m2 = groups.length, j2 = 0; j2 < m2; ++j2) { for (var group2 = groups[j2], n2 = group2.length, node2, i2 = 0; i2 < n2; ++i2) { if (node2 = group2[i2]) { - schedule_default(node2, name, id26, i2, group2, timing || inherit(node2, id26)); + schedule_default(node2, name, id27, i2, group2, timing || inherit(node2, id27)); } } } - return new Transition(groups, this._parents, name, id26); + return new Transition(groups, this._parents, name, id27); } var defaultTiming; var init_transition3 = __esm({ @@ -31763,7 +32841,7 @@ var __esbuild_esm_mermaid = (() => { // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.js var merge, merge_default3; - var init_merge3 = __esm({ + var init_merge4 = __esm({ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.js"() { "use strict"; init_baseMerge(); @@ -31888,7 +32966,7 @@ var __esbuild_esm_mermaid = (() => { init_detectType(); init_assignWithDepth(); init_memoize(); - init_merge3(); + init_merge4(); init_regexes(); ZERO_WIDTH_SPACE = "\u200B"; d3CurveTypes = { @@ -32288,11 +33366,11 @@ var __esbuild_esm_mermaid = (() => { return text2.replace(/fl°°/g, "&#").replace(/fl°/g, "&").replace(/¶ß/g, ";"); }, "decodeEntities"); getEdgeId = /* @__PURE__ */ __name((from2, to, { - counter = 0, + counter: counter2 = 0, prefix, suffix }) => { - return `${prefix ? `${prefix}_` : ""}${from2}_${to}_${counter}${suffix ? `_${suffix}` : ""}`; + return `${prefix ? `${prefix}_` : ""}${from2}_${to}_${counter2}${suffix ? `_${suffix}` : ""}`; }, "getEdgeId"); } }); @@ -32322,7 +33400,7 @@ var __esbuild_esm_mermaid = (() => { } } } - function drawInsideBoundary(diagram23, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) { + function drawInsideBoundary(diagram24, parentBoundaryAlias, parentBounds, currentBoundaries, diagObj) { let currentBounds = new Bounds(diagObj); currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow2, currentBoundaries.length); for (let [i2, currentBoundary] of currentBoundaries.entries()) { @@ -32388,7 +33466,7 @@ var __esbuild_esm_mermaid = (() => { if (currentPersonOrSystemKeys.length > 0) { drawC4ShapeArray( currentBounds, - diagram23, + diagram24, currentPersonOrSystemArray, currentPersonOrSystemKeys ); @@ -32397,7 +33475,7 @@ var __esbuild_esm_mermaid = (() => { let nextCurrentBoundaries = diagObj.db.getBoundarys(parentBoundaryAlias); if (nextCurrentBoundaries.length > 0) { drawInsideBoundary( - diagram23, + diagram24, parentBoundaryAlias, currentBounds, nextCurrentBoundaries, @@ -32405,7 +33483,7 @@ var __esbuild_esm_mermaid = (() => { ); } if (currentBoundary.alias !== "global") { - drawBoundary2(diagram23, currentBoundary, currentBounds); + drawBoundary2(diagram24, currentBoundary, currentBounds); } parentBounds.data.stopy = Math.max( currentBounds.data.stopy + conf.c4ShapeMargin, @@ -32554,7 +33632,7 @@ var __esbuild_esm_mermaid = (() => { }; }, "messageFont"); __name(calcC4ShapeTextWH, "calcC4ShapeTextWH"); - drawBoundary2 = /* @__PURE__ */ __name(function(diagram23, boundary, bounds4) { + drawBoundary2 = /* @__PURE__ */ __name(function(diagram24, boundary, bounds4) { boundary.x = bounds4.data.startx; boundary.y = bounds4.data.starty; boundary.width = bounds4.data.stopx - bounds4.data.startx; @@ -32566,9 +33644,9 @@ var __esbuild_esm_mermaid = (() => { boundaryLabelConf.fontWeight = "bold"; let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf); calcC4ShapeTextWH("label", boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth); - svgDraw_default.drawBoundary(diagram23, boundary, conf); + svgDraw_default.drawBoundary(diagram24, boundary, conf); }, "drawBoundary"); - drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram23, c4ShapeArray2, c4ShapeKeys) { + drawC4ShapeArray = /* @__PURE__ */ __name(function(currentBounds, diagram24, c4ShapeArray2, c4ShapeKeys) { let Y3 = 0; for (const c4ShapeKey of c4ShapeKeys) { Y3 = 0; @@ -32634,7 +33712,7 @@ var __esbuild_esm_mermaid = (() => { c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height); c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin; currentBounds.insert(c4Shape); - svgDraw_default.drawC4Shape(diagram23, c4Shape, conf); + svgDraw_default.drawC4Shape(diagram24, c4Shape, conf); } currentBounds.bumpLastMargin(conf.c4ShapeMargin); }, "drawC4ShapeArray"); @@ -32711,7 +33789,7 @@ var __esbuild_esm_mermaid = (() => { let endPoint = getIntersectPoint(endNode, endIntersectPoint); return { startPoint, endPoint }; }, "getIntersectPoints"); - drawRels2 = /* @__PURE__ */ __name(function(diagram23, rels2, getC4ShapeObj, diagObj) { + drawRels2 = /* @__PURE__ */ __name(function(diagram24, rels2, getC4ShapeObj, diagObj) { let i2 = 0; for (let rel2 of rels2) { i2 = i2 + 1; @@ -32737,26 +33815,26 @@ var __esbuild_esm_mermaid = (() => { rel2.startPoint = points.startPoint; rel2.endPoint = points.endPoint; } - svgDraw_default.drawRels(diagram23, rels2, conf); + svgDraw_default.drawRels(diagram24, rels2, conf); }, "drawRels"); __name(drawInsideBoundary, "drawInsideBoundary"); - draw = /* @__PURE__ */ __name(function(_text, id26, _version, diagObj) { + draw = /* @__PURE__ */ __name(function(_text, id27, _version, diagObj) { conf = getConfig2().c4; const securityLevel = getConfig2().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); - let db7 = diagObj.db; + let db8 = diagObj.db; diagObj.db.setWrap(conf.wrap); - c4ShapeInRow2 = db7.getC4ShapeInRow(); - c4BoundaryInRow2 = db7.getC4BoundaryInRow(); + c4ShapeInRow2 = db8.getC4ShapeInRow(); + c4BoundaryInRow2 = db8.getC4BoundaryInRow(); log.debug(`C:${JSON.stringify(conf, null, 2)}`); - const diagram23 = securityLevel === "sandbox" ? root4.select(`[id="${id26}"]`) : select_default2(`[id="${id26}"]`); - svgDraw_default.insertComputerIcon(diagram23); - svgDraw_default.insertDatabaseIcon(diagram23); - svgDraw_default.insertClockIcon(diagram23); + const diagram24 = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`); + svgDraw_default.insertComputerIcon(diagram24); + svgDraw_default.insertDatabaseIcon(diagram24); + svgDraw_default.insertClockIcon(diagram24); let screenBounds = new Bounds(diagObj); screenBounds.setData( conf.diagramMarginX, @@ -32769,12 +33847,12 @@ var __esbuild_esm_mermaid = (() => { globalBoundaryMaxY = conf.diagramMarginY; const title2 = diagObj.db.getTitle(); let currentBoundaries = diagObj.db.getBoundarys(""); - drawInsideBoundary(diagram23, "", screenBounds, currentBoundaries, diagObj); - svgDraw_default.insertArrowHead(diagram23); - svgDraw_default.insertArrowEnd(diagram23); - svgDraw_default.insertArrowCrossHead(diagram23); - svgDraw_default.insertArrowFilledHead(diagram23); - drawRels2(diagram23, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj); + drawInsideBoundary(diagram24, "", screenBounds, currentBoundaries, diagObj); + svgDraw_default.insertArrowHead(diagram24); + svgDraw_default.insertArrowEnd(diagram24); + svgDraw_default.insertArrowCrossHead(diagram24); + svgDraw_default.insertArrowFilledHead(diagram24); + drawRels2(diagram24, diagObj.db.getRels(), diagObj.db.getC4Shape, diagObj); screenBounds.data.stopx = globalBoundaryMaxX; screenBounds.data.stopy = globalBoundaryMaxY; const box = screenBounds.data; @@ -32783,11 +33861,11 @@ var __esbuild_esm_mermaid = (() => { let boxWidth = box.stopx - box.startx; const width3 = boxWidth + 2 * conf.diagramMarginX; if (title2) { - diagram23.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY); + diagram24.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr("y", box.starty + conf.diagramMarginY); } - configureSvgSize(diagram23, height2, width3, conf.useMaxWidth); + configureSvgSize(diagram24, height2, width3, conf.useMaxWidth); const extraVertForTitle = title2 ? 60 : 0; - diagram23.attr( + diagram24.attr( "viewBox", box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width3 + " " + (height2 + extraVertForTitle) ); @@ -32879,29 +33957,29 @@ var __esbuild_esm_mermaid = (() => { firstGraphFlag = true; funs = []; sanitizeText4 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, config2), "sanitizeText"); - lookUpDomId = /* @__PURE__ */ __name(function(id26) { + lookUpDomId = /* @__PURE__ */ __name(function(id27) { for (const vertex of vertices.values()) { - if (vertex.id === id26) { + if (vertex.id === id27) { return vertex.domId; } } - return id26; + return id27; }, "lookUpDomId"); - addVertex = /* @__PURE__ */ __name(function(id26, textObj, type3, style3, classes6, dir2, props = {}) { - if (!id26 || id26.trim().length === 0) { + addVertex = /* @__PURE__ */ __name(function(id27, textObj, type3, style3, classes6, dir2, props = {}) { + if (!id27 || id27.trim().length === 0) { return; } let txt; - let vertex = vertices.get(id26); + let vertex = vertices.get(id27); if (vertex === void 0) { vertex = { - id: id26, + id: id27, labelType: "text", - domId: MERMAID_DOM_ID_PREFIX + id26 + "-" + vertexCounter, + domId: MERMAID_DOM_ID_PREFIX + id27 + "-" + vertexCounter, styles: [], classes: [] }; - vertices.set(id26, vertex); + vertices.set(id27, vertex); } vertexCounter++; if (textObj !== void 0) { @@ -32914,7 +33992,7 @@ var __esbuild_esm_mermaid = (() => { vertex.text = txt; } else { if (vertex.text === void 0) { - vertex.text = id26; + vertex.text = id27; } } if (type3 !== void 0) { @@ -33005,11 +34083,11 @@ You have to call mermaid.initialize.` }); }, "updateLink"); addClass = /* @__PURE__ */ __name(function(ids, style3) { - ids.split(",").forEach(function(id26) { - let classNode = classes.get(id26); + ids.split(",").forEach(function(id27) { + let classNode = classes.get(id27); if (classNode === void 0) { - classNode = { id: id26, styles: [], textStyles: [] }; - classes.set(id26, classNode); + classNode = { id: id27, styles: [], textStyles: [] }; + classes.set(id27, classNode); } if (style3 !== void 0 && style3 !== null) { style3.forEach(function(s2) { @@ -33041,12 +34119,12 @@ You have to call mermaid.initialize.` } }, "setDirection"); setClass = /* @__PURE__ */ __name(function(ids, className) { - for (const id26 of ids.split(",")) { - const vertex = vertices.get(id26); + for (const id27 of ids.split(",")) { + const vertex = vertices.get(id27); if (vertex) { vertex.classes.push(className); } - const subGraph = subGraphLookup.get(id26); + const subGraph = subGraphLookup.get(id27); if (subGraph) { subGraph.classes.push(className); } @@ -33057,12 +34135,12 @@ You have to call mermaid.initialize.` return; } tooltip = sanitizeText4(tooltip); - for (const id26 of ids.split(",")) { - tooltips.set(version === "gen-1" ? lookUpDomId(id26) : id26, tooltip); + for (const id27 of ids.split(",")) { + tooltips.set(version === "gen-1" ? lookUpDomId(id27) : id27, tooltip); } }, "setTooltip"); - setClickFun = /* @__PURE__ */ __name(function(id26, functionName, functionArgs) { - const domId = lookUpDomId(id26); + setClickFun = /* @__PURE__ */ __name(function(id27, functionName, functionArgs) { + const domId = lookUpDomId(id27); if (getConfig2().securityLevel !== "loose") { return; } @@ -33081,9 +34159,9 @@ You have to call mermaid.initialize.` } } if (argList.length === 0) { - argList.push(id26); + argList.push(id27); } - const vertex = vertices.get(id26); + const vertex = vertices.get(id27); if (vertex) { vertex.haveCallback = true; funs.push(function() { @@ -33101,8 +34179,8 @@ You have to call mermaid.initialize.` } }, "setClickFun"); setLink = /* @__PURE__ */ __name(function(ids, linkStr, target) { - ids.split(",").forEach(function(id26) { - const vertex = vertices.get(id26); + ids.split(",").forEach(function(id27) { + const vertex = vertices.get(id27); if (vertex !== void 0) { vertex.link = utils_default2.formatUrl(linkStr, config2); vertex.linkTarget = target; @@ -33110,12 +34188,12 @@ You have to call mermaid.initialize.` }); setClass(ids, "clickable"); }, "setLink"); - getTooltip = /* @__PURE__ */ __name(function(id26) { - return tooltips.get(id26); + getTooltip = /* @__PURE__ */ __name(function(id27) { + return tooltips.get(id27); }, "getTooltip"); setClickEvent = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) { - ids.split(",").forEach(function(id26) { - setClickFun(id26, functionName, functionArgs); + ids.split(",").forEach(function(id27) { + setClickFun(id27, functionName, functionArgs); }); setClass(ids, "clickable"); }, "setClickEvent"); @@ -33182,10 +34260,10 @@ You have to call mermaid.initialize.` return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"; }, "defaultStyle"); addSubGraph = /* @__PURE__ */ __name(function(_id, list2, _title) { - let id26 = _id.text.trim(); + let id27 = _id.text.trim(); let title2 = _title.text; if (_id === _title && /\s/.exec(_title.text)) { - id26 = void 0; + id27 = void 0; } function uniq2(a2) { const prims = { boolean: {}, number: {}, string: {} }; @@ -33215,12 +34293,12 @@ You have to call mermaid.initialize.` nodeList[i2] = lookUpDomId(nodeList[i2]); } } - id26 = id26 ?? "subGraph" + subCount; + id27 = id27 ?? "subGraph" + subCount; title2 = title2 || ""; title2 = sanitizeText4(title2); subCount = subCount + 1; const subGraph = { - id: id26, + id: id27, nodes: nodeList, title: title2.trim(), classes: [], @@ -33230,12 +34308,12 @@ You have to call mermaid.initialize.` log.info("Adding", subGraph.id, subGraph.nodes, subGraph.dir); subGraph.nodes = makeUniq(subGraph, subGraphs).nodes; subGraphs.push(subGraph); - subGraphLookup.set(id26, subGraph); - return id26; + subGraphLookup.set(id27, subGraph); + return id27; }, "addSubGraph"); - getPosForId = /* @__PURE__ */ __name(function(id26) { + getPosForId = /* @__PURE__ */ __name(function(id27) { for (const [i2, subGraph] of subGraphs.entries()) { - if (subGraph.id === id26) { + if (subGraph.id === id27) { return i2; } } @@ -33243,7 +34321,7 @@ You have to call mermaid.initialize.` }, "getPosForId"); secCount = -1; posCrossRef = []; - indexNodes2 = /* @__PURE__ */ __name(function(id26, pos) { + indexNodes2 = /* @__PURE__ */ __name(function(id27, pos) { const nodes6 = subGraphs[pos].nodes; secCount = secCount + 1; if (secCount > 2e3) { @@ -33253,7 +34331,7 @@ You have to call mermaid.initialize.` }; } posCrossRef[secCount] = pos; - if (subGraphs[pos].id === id26) { + if (subGraphs[pos].id === id27) { return { result: true, count: 0 @@ -33264,7 +34342,7 @@ You have to call mermaid.initialize.` while (count < nodes6.length) { const childPos = getPosForId(nodes6[count]); if (childPos >= 0) { - const res = indexNodes2(id26, childPos); + const res = indexNodes2(id27, childPos); if (res.result) { return { result: true, @@ -33431,7 +34509,7 @@ You have to call mermaid.initialize.` } return vertex.type ?? "squareRect"; }, "getTypeFromVertex"); - findNode = /* @__PURE__ */ __name((nodes6, id26) => nodes6.find((node2) => node2.id === id26), "findNode"); + findNode = /* @__PURE__ */ __name((nodes6, id27) => nodes6.find((node2) => node2.id === id27), "findNode"); destructEdgeType = /* @__PURE__ */ __name((type3) => { let arrowTypeStart = "none"; let arrowTypeEnd = "arrow_point"; @@ -33492,8 +34570,8 @@ You have to call mermaid.initialize.` if (subGraph.nodes.length > 0) { subGraphDB.set(subGraph.id, true); } - for (const id26 of subGraph.nodes) { - parentDB.set(id26, subGraph.id); + for (const id27 of subGraph.nodes) { + parentDB.set(id27, subGraph.id); } } for (let i2 = subGraphs2.length - 1; i2 >= 0; i2--) { @@ -33837,8 +34915,8 @@ You have to call mermaid.initialize.` return ""; }); } - function edit(regex, opt) { - let source = typeof regex === "string" ? regex : regex.source; + function edit(regex2, opt) { + let source = typeof regex2 === "string" ? regex2 : regex2.source; opt = opt || ""; const obj = { replace: /* @__PURE__ */ __name((name, val) => { @@ -35384,15 +36462,15 @@ ${text2} * Static Parse Method */ static parse(tokens2, options3) { - const parser21 = new __Parser(options3); - return parser21.parse(tokens2); + const parser22 = new __Parser(options3); + return parser22.parse(tokens2); } /** * Static Parse Inline Method */ static parseInline(tokens2, options3) { - const parser21 = new __Parser(options3); - return parser21.parseInline(tokens2); + const parser22 = new __Parser(options3); + return parser22.parseInline(tokens2); } /** * Parse Loop @@ -35482,8 +36560,8 @@ ${text2} /** * Parse Inline Tokens */ - parseInline(tokens2, renderer7) { - renderer7 = renderer7 || this.renderer; + parseInline(tokens2, renderer8) { + renderer8 = renderer8 || this.renderer; let out = ""; for (let i2 = 0; i2 < tokens2.length; i2++) { const anyToken = tokens2[i2]; @@ -35497,43 +36575,43 @@ ${text2} const token2 = anyToken; switch (token2.type) { case "escape": { - out += renderer7.text(token2); + out += renderer8.text(token2); break; } case "html": { - out += renderer7.html(token2); + out += renderer8.html(token2); break; } case "link": { - out += renderer7.link(token2); + out += renderer8.link(token2); break; } case "image": { - out += renderer7.image(token2); + out += renderer8.image(token2); break; } case "strong": { - out += renderer7.strong(token2); + out += renderer8.strong(token2); break; } case "em": { - out += renderer7.em(token2); + out += renderer8.em(token2); break; } case "codespan": { - out += renderer7.codespan(token2); + out += renderer8.codespan(token2); break; } case "br": { - out += renderer7.br(token2); + out += renderer8.br(token2); break; } case "del": { - out += renderer7.del(token2); + out += renderer8.del(token2); break; } case "text": { - out += renderer7.text(token2); + out += renderer8.text(token2); break; } default: { @@ -35696,9 +36774,9 @@ ${text2} opts.extensions = extensions2; } if (pack.renderer) { - const renderer7 = this.defaults.renderer || new _Renderer(this.defaults); + const renderer8 = this.defaults.renderer || new _Renderer(this.defaults); for (const prop in pack.renderer) { - if (!(prop in renderer7)) { + if (!(prop in renderer8)) { throw new Error(`renderer '${prop}' does not exist`); } if (["options", "parser"].includes(prop)) { @@ -35707,18 +36785,18 @@ ${text2} const rendererProp = prop; let rendererFunc = pack.renderer[rendererProp]; if (!pack.useNewRenderer) { - rendererFunc = this.#convertRendererFunction(rendererFunc, rendererProp, renderer7); + rendererFunc = this.#convertRendererFunction(rendererFunc, rendererProp, renderer8); } - const prevRenderer = renderer7[rendererProp]; - renderer7[rendererProp] = (...args2) => { - let ret = rendererFunc.apply(renderer7, args2); + const prevRenderer = renderer8[rendererProp]; + renderer8[rendererProp] = (...args2) => { + let ret = rendererFunc.apply(renderer8, args2); if (ret === false) { - ret = prevRenderer.apply(renderer7, args2); + ret = prevRenderer.apply(renderer8, args2); } return ret || ""; }; } - opts.renderer = renderer7; + opts.renderer = renderer8; } if (pack.tokenizer) { const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults); @@ -35793,14 +36871,14 @@ ${text2} return this; } // TODO: Remove this in next major release - #convertRendererFunction(func, prop, renderer7) { + #convertRendererFunction(func, prop, renderer8) { switch (prop) { case "heading": return function(token2) { if (!token2.type || token2.type !== prop) { return func.apply(this, arguments); } - return func.call(this, renderer7.parser.parseInline(token2.tokens), token2.depth, unescape2(renderer7.parser.parseInline(token2.tokens, renderer7.parser.textRenderer))); + return func.call(this, renderer8.parser.parseInline(token2.tokens), token2.depth, unescape2(renderer8.parser.parseInline(token2.tokens, renderer8.parser.textRenderer))); }; case "code": return function(token2) { @@ -35977,7 +37055,7 @@ ${text2} parser(tokens2, options3) { return _Parser.parse(tokens2, options3 ?? this.defaults); } - #parseMarkdown(lexer2, parser21) { + #parseMarkdown(lexer2, parser22) { return (src, options3) => { const origOpt = { ...options3 }; const opt = { ...this.defaults, ...origOpt }; @@ -35998,7 +37076,7 @@ ${text2} opt.hooks.options = opt; } if (opt.async) { - return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens2) => opt.hooks ? opt.hooks.processAllTokens(tokens2) : tokens2).then((tokens2) => opt.walkTokens ? Promise.all(this.walkTokens(tokens2, opt.walkTokens)).then(() => tokens2) : tokens2).then((tokens2) => parser21(tokens2, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError2); + return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens2) => opt.hooks ? opt.hooks.processAllTokens(tokens2) : tokens2).then((tokens2) => opt.walkTokens ? Promise.all(this.walkTokens(tokens2, opt.walkTokens)).then(() => tokens2) : tokens2).then((tokens2) => parser22(tokens2, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError2); } try { if (opt.hooks) { @@ -36011,7 +37089,7 @@ ${text2} if (opt.walkTokens) { this.walkTokens(tokens2, opt.walkTokens); } - let html2 = parser21(tokens2, opt); + let html2 = parser22(tokens2, opt); if (opt.hooks) { html2 = opt.hooks.postprocess(html2); } @@ -37694,13 +38772,13 @@ ${text2} "use strict"; init_src32(); init_nodes2(); - getDiagramElement = /* @__PURE__ */ __name((id26, securityLevel) => { + getDiagramElement = /* @__PURE__ */ __name((id27, securityLevel) => { let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); - const svg = root4.select(`[id="${id26}"]`); + const svg = root4.select(`[id="${id27}"]`); return svg; }, "getDiagramElement"); } @@ -39420,12 +40498,12 @@ ${text2} "src/rendering-util/rendering-elements/edgeMarker.ts"() { "use strict"; init_logger(); - addEdgeMarkers = /* @__PURE__ */ __name((svgPath, edge, url, id26, diagramType) => { + addEdgeMarkers = /* @__PURE__ */ __name((svgPath, edge, url, id27, diagramType) => { if (edge.arrowTypeStart) { - addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id26, diagramType); + addEdgeMarker(svgPath, "start", edge.arrowTypeStart, url, id27, diagramType); } if (edge.arrowTypeEnd) { - addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id26, diagramType); + addEdgeMarker(svgPath, "end", edge.arrowTypeEnd, url, id27, diagramType); } }, "addEdgeMarkers"); arrowTypesMap = { @@ -39439,14 +40517,14 @@ ${text2} dependency: "dependency", lollipop: "lollipop" }; - addEdgeMarker = /* @__PURE__ */ __name((svgPath, position5, arrowType, url, id26, diagramType) => { + addEdgeMarker = /* @__PURE__ */ __name((svgPath, position5, arrowType, url, id27, diagramType) => { const endMarkerType = arrowTypesMap[arrowType]; if (!endMarkerType) { log.warn(`Unknown arrow type: ${arrowType}`); return; } const suffix = position5 === "start" ? "Start" : "End"; - svgPath.attr(`marker-${position5}`, `url(${url}#${id26}_${diagramType}-${endMarkerType}${suffix})`); + svgPath.attr(`marker-${position5}`, `url(${url}#${id27}_${diagramType}-${endMarkerType}${suffix})`); }, "addEdgeMarker"); } }); @@ -39818,7 +40896,7 @@ ${text2} } return newLineData; }, "fixCorners"); - insertEdge = /* @__PURE__ */ __name(function(elem, edge, clusterDb3, diagramType, startNode, endNode, id26) { + insertEdge = /* @__PURE__ */ __name(function(elem, edge, clusterDb3, diagramType, startNode, endNode, id27) { const { handDrawnSeed } = getConfig2(); let points = edge.points; let pointsHasChanged = false; @@ -39921,7 +40999,7 @@ ${text2} } log.info("arrowTypeStart", edge.arrowTypeStart); log.info("arrowTypeEnd", edge.arrowTypeEnd); - addEdgeMarkers(svgPath, edge, url, id26, diagramType); + addEdgeMarkers(svgPath, edge, url, id27, diagramType); let paths = {}; if (pointsHasChanged) { paths.updatedPath = points; @@ -39938,46 +41016,46 @@ ${text2} "src/rendering-util/rendering-elements/markers.js"() { "use strict"; init_logger(); - insertMarkers = /* @__PURE__ */ __name((elem, markerArray, type3, id26) => { + insertMarkers = /* @__PURE__ */ __name((elem, markerArray, type3, id27) => { markerArray.forEach((markerName) => { - markers[markerName](elem, type3, id26); + markers[markerName](elem, type3, id27); }); }, "insertMarkers"); - extension = /* @__PURE__ */ __name((elem, type3, id26) => { - log.trace("Making markers for ", id26); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-extensionStart").attr("class", "marker extension " + type3).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"); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-extensionEnd").attr("class", "marker extension " + type3).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"); + extension = /* @__PURE__ */ __name((elem, type3, id27) => { + log.trace("Making markers for ", id27); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-extensionStart").attr("class", "marker extension " + type3).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"); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-extensionEnd").attr("class", "marker extension " + type3).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"); }, "extension"); - composition = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-compositionStart").attr("class", "marker composition " + type3).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"); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-compositionEnd").attr("class", "marker composition " + type3).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"); + composition = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-compositionStart").attr("class", "marker composition " + type3).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"); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-compositionEnd").attr("class", "marker composition " + type3).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"); }, "composition"); - aggregation = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-aggregationStart").attr("class", "marker aggregation " + type3).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"); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-aggregationEnd").attr("class", "marker aggregation " + type3).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"); + aggregation = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-aggregationStart").attr("class", "marker aggregation " + type3).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"); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-aggregationEnd").attr("class", "marker aggregation " + type3).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"); }, "aggregation"); - dependency = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-dependencyStart").attr("class", "marker dependency " + type3).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"); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-dependencyEnd").attr("class", "marker dependency " + type3).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"); + dependency = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-dependencyStart").attr("class", "marker dependency " + type3).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"); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-dependencyEnd").attr("class", "marker dependency " + type3).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"); }, "dependency"); - lollipop = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-lollipopStart").attr("class", "marker lollipop " + type3).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); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-lollipopEnd").attr("class", "marker lollipop " + type3).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); + lollipop = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-lollipopStart").attr("class", "marker lollipop " + type3).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); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-lollipopEnd").attr("class", "marker lollipop " + type3).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); }, "lollipop"); - point6 = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("marker").attr("id", id26 + "_" + type3 + "-pointEnd").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).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"); - elem.append("marker").attr("id", id26 + "_" + type3 + "-pointStart").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).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"); + point6 = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("marker").attr("id", id27 + "_" + type3 + "-pointEnd").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).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"); + elem.append("marker").attr("id", id27 + "_" + type3 + "-pointStart").attr("class", "marker " + type3).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 8).attr("markerHeight", 8).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"); }, "point"); - circle2 = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("marker").attr("id", id26 + "_" + type3 + "-circleEnd").attr("class", "marker " + type3).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"); - elem.append("marker").attr("id", id26 + "_" + type3 + "-circleStart").attr("class", "marker " + type3).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"); + circle2 = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("marker").attr("id", id27 + "_" + type3 + "-circleEnd").attr("class", "marker " + type3).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"); + elem.append("marker").attr("id", id27 + "_" + type3 + "-circleStart").attr("class", "marker " + type3).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"); }, "circle"); - cross = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("marker").attr("id", id26 + "_" + type3 + "-crossEnd").attr("class", "marker cross " + type3).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"); - elem.append("marker").attr("id", id26 + "_" + type3 + "-crossStart").attr("class", "marker cross " + type3).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"); + cross = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("marker").attr("id", id27 + "_" + type3 + "-crossEnd").attr("class", "marker cross " + type3).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"); + elem.append("marker").attr("id", id27 + "_" + type3 + "-crossStart").attr("class", "marker cross " + type3).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"); }, "cross"); - barb = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); + barb = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "userSpaceOnUse").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); }, "barb"); markers = { extension, @@ -43695,7 +44773,7 @@ ${text2} // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/defaults.js var objectProto18, hasOwnProperty15, defaults, defaults_default; - var init_defaults = __esm({ + var init_defaults3 = __esm({ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/defaults.js"() { "use strict"; init_baseRest(); @@ -44979,7 +46057,7 @@ ${text2} return baseKeys_default(collection4).length; } var mapTag8, setTag8, size_default2; - var init_size2 = __esm({ + var init_size3 = __esm({ "../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/size.js"() { "use strict"; init_baseKeys(); @@ -45180,8 +46258,8 @@ ${text2} // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqueId.js function uniqueId(prefix) { - var id26 = ++idCounter; - return toString_default(prefix) + id26; + var id27 = ++idCounter; + return toString_default(prefix) + id27; } var idCounter, uniqueId_default; var init_uniqueId = __esm({ @@ -45236,7 +46314,7 @@ ${text2} init_cloneDeep(); init_compact(); init_constant7(); - init_defaults(); + init_defaults3(); init_difference(); init_drop(); init_dropRight(); @@ -45267,7 +46345,7 @@ ${text2} init_map(); init_mapValues(); init_max2(); - init_merge3(); + init_merge4(); init_min2(); init_minBy(); init_noop2(); @@ -45277,7 +46355,7 @@ ${text2} init_range2(); init_reduce(); init_reject(); - init_size2(); + init_size3(); init_some(); init_sortBy(); init_union(); @@ -45797,8 +46875,8 @@ ${text2} if (g2.nodeCount() <= 1) { return []; } - var state4 = buildState(g2, weightFn || DEFAULT_WEIGHT_FN); - var results = doGreedyFAS(state4.graph, state4.buckets, state4.zeroIdx); + var state5 = buildState(g2, weightFn || DEFAULT_WEIGHT_FN); + var results = doGreedyFAS(state5.graph, state5.buckets, state5.zeroIdx); return flatten_default( map_default(results, function(e3) { return g2.outEdges(e3.v, e3.w); @@ -48320,10 +49398,10 @@ ${text2} parents.clear(); clusterDb.clear(); }, "clear"); - isDescendant2 = /* @__PURE__ */ __name((id26, ancestorId) => { + isDescendant2 = /* @__PURE__ */ __name((id27, ancestorId) => { const ancestorDescendants = descendants.get(ancestorId) || []; - log.trace("In isDescendant", ancestorId, " ", id26, " = ", ancestorDescendants.includes(id26)); - return ancestorDescendants.includes(id26); + log.trace("In isDescendant", ancestorId, " ", id27, " = ", ancestorDescendants.includes(id27)); + return ancestorDescendants.includes(id27); }, "isDescendant"); edgeInCluster = /* @__PURE__ */ __name((edge, clusterId) => { const clusterDescendants = descendants.get(clusterId) || []; @@ -48410,20 +49488,20 @@ ${text2} graph.removeNode(node2); }); }, "copy"); - extractDescendants = /* @__PURE__ */ __name((id26, graph) => { - const children2 = graph.children(id26); + extractDescendants = /* @__PURE__ */ __name((id27, graph) => { + const children2 = graph.children(id27); let res = [...children2]; for (const child of children2) { - parents.set(child, id26); + parents.set(child, id27); res = [...res, ...extractDescendants(child, graph)]; } return res; }, "extractDescendants"); - findCommonEdges = /* @__PURE__ */ __name((graph, id1, id26) => { + findCommonEdges = /* @__PURE__ */ __name((graph, id1, id27) => { const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1); - const edges22 = graph.edges().filter((edge) => edge.v === id26 || edge.w === id26); + const edges22 = graph.edges().filter((edge) => edge.v === id27 || edge.w === id27); const edges1Prim = edges1.map((edge) => { - return { v: edge.v === id1 ? id26 : edge.v, w: edge.w === id1 ? id1 : edge.w }; + return { v: edge.v === id1 ? id27 : edge.v, w: edge.w === id1 ? id1 : edge.w }; }); const edges2Prim = edges22.map((edge) => { return { v: edge.v, w: edge.w }; @@ -48433,11 +49511,11 @@ ${text2} }); return result; }, "findCommonEdges"); - findNonClusterChild = /* @__PURE__ */ __name((id26, graph, clusterId) => { - const children2 = graph.children(id26); - log.trace("Searching children of id ", id26, children2); + findNonClusterChild = /* @__PURE__ */ __name((id27, graph, clusterId) => { + const children2 = graph.children(id27); + log.trace("Searching children of id ", id27, children2); if (children2.length < 1) { - return id26; + return id27; } let reserve; for (const child of children2) { @@ -48453,17 +49531,17 @@ ${text2} } return reserve; }, "findNonClusterChild"); - getAnchorId = /* @__PURE__ */ __name((id26) => { - if (!clusterDb.has(id26)) { - return id26; + getAnchorId = /* @__PURE__ */ __name((id27) => { + if (!clusterDb.has(id27)) { + return id27; } - if (!clusterDb.get(id26).externalConnections) { - return id26; + if (!clusterDb.get(id27).externalConnections) { + return id27; } - if (clusterDb.has(id26)) { - return clusterDb.get(id26).id; + if (clusterDb.has(id27)) { + return clusterDb.get(id27).id; } - return id26; + return id27; }, "getAnchorId"); adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => { if (!graph || depth > 10) { @@ -48472,42 +49550,42 @@ ${text2} } else { log.debug("Opting in, graph "); } - graph.nodes().forEach(function(id26) { - const children2 = graph.children(id26); + graph.nodes().forEach(function(id27) { + const children2 = graph.children(id27); if (children2.length > 0) { log.warn( "Cluster identified", - id26, + id27, " Replacement id in edges: ", - findNonClusterChild(id26, graph, id26) + findNonClusterChild(id27, graph, id27) ); - descendants.set(id26, extractDescendants(id26, graph)); - clusterDb.set(id26, { id: findNonClusterChild(id26, graph, id26), clusterData: graph.node(id26) }); + descendants.set(id27, extractDescendants(id27, graph)); + clusterDb.set(id27, { id: findNonClusterChild(id27, graph, id27), clusterData: graph.node(id27) }); } }); - graph.nodes().forEach(function(id26) { - const children2 = graph.children(id26); + graph.nodes().forEach(function(id27) { + const children2 = graph.children(id27); const edges5 = graph.edges(); if (children2.length > 0) { - log.debug("Cluster identified", id26, descendants); + log.debug("Cluster identified", id27, descendants); edges5.forEach((edge) => { - const d1 = isDescendant2(edge.v, id26); - const d2 = isDescendant2(edge.w, id26); + const d1 = isDescendant2(edge.v, id27); + const d2 = isDescendant2(edge.w, id27); if (d1 ^ d2) { - log.warn("Edge: ", edge, " leaves cluster ", id26); - log.warn("Descendants of XXX ", id26, ": ", descendants.get(id26)); - clusterDb.get(id26).externalConnections = true; + log.warn("Edge: ", edge, " leaves cluster ", id27); + log.warn("Descendants of XXX ", id27, ": ", descendants.get(id27)); + clusterDb.get(id27).externalConnections = true; } }); } else { - log.debug("Not a cluster ", id26, descendants); + log.debug("Not a cluster ", id27, descendants); } }); - for (let id26 of clusterDb.keys()) { - const nonClusterChild = clusterDb.get(id26).id; + for (let id27 of clusterDb.keys()) { + const nonClusterChild = clusterDb.get(id27).id; const parent4 = graph.parent(nonClusterChild); - if (parent4 !== id26 && clusterDb.has(parent4) && !clusterDb.get(parent4).externalConnections) { - clusterDb.get(id26).id = parent4; + if (parent4 !== id27 && clusterDb.has(parent4) && !clusterDb.get(parent4).externalConnections) { + clusterDb.get(id27).id = parent4; } } graph.edges().forEach(function(e3) { @@ -48527,51 +49605,7 @@ ${text2} " --- ", clusterDb.get(e3.w) ); - if (clusterDb.get(e3.v) && clusterDb.get(e3.w) && clusterDb.get(e3.v) === clusterDb.get(e3.w)) { - log.warn("Fixing and trying link to self - removing XXX", e3.v, e3.w, e3.name); - log.warn("Fixing and trying - removing XXX", e3.v, e3.w, e3.name); - v3 = getAnchorId(e3.v); - w3 = getAnchorId(e3.w); - graph.removeEdge(e3.v, e3.w, e3.name); - const specialId1 = e3.w + "---" + e3.v + "---1"; - const specialId2 = e3.w + "---" + e3.v + "---2"; - graph.setNode(specialId1, { - domId: specialId1, - id: specialId1, - labelStyle: "", - label: "", - padding: 0, - shape: "labelRect", - style: "", - width: 10, - height: 10 - }); - graph.setNode(specialId2, { - domId: specialId2, - id: specialId2, - labelStyle: "", - padding: 0, - shape: "labelRect", - style: "", - width: 10, - height: 10 - }); - const edge1 = structuredClone(edge); - const edgeMid = structuredClone(edge); - const edge2 = structuredClone(edge); - edge1.label = ""; - edge1.arrowTypeEnd = "none"; - edge1.id = e3.name + "-cyclic-special-1"; - edgeMid.arrowTypeEnd = "none"; - edgeMid.id = e3.name + "-cyclic-special-mid"; - edge2.label = ""; - edge1.fromCluster = e3.v; - edge2.toCluster = e3.v; - edge2.id = e3.name + "-cyclic-special-2"; - graph.setEdge(v3, specialId1, edge1, e3.name + "-cyclic-special-0"); - graph.setEdge(specialId1, specialId2, edgeMid, e3.name + "-cyclic-special-1"); - graph.setEdge(specialId2, w3, edge2, e3.name + "-cyclic-special-2"); - } else if (clusterDb.get(e3.v) || clusterDb.get(e3.w)) { + if (clusterDb.get(e3.v) || clusterDb.get(e3.w)) { log.warn("Fixing and trying - removing XXX", e3.v, e3.w, e3.name); v3 = getAnchorId(e3.v); w3 = getAnchorId(e3.w); @@ -48681,7 +49715,7 @@ ${text2} for (const node2 of nodes6) { const data5 = graph.node(node2); log.warn(" Now next level", node2, data5); - if (data5.clusterNode) { + if (data5?.clusterNode) { extractor(data5.graph, depth + 1); } } @@ -48723,8 +49757,8 @@ ${text2} init_logger(); init_subGraphTitleMargins(); init_diagramAPI(); - recursiveRender = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id26, parentCluster, siteConfig2) => { - log.info("Graph in recursive render: XXX", write(graph), parentCluster); + recursiveRender = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id27, parentCluster, siteConfig2) => { + log.warn("Graph in recursive render:XAX", write(graph), parentCluster); const dir2 = graph.graph().rankdir; log.trace("Dir in recursive render - dir:", dir2); const elem = _elem.insert("g").attr("class", "root"); @@ -48772,7 +49806,7 @@ ${text2} nodes6, node2.graph, diagramType, - id26, + id27, graph.node(v3), siteConfig2 ); @@ -48793,7 +49827,7 @@ ${text2} setNodeElem2(newEl, node2); } else { if (graph.children(v3).length > 0) { - log.info( + log.trace( "Cluster - the non recursive path XBX", v3, node2.id, @@ -48802,10 +49836,10 @@ ${text2} "Graph:", graph ); - log.info(findNonClusterChild(node2.id, graph)); + log.trace(findNonClusterChild(node2.id, graph)); clusterDb.set(node2.id, { id: findNonClusterChild(node2.id, graph), node: node2 }); } else { - log.trace("Node - the non recursive path XAX", v3, node2.id, node2); + log.trace("Node - the non recursive path XAX", v3, nodes6, graph.node(v3), dir2); await insertNode2(nodes6, graph.node(v3), dir2); } } @@ -48914,7 +49948,7 @@ ${text2} edge.points.forEach((point8) => point8.y += subGraphTitleTotalMargin / 2); const startNode = graph.node(e3.v); var endNode = graph.node(e3.w); - const paths = insertEdge(edgePaths, edge, clusterDb, diagramType, startNode, endNode, id26); + const paths = insertEdge(edgePaths, edge, clusterDb, diagramType, startNode, endNode, id27); positionEdgeLabel(edge, paths); }); graph.nodes().forEach(function(v3) { @@ -48954,11 +49988,61 @@ ${text2} }); log.debug("Edges:", data4Layout.edges); data4Layout.edges.forEach((edge) => { - graph.setEdge(edge.start, edge.end, { ...edge }, edge.id); + if (edge.start === edge.end) { + const nodeId = edge.start; + const specialId1 = nodeId + "---" + nodeId + "---1"; + const specialId2 = nodeId + "---" + nodeId + "---2"; + const node2 = graph.node(nodeId); + graph.setNode(specialId1, { + domId: specialId1, + id: specialId1, + parentId: node2.parentId, + labelStyle: "", + label: "", + padding: 0, + shape: "labelRect", + // shape: 'rect', + style: "", + width: 10, + height: 10 + }); + graph.setParent(specialId1, node2.parentId); + graph.setNode(specialId2, { + domId: specialId2, + id: specialId2, + parentId: node2.parentId, + labelStyle: "", + padding: 0, + // shape: 'rect', + shape: "labelRect", + label: "", + style: "", + width: 10, + height: 10 + }); + graph.setParent(specialId2, node2.parentId); + const edge1 = structuredClone(edge); + const edgeMid = structuredClone(edge); + const edge2 = structuredClone(edge); + edge1.label = ""; + edge1.arrowTypeEnd = "none"; + edge1.id = nodeId + "-cyclic-special-1"; + edgeMid.arrowTypeEnd = "none"; + edgeMid.id = nodeId + "-cyclic-special-mid"; + edge2.label = ""; + edge1.fromCluster = nodeId; + edge2.toCluster = nodeId; + edge2.id = nodeId + "-cyclic-special-2"; + graph.setEdge(nodeId, specialId1, edge1, nodeId + "-cyclic-special-0"); + graph.setEdge(specialId1, specialId2, edgeMid, nodeId + "-cyclic-special-1"); + graph.setEdge(specialId2, nodeId, edge2, nodeId + "-cyc init_logger(); layoutAlgorithms = {}; registerLayoutLoaders = /* @__PURE__ */ __name((loaders) => { - for (const loader25 of loaders) { - layoutAlgorithms[loader25.name] = loader25; + for (const loader26 of loaders) { + layoutAlgorithms[loader26.name] = loader26; } }, "registerLayoutLoaders"); registerDefaultLayoutLoaders = /* @__PURE__ */ __name(() => { @@ -49063,19 +50147,19 @@ ${text2} getClasses2 = /* @__PURE__ */ __name(function(text2, diagramObj) { return diagramObj.db.getClasses(); }, "getClasses"); - draw2 = /* @__PURE__ */ __name(async function(text2, id26, _version, diag) { + draw2 = /* @__PURE__ */ __name(async function(text2, id27, _version, diag) { log.info("REF0:"); - log.info("Drawing state diagram (v2)", id26); + log.info("Drawing state diagram (v2)", id27); const { securityLevel, flowchart: conf8, layout: layout6 } = getConfig2(); let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; log.debug("Before getData: "); const data4Layout = diag.db.getData(); log.debug("Data: ", data4Layout); - const svg = getDiagramElement(id26, securityLevel); + const svg = getDiagramElement(id27, securityLevel); const direction4 = getDirection(); data4Layout.type = diag.type; data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout6); @@ -49088,7 +50172,7 @@ ${text2} data4Layout.nodeSpacing = conf8?.nodeSpacing || 50; data4Layout.rankSpacing = conf8?.rankSpacing || 50; data4Layout.markers = ["point", "circle", "cross"]; - data4Layout.diagramId = id26; + data4Layout.diagramId = id27; log.debug("REF1:", data4Layout); await render4(data4Layout, svg); const padding3 = data4Layout.config.flowchart?.diagramPadding ?? 8; @@ -49100,7 +50184,7 @@ ${text2} ); setupViewPortForSVG(svg, padding3, "flowchart", conf8?.useMaxWidth || false); for (const vertex of data4Layout.nodes) { - const node2 = select_default2(`#${id26} [id="${vertex.id}"]`); + const node2 = select_default2(`#${id27} [id="${vertex.id}"]`); if (!node2 || !vertex.link) { continue; } @@ -49146,7 +50230,7 @@ ${text2} for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 4], $V1 = [1, 3], $V2 = [1, 5], $V3 = [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], $V4 = [2, 2], $V5 = [1, 13], $V6 = [1, 14], $V7 = [1, 15], $V8 = [1, 16], $V9 = [1, 23], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 49], $Ve = [1, 48], $Vf = [1, 29], $Vg = [1, 30], $Vh = [1, 31], $Vi = [1, 32], $Vj = [1, 33], $Vk = [1, 44], $Vl = [1, 46], $Vm = [1, 42], $Vn = [1, 47], $Vo = [1, 43], $Vp = [1, 50], $Vq = [1, 45], $Vr = [1, 51], $Vs = [1, 52], $Vt = [1, 34], $Vu = [1, 35], $Vv = [1, 36], $Vw = [1, 37], $Vx = [1, 57], $Vy = [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], $Vz = [1, 61], $VA = [1, 60], $VB = [1, 62], $VC = [8, 9, 11, 73, 75], $VD = [1, 88], $VE = [1, 93], $VF = [1, 92], $VG = [1, 89], $VH = [1, 85], $VI = [1, 91], $VJ = [1, 87], $VK = [1, 94], $VL = [1, 90], $VM = [1, 95], $VN = [1, 86], $VO = [8, 9, 10, 11, 73, 75], $VP = [8, 9, 10, 11, 44, 73, 75], $VQ = [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], $VR = [8, 9, 11, 42, 58, 73, 75, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VS = [42, 58, 86, 99, 102, 103, 106, 108, 111, 112, 113], $VT = [1, 121], $VU = [1, 120], $VV = [1, 128], $VW = [1, 142], $VX = [1, 143], $VY = [1, 144], $VZ = [1, 145], $V_ = [1, 130], $V$ = [1, 132], $V01 = [1, 136], $V11 = [1, 137], $V21 = [1, 138], $V31 = [1, 139], $V41 = [1, 140], $V51 = [1, 141], $V61 = [1, 146], $V71 = [1, 147], $V81 = [1, 126], $V91 = [1, 127], $Va1 = [1, 134], $Vb1 = [1, 129], $Vc1 = [1, 133], $Vd1 = [1, 131], $Ve1 = [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], $Vf1 = [1, 149], $Vg1 = [8, 9, 11], $Vh1 = [8, 9, 10, 11, 14, 42, 58, 86, 102, 103, 106, 108, 111, 112, 113], $Vi1 = [1, 169], $Vj1 = [1, 165], $Vk1 = [1, 166], $Vl1 = [1, 170], $Vm1 = [1, 167], $Vn1 = [1, 168], $Vo1 = [75, 113, 116], $Vp1 = [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], $Vq1 = [10, 103], $Vr1 = [31, 47, 49, 51, 53, 55, 60, 62, 64, 65, 67, 69, 113, 114, 115], $Vs1 = [1, 235], $Vt1 = [1, 233], $Vu1 = [1, 237], $Vv1 = [1, 231], $Vw1 = [1, 232], $Vx1 = [1, 234], $Vy1 = [1, 236], $Vz1 = [1, 238], $VA1 = [1, 255], $VB1 = [8, 9, 11, 103], $VC1 = [8, 9, 10, 11, 58, 81, 102, 103, 106, 107, 108, 109]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -49540,21 +50624,21 @@ ${text2} return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -49573,7 +50657,7 @@ ${text2} }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -50323,13 +51407,13 @@ ${text2} }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser3.parser = parser3; @@ -50520,7 +51604,7 @@ ${text2} for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [6, 8, 10, 20, 22, 24, 26, 27, 28], $V1 = [1, 10], $V2 = [1, 11], $V3 = [1, 12], $V4 = [1, 13], $V5 = [1, 14], $V6 = [1, 15], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 23], $Va = [1, 24], $Vb = [1, 25], $Vc = [6, 8, 10, 13, 15, 18, 19, 20, 22, 24, 26, 27, 28, 41, 42, 43, 44, 45], $Vd = [1, 34], $Ve = [27, 28, 46, 47], $Vf = [41, 42, 43, 44, 45], $Vg = [17, 34], $Vh = [1, 54], $Vi = [1, 53], $Vj = [17, 34, 36, 38]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -50703,21 +51787,21 @@ ${text2} return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -50736,7 +51820,7 @@ ${text2} }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -51264,13 +52348,13 @@ ${text2} }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser4.parser = parser4; @@ -51908,20 +52992,29 @@ ${text2} const len = svgPath.node().getTotalLength(); const labelPoint = svgPath.node().getPointAtLength(len * 0.5); const labelId = "rel" + relCnt; - const labelNode = svg.append("text").classed("er relationshipLabel", true).attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).style("text-anchor", "middle").style("dominant-baseline", "middle").style("font-family", getConfig2().fontFamily).style("font-size", conf2.fontSize + "px").text(rel2.roleA); + const labelText = rel2.roleA.split(/
/g); + const labelNode = svg.append("text").classed("er relationshipLabel", true).attr("id", labelId).attr("x", labelPoint.x).attr("y", labelPoint.y).style("text-anchor", "middle").style("dominant-baseline", "middle").style("font-family", getConfig2().fontFamily).style("font-size", conf2.fontSize + "px"); + if (labelText.length == 1) { + labelNode.text(rel2.roleA); + } else { + const firstShift = -(labelText.length - 1) * 0.5; + labelText.forEach((txt, i2) => { + labelNode.append("tspan").attr("x", labelPoint.x).attr("dy", `${i2 === 0 ? firstShift : 1}em`).text(txt); + }); + } const labelBBox = labelNode.node().getBBox(); svg.insert("rect", "#" + labelId).classed("er relationshipLabelBox", true).attr("x", labelPoint.x - labelBBox.width / 2).attr("y", labelPoint.y - labelBBox.height / 2).attr("width", labelBBox.width).attr("height", labelBBox.height); }, "drawRelationshipFromLayout"); - draw3 = /* @__PURE__ */ __name(function(text2, id26, _version, diagObj) { + draw3 = /* @__PURE__ */ __name(function(text2, id27, _version, diagObj) { conf2 = getConfig2().er; log.info("Drawing ER diagram"); const securityLevel = getConfig2().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); - const svg = root4.select(`[id='${id26}']`); + const svg = root4.select(`[id='${id27}']`); erMarkers_default.insertMarkers(svg, conf2); let g2; g2 = new Graph({ @@ -52147,9 +53240,9 @@ ${text2} return new StreamImpl(() => collection4[Symbol.iterator](), (iterator) => iterator.next()); } if (typeof collection4.length === "number") { - return new StreamImpl(() => ({ index: 0 }), (state4) => { - if (state4.index < collection4.length) { - return { done: false, value: collection4[state4.index++] }; + return new StreamImpl(() => ({ index: 0 }), (state5) => { + if (state5.index < collection4.length) { + return { done: false, value: collection4[state5.index++] }; } else { return DONE_RESULT; } @@ -52157,31 +53250,31 @@ ${text2} } } if (collections.length > 1) { - return new StreamImpl(() => ({ collIndex: 0, arrIndex: 0 }), (state4) => { + return new StreamImpl(() => ({ collIndex: 0, arrIndex: 0 }), (state5) => { do { - if (state4.iterator) { - const next3 = state4.iterator.next(); + if (state5.iterator) { + const next3 = state5.iterator.next(); if (!next3.done) { return next3; } - state4.iterator = void 0; + state5.iterator = void 0; } - if (state4.array) { - if (state4.arrIndex < state4.array.length) { - return { done: false, value: state4.array[state4.arrIndex++] }; + if (state5.array) { + if (state5.arrIndex < state5.array.length) { + return { done: false, value: state5.array[state5.arrIndex++] }; } - state4.array = void 0; - state4.arrIndex = 0; + state5.array = void 0; + state5.arrIndex = 0; } - if (state4.collIndex < collections.length) { - const collection4 = collections[state4.collIndex++]; + if (state5.collIndex < collections.length) { + const collection4 = collections[state5.collIndex++]; if (isIterable(collection4)) { - state4.iterator = collection4[Symbol.iterator](); + state5.iterator = collection4[Symbol.iterator](); } else if (collection4 && typeof collection4.length === "number") { - state4.array = collection4; + state5.array = collection4; } } - } while (state4.iterator || state4.array || state4.collIndex < collections.length); + } while (state5.iterator || state5.array || state5.collIndex < collections.length); return DONE_RESULT; }); } @@ -52251,16 +53344,16 @@ ${text2} } concat(other) { const iterator = other[Symbol.iterator](); - return new _StreamImpl(() => ({ first: this.startFn(), firstDone: false }), (state4) => { + return new _StreamImpl(() => ({ first: this.startFn(), firstDone: false }), (state5) => { let result; - if (!state4.firstDone) { + if (!state5.firstDone) { do { - result = this.nextFn(state4.first); + result = this.nextFn(state5.first); if (!result.done) { return result; } } while (!result.done); - state4.firstDone = true; + state5.firstDone = true; } do { result = iterator.next(); @@ -52334,8 +53427,8 @@ ${text2} } } map(callbackfn) { - return new _StreamImpl(this.startFn, (state4) => { - const { done, value: value2 } = this.nextFn(state4); + return new _StreamImpl(this.startFn, (state5) => { + const { done, value: value2 } = this.nextFn(state5); if (done) { return DONE_RESULT; } else { @@ -52344,10 +53437,10 @@ ${text2} }); } filter(predicate) { - return new _StreamImpl(this.startFn, (state4) => { + return new _StreamImpl(this.startFn, (state5) => { let result; do { - result = this.nextFn(state4); + result = this.nextFn(state5); if (!result.done && predicate(result.value)) { return result; } @@ -52422,26 +53515,26 @@ ${text2} return false; } flatMap(callbackfn) { - return new _StreamImpl(() => ({ this: this.startFn() }), (state4) => { + return new _StreamImpl(() => ({ this: this.startFn() }), (state5) => { do { - if (state4.iterator) { - const next3 = state4.iterator.next(); + if (state5.iterator) { + const next3 = state5.iterator.next(); if (next3.done) { - state4.iterator = void 0; + state5.iterator = void 0; } else { return next3; } } - const { done, value: value2 } = this.nextFn(state4.this); + const { done, value: value2 } = this.nextFn(state5.this); if (!done) { const mapped = callbackfn(value2); if (isIterable(mapped)) { - state4.iterator = mapped[Symbol.iterator](); + state5.iterator = mapped[Symbol.iterator](); } else { return { done: false, value: mapped }; } } - } while (state4.iterator); + } while (state5.iterator); return DONE_RESULT; }); } @@ -52453,25 +53546,25 @@ ${text2} return this; } const stream2 = depth > 1 ? this.flat(depth - 1) : this; - return new _StreamImpl(() => ({ this: stream2.startFn() }), (state4) => { + return new _StreamImpl(() => ({ this: stream2.startFn() }), (state5) => { do { - if (state4.iterator) { - const next3 = state4.iterator.next(); + if (state5.iterator) { + const next3 = state5.iterator.next(); if (next3.done) { - state4.iterator = void 0; + state5.iterator = void 0; } else { return next3; } } - const { done, value: value2 } = stream2.nextFn(state4.this); + const { done, value: value2 } = stream2.nextFn(state5.this); if (!done) { if (isIterable(value2)) { - state4.iterator = value2[Symbol.iterator](); + state5.iterator = value2[Symbol.iterator](); } else { return { done: false, value: value2 }; } } - } while (state4.iterator); + } while (state5.iterator); return DONE_RESULT; }); } @@ -52485,23 +53578,23 @@ ${text2} } tail(skipCount = 1) { return new _StreamImpl(() => { - const state4 = this.startFn(); + const state5 = this.startFn(); for (let i2 = 0; i2 < skipCount; i2++) { - const next3 = this.nextFn(state4); + const next3 = this.nextFn(state5); if (next3.done) { - return state4; + return state5; } } - return state4; + return state5; }, this.nextFn); } limit(maxSize) { - return new _StreamImpl(() => ({ size: 0, state: this.startFn() }), (state4) => { - state4.size++; - if (state4.size > maxSize) { + return new _StreamImpl(() => ({ size: 0, state: this.startFn() }), (state5) => { + state5.size++; + if (state5.size > maxSize) { return DONE_RESULT; } - return this.nextFn(state4.state); + return this.nextFn(state5.state); }); } distinct(by) { @@ -52541,18 +53634,18 @@ ${text2} super(() => ({ iterators: (options3 === null || options3 === void 0 ? void 0 : options3.includeRoot) ? [[root4][Symbol.iterator]()] : [children2(root4)[Symbol.iterator]()], pruned: false - }), (state4) => { - if (state4.pruned) { - state4.iterators.pop(); - state4.pruned = false; + }), (state5) => { + if (state5.pruned) { + state5.iterators.pop(); + state5.pruned = false; } - while (state4.iterators.length > 0) { - const iterator = state4.iterators[state4.iterators.length - 1]; + while (state5.iterators.length > 0) { + const iterator = state5.iterators[state5.iterators.length - 1]; const next3 = iterator.next(); if (next3.done) { - state4.iterators.pop(); + state5.iterators.pop(); } else { - state4.iterators.push(children2(next3.value)[Symbol.iterator]()); + state5.iterators.push(children2(next3.value)[Symbol.iterator]()); return next3; } } @@ -53852,28 +54945,28 @@ ${text2} keys: Object.keys(node2), keyIndex: 0, arrayIndex: 0 - }), (state4) => { - while (state4.keyIndex < state4.keys.length) { - const property2 = state4.keys[state4.keyIndex]; + }), (state5) => { + while (state5.keyIndex < state5.keys.length) { + const property2 = state5.keys[state5.keyIndex]; if (!property2.startsWith("$")) { const value2 = node2[property2]; if (isAstNode(value2)) { - state4.keyIndex++; + state5.keyIndex++; if (isAstNodeInRange(value2, range3)) { return { done: false, value: value2 }; } } else if (Array.isArray(value2)) { - while (state4.arrayIndex < value2.length) { - const index = state4.arrayIndex++; + while (state5.arrayIndex < value2.length) { + const index = state5.arrayIndex++; const element3 = value2[index]; if (isAstNode(element3) && isAstNodeInRange(element3, range3)) { return { done: false, value: element3 }; } } - state4.arrayIndex = 0; + state5.arrayIndex = 0; } } - state4.keyIndex++; + state5.keyIndex++; } return DONE_RESULT; }); @@ -53908,26 +55001,26 @@ ${text2} keys: Object.keys(node2), keyIndex: 0, arrayIndex: 0 - }), (state4) => { - while (state4.keyIndex < state4.keys.length) { - const property2 = state4.keys[state4.keyIndex]; + }), (state5) => { + while (state5.keyIndex < state5.keys.length) { + const property2 = state5.keys[state5.keyIndex]; if (!property2.startsWith("$")) { const value2 = node2[property2]; if (isReference(value2)) { - state4.keyIndex++; + state5.keyIndex++; return { done: false, value: { reference: value2, container: node2, property: property2 } }; } else if (Array.isArray(value2)) { - while (state4.arrayIndex < value2.length) { - const index = state4.arrayIndex++; + while (state5.arrayIndex < value2.length) { + const index = state5.arrayIndex++; const element3 = value2[index]; if (isReference(element3)) { return { done: false, value: { reference: element3, container: node2, property: property2, index } }; } } - state4.arrayIndex = 0; + state5.arrayIndex = 0; } } - state4.keyIndex++; + state5.keyIndex++; } return DONE_RESULT; }); @@ -54945,16 +56038,16 @@ ${text2} function getCaseInsensitivePattern(keyword) { return Array.prototype.map.call(keyword, (letter) => /\w/.test(letter) ? `[${letter.toLowerCase()}${letter.toUpperCase()}]` : escapeRegExp(letter)).join(""); } - function partialMatches(regex, input) { - const partial = partialRegExp(regex); + function partialMatches(regex2, input) { + const partial = partialRegExp(regex2); const match2 = input.match(partial); return !!match2 && match2[0].length > 0; } - function partialRegExp(regex) { - if (typeof regex === "string") { - regex = new RegExp(regex); + function partialRegExp(regex2) { + if (typeof regex2 === "string") { + regex2 = new RegExp(regex2); } - const re2 = regex, source = regex.source; + const re2 = regex2, source = regex2.source; let i2 = 0; function process2() { let result = "", tmp; @@ -55080,7 +56173,7 @@ ${text2} return result; } __name(process2, "process"); - return new RegExp(process2(), regex.flags); + return new RegExp(process2(), regex2.flags); } var NEWLINE_REGEXP, regexpParser, TerminalRegExpVisitor, visitor; var init_regexp_utils = __esm({ @@ -55102,9 +56195,9 @@ ${text2} get endRegex() { return this.endRegexpStack.join(""); } - reset(regex) { + reset(regex2) { this.multiline = false; - this.regex = regex; + this.regex = regex2; this.startRegexp = ""; this.isStarting = true; this.endRegexpStack = []; @@ -55134,8 +56227,8 @@ ${text2} visitSet(node2) { if (!this.multiline) { const set6 = this.regex.substring(node2.loc.begin, node2.loc.end); - const regex = new RegExp(set6); - this.multiline = Boolean("\n".match(regex)); + const regex2 = new RegExp(set6); + this.multiline = Boolean("\n".match(regex2)); } if (node2.quantifier) { this.isStarting = false; @@ -55610,15 +56703,15 @@ ${text2} function keywordToRegex(keyword) { return escapeRegExp(keyword.value); } - function withCardinality(regex, options3) { + function withCardinality(regex2, options3) { var _a; if (options3.wrap !== false || options3.lookahead) { - regex = `(${(_a = options3.lookahead) !== null && _a !== void 0 ? _a : ""}${regex})`; + regex2 = `(${(_a = options3.lookahead) !== null && _a !== void 0 ? _a : ""}${regex2})`; } if (options3.cardinality) { - return `${regex}${options3.cardinality}`; + return `${regex2}${options3.cardinality}`; } - return regex; + return regex2; } var WILDCARD; var init_grammar_utils = __esm({ @@ -62258,10 +63351,10 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis atn.decisionMap[buildATNKey(rule, "Option", optional2.idx)] = start3; return handle; } - function defineDecisionState(atn, state4) { - atn.decisionStates.push(state4); - state4.decision = atn.decisionStates.length - 1; - return state4.decision; + function defineDecisionState(atn, state5) { + atn.decisionStates.push(state5); + state5.decision = atn.decisionStates.length - 1; + return state5.decision; } function makeAlts(atn, rule, start3, production, ...alts) { const end2 = newState(atn, rule, production, { @@ -62387,14 +63480,14 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis atn.states.push(t4); return t4; } - function addTransition(state4, transition2) { - if (state4.transitions.length === 0) { - state4.epsilonOnlyTransitions = transition2.isEpsilon(); + function addTransition(state5, transition2) { + if (state5.transitions.length === 0) { + state5.epsilonOnlyTransitions = transition2.isEpsilon(); } - state4.transitions.push(transition2); + state5.transitions.push(transition2); } - function removeState(atn, state4) { - atn.states.splice(atn.states.indexOf(state4), 1); + function removeState(atn, state5) { + atn.states.splice(atn.states.indexOf(state5), 1); } var ATN_BASIC, ATN_RULE_START, ATN_PLUS_BLOCK_START, ATN_STAR_BLOCK_START, ATN_RULE_STOP, ATN_BLOCK_END, ATN_STAR_LOOP_BACK, ATN_STAR_LOOP_ENTRY, ATN_PLUS_LOOP_BACK, ATN_LOOP_END, AbstractTransition, AtomTransition, EpsilonTransition, RuleTransition; var init_atn = __esm({ @@ -62698,8 +63791,8 @@ For Further details.`; tokenPath: path4 }; } - function getExistingTargetState(state4, token2) { - return state4.edges[token2.tokenTypeIdx]; + function getExistingTargetState(state5, token2) { + return state5.edges[token2.tokenTypeIdx]; } function computeReachSet(configs, token2, predicateSet) { const intermediate = new ATNConfigSet(); @@ -62774,18 +63867,18 @@ For Further details.`; from2.edges[token2.tokenTypeIdx] = to; return to; } - function addDFAState(dfa, state4) { - if (state4 === DFA_ERROR) { - return state4; + function addDFAState(dfa, state5) { + if (state5 === DFA_ERROR) { + return state5; } - const mapKey = state4.configs.key; + const mapKey = state5.configs.key; const existing = dfa.states[mapKey]; if (existing !== void 0) { return existing; } - state4.configs.finalize(); - dfa.states[mapKey] = state4; - return state4; + state5.configs.finalize(); + dfa.states[mapKey] = state5; + return state5; } function computeStartState(atnState) { const configs = new ATNConfigSet(); @@ -63095,7 +64188,7 @@ For Further details.`; }); // ../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/index.js - var init_lib = __esm({ + var init_lib2 = __esm({ "../../node_modules/.pnpm/chevrotain-allstar@0.3.1_chevrotain@11.0.3/node_modules/chevrotain-allstar/lib/index.js"() { "use strict"; init_all_star_lookahead(); @@ -64590,7 +65683,7 @@ For Further details.`; "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser.js"() { "use strict"; init_api5(); - init_lib(); + init_lib2(); init_ast(); init_grammar_utils(); init_ast_utils(); @@ -65004,16 +66097,16 @@ For Further details.`; }); // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/parser-builder-base.js - function createParser(grammar, parser21, tokens2) { + function createParser(grammar, parser22, tokens2) { const rules = /* @__PURE__ */ new Map(); const parserContext = { - parser: parser21, + parser: parser22, tokens: tokens2, rules, ruleNames: /* @__PURE__ */ new Map() }; buildRules(parserContext, grammar); - return parser21; + return parser22; } function buildRules(parserContext, grammar) { const reachable = getAllReachableRules(grammar, false); @@ -65156,15 +66249,15 @@ For Further details.`; }, "idFunc"); const alternatives = /* @__PURE__ */ __name((args) => ctx.parser.alternatives(orIdx, methods.map((method, idx) => { const alt = { ALT: /* @__PURE__ */ __name(() => true, "ALT") }; - const parser21 = ctx.parser; + const parser22 = ctx.parser; alt.ALT = () => { method.ALT(args); - if (!parser21.isRecording()) { - const key = idFunc(orIdx, parser21); - if (!parser21.unorderedGroups.get(key)) { - parser21.unorderedGroups.set(key, []); + if (!parser22.isRecording()) { + const key = idFunc(orIdx, parser22); + if (!parser22.unorderedGroups.get(key)) { + parser22.unorderedGroups.set(key, []); } - const groupState = parser21.unorderedGroups.get(key); + const groupState = parser22.unorderedGroups.get(key); if (typeof (groupState === null || groupState === void 0 ? void 0 : groupState[idx]) === "undefined") { groupState[idx] = true; } @@ -65175,7 +66268,7 @@ For Further details.`; alt.GATE = () => gate(args); } else { alt.GATE = () => { - const trackedAlternatives = parser21.unorderedGroups.get(idFunc(orIdx, parser21)); + const trackedAlternatives = parser22.unorderedGroups.get(idFunc(orIdx, parser22)); const allow = !(trackedAlternatives === null || trackedAlternatives === void 0 ? void 0 : trackedAlternatives[idx]); return allow; }; @@ -65358,10 +66451,10 @@ For Further details.`; function createCompletionParser(services) { const grammar = services.Grammar; const lexer2 = services.parser.Lexer; - const parser21 = new LangiumCompletionParser(services); - createParser(grammar, parser21, lexer2.definition); - parser21.finalize(); - return parser21; + const parser22 = new LangiumCompletionParser(services); + createParser(grammar, parser22, lexer2.definition); + parser22.finalize(); + return parser22; } var init_completion_parser_builder = __esm({ "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/completion-parser-builder.js"() { @@ -65374,15 +66467,15 @@ For Further details.`; // ../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser-builder.js function createLangiumParser(services) { - const parser21 = prepareLangiumParser(services); - parser21.finalize(); - return parser21; + const parser22 = prepareLangiumParser(services); + parser22.finalize(); + return parser22; } function prepareLangiumParser(services) { const grammar = services.Grammar; const lexer2 = services.parser.Lexer; - const parser21 = new LangiumParser(services); - return createParser(grammar, parser21, lexer2.definition); + const parser22 = new LangiumParser(services); + return createParser(grammar, parser22, lexer2.definition); } var init_langium_parser_builder = __esm({ "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/parser/langium-parser-builder.js"() { @@ -65427,29 +66520,29 @@ For Further details.`; return rules.filter(isTerminalRule).filter((e3) => !e3.fragment).map((terminal) => this.buildTerminalToken(terminal)).toArray(); } buildTerminalToken(terminal) { - const regex = terminalRegex(terminal); - const pattern = this.requiresCustomPattern(regex) ? this.regexPatternFunction(regex) : regex; + const regex2 = terminalRegex(terminal); + const pattern = this.requiresCustomPattern(regex2) ? this.regexPatternFunction(regex2) : regex2; const tokenType = { name: terminal.name, PATTERN: pattern, LINE_BREAKS: true }; if (terminal.hidden) { - tokenType.GROUP = isWhitespace(regex) ? Lexer2.SKIPPED : "hidden"; + tokenType.GROUP = isWhitespace(regex2) ? Lexer2.SKIPPED : "hidden"; } return tokenType; } - requiresCustomPattern(regex) { - if (regex.flags.includes("u")) { + requiresCustomPattern(regex2) { + if (regex2.flags.includes("u")) { return true; - } else if (regex.source.includes("?<=") || regex.source.includes("? { stickyRegex.lastIndex = offset; const execResult = stickyRegex.exec(text2); @@ -68573,21 +69666,21 @@ For Further details.`; const toBeValidated = documents2.filter((doc) => this.shouldValidate(doc)); await this.runCancelable(toBeValidated, DocumentState.Validated, cancelToken, (doc) => this.validate(doc, cancelToken)); for (const doc of documents2) { - const state4 = this.buildState.get(doc.uri.toString()); - if (state4) { - state4.completed = true; + const state5 = this.buildState.get(doc.uri.toString()); + if (state5) { + state5.completed = true; } } } prepareBuild(documents2, options3) { for (const doc of documents2) { const key = doc.uri.toString(); - const state4 = this.buildState.get(key); - if (!state4 || state4.completed) { + const state5 = this.buildState.get(key); + if (!state5 || state5.completed) { this.buildState.set(key, { completed: false, options: options3, - result: state4 === null || state4 === void 0 ? void 0 : state4.result + result: state5 === null || state5 === void 0 ? void 0 : state5.result }); } } @@ -68608,7 +69701,7 @@ For Further details.`; this.buildPhaseListeners.delete(targetState, callback); }); } - waitUntil(state4, uriOrToken, cancelToken) { + waitUntil(state5, uriOrToken, cancelToken) { let uri = void 0; if (uriOrToken && "path" in uriOrToken) { uri = uriOrToken; @@ -68618,17 +69711,17 @@ For Further details.`; cancelToken !== null && cancelToken !== void 0 ? cancelToken : cancelToken = cancellation_exports.CancellationToken.None; if (uri) { const document2 = this.langiumDocuments.getDocument(uri); - if (document2 && document2.state > state4) { + if (document2 && document2.state > state5) { return Promise.resolve(uri); } } - if (this.currentState >= state4) { + if (this.currentState >= state5) { return Promise.resolve(void 0); } else if (cancelToken.isCancellationRequested) { return Promise.reject(OperationCancelled); } return new Promise((resolve3, reject3) => { - const buildDisposable = this.onBuildPhase(state4, () => { + const buildDisposable = this.onBuildPhase(state5, () => { buildDisposable.dispose(); cancelDisposable.dispose(); if (uri) { @@ -68645,11 +69738,11 @@ For Further details.`; }); }); } - async notifyBuildPhase(documents2, state4, cancelToken) { + async notifyBuildPhase(documents2, state5, cancelToken) { if (documents2.length === 0) { return; } - const listeners = this.buildPhaseListeners.get(state4); + const listeners = this.buildPhaseListeners.get(state5); for (const listener of listeners) { await interruptAndCheck(cancelToken); await listener(documents2, cancelToken); @@ -68678,14 +69771,14 @@ For Further details.`; } else { document2.diagnostics = diagnostics; } - const state4 = this.buildState.get(document2.uri.toString()); - if (state4) { - (_a = state4.result) !== null && _a !== void 0 ? _a : state4.result = {}; + const state5 = this.buildState.get(document2.uri.toString()); + if (state5) { + (_a = state5.result) !== null && _a !== void 0 ? _a : state5.result = {}; const newCategories = (_b = options3 === null || options3 === void 0 ? void 0 : options3.categories) !== null && _b !== void 0 ? _b : ValidationCategory.all; - if (state4.result.validationChecks) { - state4.result.validationChecks.push(...newCategories); + if (state5.result.validationChecks) { + state5.result.validationChecks.push(...newCategories); } else { - state4.result.validationChecks = [...newCategories]; + state5.result.validationChecks = [...newCategories]; } } } @@ -70013,22 +71106,22 @@ ${content}`; } return this.grammarElementIdMap.get(node2); } - getGrammarElement(id26) { + getGrammarElement(id27) { if (this.grammarElementIdMap.size === 0) { this.createGrammarElementIdMap(); } - const element3 = this.grammarElementIdMap.getKey(id26); + const element3 = this.grammarElementIdMap.getKey(id27); if (element3) { return element3; } else { - throw new Error("Invalid grammar element id: " + id26); + throw new Error("Invalid grammar element id: " + id27); } } createGrammarElementIdMap() { - let id26 = 0; + let id27 = 0; for (const element3 of streamAst(this.grammar)) { if (isAbstractElement(element3)) { - this.grammarElementIdMap.set(element3, id26++); + this.grammarElementIdMap.set(element3, id27++); } } } @@ -70539,7 +71632,7 @@ ${content}`; stream: () => stream, toDiagnosticSeverity: () => toDiagnosticSeverity }); - var init_lib2 = __esm({ + var init_lib3 = __esm({ "../../node_modules/.pnpm/langium@3.0.0/node_modules/langium/lib/index.js"() { "use strict"; init_default_module(); @@ -70560,7 +71653,10 @@ ${content}`; } }); - // ../parser/dist/chunks/mermaid-parser.core/chunk-U3TRWOCV.mjs + // ../parser/dist/chunks/mermaid-parser.core/chunk-Y27MQZ3U.mjs + function isArchitecture(item) { + return reflection2.isInstance(item, Architecture); + } function isBranch(item) { return reflection2.isInstance(item, Branch); } @@ -70591,17 +71687,20 @@ ${content}`; function isPieSection(item) { return reflection2.isInstance(item, PieSection); } - var __defProp2, __name2, Statement, Branch, Checkout, CherryPicking, Commit, Common, GitGraph, Info, Merge, Packet, PacketBlock, Pie, PieSection, Direction, MermaidAstReflection, reflection2, loadedInfoGrammar, InfoGrammar, loadedPacketGrammar, PacketGrammar, loadedPieGrammar, PieGrammar, loadedGitGraphGrammar, GitGraphGrammar, InfoLanguageMetaData, PacketLanguageMetaData, PieLanguageMetaData, GitGraphLanguageMetaData, MermaidGeneratedSharedModule, InfoGeneratedModule, PacketGeneratedModule, PieGeneratedModule, GitGraphGeneratedModule, accessibilityDescrRegex, accessibilityTitleRegex, titleRegex, rulesRegexes, AbstractMermaidValueConverter, CommonValueConverter, AbstractMermaidTokenBuilder, CommonTokenBuilder; - var init_chunk_U3TRWOCV = __esm({ - "../parser/dist/chunks/mermaid-parser.core/chunk-U3TRWOCV.mjs"() { + var __defProp2, __name2, Statement, Architecture, Branch, Checkout, CherryPicking, Commit, Common, GitGraph, Info, Merge, Packet, PacketBlock, Pie, PieSection, Direction, MermaidAstReflection, reflection2, loadedInfoGrammar, InfoGrammar, loadedPacketGrammar, PacketGrammar, loadedPieGrammar, PieGrammar, loadedArchitectureGrammar, ArchitectureGrammar, loadedGitGraphGrammar, GitGraphGrammar, InfoLanguageMetaData, PacketLanguageMetaData, PieLanguageMetaData, ArchitectureLanguageMetaData, GitGraphLanguageMetaData, MermaidGeneratedSharedModule, InfoGeneratedModule, PacketGeneratedModule, PieGeneratedModule, ArchitectureGeneratedModule, GitGraphGeneratedModule, accessibilityDescrRegex, accessibilityTitleRegex, titleRegex, rulesRegexes, AbstractMermaidValueConverter, CommonValueConverter, AbstractMermaidTokenBuilder, CommonTokenBuilder; + var init_chunk_Y27MQZ3U = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-Y27MQZ3U.mjs"() { "use strict"; - init_lib2(); - init_lib2(); - init_lib2(); - init_lib2(); + init_lib3(); + init_lib3(); + init_lib3(); + init_lib3(); __defProp2 = Object.defineProperty; __name2 = /* @__PURE__ */ __name((target, value2) => __defProp2(target, "name", { value: value2, configurable: true }), "__name"); Statement = "Statement"; + Architecture = "Architecture"; + __name(isArchitecture, "isArchitecture"); + __name2(isArchitecture, "isArchitecture"); Branch = "Branch"; __name(isBranch, "isBranch"); __name2(isBranch, "isBranch"); @@ -70643,7 +71742,7 @@ ${content}`; __name2(this, "MermaidAstReflection"); } getAllTypes() { - return ["Branch", "Checkout", "CherryPicking", "Commit", "Common", "Direction", "GitGraph", "Info", "Merge", "Packet", "PacketBlock", "Pie", "PieSection", "Statement"]; + return ["Architecture", "Branch", "Checkout", "CherryPicking", "Commit", "Common", "Direction", "Edge", "GitGraph", "Group", "Info", "Junction", "Merge", "Packet", "PacketBlock", "Pie", "PieSection", "Service", "Statement"]; } computeIsSubtype(subtype, supertype) { switch (subtype) { @@ -70672,6 +71771,20 @@ ${content}`; } getTypeMetaData(type3) { switch (type3) { + case "Architecture": { + return { + name: "Architecture", + properties: [ + { name: "accDescr" }, + { name: "accTitle" }, + { name: "edges", defaultValue: [] }, + { name: "groups", defaultValue: [] }, + { name: "junctions", defaultValue: [] }, + { name: "services", defaultValue: [] }, + { name: "title" } + ] + }; + } case "Branch": { return { name: "Branch", @@ -70720,6 +71833,22 @@ ${content}`; ] }; } + case "Edge": { + return { + name: "Edge", + properties: [ + { name: "lhsDir" }, + { name: "lhsGroup", defaultValue: false }, + { name: "lhsId" }, + { name: "lhsInto", defaultValue: false }, + { name: "rhsDir" }, + { name: "rhsGroup", defaultValue: false }, + { name: "rhsId" }, + { name: "rhsInto", defaultValue: false }, + { name: "title" } + ] + }; + } case "GitGraph": { return { name: "GitGraph", @@ -70731,6 +71860,17 @@ ${content}`; ] }; } + case "Group": { + return { + name: "Group", + properties: [ + { name: "icon" }, + { name: "id" }, + { name: "in" }, + { name: "title" } + ] + }; + } case "Info": { return { name: "Info", @@ -70741,6 +71881,15 @@ ${content}`; ] }; } + case "Junction": { + return { + name: "Junction", + properties: [ + { name: "id" }, + { name: "in" } + ] + }; + } case "Merge": { return { name: "Merge", @@ -70794,6 +71943,18 @@ ${content}`; ] }; } + case "Service": { + return { + name: "Service", + properties: [ + { name: "icon" }, + { name: "iconText" }, + { name: "id" }, + { name: "in" }, + { name: "title" } + ] + }; + } case "Direction": { return { name: "Direction", @@ -70819,6 +71980,7 @@ ${content}`; InfoGrammar = /* @__PURE__ */ __name2(() => loadedInfoGrammar ?? (loadedInfoGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","name":"Info","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "InfoGrammar"); PacketGrammar = /* @__PURE__ */ __name2(() => loadedPacketGrammar ?? (loadedPacketGrammar = loadGrammarFromJson(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","name":"Packet","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}`)), "PacketGrammar"); PieGrammar = /* @__PURE__ */ __name2(() => loadedPieGrammar ?? (loadedPieGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","name":"Pie","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "PieGrammar"); + ArchitectureGrammar = /* @__PURE__ */ __name2(() => loadedArchitectureGrammar ?? (loadedArchitectureGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","name":"Architecture","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LeftPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RightPort","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Arrow","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')), "ArchitectureGrammar"); GitGraphGrammar = /* @__PURE__ */ __name2(() => loadedGitGraphGrammar ?? (loadedGitGraphGrammar = loadGrammarFromJson(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","name":"TitleAndAccessibilities","fragment":true,"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EOL","fragment":true,"dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","name":"GitGraph","entry":true,"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}`)), "GitGraphGrammar"); InfoLanguageMetaData = { languageId: "info", @@ -70835,6 +71997,11 @@ ${content}`; fileExtensions: [".mmd", ".mermaid"], caseInsensitive: false }; + ArchitectureLanguageMetaData = { + languageId: "architecture", + fileExtensions: [".mmd", ".mermaid"], + caseInsensitive: false + }; GitGraphLanguageMetaData = { languageId: "gitGraph", fileExtensions: [".mmd", ".mermaid"], @@ -70858,6 +72025,11 @@ ${content}`; LanguageMetaData: /* @__PURE__ */ __name2(() => PieLanguageMetaData, "LanguageMetaData"), parser: {} }; + ArchitectureGeneratedModule = { + Grammar: /* @__PURE__ */ __name2(() => ArchitectureGrammar(), "Grammar"), + LanguageMetaData: /* @__PURE__ */ __name2(() => ArchitectureLanguageMetaData, "LanguageMetaData"), + parser: {} + }; GitGraphGeneratedModule = { Grammar: /* @__PURE__ */ __name2(() => GitGraphGrammar(), "Grammar"), LanguageMetaData: /* @__PURE__ */ __name2(() => GitGraphLanguageMetaData, "LanguageMetaData"), @@ -70889,11 +72061,11 @@ ${content}`; return value2; } runCommonConverter(rule, input, _cstNode) { - const regex = rulesRegexes[rule.name]; - if (regex === void 0) { + const regex2 = rulesRegexes[rule.name]; + if (regex2 === void 0) { return void 0; } - const match2 = regex.exec(input); + const match2 = regex2.exec(input); if (match2 === null) { return void 0; } @@ -70949,7 +72121,7 @@ ${content}`; } }); - // ../parser/dist/chunks/mermaid-parser.core/chunk-QE2ZKFLT.mjs + // ../parser/dist/chunks/mermaid-parser.core/chunk-NCMFTTUW.mjs function createGitGraphServices(context = EmptyFileSystem) { const shared = inject( createDefaultSharedCoreModule(context), @@ -70964,11 +72136,11 @@ ${content}`; return { shared, GitGraph: GitGraph2 }; } var GitGraphTokenBuilder, GitGraphModule; - var init_chunk_QE2ZKFLT = __esm({ - "../parser/dist/chunks/mermaid-parser.core/chunk-QE2ZKFLT.mjs"() { + var init_chunk_NCMFTTUW = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-NCMFTTUW.mjs"() { "use strict"; - init_chunk_U3TRWOCV(); - init_lib2(); + init_chunk_Y27MQZ3U(); + init_lib3(); GitGraphTokenBuilder = class extends AbstractMermaidTokenBuilder { static { __name(this, "GitGraphTokenBuilder"); @@ -70991,7 +72163,7 @@ ${content}`; } }); - // ../parser/dist/chunks/mermaid-parser.core/chunk-O2VHLUZY.mjs + // ../parser/dist/chunks/mermaid-parser.core/chunk-4YFB5VUC.mjs function createInfoServices(context = EmptyFileSystem) { const shared = inject( createDefaultSharedCoreModule(context), @@ -71006,11 +72178,11 @@ ${content}`; return { shared, Info: Info2 }; } var InfoTokenBuilder, InfoModule; - var init_chunk_O2VHLUZY = __esm({ - "../parser/dist/chunks/mermaid-parser.core/chunk-O2VHLUZY.mjs"() { + var init_chunk_4YFB5VUC = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-4YFB5VUC.mjs"() { "use strict"; - init_chunk_U3TRWOCV(); - init_lib2(); + init_chunk_Y27MQZ3U(); + init_lib3(); InfoTokenBuilder = class extends AbstractMermaidTokenBuilder { static { __name(this, "InfoTokenBuilder"); @@ -71033,7 +72205,7 @@ ${content}`; } }); - // ../parser/dist/chunks/mermaid-parser.core/chunk-HTBTGXD4.mjs + // ../parser/dist/chunks/mermaid-parser.core/chunk-EQFLFMNE.mjs function createPacketServices(context = EmptyFileSystem) { const shared = inject( createDefaultSharedCoreModule(context), @@ -71048,11 +72220,11 @@ ${content}`; return { shared, Packet: Packet2 }; } var PacketTokenBuilder, PacketModule; - var init_chunk_HTBTGXD4 = __esm({ - "../parser/dist/chunks/mermaid-parser.core/chunk-HTBTGXD4.mjs"() { + var init_chunk_EQFLFMNE = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-EQFLFMNE.mjs"() { "use strict"; - init_chunk_U3TRWOCV(); - init_lib2(); + init_chunk_Y27MQZ3U(); + init_lib3(); PacketTokenBuilder = class extends AbstractMermaidTokenBuilder { static { __name(this, "PacketTokenBuilder"); @@ -71075,7 +72247,7 @@ ${content}`; } }); - // ../parser/dist/chunks/mermaid-parser.core/chunk-NM56GJBF.mjs + // ../parser/dist/chunks/mermaid-parser.core/chunk-BI6EQKOQ.mjs function createPieServices(context = EmptyFileSystem) { const shared = inject( createDefaultSharedCoreModule(context), @@ -71090,11 +72262,11 @@ ${content}`; return { shared, Pie: Pie2 }; } var PieTokenBuilder, PieValueConverter, PieModule; - var init_chunk_NM56GJBF = __esm({ - "../parser/dist/chunks/mermaid-parser.core/chunk-NM56GJBF.mjs"() { + var init_chunk_BI6EQKOQ = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-BI6EQKOQ.mjs"() { "use strict"; - init_chunk_U3TRWOCV(); - init_lib2(); + init_chunk_Y27MQZ3U(); + init_lib3(); PieTokenBuilder = class extends AbstractMermaidTokenBuilder { static { __name(this, "PieTokenBuilder"); @@ -71131,59 +72303,133 @@ ${content}`; } }); - // ../parser/dist/chunks/mermaid-parser.core/info-PWGDJKR5.mjs - var info_PWGDJKR5_exports = {}; - __export(info_PWGDJKR5_exports, { + // ../parser/dist/chunks/mermaid-parser.core/chunk-FF7BQXOH.mjs + function createArchitectureServices(context = EmptyFileSystem) { + const shared = inject( + createDefaultSharedCoreModule(context), + MermaidGeneratedSharedModule + ); + const Architecture2 = inject( + createDefaultCoreModule({ shared }), + ArchitectureGeneratedModule, + ArchitectureModule + ); + shared.ServiceRegistry.register(Architecture2); + return { shared, Architecture: Architecture2 }; + } + var ArchitectureTokenBuilder, ArchitectureValueConverter, ArchitectureModule; + var init_chunk_FF7BQXOH = __esm({ + "../parser/dist/chunks/mermaid-parser.core/chunk-FF7BQXOH.mjs"() { + "use strict"; + init_chunk_Y27MQZ3U(); + init_lib3(); + ArchitectureTokenBuilder = class extends AbstractMermaidTokenBuilder { + static { + __name(this, "ArchitectureTokenBuilder"); + } + static { + __name2(this, "ArchitectureTokenBuilder"); + } + constructor() { + super(["architecture"]); + } + }; + ArchitectureValueConverter = class extends AbstractMermaidValueConverter { + static { + __name(this, "ArchitectureValueConverter"); + } + static { + __name2(this, "ArchitectureValueConverter"); + } + runCustomConverter(rule, input, _cstNode) { + if (rule.name === "ARCH_ICON") { + return input.replace(/[()]/g, "").trim(); + } else if (rule.name === "ARCH_TEXT_ICON") { + return input.replace(/["()]/g, ""); + } else if (rule.name === "ARCH_TITLE") { + return input.replace(/[[\]]/g, "").trim(); + } + return void 0; + } + }; + ArchitectureModule = { + parser: { + TokenBuilder: /* @__PURE__ */ __name2(() => new ArchitectureTokenBuilder(), "TokenBuilder"), + ValueConverter: /* @__PURE__ */ __name2(() => new ArchitectureValueConverter(), "ValueConverter") + } + }; + __name(createArchitectureServices, "createArchitectureServices"); + __name2(createArchitectureServices, "createArchitectureServices"); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/info-46DW6VJ7.mjs + var info_46DW6VJ7_exports = {}; + __export(info_46DW6VJ7_exports, { InfoModule: () => InfoModule, createInfoServices: () => createInfoServices }); - var init_info_PWGDJKR5 = __esm({ - "../parser/dist/chunks/mermaid-parser.core/info-PWGDJKR5.mjs"() { + var init_info_46DW6VJ7 = __esm({ + "../parser/dist/chunks/mermaid-parser.core/info-46DW6VJ7.mjs"() { "use strict"; - init_chunk_O2VHLUZY(); - init_chunk_U3TRWOCV(); + init_chunk_4YFB5VUC(); + init_chunk_Y27MQZ3U(); } }); - // ../parser/dist/chunks/mermaid-parser.core/packet-7PPW3X5M.mjs - var packet_7PPW3X5M_exports = {}; - __export(packet_7PPW3X5M_exports, { + // ../parser/dist/chunks/mermaid-parser.core/packet-W2GHVCYJ.mjs + var packet_W2GHVCYJ_exports = {}; + __export(packet_W2GHVCYJ_exports, { PacketModule: () => PacketModule, createPacketServices: () => createPacketServices }); - var init_packet_7PPW3X5M = __esm({ - "../parser/dist/chunks/mermaid-parser.core/packet-7PPW3X5M.mjs"() { + var init_packet_W2GHVCYJ = __esm({ + "../parser/dist/chunks/mermaid-parser.core/packet-W2GHVCYJ.mjs"() { "use strict"; - init_chunk_HTBTGXD4(); - init_chunk_U3TRWOCV(); + init_chunk_EQFLFMNE(); + init_chunk_Y27MQZ3U(); } }); - // ../parser/dist/chunks/mermaid-parser.core/pie-RF5LNP4B.mjs - var pie_RF5LNP4B_exports = {}; - __export(pie_RF5LNP4B_exports, { + // ../parser/dist/chunks/mermaid-parser.core/pie-BEWT4RHE.mjs + var pie_BEWT4RHE_exports = {}; + __export(pie_BEWT4RHE_exports, { PieModule: () => PieModule, createPieServices: () => createPieServices }); - var init_pie_RF5LNP4B = __esm({ - "../parser/dist/chunks/mermaid-parser.core/pie-RF5LNP4B.mjs"() { + var init_pie_BEWT4RHE = __esm({ + "../parser/dist/chunks/mermaid-parser.core/pie-BEWT4RHE.mjs"() { + "use strict"; + init_chunk_BI6EQKOQ(); + init_chunk_Y27MQZ3U(); + } + }); + + // ../parser/dist/chunks/mermaid-parser.core/architecture-I3QFYML2.mjs + var architecture_I3QFYML2_exports = {}; + __export(architecture_I3QFYML2_exports, { + ArchitectureModule: () => ArchitectureModule, + createArchitectureServices: () => createArchitectureServices + }); + var init_architecture_I3QFYML2 = __esm({ + "../parser/dist/chunks/mermaid-parser.core/architecture-I3QFYML2.mjs"() { "use strict"; - init_chunk_NM56GJBF(); - init_chunk_U3TRWOCV(); + init_chunk_FF7BQXOH(); + init_chunk_Y27MQZ3U(); } }); - // ../parser/dist/chunks/mermaid-parser.core/gitGraph-F2EDSAW4.mjs - var gitGraph_F2EDSAW4_exports = {}; - __export(gitGraph_F2EDSAW4_exports, { + // ../parser/dist/chunks/mermaid-parser.core/gitGraph-YCYPL57B.mjs + var gitGraph_YCYPL57B_exports = {}; + __export(gitGraph_YCYPL57B_exports, { GitGraphModule: () => GitGraphModule, createGitGraphServices: () => createGitGraphServices }); - var init_gitGraph_F2EDSAW4 = __esm({ - "../parser/dist/chunks/mermaid-parser.core/gitGraph-F2EDSAW4.mjs"() { + var init_gitGraph_YCYPL57B = __esm({ + "../parser/dist/chunks/mermaid-parser.core/gitGraph-YCYPL57B.mjs"() { "use strict"; - init_chunk_QE2ZKFLT(); - init_chunk_U3TRWOCV(); + init_chunk_NCMFTTUW(); + init_chunk_Y27MQZ3U(); } }); @@ -71196,8 +72442,8 @@ ${content}`; if (!parsers[diagramType]) { await initializer(); } - const parser21 = parsers[diagramType]; - const result = parser21.parse(text2); + const parser22 = parsers[diagramType]; + const result = parser22.parse(text2); if (result.lexerErrors.length > 0 || result.parserErrors.length > 0) { throw new MermaidParseError(result); } @@ -71207,32 +72453,38 @@ ${content}`; var init_mermaid_parser_core = __esm({ "../parser/dist/mermaid-parser.core.mjs"() { "use strict"; - init_chunk_QE2ZKFLT(); - init_chunk_O2VHLUZY(); - init_chunk_HTBTGXD4(); - init_chunk_NM56GJBF(); - init_chunk_U3TRWOCV(); + init_chunk_NCMFTTUW(); + init_chunk_4YFB5VUC(); + init_chunk_EQFLFMNE(); + init_chunk_BI6EQKOQ(); + init_chunk_FF7BQXOH(); + init_chunk_Y27MQZ3U(); parsers = {}; initializers = { info: /* @__PURE__ */ __name2(async () => { - const { createInfoServices: createInfoServices2 } = await Promise.resolve().then(() => (init_info_PWGDJKR5(), info_PWGDJKR5_exports)); - const parser21 = createInfoServices2().Info.parser.LangiumParser; - parsers.info = parser21; + const { createInfoServices: createInfoServices2 } = await Promise.resolve().then(() => (init_info_46DW6VJ7(), info_46DW6VJ7_exports)); + const parser22 = createInfoServices2().Info.parser.LangiumParser; + parsers.info = parser22; }, "info"), packet: /* @__PURE__ */ __name2(async () => { - const { createPacketServices: createPacketServices2 } = await Promise.resolve().then(() => (init_packet_7PPW3X5M(), packet_7PPW3X5M_exports)); - const parser21 = createPacketServices2().Packet.parser.LangiumParser; - parsers.packet = parser21; + const { createPacketServices: createPacketServices2 } = await Promise.resolve().then(() => (init_packet_W2GHVCYJ(), packet_W2GHVCYJ_exports)); + const parser22 = createPacketServices2().Packet.parser.LangiumParser; + parsers.packet = parser22; }, "packet"), pie: /* @__PURE__ */ __name2(async () => { - const { createPieServices: createPieServices2 } = await Promise.resolve().then(() => (init_pie_RF5LNP4B(), pie_RF5LNP4B_exports)); - const parser21 = createPieServices2().Pie.parser.LangiumParser; - parsers.pie = parser21; + const { createPieServices: createPieServices2 } = await Promise.resolve().then(() => (init_pie_BEWT4RHE(), pie_BEWT4RHE_exports)); + const parser22 = createPieServices2().Pie.parser.LangiumParser; + parsers.pie = parser22; }, "pie"), + architecture: /* @__PURE__ */ __name2(async () => { + const { createArchitectureServices: createArchitectureServices2 } = await Promise.resolve().then(() => (init_architecture_I3QFYML2(), architecture_I3QFYML2_exports)); + const parser22 = createArchitectureServices2().Architecture.parser.LangiumParser; + parsers.architecture = parser22; + }, "architecture"), gitGraph: /* @__PURE__ */ __name2(async () => { - const { createGitGraphServices: createGitGraphServices2 } = await Promise.resolve().then(() => (init_gitGraph_F2EDSAW4(), gitGraph_F2EDSAW4_exports)); - const parser21 = createGitGraphServices2().GitGraph.parser.LangiumParser; - parsers.gitGraph = parser21; + const { createGitGraphServices: createGitGraphServices2 } = await Promise.resolve().then(() => (init_gitGraph_YCYPL57B(), gitGraph_YCYPL57B_exports)); + const parser22 = createGitGraphServices2().GitGraph.parser.LangiumParser; + parsers.gitGraph = parser22; }, "gitGraph") }; __name(parse2, "parse"); @@ -71255,15 +72507,15 @@ ${content}`; }); // src/diagrams/common/populateCommonDb.ts - function populateCommonDb(ast, db7) { + function populateCommonDb(ast, db8) { if (ast.accDescr) { - db7.setAccDescription?.(ast.accDescr); + db8.setAccDescription?.(ast.accDescr); } if (ast.accTitle) { - db7.setAccTitle?.(ast.accTitle); + db8.setAccTitle?.(ast.accTitle); } if (ast.title) { - db7.setDiagramTitle?.(ast.title); + db8.setDiagramTitle?.(ast.title); } } var init_populateCommonDb = __esm({ @@ -71429,17 +72681,17 @@ ${content}`; }, "getOptions"); commit = /* @__PURE__ */ __name(function(commitDB) { let msg = commitDB.msg; - let id26 = commitDB.id; + let id27 = commitDB.id; const type3 = commitDB.type; let tags2 = commitDB.tags; - log.info("commit", msg, id26, type3, tags2); - log.debug("Entering commit:", msg, id26, type3, tags2); + log.info("commit", msg, id27, type3, tags2); + log.debug("Entering commit:", msg, id27, type3, tags2); const config6 = getConfig3(); - id26 = common_default.sanitizeText(id26, config6); + id27 = common_default.sanitizeText(id27, config6); msg = common_default.sanitizeText(msg, config6); tags2 = tags2?.map((tag2) => common_default.sanitizeText(tag2, config6)); const newCommit = { - id: id26 ? id26 : state2.records.seq + "-" + getID(), + id: id27 ? id27 : state2.records.seq + "-" + getID(), message: msg, seq: state2.records.seq++, type: type3 ?? commitType.NORMAL, @@ -71673,11 +72925,11 @@ ${content}`; throw error3; } else { state2.records.currBranch = branch2; - const id26 = state2.records.branches.get(state2.records.currBranch); - if (id26 === void 0 || !id26) { + const id27 = state2.records.branches.get(state2.records.currBranch); + if (id27 === void 0 || !id27) { state2.records.head = null; } else { - state2.records.head = state2.records.commits.get(id26) ?? null; + state2.records.head = state2.records.commits.get(id27) ?? null; } } }, "checkout"); @@ -71768,26 +73020,26 @@ ${content}`; init_populateCommonDb(); init_gitGraphAst(); init_gitGraphTypes(); - populate = /* @__PURE__ */ __name((ast, db7) => { - populateCommonDb(ast, db7); + populate = /* @__PURE__ */ __name((ast, db8) => { + populateCommonDb(ast, db8); if (ast.dir) { - db7.setDirection(ast.dir); + db8.setDirection(ast.dir); } for (const statement of ast.statements) { - parseStatement(statement, db7); + parseStatement(statement, db8); } }, "populate"); - parseStatement = /* @__PURE__ */ __name((statement, db7) => { + parseStatement = /* @__PURE__ */ __name((statement, db8) => { const parsers2 = { - Commit: /* @__PURE__ */ __name((stmt) => db7.commit(parseCommit(stmt)), "Commit"), - Branch: /* @__PURE__ */ __name((stmt) => db7.branch(parseBranch(stmt)), "Branch"), - Merge: /* @__PURE__ */ __name((stmt) => db7.merge(parseMerge(stmt)), "Merge"), - Checkout: /* @__PURE__ */ __name((stmt) => db7.checkout(parseCheckout(stmt)), "Checkout"), - CherryPicking: /* @__PURE__ */ __name((stmt) => db7.cherryPick(parseCherryPicking(stmt)), "CherryPicking") + Commit: /* @__PURE__ */ __name((stmt) => db8.commit(parseCommit(stmt)), "Commit"), + Branch: /* @__PURE__ */ __name((stmt) => db8.branch(parseBranch(stmt)), "Branch"), + Merge: /* @__PURE__ */ __name((stmt) => db8.merge(parseMerge(stmt)), "Merge"), + Checkout: /* @__PURE__ */ __name((stmt) => db8.checkout(parseCheckout(stmt)), "Checkout"), + CherryPicking: /* @__PURE__ */ __name((stmt) => db8.cherryPick(parseCherryPicking(stmt)), "CherryPicking") }; - const parser21 = parsers2[statement.$type]; - if (parser21) { - parser21(statement); + const parser22 = parsers2[statement.$type]; + if (parser22) { + parser22(statement); } else { log.error(`Unknown statement type: ${statement.$type}`); } @@ -72567,22 +73819,22 @@ ${content}`; pos += 50 + (rotateCommitLabel ? 40 : 0) + (dir === "TB" || dir === "BT" ? bbox.width / 2 : 0); return pos; }, "setBranchPosition"); - draw4 = /* @__PURE__ */ __name(function(txt, id26, ver, diagObj) { + draw4 = /* @__PURE__ */ __name(function(txt, id27, ver, diagObj) { clear11(); - log.debug("in gitgraph renderer", txt + "\n", "id:", id26, ver); + log.debug("in gitgraph renderer", txt + "\n", "id:", id27, ver); if (!DEFAULT_GITGRAPH_CONFIG2) { throw new Error("GitGraph config not found"); } const rotateCommitLabel = DEFAULT_GITGRAPH_CONFIG2.rotateCommitLabel ?? false; - const db7 = diagObj.db; - allCommitsDict = db7.getCommits(); - const branches = db7.getBranchesAsObjArray(); - dir = db7.getDirection(); - const diagram23 = select_default2(`[id="${id26}"]`); + const db8 = diagObj.db; + allCommitsDict = db8.getCommits(); + const branches = db8.getBranchesAsObjArray(); + dir = db8.getDirection(); + const diagram24 = select_default2(`[id="${id27}"]`); let pos = 0; branches.forEach((branch2, index) => { const labelElement = drawText2(branch2.name); - const g2 = diagram23.append("g"); + const g2 = diagram24.append("g"); const branchLabel = g2.insert("g").attr("class", "branchLabel"); const label = branchLabel.insert("g").attr("class", "label branch-label"); label.node()?.appendChild(labelElement); @@ -72592,21 +73844,21 @@ ${content}`; branchLabel.remove(); g2.remove(); }); - drawCommits(diagram23, allCommitsDict, false); + drawCommits(diagram24, allCommitsDict, false); if (DEFAULT_GITGRAPH_CONFIG2.showBranches) { - drawBranches(diagram23, branches); + drawBranches(diagram24, branches); } - drawArrows(diagram23, allCommitsDict); - drawCommits(diagram23, allCommitsDict, true); + drawArrows(diagram24, allCommitsDict); + drawCommits(diagram24, allCommitsDict, true); utils_default2.insertTitle( - diagram23, + diagram24, "gitTitleText", DEFAULT_GITGRAPH_CONFIG2.titleTopMargin ?? 0, - db7.getDiagramTitle() + db8.getDiagramTitle() ); setupGraphViewbox2( void 0, - diagram23, + diagram24, DEFAULT_GITGRAPH_CONFIG2.diagramPadding, DEFAULT_GITGRAPH_CONFIG2.useMaxWidth ); @@ -73095,7 +74347,7 @@ ${content}`; for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 36, 38, 40], $V1 = [1, 26], $V2 = [1, 27], $V3 = [1, 28], $V4 = [1, 29], $V5 = [1, 30], $V6 = [1, 31], $V7 = [1, 32], $V8 = [1, 33], $V9 = [1, 34], $Va = [1, 9], $Vb = [1, 10], $Vc = [1, 11], $Vd = [1, 12], $Ve = [1, 13], $Vf = [1, 14], $Vg = [1, 15], $Vh = [1, 16], $Vi = [1, 19], $Vj = [1, 20], $Vk = [1, 21], $Vl = [1, 22], $Vm = [1, 23], $Vn = [1, 25], $Vo = [1, 35]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -73304,21 +74556,21 @@ ${content}`; return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -73337,7 +74589,7 @@ ${content}`; }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -73854,13 +75106,13 @@ ${content}`; }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser6.parser = parser6; @@ -73868,9 +75120,9 @@ ${content}`; } }); - // ../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/isoWeek.js + // ../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isoWeek.js var require_isoWeek = __commonJS({ - "../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/isoWeek.js"(exports2, module2) { + "../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/isoWeek.js"(exports2, module2) { "use strict"; !function(e3, t4) { "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t4() : "function" == typeof define && define.amd ? define(t4) : (e3 = "undefined" != typeof globalThis ? globalThis : e3 || self).dayjs_plugin_isoWeek = t4(); @@ -73900,33 +75152,33 @@ ${content}`; } }); - // ../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/customParseFormat.js + // ../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/customParseFormat.js var require_customParseFormat = __commonJS({ - "../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/customParseFormat.js"(exports2, module2) { + "../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/customParseFormat.js"(exports2, module2) { "use strict"; !function(e3, t4) { "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t4() : "function" == typeof define && define.amd ? define(t4) : (e3 = "undefined" != typeof globalThis ? globalThis : e3 || self).dayjs_plugin_customParseFormat = t4(); }(exports2, function() { "use strict"; - var e3 = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t4 = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n2 = /\d\d/, r2 = /\d\d?/, i2 = /\d*[^-_:/,()\s\d]+/, o2 = {}, s2 = /* @__PURE__ */ __name(function(e4) { + var e3 = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t4 = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n2 = /\d/, r2 = /\d\d/, i2 = /\d\d?/, o2 = /\d*[^-_:/,()\s\d]+/, s2 = {}, a2 = /* @__PURE__ */ __name(function(e4) { return (e4 = +e4) + (e4 > 68 ? 1900 : 2e3); - }, "s"); - var a2 = /* @__PURE__ */ __name(function(e4) { + }, "a"); + var f3 = /* @__PURE__ */ __name(function(e4) { return function(t5) { this[e4] = +t5; }; - }, "a"), f3 = [/[+-]\d\d:?(\d\d)?|Z/, function(e4) { + }, "f"), h2 = [/[+-]\d\d:?(\d\d)?|Z/, function(e4) { (this.zone || (this.zone = {})).offset = function(e6) { if (!e6) return 0; if ("Z" === e6) return 0; var t5 = e6.match(/([+-]|\d\d)/g), n3 = 60 * t5[1] + (+t5[2] || 0); return 0 === n3 ? 0 : "+" === t5[0] ? -n3 : n3; }(e4); - }], h2 = /* @__PURE__ */ __name(function(e4) { - var t5 = o2[e4]; + }], u2 = /* @__PURE__ */ __name(function(e4) { + var t5 = s2[e4]; return t5 && (t5.indexOf ? t5 : t5.s.concat(t5.f)); - }, "h"), u2 = /* @__PURE__ */ __name(function(e4, t5) { - var n3, r3 = o2.meridiem; + }, "u"), d2 = /* @__PURE__ */ __name(function(e4, t5) { + var n3, r3 = s2.meridiem; if (r3) { for (var i3 = 1; i3 <= 24; i3 += 1) if (e4.indexOf(r3(i3, 0, t5)) > -1) { n3 = i3 > 12; @@ -73934,50 +75186,52 @@ ${content}`; } } else n3 = e4 === (t5 ? "pm" : "PM"); return n3; - }, "u"), d2 = { A: [i2, function(e4) { - this.afternoon = u2(e4, false); - }], a: [i2, function(e4) { - this.afternoon = u2(e4, true); - }], S: [/\d/, function(e4) { + }, "d"), c3 = { A: [o2, function(e4) { + this.afternoon = d2(e4, false); + }], a: [o2, function(e4) { + this.afternoon = d2(e4, true); + }], Q: [n2, function(e4) { + this.month = 3 * (e4 - 1) + 1; + }], S: [n2, function(e4) { this.milliseconds = 100 * +e4; - }], SS: [n2, function(e4) { + }], SS: [r2, function(e4) { this.milliseconds = 10 * +e4; }], SSS: [/\d{3}/, function(e4) { this.milliseconds = +e4; - }], s: [r2, a2("seconds")], ss: [r2, a2("seconds")], m: [r2, a2("minutes")], mm: [r2, a2("minutes")], H: [r2, a2("hours")], h: [r2, a2("hours")], HH: [r2, a2("hours")], hh: [r2, a2("hours")], D: [r2, a2("day")], DD: [n2, a2("day")], Do: [i2, function(e4) { - var t5 = o2.ordinal, n3 = e4.match(/\d+/); + }], s: [i2, f3("seconds")], ss: [i2, f3("seconds")], m: [i2, f3("minutes")], mm: [i2, f3("minutes")], H: [i2, f3("hours")], h: [i2, f3("hours")], HH: [i2, f3("hours")], hh: [i2, f3("hours")], D: [i2, f3("day")], DD: [r2, f3("day")], Do: [o2, function(e4) { + var t5 = s2.ordinal, n3 = e4.match(/\d+/); if (this.day = n3[0], t5) for (var r3 = 1; r3 <= 31; r3 += 1) t5(r3).replace(/\[|\]/g, "") === e4 && (this.day = r3); - }], M: [r2, a2("month")], MM: [n2, a2("month")], MMM: [i2, function(e4) { - var t5 = h2("months"), n3 = (h2("monthsShort") || t5.map(function(e6) { + }], w: [i2, f3("week")], ww: [r2, f3("week")], M: [i2, f3("month")], MM: [r2, f3("month")], MMM: [o2, function(e4) { + var t5 = u2("months"), n3 = (u2("monthsShort") || t5.map(function(e6) { return e6.slice(0, 3); })).indexOf(e4) + 1; if (n3 < 1) throw new Error(); this.month = n3 % 12 || n3; - }], MMMM: [i2, function(e4) { - var t5 = h2("months").indexOf(e4) + 1; + }], MMMM: [o2, function(e4) { + var t5 = u2("months").indexOf(e4) + 1; if (t5 < 1) throw new Error(); this.month = t5 % 12 || t5; - }], Y: [/[+-]?\d+/, a2("year")], YY: [n2, function(e4) { - this.year = s2(e4); - }], YYYY: [/\d{4}/, a2("year")], Z: f3, ZZ: f3 }; - function c3(n3) { + }], Y: [/[+-]?\d+/, f3("year")], YY: [r2, function(e4) { + this.year = a2(e4); + }], YYYY: [/\d{4}/, f3("year")], Z: h2, ZZ: h2 }; + function l2(n3) { var r3, i3; - r3 = n3, i3 = o2 && o2.formats; - for (var s3 = (n3 = r3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t5, n4, r4) { - var o3 = r4 && r4.toUpperCase(); - return n4 || i3[r4] || e3[r4] || i3[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e4, t6, n5) { + r3 = n3, i3 = s2 && s2.formats; + for (var o3 = (n3 = r3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t5, n4, r4) { + var o4 = r4 && r4.toUpperCase(); + return n4 || i3[r4] || e3[r4] || i3[o4].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e4, t6, n5) { return t6 || n5.slice(1); }); - })).match(t4), a3 = s3.length, f4 = 0; f4 < a3; f4 += 1) { - var h3 = s3[f4], u3 = d2[h3], c4 = u3 && u3[0], l2 = u3 && u3[1]; - s3[f4] = l2 ? { regex: c4, parser: l2 } : h3.replace(/^\[|\]$/g, ""); + })).match(t4), a3 = o3.length, f4 = 0; f4 < a3; f4 += 1) { + var h3 = o3[f4], u3 = c3[h3], d3 = u3 && u3[0], l3 = u3 && u3[1]; + o3[f4] = l3 ? { regex: d3, parser: l3 } : h3.replace(/^\[|\]$/g, ""); } return function(e4) { for (var t5 = {}, n4 = 0, r4 = 0; n4 < a3; n4 += 1) { - var i4 = s3[n4]; + var i4 = o3[n4]; if ("string" == typeof i4) r4 += i4.length; else { - var o3 = i4.regex, f5 = i4.parser, h4 = e4.slice(r4), u4 = o3.exec(h4)[0]; + var s3 = i4.regex, f5 = i4.parser, h4 = e4.slice(r4), u4 = s3.exec(h4)[0]; f5.call(t5, u4), e4 = e4.replace(u4, ""); } } @@ -73990,35 +75244,35 @@ ${content}`; }(t5), t5; }; } - __name(c3, "c"); + __name(l2, "l"); return function(e4, t5, n3) { - n3.p.customParseFormat = true, e4 && e4.parseTwoDigitYear && (s2 = e4.parseTwoDigitYear); + n3.p.customParseFormat = true, e4 && e4.parseTwoDigitYear && (a2 = e4.parseTwoDigitYear); var r3 = t5.prototype, i3 = r3.parse; r3.parse = function(e6) { - var t6 = e6.date, r4 = e6.utc, s3 = e6.args; + var t6 = e6.date, r4 = e6.utc, o3 = e6.args; this.$u = r4; - var a3 = s3[1]; + var a3 = o3[1]; if ("string" == typeof a3) { - var f4 = true === s3[2], h3 = true === s3[3], u3 = f4 || h3, d3 = s3[2]; - h3 && (d3 = s3[2]), o2 = this.$locale(), !f4 && d3 && (o2 = n3.Ls[d3]), this.$d = function(e7, t7, n4) { + var f4 = true === o3[2], h3 = true === o3[3], u3 = f4 || h3, d3 = o3[2]; + h3 && (d3 = o3[2]), s2 = this.$locale(), !f4 && d3 && (s2 = n3.Ls[d3]), this.$d = function(e7, t7, n4, r5) { try { if (["x", "X"].indexOf(t7) > -1) return new Date(("X" === t7 ? 1e3 : 1) * e7); - var r5 = c3(t7)(e7), i4 = r5.year, o3 = r5.month, s4 = r5.day, a4 = r5.hours, f5 = r5.minutes, h4 = r5.seconds, u4 = r5.milliseconds, d4 = r5.zone, l3 = /* @__PURE__ */ new Date(), m3 = s4 || (i4 || o3 ? 1 : l3.getDate()), M3 = i4 || l3.getFullYear(), Y3 = 0; - i4 && !o3 || (Y3 = o3 > 0 ? o3 - 1 : l3.getMonth()); - var p3 = a4 || 0, v3 = f5 || 0, D3 = h4 || 0, g2 = u4 || 0; - return d4 ? new Date(Date.UTC(M3, Y3, m3, p3, v3, D3, g2 + 60 * d4.offset * 1e3)) : n4 ? new Date(Date.UTC(M3, Y3, m3, p3, v3, D3, g2)) : new Date(M3, Y3, m3, p3, v3, D3, g2); + var i4 = l2(t7)(e7), o4 = i4.year, s3 = i4.month, a4 = i4.day, f5 = i4.hours, h4 = i4.minutes, u4 = i4.seconds, d4 = i4.milliseconds, c5 = i4.zone, m3 = i4.week, M3 = /* @__PURE__ */ new Date(), Y3 = a4 || (o4 || s3 ? 1 : M3.getDate()), p3 = o4 || M3.getFullYear(), v3 = 0; + o4 && !s3 || (v3 = s3 > 0 ? s3 - 1 : M3.getMonth()); + var D3, w3 = f5 || 0, g2 = h4 || 0, y5 = u4 || 0, L2 = d4 || 0; + return c5 ? new Date(Date.UTC(p3, v3, Y3, w3, g2, y5, L2 + 60 * c5.offset * 1e3)) : n4 ? new Date(Date.UTC(p3, v3, Y3, w3, g2, y5, L2)) : (D3 = new Date(p3, v3, Y3, w3, g2, y5, L2), m3 && (D3 = r5(D3).week(m3).toDate()), D3); } catch (e8) { return /* @__PURE__ */ new Date(""); } - }(t6, a3, r4), this.init(), d3 && true !== d3 && (this.$L = this.locale(d3).$L), u3 && t6 != this.format(a3) && (this.$d = /* @__PURE__ */ new Date("")), o2 = {}; - } else if (a3 instanceof Array) for (var l2 = a3.length, m2 = 1; m2 <= l2; m2 += 1) { - s3[1] = a3[m2 - 1]; - var M2 = n3.apply(this, s3); + }(t6, a3, r4, n3), this.init(), d3 && true !== d3 && (this.$L = this.locale(d3).$L), u3 && t6 != this.format(a3) && (this.$d = /* @__PURE__ */ new Date("")), s2 = {}; + } else if (a3 instanceof Array) for (var c4 = a3.length, m2 = 1; m2 <= c4; m2 += 1) { + o3[1] = a3[m2 - 1]; + var M2 = n3.apply(this, o3); if (M2.isValid()) { this.$d = M2.$d, this.$L = M2.$L, this.init(); break; } - m2 === l2 && (this.$d = /* @__PURE__ */ new Date("")); + m2 === c4 && (this.$d = /* @__PURE__ */ new Date("")); } else i3.call(this, e6); }; @@ -74027,9 +75281,9 @@ ${content}`; } }); - // ../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/advancedFormat.js + // ../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/advancedFormat.js var require_advancedFormat = __commonJS({ - "../../node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/advancedFormat.js"(exports2, module2) { + "../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/advancedFormat.js"(exports2, module2) { "use strict"; !function(e3, t4) { "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t4() : "function" == typeof define && define.amd ? define(t4) : (e3 = "undefined" != typeof globalThis ? globalThis : e3 || self).dayjs_plugin_advancedFormat = t4(); @@ -74087,8 +75341,8 @@ ${content}`; matchFound = false; tags2.forEach(function(t4) { const pattern = "^\\s*" + t4 + "\\s*$"; - const regex = new RegExp(pattern); - if (data5[0].match(regex)) { + const regex2 = new RegExp(pattern); + if (data5[0].match(regex2)) { task[t4] = true; data5.shift(1); matchFound = true; @@ -74299,8 +75553,8 @@ ${content}`; const afterStatement = afterRePattern.exec(str2); if (afterStatement !== null) { let latestTask = null; - for (const id26 of afterStatement.groups.ids.split(" ")) { - let task = findTaskById(id26); + for (const id27 of afterStatement.groups.ids.split(" ")) { + let task = findTaskById(id27); if (task !== void 0 && (!latestTask || task.endTime > latestTask.endTime)) { latestTask = task; } @@ -74343,8 +75597,8 @@ ${content}`; const untilStatement = untilRePattern.exec(str2); if (untilStatement !== null) { let earliestTask = null; - for (const id26 of untilStatement.groups.ids.split(" ")) { - let task = findTaskById(id26); + for (const id27 of untilStatement.groups.ids.split(" ")) { + let task = findTaskById(id27); if (task !== void 0 && (!earliestTask || task.startTime < earliestTask.startTime)) { earliestTask = task; } @@ -74496,8 +75750,8 @@ ${content}`; lastTaskID = rawTask.id; taskDb[rawTask.id] = pos - 1; }, "addTask"); - findTaskById = /* @__PURE__ */ __name(function(id26) { - const pos = taskDb[id26]; + findTaskById = /* @__PURE__ */ __name(function(id27) { + const pos = taskDb[id27]; return rawTasks[pos]; }, "findTaskById"); addTaskOrg = /* @__PURE__ */ __name(function(descr, data5) { @@ -74567,26 +75821,26 @@ ${content}`; if (getConfig2().securityLevel !== "loose") { linkStr = (0, import_sanitize_url4.sanitizeUrl)(_linkStr); } - ids.split(",").forEach(function(id26) { - let rawTask = findTaskById(id26); + ids.split(",").forEach(function(id27) { + let rawTask = findTaskById(id27); if (rawTask !== void 0) { - pushFun(id26, () => { + pushFun(id27, () => { window.open(linkStr, "_self"); }); - links.set(id26, linkStr); + links.set(id27, linkStr); } }); setClass2(ids, "clickable"); }, "setLink"); setClass2 = /* @__PURE__ */ __name(function(ids, className) { - ids.split(",").forEach(function(id26) { - let rawTask = findTaskById(id26); + ids.split(",").forEach(function(id27) { + let rawTask = findTaskById(id27); if (rawTask !== void 0) { rawTask.classes.push(className); } }); }, "setClass"); - setClickFun2 = /* @__PURE__ */ __name(function(id26, functionName, functionArgs) { + setClickFun2 = /* @__PURE__ */ __name(function(id27, functionName, functionArgs) { if (getConfig2().securityLevel !== "loose") { return; } @@ -74605,19 +75859,19 @@ ${content}`; } } if (argList.length === 0) { - argList.push(id26); + argList.push(id27); } - let rawTask = findTaskById(id26); + let rawTask = findTaskById(id27); if (rawTask !== void 0) { - pushFun(id26, () => { + pushFun(id27, () => { utils_default2.runFunc(functionName, ...argList); }); } }, "setClickFun"); - pushFun = /* @__PURE__ */ __name(function(id26, callbackFunction) { + pushFun = /* @__PURE__ */ __name(function(id27, callbackFunction) { funs2.push( function() { - const elem = document.querySelector(`[id="${id26}"]`); + const elem = document.querySelector(`[id="${id27}"]`); if (elem !== null) { elem.addEventListener("click", function() { callbackFunction(); @@ -74625,7 +75879,7 @@ ${content}`; } }, function() { - const elem = document.querySelector(`[id="${id26}-text"]`); + const elem = document.querySelector(`[id="${id27}-text"]`); if (elem !== null) { elem.addEventListener("click", function() { callbackFunction(); @@ -74635,8 +75889,8 @@ ${content}`; ); }, "pushFun"); setClickEvent2 = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) { - ids.split(",").forEach(function(id26) { - setClickFun2(id26, functionName, functionArgs); + ids.split(",").forEach(function(id27) { + setClickFun2(id27, functionName, functionArgs); }); setClass2(ids, "clickable"); }, "setClickEvent"); @@ -74733,16 +75987,16 @@ ${content}`; } return maxIntersections; }, "getMaxIntersections"); - draw5 = /* @__PURE__ */ __name(function(text2, id26, version4, diagObj) { + draw5 = /* @__PURE__ */ __name(function(text2, id27, version4, diagObj) { const conf8 = getConfig2().gantt; const securityLevel = getConfig2().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - const elem = doc.getElementById(id26); + const elem = doc.getElementById(id27); w2 = elem.parentElement.offsetWidth; if (w2 === void 0) { w2 = 1200; @@ -74781,7 +76035,7 @@ ${content}`; } } elem.setAttribute("viewBox", "0 0 " + w2 + " " + h2); - const svg = root4.select(`[id="${id26}"]`); + const svg = root4.select(`[id="${id27}"]`); const timeScale = time().domain([ min(taskArray, function(d2) { return d2.startTime; @@ -74830,7 +76084,7 @@ ${content}`; __name(makeGantt, "makeGantt"); function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w3) { const uniqueTaskOrderIds = [...new Set(theArray.map((item) => item.order))]; - const uniqueTasks = uniqueTaskOrderIds.map((id27) => theArray.find((item) => item.order === id27)); + const uniqueTasks = uniqueTaskOrderIds.map((id28) => theArray.find((item) => item.order === id28)); svg.append("g").selectAll("rect").data(uniqueTasks).enter().append("rect").attr("x", 0).attr("y", function(d2, i2) { i2 = d2.order; return i2 * theGap + theTopPad - 2; @@ -74982,7 +76236,7 @@ ${content}`; const securityLevel2 = getConfig2().securityLevel; if (securityLevel2 === "sandbox") { let sandboxElement2; - sandboxElement2 = select_default2("#i" + id26); + sandboxElement2 = select_default2("#i" + id27); const doc2 = sandboxElement2.nodes()[0].contentDocument; rectangles.filter(function(d2) { return links3.has(d2.id); @@ -75502,7 +76756,7 @@ ${content}`; var version2; var init_package = __esm({ "package.json"() { - version2 = "11.0.2"; + version2 = "11.1.0"; } }); @@ -75527,15 +76781,15 @@ ${content}`; "use strict"; init_src32(); init_diagramAPI(); - selectSvgElement = /* @__PURE__ */ __name((id26) => { + selectSvgElement = /* @__PURE__ */ __name((id27) => { const { securityLevel } = getConfig2(); let root4 = select_default2("body"); if (securityLevel === "sandbox") { - const sandboxElement = select_default2(`#i${id26}`); + const sandboxElement = select_default2(`#i${id27}`); const doc = sandboxElement.node()?.contentDocument ?? document; root4 = select_default2(doc.body); } - const svg = root4.select(`#${id26}`); + const svg = root4.select(`#${id27}`); return svg; }, "selectSvgElement"); } @@ -75549,9 +76803,9 @@ ${content}`; init_logger(); init_selectSvgElement(); init_setupGraphViewbox(); - draw6 = /* @__PURE__ */ __name((text2, id26, version4) => { + draw6 = /* @__PURE__ */ __name((text2, id27, version4) => { log.debug("rendering info diagram\n" + text2); - const svg = selectSvgElement(id26); + const svg = selectSvgElement(id27); configureSvgSize(svg, 100, 400, true); const group2 = svg.append("g"); group2.append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", 32).style("text-anchor", "middle").text(`v${version4}`); @@ -75640,10 +76894,10 @@ ${content}`; init_logger(); init_populateCommonDb(); init_pieDb(); - populateDb = /* @__PURE__ */ __name((ast, db7) => { - populateCommonDb(ast, db7); - db7.setShowData(ast.showData); - ast.sections.map(db7.addSection); + populateDb = /* @__PURE__ */ __name((ast, db8) => { + populateCommonDb(ast, db8); + db8.setShowData(ast.showData); + ast.sections.map(db8.addSection); }, "populateDb"); parser8 = { parse: /* @__PURE__ */ __name(async (input) => { @@ -75718,17 +76972,17 @@ ${content}`; ); return pie2(pieData); }, "createPieArcs"); - draw7 = /* @__PURE__ */ __name((text2, id26, _version, diagObj) => { + draw7 = /* @__PURE__ */ __name((text2, id27, _version, diagObj) => { log.debug("rendering pie chart\n" + text2); - const db7 = diagObj.db; + const db8 = diagObj.db; const globalConfig = getConfig2(); - const pieConfig = cleanAndMerge(db7.getConfig(), globalConfig.pie); + const pieConfig = cleanAndMerge(db8.getConfig(), globalConfig.pie); const MARGIN = 40; const LEGEND_RECT_SIZE = 18; const LEGEND_SPACING = 4; const height2 = 450; const pieWidth = height2; - const svg = selectSvgElement(id26); + const svg = selectSvgElement(id27); const group2 = svg.append("g"); group2.attr("transform", "translate(" + pieWidth / 2 + "," + height2 / 2 + ")"); const { themeVariables } = globalConfig; @@ -75739,7 +76993,7 @@ ${content}`; const arcGenerator = arc_default().innerRadius(0).outerRadius(radius2); const labelArcGenerator = arc_default().innerRadius(radius2 * textPosition).outerRadius(radius2 * textPosition); group2.append("circle").attr("cx", 0).attr("cy", 0).attr("r", radius2 + outerStrokeWidth / 2).attr("class", "pieOuterCircle"); - const sections5 = db7.getSections(); + const sections5 = db8.getSections(); const arcs = createPieArcs(sections5); const myGeneratedColors = [ themeVariables.pie1, @@ -75768,7 +77022,7 @@ ${content}`; }).attr("transform", (datum2) => { return "translate(" + labelArcGenerator.centroid(datum2) + ")"; }).style("text-anchor", "middle").attr("class", "slice"); - group2.append("text").text(db7.getDiagramTitle()).attr("x", 0).attr("y", -(height2 - 50) / 2).attr("class", "pieTitleText"); + group2.append("text").text(db8.getDiagramTitle()).attr("x", 0).attr("y", -(height2 - 50) / 2).attr("class", "pieTitleText"); const legend = group2.selectAll(".legend").data(color2.domain()).enter().append("g").attr("class", "legend").attr("transform", (_datum, index) => { const height3 = LEGEND_RECT_SIZE + LEGEND_SPACING; const offset = height3 * color2.domain().length / 2; @@ -75779,7 +77033,7 @@ ${content}`; legend.append("rect").attr("width", LEGEND_RECT_SIZE).attr("height", LEGEND_RECT_SIZE).style("fill", color2).style("stroke", color2); legend.data(arcs).append("text").attr("x", LEGEND_RECT_SIZE + LEGEND_SPACING).attr("y", LEGEND_RECT_SIZE - LEGEND_SPACING).text((datum2) => { const { label, value: value2 } = datum2.data; - if (db7.getShowData()) { + if (db8.getShowData()) { return `${label} [${value2}]`; } return label; @@ -75827,7 +77081,7 @@ ${content}`; for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [1, 7], $V5 = [1, 4, 5, 10, 12, 13, 14, 18, 25, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], $V6 = [1, 4, 5, 10, 12, 13, 14, 18, 25, 28, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], $V7 = [55, 56, 57], $V8 = [2, 36], $V9 = [1, 37], $Va = [1, 36], $Vb = [1, 38], $Vc = [1, 35], $Vd = [1, 43], $Ve = [1, 41], $Vf = [1, 14], $Vg = [1, 23], $Vh = [1, 18], $Vi = [1, 19], $Vj = [1, 20], $Vk = [1, 21], $Vl = [1, 22], $Vm = [1, 24], $Vn = [1, 25], $Vo = [1, 26], $Vp = [1, 27], $Vq = [1, 28], $Vr = [1, 29], $Vs = [1, 32], $Vt = [1, 33], $Vu = [1, 34], $Vv = [1, 39], $Vw = [1, 40], $Vx = [1, 42], $Vy = [1, 44], $Vz = [1, 62], $VA = [1, 61], $VB = [4, 5, 8, 10, 12, 13, 14, 18, 44, 47, 49, 55, 56, 57, 63, 64, 65, 66, 67], $VC = [1, 65], $VD = [1, 66], $VE = [1, 67], $VF = [1, 68], $VG = [1, 69], $VH = [1, 70], $VI = [1, 71], $VJ = [1, 72], $VK = [1, 73], $VL = [1, 74], $VM = [1, 75], $VN = [1, 76], $VO = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18], $VP = [1, 90], $VQ = [1, 91], $VR = [1, 92], $VS = [1, 99], $VT = [1, 93], $VU = [1, 96], $VV = [1, 94], $VW = [1, 95], $VX = [1, 97], $VY = [1, 98], $VZ = [1, 102], $V_ = [10, 55, 56, 57], $V$ = [4, 5, 6, 8, 10, 11, 13, 17, 18, 19, 20, 55, 56, 57]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -75997,21 +77251,21 @@ ${content}`; return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -76030,7 +77284,7 @@ ${content}`; }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -76551,13 +77805,13 @@ ${content}`; }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser9.parser = parser9; @@ -77184,7 +78438,7 @@ ${content}`; init_diagramAPI(); init_logger(); init_setupGraphViewbox(); - draw8 = /* @__PURE__ */ __name((txt, id26, _version, diagObj) => { + draw8 = /* @__PURE__ */ __name((txt, id27, _version, diagObj) => { function getDominantBaseLine(horizontalPos) { return horizontalPos === "top" ? "hanging" : "middle"; } @@ -77202,10 +78456,10 @@ ${content}`; const securityLevel = conf8.securityLevel; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); - const svg = root4.select(`[id="${id26}"]`); + const svg = root4.select(`[id="${id27}"]`); const group2 = svg.append("g").attr("class", "main"); const width3 = conf8.quadrantChart?.chartWidth ?? 500; const height2 = conf8.quadrantChart?.chartHeight ?? 500; @@ -77277,7 +78531,7 @@ ${content}`; for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 10, 12, 14, 16, 18, 19, 21, 23], $V1 = [2, 6], $V2 = [1, 3], $V3 = [1, 5], $V4 = [1, 6], $V5 = [1, 7], $V6 = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], $V7 = [1, 25], $V8 = [1, 26], $V9 = [1, 28], $Va = [1, 29], $Vb = [1, 30], $Vc = [1, 31], $Vd = [1, 32], $Ve = [1, 33], $Vf = [1, 34], $Vg = [1, 35], $Vh = [1, 36], $Vi = [1, 37], $Vj = [1, 43], $Vk = [1, 42], $Vl = [1, 47], $Vm = [1, 50], $Vn = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], $Vo = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], $Vp = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], $Vq = [1, 64]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -77430,21 +78684,21 @@ ${content}`; return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -77463,7 +78717,7 @@ ${content}`; }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -77967,13 +79221,13 @@ ${content}`; }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser10.parser = parser10; @@ -79181,10 +80435,10 @@ ${content}`; init_logger(); init_selectSvgElement(); init_setupGraphViewbox(); - draw9 = /* @__PURE__ */ __name((txt, id26, _version, diagObj) => { - const db7 = diagObj.db; - const themeConfig = db7.getChartThemeConfig(); - const chartConfig = db7.getChartConfig(); + draw9 = /* @__PURE__ */ __name((txt, id27, _version, diagObj) => { + const db8 = diagObj.db; + const themeConfig = db8.getChartThemeConfig(); + const chartConfig = db8.getChartConfig(); function getDominantBaseLine(horizontalPos) { return horizontalPos === "top" ? "text-before-edge" : "middle"; } @@ -79198,14 +80452,14 @@ ${content}`; } __name(getTextTransformation, "getTextTransformation"); log.debug("Rendering xychart chart\n" + txt); - const svg = selectSvgElement(id26); + const svg = selectSvgElement(id27); const group2 = svg.append("g").attr("class", "main"); const background = group2.append("rect").attr("width", chartConfig.width).attr("height", chartConfig.height).attr("class", "background"); configureSvgSize(svg, chartConfig.height, chartConfig.width, true); svg.attr("viewBox", `0 0 ${chartConfig.width} ${chartConfig.height}`); background.attr("fill", themeConfig.backgroundColor); - db7.setTmpSVGG(svg.append("g").attr("class", "mermaid-tmp-group")); - const shapes5 = db7.getDrawableElem(); + db8.setTmpSVGG(svg.append("g").attr("class", "mermaid-tmp-group")); + const shapes5 = db8.getDrawableElem(); const groups = {}; function getGroup(gList) { let elem = group2; @@ -79278,7 +80532,7 @@ ${content}`; for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [5, 6, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63], $V5 = [1, 18], $V6 = [2, 7], $V7 = [1, 22], $V8 = [1, 23], $V9 = [1, 24], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 20], $Ve = [1, 28], $Vf = [1, 29], $Vg = [62, 63], $Vh = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 51, 53, 62, 63], $Vi = [1, 47], $Vj = [1, 48], $Vk = [1, 49], $Vl = [1, 50], $Vm = [1, 51], $Vn = [1, 52], $Vo = [1, 53], $Vp = [53, 54], $Vq = [1, 64], $Vr = [1, 60], $Vs = [1, 61], $Vt = [1, 62], $Vu = [1, 63], $Vv = [1, 65], $Vw = [1, 69], $Vx = [1, 70], $Vy = [1, 67], $Vz = [1, 68], $VA = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -79446,21 +80700,21 @@ ${content}`; return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -79479,7 +80733,7 @@ ${content}`; }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -79991,13 +81245,13 @@ ${content}`; }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser11.parser = parser11; @@ -80061,9 +81315,9 @@ ${content}`; return requirements.get(name); }, "addRequirement"); getRequirements = /* @__PURE__ */ __name(() => requirements, "getRequirements"); - setNewReqId = /* @__PURE__ */ __name((id26) => { + setNewReqId = /* @__PURE__ */ __name((id27) => { if (latestRequirement !== void 0) { - latestRequirement.id = id26; + latestRequirement.id = id27; } }, "setNewReqId"); setNewReqText = /* @__PURE__ */ __name((text2) => { @@ -80244,12 +81498,12 @@ ${content}`; init_requirementMarkers(); conf3 = {}; relCnt2 = 0; - newRectNode = /* @__PURE__ */ __name((parentNode, id26) => { - return parentNode.insert("rect", "#" + id26).attr("class", "req reqBox").attr("x", 0).attr("y", 0).attr("width", conf3.rect_min_width + "px").attr("height", conf3.rect_min_height + "px"); + newRectNode = /* @__PURE__ */ __name((parentNode, id27) => { + return parentNode.insert("rect", "#" + id27).attr("class", "req reqBox").attr("x", 0).attr("y", 0).attr("width", conf3.rect_min_width + "px").attr("height", conf3.rect_min_height + "px"); }, "newRectNode"); - newTitleNode = /* @__PURE__ */ __name((parentNode, id26, txts) => { + newTitleNode = /* @__PURE__ */ __name((parentNode, id27, txts) => { let x5 = conf3.rect_min_width / 2; - let title2 = parentNode.append("text").attr("class", "req reqLabel reqTitle").attr("id", id26).attr("x", x5).attr("y", conf3.rect_padding).attr("dominant-baseline", "hanging"); + let title2 = parentNode.append("text").attr("class", "req reqLabel reqTitle").attr("id", id27).attr("x", x5).attr("y", conf3.rect_padding).attr("dominant-baseline", "hanging"); let i2 = 0; txts.forEach((textStr) => { if (i2 == 0) { @@ -80268,8 +81522,8 @@ ${content}`; y: totalY }; }, "newTitleNode"); - newBodyNode = /* @__PURE__ */ __name((parentNode, id26, txts, yStart) => { - let body = parentNode.append("text").attr("class", "req reqLabel").attr("id", id26).attr("x", conf3.rect_padding).attr("y", yStart).attr("dominant-baseline", "hanging"); + newBodyNode = /* @__PURE__ */ __name((parentNode, id27, txts, yStart) => { + let body = parentNode.append("text").attr("class", "req reqLabel").attr("id", id27).attr("x", conf3.rect_padding).attr("y", yStart).attr("dominant-baseline", "hanging"); let currentRow = 0; const charLimit = 30; let wrappedTxts = []; @@ -80363,9 +81617,9 @@ ${content}`; }, "drawReqs"); drawElements = /* @__PURE__ */ __name((els, graph, svgNode2) => { els.forEach((el, elName) => { - const id26 = elementString(elName); - const groupNode = svgNode2.append("g").attr("id", id26); - const textId = "element-" + id26; + const id27 = elementString(elName); + const groupNode = svgNode2.append("g").attr("id", id27); + const textId = "element-" + id27; const rectNode = newRectNode(groupNode, textId); let nodes6 = []; let titleNodeInfo = newTitleNode(groupNode, textId + "_title", [`<>`, `${elName}`]); @@ -80378,11 +81632,11 @@ ${content}`; ); nodes6.push(bodyNode); const rectBBox = rectNode.node().getBBox(); - graph.setNode(id26, { + graph.setNode(id27, { width: rectBBox.width, height: rectBBox.height, shape: "rect", - id: id26 + id: id27 }); }); }, "drawElements"); @@ -80409,15 +81663,15 @@ ${content}`; elementString = /* @__PURE__ */ __name((str2) => { return str2.replace(/\s/g, "").replace(/\./g, "_"); }, "elementString"); - draw10 = /* @__PURE__ */ __name((text2, id26, _version, diagObj) => { + draw10 = /* @__PURE__ */ __name((text2, id27, _version, diagObj) => { conf3 = getConfig2().requirement; const securityLevel = conf3.securityLevel; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); - const svg = root4.select(`[id='${id26}']`); + const svg = root4.select(`[id='${id27}']`); requirementMarkers_default.insertLineEndings(svg, conf3); const g2 = new Graph({ multigraph: false, @@ -80442,7 +81696,7 @@ ${content}`; layout(g2); adjustEntities2(svg, g2); relationships2.forEach(function(rel2) { - drawRelationshipFromLayout2(svg, rel2, g2, id26, diagObj); + drawRelationshipFromLayout2(svg, rel2, g2, id27, diagObj); }); const padding3 = conf3.rect_padding; const svgBounds = svg.node().getBBox(); @@ -80489,7 +81743,7 @@ ${content}`; for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 13], $V7 = [1, 14], $V8 = [1, 16], $V9 = [1, 17], $Va = [1, 18], $Vb = [1, 24], $Vc = [1, 25], $Vd = [1, 26], $Ve = [1, 27], $Vf = [1, 28], $Vg = [1, 29], $Vh = [1, 30], $Vi = [1, 31], $Vj = [1, 32], $Vk = [1, 33], $Vl = [1, 34], $Vm = [1, 35], $Vn = [1, 36], $Vo = [1, 37], $Vp = [1, 38], $Vq = [1, 39], $Vr = [1, 41], $Vs = [1, 42], $Vt = [1, 43], $Vu = [1, 44], $Vv = [1, 45], $Vw = [1, 46], $Vx = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], $Vy = [4, 5, 16, 50, 52, 53], $Vz = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VA = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VB = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VC = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VD = [68, 69, 70], $VE = [1, 122]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -80785,21 +82039,21 @@ ${content}`; return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -80818,7 +82072,7 @@ ${content}`; }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -81404,13 +82658,13 @@ ${content}`; }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser12.parser = parser12; @@ -81472,9 +82726,9 @@ ${content}`; }); state3.records.currentBox = state3.records.boxes.slice(-1)[0]; }, "addBox"); - addActor = /* @__PURE__ */ __name(function(id26, name, description, type3) { + addActor = /* @__PURE__ */ __name(function(id27, name, description, type3) { let assignedBox = state3.records.currentBox; - const old = state3.records.actors.get(id26); + const old = state3.records.actors.get(id27); if (old) { if (state3.records.currentBox && old.box && state3.records.currentBox !== old.box) { throw new Error( @@ -81493,7 +82747,7 @@ ${content}`; if (type3 == null || description.text == null) { description = { text: name, type: type3 }; } - state3.records.actors.set(id26, { + state3.records.actors.set(id27, { box: assignedBox, name, description: description.text, @@ -81508,13 +82762,13 @@ ${content}`; if (state3.records.prevActor) { const prevActorInRecords = state3.records.actors.get(state3.records.prevActor); if (prevActorInRecords) { - prevActorInRecords.nextActor = id26; + prevActorInRecords.nextActor = id27; } } if (state3.records.currentBox) { - state3.records.currentBox.actorKeys.push(id26); + state3.records.currentBox.actorKeys.push(id27); } - state3.records.prevActor = id26; + state3.records.prevActor = id27; }, "addActor"); activationCount = /* @__PURE__ */ __name((part) => { let i2; @@ -81587,8 +82841,8 @@ ${content}`; getDestroyedActors = /* @__PURE__ */ __name(function() { return state3.records.destroyedActors; }, "getDestroyedActors"); - getActor = /* @__PURE__ */ __name(function(id26) { - return state3.records.actors.get(id26); + getActor = /* @__PURE__ */ __name(function(id27) { + return state3.records.actors.get(id27); }, "getActor"); getActorKeys = /* @__PURE__ */ __name(function() { return [...state3.records.actors.keys()]; @@ -82302,13 +83556,13 @@ ${content}`; return polygon2; }, "drawLabel"); actorCnt = -1; - fixLifeLineHeights = /* @__PURE__ */ __name((diagram23, actors2, actorKeys, conf8) => { - if (!diagram23.select) { + fixLifeLineHeights = /* @__PURE__ */ __name((diagram24, actors2, actorKeys, conf8) => { + if (!diagram24.select) { return; } actorKeys.forEach((actorKey) => { const actor = actors2.get(actorKey); - const actorDOM = diagram23.select("#actor" + actor.actorCnt); + const actorDOM = diagram24.select("#actor" + actor.actorCnt); if (!conf8.mirrorActors && actor.stopy) { actorDOM.attr("y2", actor.stopy + actor.height / 2); } else if (conf8.mirrorActors) { @@ -83105,7 +84359,7 @@ ${content}`; this.updateVal(bounds.data, "stopy", _stopy, Math.max); this.updateBounds(_startx, _starty, _stopx, _stopy); }, "insert"), - newActivation: /* @__PURE__ */ __name(function(message, diagram23, actors2) { + newActivation: /* @__PURE__ */ __name(function(message, diagram24, actors2) { const actorRect = actors2.get(message.from); const stackedSize = actorActivations(message.from).length || 0; const x5 = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf4.activationWidth / 2; @@ -83115,7 +84369,7 @@ ${content}`; stopx: x5 + conf4.activationWidth, stopy: void 0, actor: message.from, - anchored: svgDraw_default2.anchorElement(diagram23) + anchored: svgDraw_default2.anchorElement(diagram24) }); }, "newActivation"), endActivation: /* @__PURE__ */ __name(function(message) { @@ -83233,7 +84487,7 @@ ${content}`; }; }, "actorFont"); __name(boundMessage, "boundMessage"); - drawMessage = /* @__PURE__ */ __name(async function(diagram23, msgModel, lineStartY, diagObj) { + drawMessage = /* @__PURE__ */ __name(async function(diagram24, msgModel, lineStartY, diagObj) { const { startx, stopx, starty, message, type: type3, sequenceIndex, sequenceVisible } = msgModel; const textDims = utils_default2.calculateTextDimensions(message, messageFont2(conf4)); const textObj = getTextObj(); @@ -83251,26 +84505,26 @@ ${content}`; textObj.textMargin = conf4.wrapPadding; textObj.tspan = false; if (hasKatex(textObj.text)) { - await drawKatex(diagram23, textObj, { startx, stopx, starty: lineStartY }); + await drawKatex(diagram24, textObj, { startx, stopx, starty: lineStartY }); } else { - drawText3(diagram23, textObj); + drawText3(diagram24, textObj); } const textWidth = textDims.width; let line2; if (startx === stopx) { if (conf4.rightAngles) { - line2 = diagram23.append("path").attr( + line2 = diagram24.append("path").attr( "d", `M ${startx},${lineStartY} H ${startx + common_default.getMax(conf4.width / 2, textWidth / 2)} V ${lineStartY + 25} H ${startx}` ); } else { - line2 = diagram23.append("path").attr( + line2 = diagram24.append("path").attr( "d", "M " + startx + "," + lineStartY + " C " + (startx + 60) + "," + (lineStartY - 10) + " " + (startx + 60) + "," + (lineStartY + 30) + " " + startx + "," + (lineStartY + 20) ); } } else { - line2 = diagram23.append("line"); + line2 = diagram24.append("line"); line2.attr("x1", startx); line2.attr("y1", lineStartY); line2.attr("x2", stopx); @@ -83306,10 +84560,10 @@ ${content}`; } if (sequenceVisible || conf4.showSequenceNumbers) { line2.attr("marker-start", "url(" + url + "#sequencenumber)"); - diagram23.append("text").attr("x", startx).attr("y", lineStartY + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(sequenceIndex); + diagram24.append("text").attr("x", startx).attr("y", lineStartY + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(sequenceIndex); } }, "drawMessage"); - addActorRenderingData = /* @__PURE__ */ __name(function(diagram23, actors2, createdActors, actorKeys, verticalPos, messages, isFooter) { + addActorRenderingData = /* @__PURE__ */ __name(function(diagram24, actors2, createdActors, actorKeys, verticalPos, messages, isFooter) { let prevWidth = 0; let prevMargin = 0; let prevBox = void 0; @@ -83353,11 +84607,11 @@ ${content}`; } bounds.bumpVerticalPos(maxHeight); }, "addActorRenderingData"); - drawActors = /* @__PURE__ */ __name(async function(diagram23, actors2, actorKeys, isFooter) { + drawActors = /* @__PURE__ */ __name(async function(diagram24, actors2, actorKeys, isFooter) { if (!isFooter) { for (const actorKey of actorKeys) { const actor = actors2.get(actorKey); - await svgDraw_default2.drawActor(diagram23, actor, conf4, false); + await svgDraw_default2.drawActor(diagram24, actor, conf4, false); } } else { let maxHeight = 0; @@ -83367,20 +84621,20 @@ ${content}`; if (!actor.stopy) { actor.stopy = bounds.getVerticalPos(); } - const height2 = await svgDraw_default2.drawActor(diagram23, actor, conf4, true); + const height2 = await svgDraw_default2.drawActor(diagram24, actor, conf4, true); maxHeight = common_default.getMax(maxHeight, height2); } bounds.bumpVerticalPos(maxHeight + conf4.boxMargin); } }, "drawActors"); - drawActorsPopup = /* @__PURE__ */ __name(function(diagram23, actors2, actorKeys, doc) { + drawActorsPopup = /* @__PURE__ */ __name(function(diagram24, actors2, actorKeys, doc) { let maxHeight = 0; let maxWidth = 0; for (const actorKey of actorKeys) { const actor = actors2.get(actorKey); const minMenuWidth = getRequiredPopupWidth(actor); const menuDimensions = svgDraw_default2.drawPopup( - diagram23, + diagram24, actor, minMenuWidth, conf4, @@ -83432,18 +84686,18 @@ ${content}`; }, "activationBounds"); __name(adjustLoopHeightForWrap, "adjustLoopHeightForWrap"); __name(adjustCreatedDestroyedData, "adjustCreatedDestroyedData"); - draw11 = /* @__PURE__ */ __name(async function(_text, id26, _version, diagObj) { + draw11 = /* @__PURE__ */ __name(async function(_text, id27, _version, diagObj) { const { securityLevel, sequence } = getConfig2(); conf4 = sequence; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; bounds.init(); log.debug(diagObj.db); - const diagram23 = securityLevel === "sandbox" ? root4.select(`[id="${id26}"]`) : select_default2(`[id="${id26}"]`); + const diagram24 = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`); const actors2 = diagObj.db.getActors(); const createdActors = diagObj.db.getCreatedActors(); const destroyedActors = diagObj.db.getDestroyedActors(); @@ -83455,9 +84709,9 @@ ${content}`; const hasBoxTitles = diagObj.db.hasAtLeastOneBoxWithTitle(); const maxMessageWidthPerActor = await getMaxMessageWidthPerActor(actors2, messages, diagObj); conf4.height = await calculateActorMargins(actors2, maxMessageWidthPerActor, boxes); - svgDraw_default2.insertComputerIcon(diagram23); - svgDraw_default2.insertDatabaseIcon(diagram23); - svgDraw_default2.insertClockIcon(diagram23); + svgDraw_default2.insertComputerIcon(diagram24); + svgDraw_default2.insertDatabaseIcon(diagram24); + svgDraw_default2.insertClockIcon(diagram24); if (hasBoxes) { bounds.bumpVerticalPos(conf4.boxMargin); if (hasBoxTitles) { @@ -83472,12 +84726,12 @@ ${content}`; }); actorKeys = actorKeys.filter((actorKey) => newActors.has(actorKey)); } - addActorRenderingData(diagram23, actors2, createdActors, actorKeys, 0, messages, false); + addActorRenderingData(diagram24, actors2, createdActors, actorKeys, 0, messages, false); const loopWidths = await calculateLoopBounds(messages, actors2, maxMessageWidthPerActor, diagObj); - svgDraw_default2.insertArrowHead(diagram23); - svgDraw_default2.insertArrowCrossHead(diagram23); - svgDraw_default2.insertArrowFilledHead(diagram23); - svgDraw_default2.insertSequenceNumber(diagram23); + svgDraw_default2.insertArrowHead(diagram24); + svgDraw_default2.insertArrowCrossHead(diagram24); + svgDraw_default2.insertArrowFilledHead(diagram24); + svgDraw_default2.insertSequenceNumber(diagram24); function activeEnd(msg, verticalPos) { const activationData = bounds.endActivation(msg); if (activationData.starty + 18 > verticalPos) { @@ -83485,7 +84739,7 @@ ${content}`; verticalPos += 12; } svgDraw_default2.drawActivation( - diagram23, + diagram24, activationData, verticalPos, conf4, @@ -83505,10 +84759,10 @@ ${content}`; case diagObj.db.LINETYPE.NOTE: bounds.resetVerticalPos(); noteModel = msg.noteModel; - await drawNote(diagram23, noteModel); + await drawNote(diagram24, noteModel); break; case diagObj.db.LINETYPE.ACTIVE_START: - bounds.newActivation(msg, diagram23, actors2); + bounds.newActivation(msg, diagram24, actors2); break; case diagObj.db.LINETYPE.ACTIVE_END: activeEnd(msg, bounds.getVerticalPos()); @@ -83524,7 +84778,7 @@ ${content}`; break; case diagObj.db.LINETYPE.LOOP_END: loopModel = bounds.endLoop(); - await svgDraw_default2.drawLoop(diagram23, loopModel, "loop", conf4); + await svgDraw_default2.drawLoop(diagram24, loopModel, "loop", conf4); bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); bounds.models.addLoop(loopModel); break; @@ -83554,7 +84808,7 @@ ${content}`; break; case diagObj.db.LINETYPE.OPT_END: loopModel = bounds.endLoop(); - await svgDraw_default2.drawLoop(diagram23, loopModel, "opt", conf4); + await svgDraw_default2.drawLoop(diagram24, loopModel, "opt", conf4); bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); bounds.models.addLoop(loopModel); break; @@ -83578,7 +84832,7 @@ ${content}`; break; case diagObj.db.LINETYPE.ALT_END: loopModel = bounds.endLoop(); - await svgDraw_default2.drawLoop(diagram23, loopModel, "alt", conf4); + await svgDraw_default2.drawLoop(diagram24, loopModel, "alt", conf4); bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); bounds.models.addLoop(loopModel); break; @@ -83604,7 +84858,7 @@ ${content}`; break; case diagObj.db.LINETYPE.PAR_END: loopModel = bounds.endLoop(); - await svgDraw_default2.drawLoop(diagram23, loopModel, "par", conf4); + await svgDraw_default2.drawLoop(diagram24, loopModel, "par", conf4); bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); bounds.models.addLoop(loopModel); break; @@ -83637,7 +84891,7 @@ ${content}`; break; case diagObj.db.LINETYPE.CRITICAL_END: loopModel = bounds.endLoop(); - await svgDraw_default2.drawLoop(diagram23, loopModel, "critical", conf4); + await svgDraw_default2.drawLoop(diagram24, loopModel, "critical", conf4); bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); bounds.models.addLoop(loopModel); break; @@ -83652,7 +84906,7 @@ ${content}`; break; case diagObj.db.LINETYPE.BREAK_END: loopModel = bounds.endLoop(); - await svgDraw_default2.drawLoop(diagram23, loopModel, "break", conf4); + await svgDraw_default2.drawLoop(diagram24, loopModel, "break", conf4); bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos()); bounds.models.addLoop(loopModel); break; @@ -83662,7 +84916,7 @@ ${content}`; msgModel.starty = bounds.getVerticalPos(); msgModel.sequenceIndex = sequenceIndex; msgModel.sequenceVisible = diagObj.db.showSequenceNumbers(); - const lineStartY = await boundMessage(diagram23, msgModel); + const lineStartY = await boundMessage(diagram24, msgModel); adjustCreatedDestroyedData( msg, msgModel, @@ -83696,15 +84950,15 @@ ${content}`; } log.debug("createdActors", createdActors); log.debug("destroyedActors", destroyedActors); - await drawActors(diagram23, actors2, actorKeys, false); + await drawActors(diagram24, actors2, actorKeys, false); for (const e3 of messagesToDraw) { - await drawMessage(diagram23, e3.messageModel, e3.lineStartY, diagObj); + await drawMessage(diagram24, e3.messageModel, e3.lineStartY, diagObj); } if (conf4.mirrorActors) { - await drawActors(diagram23, actors2, actorKeys, true); + await drawActors(diagram24, actors2, actorKeys, true); } - backgrounds.forEach((e3) => svgDraw_default2.drawBackgroundRect(diagram23, e3)); - fixLifeLineHeights(diagram23, actors2, actorKeys, conf4); + backgrounds.forEach((e3) => svgDraw_default2.drawBackgroundRect(diagram24, e3)); + fixLifeLineHeights(diagram24, actors2, actorKeys, conf4); for (const box2 of bounds.models.boxes) { box2.height = bounds.getVerticalPos() - box2.y; bounds.insert(box2.x, box2.y, box2.x + box2.width, box2.height); @@ -83713,12 +84967,12 @@ ${content}`; box2.stopx = box2.startx + box2.width; box2.stopy = box2.starty + box2.height; box2.stroke = "rgb(0,0,0, 0.5)"; - svgDraw_default2.drawBox(diagram23, box2, conf4); + svgDraw_default2.drawBox(diagram24, box2, conf4); } if (hasBoxes) { bounds.bumpVerticalPos(conf4.boxMargin); } - const requiredBoxSize = drawActorsPopup(diagram23, actors2, actorKeys, doc); + const requiredBoxSize = drawActorsPopup(diagram24, actors2, actorKeys, doc); const { bounds: box } = bounds.getBounds(); if (box.startx === void 0) { box.startx = 0; @@ -83746,11 +85000,11 @@ ${content}`; } const width3 = boxWidth + 2 * conf4.diagramMarginX; if (title2) { - diagram23.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 2 * conf4.diagramMarginX).attr("y", -25); + diagram24.append("text").text(title2).attr("x", (box.stopx - box.startx) / 2 - 2 * conf4.diagramMarginX).attr("y", -25); } - configureSvgSize(diagram23, height2, width3, conf4.useMaxWidth); + configureSvgSize(diagram24, height2, width3, conf4.useMaxWidth); const extraVertForTitle = title2 ? 40 : 0; - diagram23.attr( + diagram24.attr( "viewBox", box.startx - conf4.diagramMarginX + " -" + (conf4.diagramMarginY + extraVertForTitle) + " " + width3 + " " + (height2 + extraVertForTitle) ); @@ -84041,7 +85295,7 @@ ${content}`; for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 17], $V1 = [1, 18], $V2 = [1, 19], $V3 = [1, 39], $V4 = [1, 40], $V5 = [1, 25], $V6 = [1, 23], $V7 = [1, 24], $V8 = [1, 31], $V9 = [1, 32], $Va = [1, 33], $Vb = [1, 34], $Vc = [1, 35], $Vd = [1, 36], $Ve = [1, 26], $Vf = [1, 27], $Vg = [1, 28], $Vh = [1, 29], $Vi = [1, 43], $Vj = [1, 30], $Vk = [1, 42], $Vl = [1, 44], $Vm = [1, 41], $Vn = [1, 45], $Vo = [1, 9], $Vp = [1, 8, 9], $Vq = [1, 56], $Vr = [1, 57], $Vs = [1, 58], $Vt = [1, 59], $Vu = [1, 60], $Vv = [1, 61], $Vw = [1, 62], $Vx = [1, 8, 9, 39], $Vy = [1, 74], $Vz = [1, 8, 9, 12, 13, 21, 37, 39, 42, 59, 60, 61, 62, 63, 64, 65, 70, 72], $VA = [1, 8, 9, 12, 13, 19, 21, 37, 39, 42, 46, 59, 60, 61, 62, 63, 64, 65, 70, 72, 74, 80, 95, 97, 98], $VB = [13, 74, 80, 95, 97, 98], $VC = [13, 64, 65, 74, 80, 95, 97, 98], $VD = [13, 59, 60, 61, 62, 63, 74, 80, 95, 97, 98], $VE = [1, 93], $VF = [1, 110], $VG = [1, 108], $VH = [1, 102], $VI = [1, 103], $VJ = [1, 104], $VK = [1, 105], $VL = [1, 106], $VM = [1, 107], $VN = [1, 109], $VO = [1, 8, 9, 37, 39, 42], $VP = [1, 8, 9, 21], $VQ = [1, 8, 9, 78], $VR = [1, 8, 9, 21, 73, 74, 78, 80, 81, 82, 83, 84, 85]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -84333,21 +85587,21 @@ ${content}`; return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -84366,7 +85620,7 @@ ${content}`; }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -85022,13 +86276,13 @@ ${content}`; }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser13.parser = parser13; @@ -85145,27 +86399,27 @@ ${content}`; functions2 = []; sanitizeText5 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, getConfig2()), "sanitizeText"); splitClassNameAndType = /* @__PURE__ */ __name(function(_id) { - const id26 = common_default.sanitizeText(_id, getConfig2()); + const id27 = common_default.sanitizeText(_id, getConfig2()); let genericType = ""; - let className = id26; - if (id26.indexOf("~") > 0) { - const split = id26.split("~"); + let className = id27; + if (id27.indexOf("~") > 0) { + const split = id27.split("~"); className = sanitizeText5(split[0]); genericType = sanitizeText5(split[1]); } return { className, type: genericType }; }, "splitClassNameAndType"); setClassLabel = /* @__PURE__ */ __name(function(_id, label) { - const id26 = common_default.sanitizeText(_id, getConfig2()); + const id27 = common_default.sanitizeText(_id, getConfig2()); if (label) { label = sanitizeText5(label); } - const { className } = splitClassNameAndType(id26); + const { className } = splitClassNameAndType(id27); classes2.get(className).label = label; }, "setClassLabel"); addClass3 = /* @__PURE__ */ __name(function(_id) { - const id26 = common_default.sanitizeText(_id, getConfig2()); - const { className, type: type3 } = splitClassNameAndType(id26); + const id27 = common_default.sanitizeText(_id, getConfig2()); + const { className, type: type3 } = splitClassNameAndType(id27); if (classes2.has(className)) { return; } @@ -85184,11 +86438,11 @@ ${content}`; classCounter++; }, "addClass"); lookUpDomId2 = /* @__PURE__ */ __name(function(_id) { - const id26 = common_default.sanitizeText(_id, getConfig2()); - if (classes2.has(id26)) { - return classes2.get(id26).domId; + const id27 = common_default.sanitizeText(_id, getConfig2()); + if (classes2.has(id27)) { + return classes2.get(id27).domId; } - throw new Error("Class not found: " + id26); + throw new Error("Class not found: " + id27); }, "lookUpDomId"); clear18 = /* @__PURE__ */ __name(function() { relations2 = []; @@ -85201,8 +86455,8 @@ ${content}`; direction2 = "TB"; clear(); }, "clear"); - getClass = /* @__PURE__ */ __name(function(id26) { - return classes2.get(id26); + getClass = /* @__PURE__ */ __name(function(id27) { + return classes2.get(id27); }, "getClass"); getClasses3 = /* @__PURE__ */ __name(function() { return classes2; @@ -85264,37 +86518,37 @@ ${content}`; }, "cleanupLabel"); setCssClass = /* @__PURE__ */ __name(function(ids, className) { ids.split(",").forEach(function(_id) { - let id26 = _id; + let id27 = _id; if (/\d/.exec(_id[0])) { - id26 = MERMAID_DOM_ID_PREFIX2 + id26; + id27 = MERMAID_DOM_ID_PREFIX2 + id27; } - const classNode = classes2.get(id26); + const classNode = classes2.get(id27); if (classNode) { classNode.cssClasses.push(className); } }); }, "setCssClass"); setTooltip2 = /* @__PURE__ */ __name(function(ids, tooltip) { - ids.split(",").forEach(function(id26) { + ids.split(",").forEach(function(id27) { if (tooltip !== void 0) { - classes2.get(id26).tooltip = sanitizeText5(tooltip); + classes2.get(id27).tooltip = sanitizeText5(tooltip); } }); }, "setTooltip"); - getTooltip2 = /* @__PURE__ */ __name(function(id26, namespace) { + getTooltip2 = /* @__PURE__ */ __name(function(id27, namespace) { if (namespace && namespaces.has(namespace)) { - return namespaces.get(namespace).classes.get(id26).tooltip; + return namespaces.get(namespace).classes.get(id27).tooltip; } - return classes2.get(id26).tooltip; + return classes2.get(id27).tooltip; }, "getTooltip"); setLink3 = /* @__PURE__ */ __name(function(ids, linkStr, target) { const config6 = getConfig2(); ids.split(",").forEach(function(_id) { - let id26 = _id; + let id27 = _id; if (/\d/.exec(_id[0])) { - id26 = MERMAID_DOM_ID_PREFIX2 + id26; + id27 = MERMAID_DOM_ID_PREFIX2 + id27; } - const theClass = classes2.get(id26); + const theClass = classes2.get(id27); if (theClass) { theClass.link = utils_default2.formatUrl(linkStr, config6); if (config6.securityLevel === "sandbox") { @@ -85309,9 +86563,9 @@ ${content}`; setCssClass(ids, "clickable"); }, "setLink"); setClickEvent3 = /* @__PURE__ */ __name(function(ids, functionName, functionArgs) { - ids.split(",").forEach(function(id26) { - setClickFunc(id26, functionName, functionArgs); - classes2.get(id26).haveCallback = true; + ids.split(",").forEach(function(id27) { + setClickFunc(id27, functionName, functionArgs); + classes2.get(id27).haveCallback = true; }); setCssClass(ids, "clickable"); }, "setClickEvent"); @@ -85324,9 +86578,9 @@ ${content}`; if (functionName === void 0) { return; } - const id26 = domId; - if (classes2.has(id26)) { - const elemId = lookUpDomId2(id26); + const id27 = domId; + if (classes2.has(id27)) { + const elemId = lookUpDomId2(id27); let argList = []; if (typeof functionArgs === "string") { argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); @@ -85401,15 +86655,15 @@ ${content}`; setDirection3 = /* @__PURE__ */ __name((dir2) => { direction2 = dir2; }, "setDirection"); - addNamespace = /* @__PURE__ */ __name(function(id26) { - if (namespaces.has(id26)) { + addNamespace = /* @__PURE__ */ __name(function(id27) { + if (namespaces.has(id27)) { return; } - namespaces.set(id26, { - id: id26, + namespaces.set(id27, { + id: id27, classes: /* @__PURE__ */ new Map(), children: {}, - domId: MERMAID_DOM_ID_PREFIX2 + id26 + "-" + namespaceCounter + domId: MERMAID_DOM_ID_PREFIX2 + id27 + "-" + namespaceCounter }); namespaceCounter++; }, "addNamespace"); @@ -85419,18 +86673,18 @@ ${content}`; getNamespaces = /* @__PURE__ */ __name(function() { return namespaces; }, "getNamespaces"); - addClassesToNamespace = /* @__PURE__ */ __name(function(id26, classNames) { - if (!namespaces.has(id26)) { + addClassesToNamespace = /* @__PURE__ */ __name(function(id27, classNames) { + if (!namespaces.has(id27)) { return; } for (const name of classNames) { const { className } = splitClassNameAndType(name); - classes2.get(className).parent = id26; - namespaces.get(id26).classes.set(className, classes2.get(className)); + classes2.get(className).parent = id27; + namespaces.get(id27).classes.set(className, classes2.get(className)); } }, "addClassesToNamespace"); - setCssStyle = /* @__PURE__ */ __name(function(id26, styles3) { - const thisClass = classes2.get(id26); + setCssStyle = /* @__PURE__ */ __name(function(id27, styles3) { + const thisClass = classes2.get(id27); if (!styles3 || !thisClass) { return; } @@ -85749,14 +87003,14 @@ g.classGroup line { }, "drawEdge"); drawClass = /* @__PURE__ */ __name(function(elem, classDef, conf8, diagObj) { log.debug("Rendering class ", classDef, conf8); - const id26 = classDef.id; + const id27 = classDef.id; const classInfo = { - id: id26, + id: id27, label: classDef.id, width: 0, height: 0 }; - const g2 = elem.append("g").attr("id", diagObj.db.lookUpDomId(id26)).attr("class", "classGroup"); + const g2 = elem.append("g").attr("id", diagObj.db.lookUpDomId(id27)).attr("class", "classGroup"); let title2; if (classDef.link) { title2 = g2.append("svg:a").attr("xlink:href", classDef.link).attr("target", classDef.linkTarget).append("text").attr("y", conf8.textHeight + conf8.padding).attr("x", 0); @@ -85831,14 +87085,14 @@ g.classGroup line { }, "getClassTitleString"); drawNote2 = /* @__PURE__ */ __name(function(elem, note3, conf8, _diagObj) { log.debug("Rendering note ", note3, conf8); - const id26 = note3.id; + const id27 = note3.id; const noteInfo = { - id: id26, + id: id27, text: note3.text, width: 0, height: 0 }; - const g2 = elem.append("g").attr("id", id26).attr("class", "classGroup"); + const g2 = elem.append("g").attr("id", id27).attr("class", "classGroup"); let text2 = g2.append("text").attr("y", conf8.textHeight + conf8.padding).attr("x", 0); const lines = JSON.parse(`"${note3.text}"`).split("\n"); lines.forEach(function(line2) { @@ -85907,18 +87161,18 @@ g.classGroup line { elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).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"); elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).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"); }, "insertMarkers"); - draw12 = /* @__PURE__ */ __name(function(text2, id26, _version, diagObj) { + draw12 = /* @__PURE__ */ __name(function(text2, id27, _version, diagObj) { const conf8 = getConfig2().class; idCache = {}; log.info("Rendering diagram " + text2); const securityLevel = getConfig2().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); - const diagram23 = root4.select(`[id='${id26}']`); - insertMarkers3(diagram23); + const diagram24 = root4.select(`[id='${id27}']`); + insertMarkers3(diagram24); const g2 = new Graph({ multigraph: true }); @@ -85932,7 +87186,7 @@ g.classGroup line { const keys3 = [...classes6.keys()]; for (const key of keys3) { const classDef = classes6.get(key); - const node2 = svgDraw_default3.drawClass(diagram23, classDef, conf8, diagObj); + const node2 = svgDraw_default3.drawClass(diagram24, classDef, conf8, diagObj); idCache[node2.id] = node2; g2.setNode(node2.id, node2); log.info("Org height: " + node2.height); @@ -85955,7 +87209,7 @@ g.classGroup line { const notes2 = diagObj.db.getNotes(); notes2.forEach(function(note3) { log.debug(`Adding note: ${JSON.stringify(note3)}`); - const node2 = svgDraw_default3.drawNote(diagram23, note3, conf8, diagObj); + const node2 = svgDraw_default3.drawNote(diagram24, note3, conf8, diagObj); idCache[node2.id] = node2; g2.setNode(node2.id, node2); if (note3.class && classes6.has(note3.class)) { @@ -85990,16 +87244,16 @@ g.classGroup line { g2.edges().forEach(function(e3) { if (e3 !== void 0 && g2.edge(e3) !== void 0) { log.debug("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(g2.edge(e3))); - svgDraw_default3.drawEdge(diagram23, g2.edge(e3), g2.edge(e3).relation, conf8, diagObj); + svgDraw_default3.drawEdge(diagram24, g2.edge(e3), g2.edge(e3).relation, conf8, diagObj); } }); - const svgBounds = diagram23.node().getBBox(); + const svgBounds = diagram24.node().getBBox(); const width3 = svgBounds.width + padding * 2; const height2 = svgBounds.height + padding * 2; - configureSvgSize(diagram23, height2, width3, conf8.useMaxWidth); + configureSvgSize(diagram24, height2, width3, conf8.useMaxWidth); const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width3} ${height2}`; log.debug(`viewBox ${vBox}`); - diagram23.attr("viewBox", vBox); + diagram24.attr("viewBox", vBox); }, "draw"); classRenderer_default = { draw: draw12 @@ -86042,46 +87296,46 @@ g.classGroup line { "src/dagre-wrapper/markers.js"() { "use strict"; init_logger(); - insertMarkers4 = /* @__PURE__ */ __name((elem, markerArray, type3, id26) => { + insertMarkers4 = /* @__PURE__ */ __name((elem, markerArray, type3, id27) => { markerArray.forEach((markerName) => { - markers2[markerName](elem, type3, id26); + markers2[markerName](elem, type3, id27); }); }, "insertMarkers"); - extension2 = /* @__PURE__ */ __name((elem, type3, id26) => { - log.trace("Making markers for ", id26); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-extensionStart").attr("class", "marker extension " + type3).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"); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-extensionEnd").attr("class", "marker extension " + type3).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"); + extension2 = /* @__PURE__ */ __name((elem, type3, id27) => { + log.trace("Making markers for ", id27); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-extensionStart").attr("class", "marker extension " + type3).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"); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-extensionEnd").attr("class", "marker extension " + type3).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"); }, "extension"); - composition2 = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-compositionStart").attr("class", "marker composition " + type3).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"); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-compositionEnd").attr("class", "marker composition " + type3).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"); + composition2 = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-compositionStart").attr("class", "marker composition " + type3).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"); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-compositionEnd").attr("class", "marker composition " + type3).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"); }, "composition"); - aggregation2 = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-aggregationStart").attr("class", "marker aggregation " + type3).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"); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-aggregationEnd").attr("class", "marker aggregation " + type3).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"); + aggregation2 = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-aggregationStart").attr("class", "marker aggregation " + type3).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"); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-aggregationEnd").attr("class", "marker aggregation " + type3).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"); }, "aggregation"); - dependency2 = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-dependencyStart").attr("class", "marker dependency " + type3).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"); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-dependencyEnd").attr("class", "marker dependency " + type3).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"); + dependency2 = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-dependencyStart").attr("class", "marker dependency " + type3).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"); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-dependencyEnd").attr("class", "marker dependency " + type3).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"); }, "dependency"); - lollipop2 = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-lollipopStart").attr("class", "marker lollipop " + type3).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); - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-lollipopEnd").attr("class", "marker lollipop " + type3).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); + lollipop2 = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-lollipopStart").attr("class", "marker lollipop " + type3).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); + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-lollipopEnd").attr("class", "marker lollipop " + type3).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); }, "lollipop"); - point7 = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("marker").attr("id", id26 + "_" + type3 + "-pointEnd").attr("class", "marker " + type3).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"); - elem.append("marker").attr("id", id26 + "_" + type3 + "-pointStart").attr("class", "marker " + type3).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"); + point7 = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("marker").attr("id", id27 + "_" + type3 + "-pointEnd").attr("class", "marker " + type3).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"); + elem.append("marker").attr("id", id27 + "_" + type3 + "-pointStart").attr("class", "marker " + type3).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"); }, "point"); - circle4 = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("marker").attr("id", id26 + "_" + type3 + "-circleEnd").attr("class", "marker " + type3).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"); - elem.append("marker").attr("id", id26 + "_" + type3 + "-circleStart").attr("class", "marker " + type3).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"); + circle4 = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("marker").attr("id", id27 + "_" + type3 + "-circleEnd").attr("class", "marker " + type3).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"); + elem.append("marker").attr("id", id27 + "_" + type3 + "-circleStart").attr("class", "marker " + type3).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"); }, "circle"); - cross2 = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("marker").attr("id", id26 + "_" + type3 + "-crossEnd").attr("class", "marker cross " + type3).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"); - elem.append("marker").attr("id", id26 + "_" + type3 + "-crossStart").attr("class", "marker cross " + type3).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"); + cross2 = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("marker").attr("id", id27 + "_" + type3 + "-crossEnd").attr("class", "marker cross " + type3).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"); + elem.append("marker").attr("id", id27 + "_" + type3 + "-crossStart").attr("class", "marker cross " + type3).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"); }, "cross"); - barb2 = /* @__PURE__ */ __name((elem, type3, id26) => { - elem.append("defs").append("marker").attr("id", id26 + "_" + type3 + "-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"); + barb2 = /* @__PURE__ */ __name((elem, type3, id27) => { + elem.append("defs").append("marker").attr("id", id27 + "_" + type3 + "-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"); }, "barb"); markers2 = { extension: extension2, @@ -86114,9 +87368,9 @@ g.classGroup line { parents2 = {}; clusterDb2 = {}; }, "clear"); - isDescendant3 = /* @__PURE__ */ __name((id26, ancestorId) => { - log.trace("In isDescendant", ancestorId, " ", id26, " = ", descendants2[ancestorId].includes(id26)); - if (descendants2[ancestorId].includes(id26)) { + isDescendant3 = /* @__PURE__ */ __name((id27, ancestorId) => { + log.trace("In isDescendant", ancestorId, " ", id27, " = ", descendants2[ancestorId].includes(id27)); + if (descendants2[ancestorId].includes(id27)) { return true; } return false; @@ -86208,42 +87462,42 @@ g.classGroup line { graph.removeNode(node2); }); }, "copy"); - extractDescendants2 = /* @__PURE__ */ __name((id26, graph) => { - const children2 = graph.children(id26); + extractDescendants2 = /* @__PURE__ */ __name((id27, graph) => { + const children2 = graph.children(id27); let res = [...children2]; for (const child of children2) { - parents2[child] = id26; + parents2[child] = id27; res = [...res, ...extractDescendants2(child, graph)]; } return res; }, "extractDescendants"); - findNonClusterChild2 = /* @__PURE__ */ __name((id26, graph) => { - log.trace("Searching", id26); - const children2 = graph.children(id26); - log.trace("Searching children of id ", id26, children2); + findNonClusterChild2 = /* @__PURE__ */ __name((id27, graph) => { + log.trace("Searching", id27); + const children2 = graph.children(id27); + log.trace("Searching children of id ", id27, children2); if (children2.length < 1) { - log.trace("This is a valid node", id26); - return id26; + log.trace("This is a valid node", id27); + return id27; } for (const child of children2) { const _id = findNonClusterChild2(child, graph); if (_id) { - log.trace("Found replacement for", id26, " => ", _id); + log.trace("Found replacement for", id27, " => ", _id); return _id; } } }, "findNonClusterChild"); - getAnchorId2 = /* @__PURE__ */ __name((id26) => { - if (!clusterDb2[id26]) { - return id26; + getAnchorId2 = /* @__PURE__ */ __name((id27) => { + if (!clusterDb2[id27]) { + return id27; } - if (!clusterDb2[id26].externalConnections) { - return id26; + if (!clusterDb2[id27].externalConnections) { + return id27; } - if (clusterDb2[id26]) { - return clusterDb2[id26].id; + if (clusterDb2[id27]) { + return clusterDb2[id27].id; } - return id26; + return id27; }, "getAnchorId"); adjustClustersAndEdges2 = /* @__PURE__ */ __name((graph, depth) => { if (!graph || depth > 10) { @@ -86252,44 +87506,44 @@ g.classGroup line { } else { log.debug("Opting in, graph "); } - graph.nodes().forEach(function(id26) { - const children2 = graph.children(id26); + graph.nodes().forEach(function(id27) { + const children2 = graph.children(id27); if (children2.length > 0) { log.warn( "Cluster identified", - id26, + id27, " Replacement id in edges: ", - findNonClusterChild2(id26, graph) + findNonClusterChild2(id27, graph) ); - descendants2[id26] = extractDescendants2(id26, graph); - clusterDb2[id26] = { id: findNonClusterChild2(id26, graph), clusterData: graph.node(id26) }; + descendants2[id27] = extractDescendants2(id27, graph); + clusterDb2[id27] = { id: findNonClusterChild2(id27, graph), clusterData: graph.node(id27) }; } }); - graph.nodes().forEach(function(id26) { - const children2 = graph.children(id26); + graph.nodes().forEach(function(id27) { + const children2 = graph.children(id27); const edges5 = graph.edges(); if (children2.length > 0) { - log.debug("Cluster identified", id26, descendants2); + log.debug("Cluster identified", id27, descendants2); edges5.forEach((edge) => { - if (edge.v !== id26 && edge.w !== id26) { - const d1 = isDescendant3(edge.v, id26); - const d2 = isDescendant3(edge.w, id26); + if (edge.v !== id27 && edge.w !== id27) { + const d1 = isDescendant3(edge.v, id27); + const d2 = isDescendant3(edge.w, id27); if (d1 ^ d2) { - log.warn("Edge: ", edge, " leaves cluster ", id26); - log.warn("Descendants of XXX ", id26, ": ", descendants2[id26]); - clusterDb2[id26].externalConnections = true; + log.warn("Edge: ", edge, " leaves cluster ", id27); + log.warn("Descendants of XXX ", id27, ": ", descendants2[id27]); + clusterDb2[id27].externalConnections = true; } } }); } else { - log.debug("Not a cluster ", id26, descendants2); + log.debug("Not a cluster ", id27, descendants2); } }); - for (let id26 of Object.keys(clusterDb2)) { - const nonClusterChild = clusterDb2[id26].id; + for (let id27 of Object.keys(clusterDb2)) { + const nonClusterChild = clusterDb2[id27].id; const parent4 = graph.parent(nonClusterChild); - if (parent4 !== id26 && clusterDb2[parent4] && !clusterDb2[parent4].externalConnections) { - clusterDb2[id26].id = parent4; + if (parent4 !== id27 && clusterDb2[parent4] && !clusterDb2[parent4].externalConnections) { + clusterDb2[id27].id = parent4; } } graph.edges().forEach(function(e3) { @@ -86614,12 +87868,12 @@ g.classGroup line { "src/dagre-wrapper/edgeMarker.ts"() { "use strict"; init_logger(); - addEdgeMarkers2 = /* @__PURE__ */ __name((svgPath, edge, url, id26, diagramType) => { + addEdgeMarkers2 = /* @__PURE__ */ __name((svgPath, edge, url, id27, diagramType) => { if (edge.arrowTypeStart) { - addEdgeMarker2(svgPath, "start", edge.arrowTypeStart, url, id26, diagramType); + addEdgeMarker2(svgPath, "start", edge.arrowTypeStart, url, id27, diagramType); } if (edge.arrowTypeEnd) { - addEdgeMarker2(svgPath, "end", edge.arrowTypeEnd, url, id26, diagramType); + addEdgeMarker2(svgPath, "end", edge.arrowTypeEnd, url, id27, diagramType); } }, "addEdgeMarkers"); arrowTypesMap2 = { @@ -86633,14 +87887,14 @@ g.classGroup line { dependency: "dependency", lollipop: "lollipop" }; - addEdgeMarker2 = /* @__PURE__ */ __name((svgPath, position5, arrowType, url, id26, diagramType) => { + addEdgeMarker2 = /* @__PURE__ */ __name((svgPath, position5, arrowType, url, id27, diagramType) => { const endMarkerType = arrowTypesMap2[arrowType]; if (!endMarkerType) { log.warn(`Unknown arrow type: ${arrowType}`); return; } const suffix = position5 === "start" ? "Start" : "End"; - svgPath.attr(`marker-${position5}`, `url(${url}#${id26}_${diagramType}-${endMarkerType}${suffix})`); + svgPath.attr(`marker-${position5}`, `url(${url}#${id27}_${diagramType}-${endMarkerType}${suffix})`); }, "addEdgeMarker"); } }); @@ -86929,7 +88183,7 @@ g.classGroup line { }); return points; }, "cutPathAtIntersect"); - insertEdge2 = /* @__PURE__ */ __name(function(elem, e3, edge, clusterDb3, diagramType, graph, id26) { + insertEdge2 = /* @__PURE__ */ __name(function(elem, e3, edge, clusterDb3, diagramType, graph, id27) { let points = edge.points; log.debug("abc88 InsertEdge: edge=", edge, "e=", e3); let pointsHasChanged = false; @@ -86989,7 +88243,7 @@ g.classGroup line { url = url.replace(/\(/g, "\\("); url = url.replace(/\)/g, "\\)"); } - addEdgeMarkers2(svgPath, edge, url, id26, diagramType); + addEdgeMarkers2(svgPath, edge, url, id27, diagramType); let paths = {}; if (pointsHasChanged) { paths.updatedPath = points; @@ -87016,7 +88270,7 @@ g.classGroup line { init_logger(); init_subGraphTitleMargins(); init_diagramAPI(); - recursiveRender2 = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id26, parentCluster, siteConfig2) => { + recursiveRender2 = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id27, parentCluster, siteConfig2) => { log.info("Graph in recursive render: XXX", write(graph), parentCluster); const dir2 = graph.graph().rankdir; log.trace("Dir in recursive render - dir:", dir2); @@ -87058,7 +88312,7 @@ g.classGroup line { nodes6, node2.graph, diagramType, - id26, + id27, graph.node(v3), siteConfig2 ); @@ -87128,7 +88382,7 @@ g.classGroup line { const edge = graph.edge(e3); log.info("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(edge), edge); edge.points.forEach((point8) => point8.y += subGraphTitleTotalMargin / 2); - const paths = insertEdge2(edgePaths, e3, edge, clusterDb2, diagramType, graph, id26); + const paths = insertEdge2(edgePaths, e3, edge, clusterDb2, diagramType, graph, id27); positionEdgeLabel2(edge, paths); }); graph.nodes().forEach(function(v3) { @@ -87140,8 +88394,8 @@ g.classGroup line { }); return { elem, diff: diff2 }; }, "recursiveRender"); - render5 = /* @__PURE__ */ __name(async (elem, graph, markers3, diagramType, id26) => { - markers_default2(elem, markers3, diagramType, id26); + render5 = /* @__PURE__ */ __name(async (elem, graph, markers3, diagramType, id27) => { + markers_default2(elem, markers3, diagramType, id27); clear4(); clear21(); clear20(); @@ -87150,7 +88404,7 @@ g.classGroup line { adjustClustersAndEdges2(graph); log.warn("Graph after:", JSON.stringify(write(graph))); const siteConfig2 = getConfig2(); - await recursiveRender2(elem, graph, diagramType, id26, void 0, siteConfig2); + await recursiveRender2(elem, graph, diagramType, id27, void 0, siteConfig2); }, "render"); } }); @@ -87285,7 +88539,7 @@ g.classGroup line { return; } const edgeId = startEdgeId + i2; - const edgeData = { + const edgeData2 = { id: `edgeNote${edgeId}`, //Set relationship style and line type classes: "relation", @@ -87302,7 +88556,7 @@ g.classGroup line { labelStyle: "", curve: interpolateToCurve(conf5.curve, linear_default) }; - g2.setEdge(vertex.id, vertex.class, edgeData, edgeId); + g2.setEdge(vertex.id, vertex.class, edgeData2, edgeId); }); }, "addNotes"); addRelations = /* @__PURE__ */ __name(function(relations3, g2) { @@ -87310,7 +88564,7 @@ g.classGroup line { let cnt4 = 0; relations3.forEach(function(edge) { cnt4++; - const edgeData = { + const edgeData2 = { //Set relationship style and line type classes: "relation", pattern: edge.relation.lineType == 1 ? "dashed" : "solid", @@ -87330,33 +88584,33 @@ g.classGroup line { labelStyle: "", curve: interpolateToCurve(conf8?.curve, linear_default) }; - log.info(edgeData, edge); + log.info(edgeData2, edge); if (edge.style !== void 0) { const styles3 = getStylesFromArray(edge.style); - edgeData.style = styles3.style; - edgeData.labelStyle = styles3.labelStyle; + edgeData2.style = styles3.style; + edgeData2.labelStyle = styles3.labelStyle; } edge.text = edge.title; if (edge.text === void 0) { if (edge.style !== void 0) { - edgeData.arrowheadStyle = "fill: #333"; + edgeData2.arrowheadStyle = "fill: #333"; } } else { - edgeData.arrowheadStyle = "fill: #333"; - edgeData.labelpos = "c"; + edgeData2.arrowheadStyle = "fill: #333"; + edgeData2.labelpos = "c"; if (getConfig2().flowchart?.htmlLabels ?? getConfig2().htmlLabels) { - edgeData.labelType = "html"; - edgeData.label = '' + edge.text + ""; + edgeData2.labelType = "html"; + edgeData2.label = '' + edge.text + ""; } else { - edgeData.labelType = "text"; - edgeData.label = edge.text.replace(common_default.lineBreakRegex, "\n"); + edgeData2.labelType = "text"; + edgeData2.label = edge.text.replace(common_default.lineBreakRegex, "\n"); if (edge.style === void 0) { - edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none"; + edgeData2.style = edgeData2.style || "stroke: #333; stroke-width: 1.5px;fill:none"; } - edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:"); + edgeData2.labelStyle = edgeData2.labelStyle.replace("color:", "fill:"); } } - g2.setEdge(edge.id1, edge.id2, edgeData, cnt4); + g2.setEdge(edge.id1, edge.id2, edgeData2, cnt4); }); }, "addRelations"); setConf5 = /* @__PURE__ */ __name(function(cnf) { @@ -87365,8 +88619,8 @@ g.classGroup line { ...cnf }; }, "setConf"); - draw13 = /* @__PURE__ */ __name(async function(text2, id26, _version, diagObj) { - log.info("Drawing class - ", id26); + draw13 = /* @__PURE__ */ __name(async function(text2, id27, _version, diagObj) { + log.info("Drawing class - ", id27); const conf8 = getConfig2().flowchart ?? getConfig2().class; const securityLevel = getConfig2().securityLevel; log.info("config:", conf8); @@ -87389,29 +88643,29 @@ g.classGroup line { const relations3 = diagObj.db.getRelations(); const notes2 = diagObj.db.getNotes(); log.info(relations3); - addNamespaces(namespaces2, g2, id26, diagObj); - addClasses(classes6, g2, id26, diagObj); + addNamespaces(namespaces2, g2, id27, diagObj); + addClasses(classes6, g2, id27, diagObj); addRelations(relations3, g2); addNotes(notes2, g2, relations3.length + 1, classes6); let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); - const svg = root4.select(`[id="${id26}"]`); - const element3 = root4.select("#" + id26 + " g"); + const svg = root4.select(`[id="${id27}"]`); + const element3 = root4.select("#" + id27 + " g"); await render5( element3, g2, ["aggregation", "extension", "composition", "dependency", "lollipop"], "classDiagram", - id26 + id27 ); utils_default2.insertTitle(svg, "classTitleText", conf8?.titleTopMargin ?? 5, diagObj.db.getDiagramTitle()); setupGraphViewbox(g2, svg, conf8?.diagramPadding, conf8?.useMaxWidth); if (!conf8?.htmlLabels) { const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; - const labels = doc.querySelectorAll('[id="' + id26 + '"] .edgeLabel .label'); + const labels = doc.querySelectorAll('[id="' + id27 + '"] .edgeLabel .label'); for (const label of labels) { const dim = label.getBBox(); const rect4 = doc.createElementNS("http://www.w3.org/2000/svg", "rect"); @@ -87470,7 +88724,7 @@ g.classGroup line { for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 16], $V7 = [1, 17], $V8 = [1, 18], $V9 = [1, 19], $Va = [1, 32], $Vb = [1, 20], $Vc = [1, 21], $Vd = [1, 22], $Ve = [1, 23], $Vf = [1, 24], $Vg = [1, 26], $Vh = [1, 27], $Vi = [1, 28], $Vj = [1, 29], $Vk = [1, 30], $Vl = [1, 31], $Vm = [1, 34], $Vn = [1, 35], $Vo = [1, 36], $Vp = [1, 37], $Vq = [1, 33], $Vr = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $Vs = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54], $Vt = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 45, 48, 49, 50, 51, 54]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -87519,14 +88773,14 @@ g.classGroup line { this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: "", doc: $$[$0 - 1] }; break; case 20: - var id26 = $$[$0]; + var id27 = $$[$0]; var description = $$[$0 - 2].trim(); if ($$[$0].match(":")) { var parts = $$[$0].split(":"); - id26 = parts[0]; + id27 = parts[0]; description = [description, parts[1]]; } - this.$ = { stmt: "state", id: id26, type: "default", description }; + this.$ = { stmt: "state", id: id27, type: "default", description }; break; case 21: this.$ = { stmt: "state", id: $$[$0 - 3], type: "default", description: $$[$0 - 5], doc: $$[$0 - 1] }; @@ -87647,21 +88901,21 @@ g.classGroup line { return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -87680,7 +88934,7 @@ g.classGroup line { }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -88320,13 +89574,13 @@ g.classGroup line { }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser14.parser = parser14; @@ -88383,30 +89637,30 @@ g.classGroup line { }); // src/diagrams/state/dataFetcher.js - function stateDomId(itemId = "", counter = 0, type3 = "", typeSpacer = DOMID_TYPE_SPACER) { + function stateDomId(itemId = "", counter2 = 0, type3 = "", typeSpacer = DOMID_TYPE_SPACER) { const typeStr = type3 !== null && type3.length > 0 ? `${typeSpacer}${type3}` : ""; - return `${DOMID_STATE}-${itemId}${typeStr}-${counter}`; + return `${DOMID_STATE}-${itemId}${typeStr}-${counter2}`; } - function insertOrUpdateNode(nodes6, nodeData, classes6) { - if (!nodeData.id || nodeData.id === "" || nodeData.id === "") { + function insertOrUpdateNode(nodes6, nodeData2, classes6) { + if (!nodeData2.id || nodeData2.id === "" || nodeData2.id === "") { return; } - if (nodeData.cssClasses) { - if (!Array.isArray(nodeData.cssCompiledStyles)) { - nodeData.cssCompiledStyles = []; + if (nodeData2.cssClasses) { + if (!Array.isArray(nodeData2.cssCompiledStyles)) { + nodeData2.cssCompiledStyles = []; } - nodeData.cssClasses.split(" ").forEach((cssClass) => { + nodeData2.cssClasses.split(" ").forEach((cssClass) => { if (classes6.get(cssClass)) { const classDef = classes6.get(cssClass); - nodeData.cssCompiledStyles = [...nodeData.cssCompiledStyles, ...classDef.styles]; + nodeData2.cssCompiledStyles = [...nodeData2.cssCompiledStyles, ...classDef.styles]; } }); } - const existingNodeData = nodes6.find((node2) => node2.id === nodeData.id); + const existingNodeData = nodes6.find((node2) => node2.id === nodeData2.id); if (existingNodeData) { - Object.assign(existingNodeData, nodeData); + Object.assign(existingNodeData, nodeData2); } else { - nodes6.push(nodeData); + nodes6.push(nodeData2); } } function getClassesFromDbInfo(dbInfoItem) { @@ -88458,7 +89712,7 @@ g.classGroup line { look, classes6 ); - const edgeData = { + const edgeData2 = { id: "edge" + graphItemCount, start: item.state1.id, end: item.state2.id, @@ -88474,7 +89728,7 @@ g.classGroup line { classes: CSS_EDGE, look }; - edges5.push(edgeData); + edges5.push(edgeData2); graphItemCount++; } break; @@ -88555,7 +89809,7 @@ g.classGroup line { newNode.shape = parsedItem.type === DIVIDER_TYPE ? SHAPE_DIVIDER : SHAPE_GROUP; newNode.cssClasses = `${newNode.cssClasses} ${CSS_DIAGRAM_CLUSTER} ${altFlag ? CSS_DIAGRAM_CLUSTER_ALT : ""}`; } - const nodeData = { + const nodeData2 = { labelStyle: "", shape: newNode.shape, label: newNode.description, @@ -88572,14 +89826,14 @@ g.classGroup line { ry: 10, look }; - if (nodeData.shape === SHAPE_DIVIDER) { - nodeData.label = ""; + if (nodeData2.shape === SHAPE_DIVIDER) { + nodeData2.label = ""; } if (parent4 && parent4.id !== "root") { log.trace("Setting node ", itemId, " to be child of its parent ", parent4.id); - nodeData.parentId = parent4.id; + nodeData2.parentId = parent4.id; } - nodeData.centerLabel = true; + nodeData2.centerLabel = true; if (parsedItem.note) { const noteData = { labelStyle: "", @@ -88618,7 +89872,7 @@ g.classGroup line { noteData.parentId = parentNodeId; insertOrUpdateNode(nodes6, groupData, classes6); insertOrUpdateNode(nodes6, noteData, classes6); - insertOrUpdateNode(nodes6, nodeData, classes6); + insertOrUpdateNode(nodes6, nodeData2, classes6); let from2 = itemId; let to = noteData.id; if (parsedItem.note.position === "left of") { @@ -88641,7 +89895,7 @@ g.classGroup line { look }); } else { - insertOrUpdateNode(nodes6, nodeData, classes6); + insertOrUpdateNode(nodes6, nodeData2, classes6); } } if (parsedItem.doc) { @@ -88684,19 +89938,19 @@ g.classGroup line { diagramObj.db.extract(diagramObj.db.getRootDocV2()); return diagramObj.db.getClasses(); }, "getClasses"); - draw14 = /* @__PURE__ */ __name(async function(text2, id26, _version, diag) { + draw14 = /* @__PURE__ */ __name(async function(text2, id27, _version, diag) { log.info("REF0:"); - log.info("Drawing state diagram (v2)", id26); + log.info("Drawing state diagram (v2)", id27); const { securityLevel, state: conf8, layout: layout6 } = getConfig2(); diag.db.extract(diag.db.getRootDocV2()); const data4Layout = diag.db.getData(); - const svg = getDiagramElement(id26, securityLevel); + const svg = getDiagramElement(id27, securityLevel); data4Layout.type = diag.type; data4Layout.layoutAlgorithm = layout6; data4Layout.nodeSpacing = conf8?.nodeSpacing || 50; data4Layout.rankSpacing = conf8?.rankSpacing || 50; data4Layout.markers = ["barb"]; - data4Layout.diagramId = id26; + data4Layout.diagramId = id27; await render4(data4Layout, svg); const padding3 = 8; utils_default2.insertTitle( @@ -88719,32 +89973,32 @@ g.classGroup line { function newClassesList() { return /* @__PURE__ */ new Map(); } - function startIdIfNeeded(id26 = "") { - let fixedId = id26; - if (id26 === START_NODE) { + function startIdIfNeeded(id27 = "") { + let fixedId = id27; + if (id27 === START_NODE) { startEndCount++; fixedId = `${START_TYPE}${startEndCount}`; } return fixedId; } - function startTypeIfNeeded(id26 = "", type3 = DEFAULT_STATE_TYPE) { - return id26 === START_NODE ? START_TYPE : type3; + function startTypeIfNeeded(id27 = "", type3 = DEFAULT_STATE_TYPE) { + return id27 === START_NODE ? START_TYPE : type3; } - function endIdIfNeeded(id26 = "") { - let fixedId = id26; - if (id26 === END_NODE) { + function endIdIfNeeded(id27 = "") { + let fixedId = id27; + if (id27 === END_NODE) { startEndCount++; fixedId = `${END_TYPE}${startEndCount}`; } return fixedId; } - function endTypeIfNeeded(id26 = "", type3 = DEFAULT_STATE_TYPE) { - return id26 === END_NODE ? END_TYPE : type3; + function endTypeIfNeeded(id27 = "", type3 = DEFAULT_STATE_TYPE) { + return id27 === END_NODE ? END_TYPE : type3; } function addRelationObjs(item1, item2, relationTitle) { let id1 = startIdIfNeeded(item1.id.trim()); let type1 = startTypeIfNeeded(item1.id.trim(), item1.type); - let id26 = startIdIfNeeded(item2.id.trim()); + let id27 = startIdIfNeeded(item2.id.trim()); let type22 = startTypeIfNeeded(item2.id.trim(), item2.type); addState( id1, @@ -88757,7 +90011,7 @@ g.classGroup line { item1.textStyles ); addState( - id26, + id27, type22, item2.doc, item2.description, @@ -88768,7 +90022,7 @@ g.classGroup line { ); currentDocument.relations.push({ id1, - id2: id26, + id2: id27, relationTitle: common_default.sanitizeText(relationTitle, getConfig2()) }); } @@ -88908,10 +90162,10 @@ g.classGroup line { { const ids = item.id.trim().split(","); const styles3 = item.styleClass.split(","); - ids.forEach((id26) => { - let foundState = getState(id26); + ids.forEach((id27) => { + let foundState = getState(id27); if (foundState === void 0) { - const trimmedId = id26.trim(); + const trimmedId = id27.trim(); addState(trimmedId); foundState = getState(trimmedId); } @@ -88941,8 +90195,8 @@ g.classGroup line { } }); }, "extract"); - addState = /* @__PURE__ */ __name(function(id26, type3 = DEFAULT_STATE_TYPE, doc = null, descr = null, note3 = null, classes6 = null, styles3 = null, textStyles = null) { - const trimmedId = id26?.trim(); + addState = /* @__PURE__ */ __name(function(id27, type3 = DEFAULT_STATE_TYPE, doc = null, descr = null, note3 = null, classes6 = null, styles3 = null, textStyles = null) { + const trimmedId = id27?.trim(); if (!currentDocument.states.has(trimmedId)) { log.info("Adding state ", trimmedId, descr); currentDocument.states.set(trimmedId, { @@ -89006,8 +90260,8 @@ g.classGroup line { clear(); } }, "clear"); - getState = /* @__PURE__ */ __name(function(id26) { - return currentDocument.states.get(id26); + getState = /* @__PURE__ */ __name(function(id27) { + return currentDocument.states.get(id27); }, "getState"); getStates = /* @__PURE__ */ __name(function() { return currentDocument.states; @@ -89029,19 +90283,19 @@ g.classGroup line { } else { const id1 = startIdIfNeeded(item1.trim()); const type1 = startTypeIfNeeded(item1); - const id26 = endIdIfNeeded(item2.trim()); + const id27 = endIdIfNeeded(item2.trim()); const type22 = endTypeIfNeeded(item2); addState(id1, type1); - addState(id26, type22); + addState(id27, type22); currentDocument.relations.push({ id1, - id2: id26, + id2: id27, title: common_default.sanitizeText(title2, getConfig2()) }); } }, "addRelation"); - addDescription = /* @__PURE__ */ __name(function(id26, descr) { - const theState = currentDocument.states.get(id26); + addDescription = /* @__PURE__ */ __name(function(id27, descr) { + const theState = currentDocument.states.get(id27); const _descr = descr.startsWith(":") ? descr.replace(":", "").trim() : descr; theState.descriptions.push(common_default.sanitizeText(_descr, getConfig2())); }, "addDescription"); @@ -89056,11 +90310,11 @@ g.classGroup line { dividerCnt++; return "divider-id-" + dividerCnt; }, "getDividerId"); - addStyleClass = /* @__PURE__ */ __name(function(id26, styleAttributes = "") { - if (!classes3.has(id26)) { - classes3.set(id26, { id: id26, styles: [], textStyles: [] }); + addStyleClass = /* @__PURE__ */ __name(function(id27, styleAttributes = "") { + if (!classes3.has(id27)) { + classes3.set(id27, { id: id27, styles: [], textStyles: [] }); } - const foundClass = classes3.get(id26); + const foundClass = classes3.get(id27); if (styleAttributes !== void 0 && styleAttributes !== null) { styleAttributes.split(STYLECLASS_SEP).forEach((attrib) => { const fixedAttrib = attrib.replace(/([^;]*);/, "$1").trim(); @@ -89077,10 +90331,10 @@ g.classGroup line { return classes3; }, "getClasses"); setCssClass2 = /* @__PURE__ */ __name(function(itemIds, cssClassName) { - itemIds.split(",").forEach(function(id26) { - let foundState = getState(id26); + itemIds.split(",").forEach(function(id27) { + let foundState = getState(id27); if (foundState === void 0) { - const trimmedId = id26.trim(); + const trimmedId = id27.trim(); addState(trimmedId); foundState = getState(trimmedId); } @@ -89403,10 +90657,10 @@ g.stateGroup line { drawStartState = /* @__PURE__ */ __name((g2) => g2.append("circle").attr("class", "start-state").attr("r", getConfig2().state.sizeUnit).attr("cx", getConfig2().state.padding + getConfig2().state.sizeUnit).attr("cy", getConfig2().state.padding + getConfig2().state.sizeUnit), "drawStartState"); drawDivider = /* @__PURE__ */ __name((g2) => g2.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", getConfig2().state.textHeight).attr("class", "divider").attr("x2", getConfig2().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"); drawSimpleState = /* @__PURE__ */ __name((g2, stateDef) => { - const state4 = g2.append("text").attr("x", 2 * getConfig2().state.padding).attr("y", getConfig2().state.textHeight + 2 * getConfig2().state.padding).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(stateDef.id); - const classBox = state4.node().getBBox(); + const state5 = g2.append("text").attr("x", 2 * getConfig2().state.padding).attr("y", getConfig2().state.textHeight + 2 * getConfig2().state.padding).attr("font-size", getConfig2().state.fontSize).attr("class", "state-title").text(stateDef.id); + const classBox = state5.node().getBBox(); g2.insert("rect", ":first-child").attr("x", getConfig2().state.padding).attr("y", getConfig2().state.padding).attr("width", classBox.width + 2 * getConfig2().state.padding).attr("height", classBox.height + 2 * getConfig2().state.padding).attr("rx", getConfig2().state.radius); - return state4; + return state5; }, "drawSimpleState"); drawDescrState = /* @__PURE__ */ __name((g2, stateDef) => { const addTspan2 = /* @__PURE__ */ __name(function(textEl, txt, isFirst2) { @@ -89536,14 +90790,14 @@ g.stateGroup line { return note3; }, "drawNote"); drawState = /* @__PURE__ */ __name(function(elem, stateDef) { - const id26 = stateDef.id; + const id27 = stateDef.id; const stateInfo = { - id: id26, + id: id27, label: stateDef.id, width: 0, height: 0 }; - const g2 = elem.append("g").attr("id", id26).attr("class", "stateGroup"); + const g2 = elem.append("g").attr("id", id27).attr("class", "stateGroup"); if (stateDef.type === "start") { drawStartState(g2); } @@ -89568,7 +90822,7 @@ g.stateGroup line { const stateBox = g2.node().getBBox(); stateInfo.width = stateBox.width + 2 * getConfig2().state.padding; stateInfo.height = stateBox.height + 2 * getConfig2().state.padding; - id_cache_default.set(id26, stateInfo); + id_cache_default.set(id27, stateInfo); return stateInfo; }, "drawState"); edgeCount2 = 0; @@ -89658,27 +90912,27 @@ g.stateGroup line { insertMarkers5 = /* @__PURE__ */ __name(function(elem) { elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z"); }, "insertMarkers"); - draw15 = /* @__PURE__ */ __name(function(text2, id26, _version, diagObj) { + draw15 = /* @__PURE__ */ __name(function(text2, id27, _version, diagObj) { conf6 = getConfig2().state; const securityLevel = getConfig2().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document; log.debug("Rendering diagram " + text2); - const diagram23 = root4.select(`[id='${id26}']`); - insertMarkers5(diagram23); + const diagram24 = root4.select(`[id='${id27}']`); + insertMarkers5(diagram24); const rootDoc2 = diagObj.db.getRootDoc(); - renderDoc(rootDoc2, diagram23, void 0, false, root4, doc, diagObj); + renderDoc(rootDoc2, diagram24, void 0, false, root4, doc, diagObj); const padding3 = conf6.padding; - const bounds4 = diagram23.node().getBBox(); + const bounds4 = diagram24.node().getBBox(); const width3 = bounds4.width + padding3 * 2; const height2 = bounds4.height + padding3 * 2; const svgWidth = width3 * 1.75; - configureSvgSize(diagram23, height2, svgWidth, conf6.useMaxWidth); - diagram23.attr( + configureSvgSize(diagram24, height2, svgWidth, conf6.useMaxWidth); + diagram24.attr( "viewBox", `${bounds4.x - conf6.padding} ${bounds4.y - conf6.padding} ` + width3 + " " + height2 ); @@ -89686,7 +90940,7 @@ g.stateGroup line { getLabelWidth = /* @__PURE__ */ __name((text2) => { return text2 ? text2.length * conf6.fontSizeFactor : 1; }, "getLabelWidth"); - renderDoc = /* @__PURE__ */ __name((doc, diagram23, parentId, altBkg, root4, domDocument, diagObj) => { + renderDoc = /* @__PURE__ */ __name((doc, diagram24, parentId, altBkg, root4, domDocument, diagObj) => { const graph = new Graph({ compound: true, multigraph: true @@ -89742,7 +90996,7 @@ g.stateGroup line { } let node2; if (stateDef.doc) { - let sub2 = diagram23.append("g").attr("id", stateDef.id).attr("class", "stateGroup"); + let sub2 = diagram24.append("g").attr("id", stateDef.id).attr("class", "stateGroup"); node2 = renderDoc(stateDef.doc, sub2, stateDef.id, !altBkg, root4, domDocument, diagObj); if (first3) { sub2 = addTitleAndBox(sub2, stateDef, altBkg); @@ -89756,7 +91010,7 @@ g.stateGroup line { node2.height = boxBounds.height; } } else { - node2 = drawState(diagram23, stateDef, graph); + node2 = drawState(diagram24, stateDef, graph); } if (stateDef.note) { const noteDef = { @@ -89765,7 +91019,7 @@ g.stateGroup line { note: stateDef.note, type: "note" }; - const note3 = drawState(diagram23, noteDef, graph); + const note3 = drawState(diagram24, noteDef, graph); if (stateDef.note.position === "left of") { graph.setNode(node2.id + "-note", note3); graph.setNode(node2.id, node2); @@ -89798,7 +91052,7 @@ g.stateGroup line { }); layout(graph); log.debug("Graph after layout", graph.nodes()); - const svgElem = diagram23.node(); + const svgElem = diagram24.node(); graph.nodes().forEach(function(v3) { if (v3 !== void 0 && graph.node(v3) !== void 0) { log.warn("Node " + v3 + ": " + JSON.stringify(graph.node(v3))); @@ -89832,7 +91086,7 @@ g.stateGroup line { graph.edges().forEach(function(e3) { if (e3 !== void 0 && graph.edge(e3) !== void 0) { log.debug("Edge " + e3.v + " -> " + e3.w + ": " + JSON.stringify(graph.edge(e3))); - drawEdge2(diagram23, graph.edge(e3), graph.edge(e3).relation); + drawEdge2(diagram24, graph.edge(e3), graph.edge(e3).relation); } }); stateBox = svgElem.getBBox(); @@ -89922,7 +91176,7 @@ g.stateGroup line { for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 18], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 14]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -90027,21 +91281,21 @@ g.stateGroup line { return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -90060,7 +91314,7 @@ g.stateGroup line { }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -90477,13 +91731,13 @@ g.stateGroup line { }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser15.parser = parser15; @@ -90947,7 +92201,7 @@ g.stateGroup line { }); // src/diagrams/user-journey/journeyRenderer.ts - function drawActorLegend(diagram23) { + function drawActorLegend(diagram24) { const conf8 = getConfig2().journey; let yPos = 60; Object.keys(actors).forEach((person) => { @@ -90960,7 +92214,7 @@ g.stateGroup line { stroke: "#000", pos: actors[person].position }; - svgDraw_default4.drawCircle(diagram23, circleData); + svgDraw_default4.drawCircle(diagram24, circleData); const labelData = { x: 40, y: yPos + 7, @@ -90968,7 +92222,7 @@ g.stateGroup line { text: person, textMargin: conf8.boxTextMargin | 5 }; - svgDraw_default4.drawText(diagram23, labelData); + svgDraw_default4.drawText(diagram24, labelData); yPos += 20; }); } @@ -90990,17 +92244,17 @@ g.stateGroup line { __name(drawActorLegend, "drawActorLegend"); conf7 = getConfig2().journey; LEFT_MARGIN = conf7.leftMargin; - draw16 = /* @__PURE__ */ __name(function(text2, id26, version4, diagObj) { + draw16 = /* @__PURE__ */ __name(function(text2, id27, version4, diagObj) { const conf8 = getConfig2().journey; const securityLevel = getConfig2().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); bounds2.init(); - const diagram23 = root4.select("#" + id26); - svgDraw_default4.initGraphics(diagram23); + const diagram24 = root4.select("#" + id27); + svgDraw_default4.initGraphics(diagram24); const tasks4 = diagObj.db.getTasks(); const title2 = diagObj.db.getDiagramTitle(); const actorNames = diagObj.db.getActors(); @@ -91015,21 +92269,21 @@ g.stateGroup line { }; actorPos++; }); - drawActorLegend(diagram23); + drawActorLegend(diagram24); bounds2.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50); - drawTasks(diagram23, tasks4, 0); + drawTasks(diagram24, tasks4, 0); const box = bounds2.getBounds(); if (title2) { - diagram23.append("text").text(title2).attr("x", LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25); + diagram24.append("text").text(title2).attr("x", LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 25); } const height2 = box.stopy - box.starty + 2 * conf8.diagramMarginY; const width3 = LEFT_MARGIN + box.stopx + 2 * conf8.diagramMarginX; - configureSvgSize(diagram23, height2, width3, conf8.useMaxWidth); - diagram23.append("line").attr("x1", LEFT_MARGIN).attr("y1", conf8.height * 4).attr("x2", width3 - LEFT_MARGIN - 4).attr("y2", conf8.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"); + configureSvgSize(diagram24, height2, width3, conf8.useMaxWidth); + diagram24.append("line").attr("x1", LEFT_MARGIN).attr("y1", conf8.height * 4).attr("x2", width3 - LEFT_MARGIN - 4).attr("y2", conf8.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"); const extraVertForTitle = title2 ? 70 : 0; - diagram23.attr("viewBox", `${box.startx} -25 ${width3} ${height2 + extraVertForTitle}`); - diagram23.attr("preserveAspectRatio", "xMinYMin meet"); - diagram23.attr("height", height2 + extraVertForTitle + 25); + diagram24.attr("viewBox", `${box.startx} -25 ${width3} ${height2 + extraVertForTitle}`); + diagram24.attr("preserveAspectRatio", "xMinYMin meet"); + diagram24.attr("height", height2 + extraVertForTitle + 25); }, "draw"); bounds2 = { data: { @@ -91104,7 +92358,7 @@ g.stateGroup line { }; fills = conf7.sectionFills; textColours = conf7.sectionColours; - drawTasks = /* @__PURE__ */ __name(function(diagram23, tasks4, verticalPos) { + drawTasks = /* @__PURE__ */ __name(function(diagram24, tasks4, verticalPos) { const conf8 = getConfig2().journey; let lastSection = ""; const sectionVHeight = conf8.height * 2 + conf8.diagramMarginY; @@ -91136,7 +92390,7 @@ g.stateGroup line { colour, taskCount: taskInSectionCount }; - svgDraw_default4.drawSection(diagram23, section, conf8); + svgDraw_default4.drawSection(diagram24, section, conf8); lastSection = task.section; sectionNumber++; } @@ -91154,7 +92408,7 @@ g.stateGroup line { task.fill = fill; task.num = num; task.actors = taskActors; - svgDraw_default4.drawTask(diagram23, task, conf8); + svgDraw_default4.drawTask(diagram24, task, conf8); bounds2.insert(task.x, task.y, task.x + task.width + conf8.taskMargin, 300 + 5 * 30); } }, "drawTasks"); @@ -91201,7 +92455,7 @@ g.stateGroup line { for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 20, 21], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 16], $V7 = [1, 17]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -91310,21 +92564,21 @@ g.stateGroup line { return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -91343,7 +92597,7 @@ g.stateGroup line { }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -91757,13 +93011,13 @@ g.stateGroup line { }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser16.parser = parser16; @@ -92183,17 +93437,17 @@ g.stateGroup line { init_logger(); init_diagramAPI(); init_setupGraphViewbox(); - draw18 = /* @__PURE__ */ __name(function(text2, id26, version4, diagObj) { + draw18 = /* @__PURE__ */ __name(function(text2, id27, version4, diagObj) { const conf8 = getConfig2(); const LEFT_MARGIN2 = conf8.leftMargin ?? 50; log.debug("timeline", diagObj.db); const securityLevel = conf8.securityLevel; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); - const svg = root4.select("#" + id26); + const svg = root4.select("#" + id27); svg.append("g"); const tasks4 = diagObj.db.getTasks(); const title2 = diagObj.db.getCommonDb().getDiagramTitle(); @@ -92322,7 +93576,7 @@ g.stateGroup line { conf8.timeline?.useMaxWidth ?? false ); }, "draw"); - drawTasks2 = /* @__PURE__ */ __name(function(diagram23, tasks4, sectionColor, masterX, masterY, maxTaskHeight, conf8, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections) { + drawTasks2 = /* @__PURE__ */ __name(function(diagram24, tasks4, sectionColor, masterX, masterY, maxTaskHeight, conf8, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections) { for (const task of tasks4) { const taskNode = { descr: task.task, @@ -92333,17 +93587,17 @@ g.stateGroup line { maxHeight: maxTaskHeight }; log.debug("taskNode", taskNode); - const taskWrapper = diagram23.append("g").attr("class", "taskWrapper"); + const taskWrapper = diagram24.append("g").attr("class", "taskWrapper"); const node2 = svgDraw_default5.drawNode(taskWrapper, taskNode, sectionColor, conf8); const taskHeight = node2.height; log.debug("taskHeight after draw", taskHeight); taskWrapper.attr("transform", `translate(${masterX}, ${masterY})`); maxTaskHeight = Math.max(maxTaskHeight, taskHeight); if (task.events) { - const lineWrapper = diagram23.append("g").attr("class", "lineWrapper"); + const lineWrapper = diagram24.append("g").attr("class", "lineWrapper"); let lineLength = maxTaskHeight; masterY += 100; - lineLength = lineLength + drawEvents(diagram23, task.events, sectionColor, masterX, masterY, conf8); + lineLength = lineLength + drawEvents(diagram24, task.events, sectionColor, masterX, masterY, conf8); masterY -= 100; lineWrapper.append("line").attr("x1", masterX + 190 / 2).attr("y1", masterY + maxTaskHeight).attr("x2", masterX + 190 / 2).attr( "y2", @@ -92357,7 +93611,7 @@ g.stateGroup line { } masterY = masterY - 10; }, "drawTasks"); - drawEvents = /* @__PURE__ */ __name(function(diagram23, events, sectionColor, masterX, masterY, conf8) { + drawEvents = /* @__PURE__ */ __name(function(diagram24, events, sectionColor, masterX, masterY, conf8) { let maxEventHeight = 0; const eventBeginY = masterY; masterY = masterY + 100; @@ -92371,7 +93625,7 @@ g.stateGroup line { maxHeight: 50 }; log.debug("eventNode", eventNode); - const eventWrapper = diagram23.append("g").attr("class", "eventWrapper"); + const eventWrapper = diagram24.append("g").attr("class", "eventWrapper"); const node2 = svgDraw_default5.drawNode(eventWrapper, eventNode, sectionColor, conf8); const eventHeight = node2.height; maxEventHeight = maxEventHeight + eventHeight; @@ -92503,7 +93757,7 @@ g.stateGroup line { for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 4], $V1 = [1, 13], $V2 = [1, 12], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 20], $V6 = [1, 19], $V7 = [6, 7, 8], $V8 = [1, 26], $V9 = [1, 24], $Va = [1, 25], $Vb = [6, 7, 11], $Vc = [1, 6, 13, 15, 16, 19, 22], $Vd = [1, 33], $Ve = [1, 34], $Vf = [1, 6, 7, 11, 13, 15, 16, 19, 22]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -92618,21 +93872,21 @@ g.stateGroup line { return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -92651,7 +93905,7 @@ g.stateGroup line { }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -93156,13 +94410,13 @@ g.stateGroup line { }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser17.parser = parser17; @@ -93198,8 +94452,8 @@ g.stateGroup line { getMindmap = /* @__PURE__ */ __name(() => { return nodes2.length > 0 ? nodes2[0] : null; }, "getMindmap"); - addNode = /* @__PURE__ */ __name((level, id26, descr, type3) => { - log.info("addNode", level, id26, descr, type3); + addNode = /* @__PURE__ */ __name((level, id27, descr, type3) => { + log.info("addNode", level, id27, descr, type3); const conf8 = getConfig2(); let padding3 = conf8.mindmap?.padding ?? defaultConfig_default.mindmap.padding; switch (type3) { @@ -93210,7 +94464,7 @@ g.stateGroup line { } const node2 = { id: cnt2++, - nodeId: sanitizeText(id26, conf8), + nodeId: sanitizeText(id27, conf8), level, descr: sanitizeText(descr, conf8), type: type3, @@ -93261,8 +94515,8 @@ g.stateGroup line { return nodeType.DEFAULT; } }, "getType"); - setElementForId = /* @__PURE__ */ __name((id26, element3) => { - elements2[id26] = element3; + setElementForId = /* @__PURE__ */ __name((id27, element3) => { + elements2[id27] = element3; }, "setElementForId"); decorateNode = /* @__PURE__ */ __name((decoration) => { if (!decoration) { @@ -93298,7 +94552,7 @@ g.stateGroup line { } }, "type2Str"); getLogger = /* @__PURE__ */ __name(() => log, "getLogger"); - getElementById = /* @__PURE__ */ __name((id26) => elements2[id26], "getElementById"); + getElementById = /* @__PURE__ */ __name((id27) => elements2[id27], "getElementById"); db4 = { clear: clear25, addNode, @@ -94206,9 +95460,9 @@ g.stateGroup line { var edges5 = otherNodes[h2]._private.edges; for (var i2 = 0; i2 < edges5.length; i2++) { var edge = edges5[i2]; - var edgeData = edge._private.data; - var thisToOther = this.hasElementWithId(edgeData.source) && otherNodes.hasElementWithId(edgeData.target); - var otherToThis = otherNodes.hasElementWithId(edgeData.source) && this.hasElementWithId(edgeData.target); + var edgeData2 = edge._private.data; + var thisToOther = this.hasElementWithId(edgeData2.source) && otherNodes.hasElementWithId(edgeData2.target); + var otherToThis = otherNodes.hasElementWithId(edgeData2.source) && this.hasElementWithId(edgeData2.target); var edgeConnectsThisAndOther = thisToOther || otherToThis; if (!edgeConnectsThisAndOther) { continue; @@ -96075,7 +97329,7 @@ g.stateGroup line { }, "_delete") }, { key: "clear", - value: /* @__PURE__ */ __name(function clear29() { + value: /* @__PURE__ */ __name(function clear30() { this._obj = {}; }, "clear") }, { @@ -96136,7 +97390,7 @@ g.stateGroup line { }, "_delete") }, { key: "clear", - value: /* @__PURE__ */ __name(function clear29() { + value: /* @__PURE__ */ __name(function clear30() { this._obj = /* @__PURE__ */ Object.create(null); }, "clear") }, { @@ -96872,9 +98126,9 @@ g.stateGroup line { var openSetIds = new Set$1(); var cameFrom = {}; var cameFromEdge = {}; - var addToOpenSet = /* @__PURE__ */ __name(function addToOpenSet2(ele, id26) { + var addToOpenSet = /* @__PURE__ */ __name(function addToOpenSet2(ele, id27) { openSet.push(ele); - openSetIds.add(id26); + openSetIds.add(id27); }, "addToOpenSet"); var cMin, cMinId; var popFromOpenSet = /* @__PURE__ */ __name(function popFromOpenSet2() { @@ -96882,8 +98136,8 @@ g.stateGroup line { cMinId = cMin.id(); openSetIds["delete"](cMinId); }, "popFromOpenSet"); - var isInOpenSet = /* @__PURE__ */ __name(function isInOpenSet2(id26) { - return openSetIds.has(id26); + var isInOpenSet = /* @__PURE__ */ __name(function isInOpenSet2(id27) { + return openSetIds.has(id27); }, "isInOpenSet"); addToOpenSet(root4, sid); gScore[sid] = 0; @@ -98429,13 +99683,13 @@ g.stateGroup line { var maxOutdegree = 0; for (var _i = 0; _i < numNodes; _i++) { var _node = nodes6[_i]; - var id26 = _node.id(); + var id27 = _node.id(); options3.root = _node; var _currDegree = this.degreeCentrality(options3); if (maxIndegree < _currDegree.indegree) maxIndegree = _currDegree.indegree; if (maxOutdegree < _currDegree.outdegree) maxOutdegree = _currDegree.outdegree; - indegrees[id26] = _currDegree.indegree; - outdegrees[id26] = _currDegree.outdegree; + indegrees[id27] = _currDegree.indegree; + outdegrees[id27] = _currDegree.outdegree; } return { indegree: /* @__PURE__ */ __name(function indegree(node3) { @@ -98706,15 +99960,15 @@ g.stateGroup line { } var ret = { betweenness: /* @__PURE__ */ __name(function betweenness(node2) { - var id26 = cy.collection(node2).id(); - return C2.get(id26); + var id27 = cy.collection(node2).id(); + return C2.get(id27); }, "betweenness"), betweennessNormalized: /* @__PURE__ */ __name(function betweennessNormalized(node2) { if (max10 == 0) { return 0; } - var id26 = cy.collection(node2).id(); - return C2.get(id26) / max10; + var id27 = cy.collection(node2).id(); + return C2.get(id27) / max10; }, "betweennessNormalized") }; ret.betweennessNormalised = ret.betweennessNormalized; @@ -99770,7 +101024,7 @@ g.stateGroup line { var edges5 = {}; if (directed) { eles.forEach(function(ele) { - var id26 = ele.id(); + var id27 = ele.id(); if (ele.isNode()) { var ind = ele.indegree(true); var outd = ele.outdegree(true); @@ -99778,37 +101032,37 @@ g.stateGroup line { var d22 = outd - ind; if (d1 == 1) { if (oddIn) dflag = true; - else oddIn = id26; + else oddIn = id27; } else if (d22 == 1) { if (oddOut) dflag = true; - else oddOut = id26; + else oddOut = id27; } else if (d22 > 1 || d1 > 1) { dflag = true; } - nodes6[id26] = []; + nodes6[id27] = []; ele.outgoers().forEach(function(e3) { - if (e3.isEdge()) nodes6[id26].push(e3.id()); + if (e3.isEdge()) nodes6[id27].push(e3.id()); }); } else { - edges5[id26] = [void 0, ele.target().id()]; + edges5[id27] = [void 0, ele.target().id()]; } }); } else { eles.forEach(function(ele) { - var id26 = ele.id(); + var id27 = ele.id(); if (ele.isNode()) { var d3 = ele.degree(true); if (d3 % 2) { - if (!oddIn) oddIn = id26; - else if (!oddOut) oddOut = id26; + if (!oddIn) oddIn = id27; + else if (!oddOut) oddOut = id27; else dflag = true; } - nodes6[id26] = []; + nodes6[id27] = []; ele.connectedEdges().forEach(function(e3) { - return nodes6[id26].push(e3.id()); + return nodes6[id27].push(e3.id()); }); } else { - edges5[id26] = [ele.source().id(), ele.target().id()]; + edges5[id27] = [ele.source().id(), ele.target().id()]; } }); } @@ -99882,7 +101136,7 @@ g.stateGroup line { hopcroftTarjanBiconnected = /* @__PURE__ */ __name(function hopcroftTarjanBiconnected2() { var eles = this; var nodes6 = {}; - var id26 = 0; + var id27 = 0; var edgeCount4 = 0; var components3 = []; var stack = []; @@ -99917,8 +101171,8 @@ g.stateGroup line { var biconnectedSearch = /* @__PURE__ */ __name(function biconnectedSearch2(root4, currentNode, parent4) { if (root4 === parent4) edgeCount4 += 1; nodes6[currentNode] = { - id: id26, - low: id26++, + id: id27, + low: id27++, cutVertex: false }; var edges5 = eles.getElementById(currentNode).connectedEdges().intersection(eles); @@ -99964,10 +101218,10 @@ g.stateGroup line { } } }); - var cutVertices = Object.keys(nodes6).filter(function(id27) { - return nodes6[id27].cutVertex; - }).map(function(id27) { - return eles.getElementById(id27); + var cutVertices = Object.keys(nodes6).filter(function(id28) { + return nodes6[id28].cutVertex; + }).map(function(id28) { + return eles.getElementById(id28); }); return { cut: eles.spawn(cutVertices), @@ -100080,9 +101334,9 @@ g.stateGroup line { return next3.proxy; }, "then") }; - deliver = /* @__PURE__ */ __name(function deliver2(curr, state4, name, value2) { + deliver = /* @__PURE__ */ __name(function deliver2(curr, state5, name, value2) { if (curr.state === STATE_PENDING) { - curr.state = state4; + curr.state = state5; curr[name] = value2; execute(curr); } @@ -101346,10 +102600,10 @@ g.stateGroup line { query: true, regex: stateSelectorRegex, populate: /* @__PURE__ */ __name(function populate3(selector, query, _ref3) { - var _ref4 = _slicedToArray(_ref3, 1), state4 = _ref4[0]; + var _ref4 = _slicedToArray(_ref3, 1), state5 = _ref4[0]; query.checks.push({ type: Type3.STATE, - value: state4 + value: state5 }); }, "populate") }, { @@ -101357,10 +102611,10 @@ g.stateGroup line { query: true, regex: "\\#(" + tokens.id + ")", populate: /* @__PURE__ */ __name(function populate4(selector, query, _ref5) { - var _ref6 = _slicedToArray(_ref5, 1), id26 = _ref6[0]; + var _ref6 = _slicedToArray(_ref5, 1), id27 = _ref6[0]; query.checks.push({ type: Type3.ID, - value: cleanMetaChars(id26) + value: cleanMetaChars(id27) }); }, "populate") }, { @@ -101926,8 +103180,8 @@ g.stateGroup line { return stateSelectorMatches(stateSelector, ele); }; match[Type3.ID] = function(check, ele) { - var id26 = check.value; - return ele.id() === id26; + var id27 = check.value; + return ele.id() === id27; }; match[Type3.CLASS] = function(check, ele) { var cls = check.value; @@ -104098,8 +105352,8 @@ g.stateGroup line { var add3 = /* @__PURE__ */ __name(function add4(col, other2) { for (var i2 = 0; i2 < col.length; i2++) { var ele = col[i2]; - var id26 = ele._private.data.id; - var inOther = other2.hasElementWithId(id26); + var id27 = ele._private.data.id; + var inOther = other2.hasElementWithId(id27); if (!inOther) { elements3.push(ele); } @@ -104122,8 +105376,8 @@ g.stateGroup line { var add3 = /* @__PURE__ */ __name(function add4(col, other2, retEles) { for (var i2 = 0; i2 < col.length; i2++) { var ele = col[i2]; - var id26 = ele._private.data.id; - var inOther = other2.hasElementWithId(id26); + var id27 = ele._private.data.id; + var inOther = other2.hasElementWithId(id27); if (inOther) { both.merge(ele); } else { @@ -104172,12 +105426,12 @@ g.stateGroup line { var map5 = _p.map; for (var i2 = 0; i2 < toAdd.length; i2++) { var toAddEle = toAdd[i2]; - var id26 = toAddEle._private.data.id; - var add3 = !map5.has(id26); + var id27 = toAddEle._private.data.id; + var add3 = !map5.has(id27); if (add3) { var index = this.length++; this[index] = toAddEle; - map5.set(id26, { + map5.set(id27, { ele: toAddEle, index }); @@ -104187,11 +105441,11 @@ g.stateGroup line { }, "merge"), unmergeAt: /* @__PURE__ */ __name(function unmergeAt(i2) { var ele = this[i2]; - var id26 = ele.id(); + var id27 = ele.id(); var _p = this._private; var map5 = _p.map; this[i2] = void 0; - map5["delete"](id26); + map5["delete"](id27); var unmergedLastEle = i2 === this.length - 1; if (this.length > 1 && !unmergedLastEle) { var lastEleI = this.length - 1; @@ -104211,9 +105465,9 @@ g.stateGroup line { unmergeOne: /* @__PURE__ */ __name(function unmergeOne(ele) { ele = ele[0]; var _p = this._private; - var id26 = ele._private.data.id; + var id27 = ele._private.data.id; var map5 = _p.map; - var entry = map5.get(id26); + var entry = map5.get(id27); if (!entry) { return this; } @@ -104659,10 +105913,10 @@ g.stateGroup line { elesfn$4 = { recalculateRenderedStyle: /* @__PURE__ */ __name(function recalculateRenderedStyle(useCache) { var cy = this.cy(); - var renderer7 = cy.renderer(); + var renderer8 = cy.renderer(); var styleEnabled2 = cy.styleEnabled(); - if (renderer7 && styleEnabled2) { - renderer7.recalculateRenderedStyle(this, useCache); + if (renderer8 && styleEnabled2) { + renderer8.recalculateRenderedStyle(this, useCache); } return this; }, "recalculateRenderedStyle"), @@ -105298,10 +106552,10 @@ g.stateGroup line { if (element$1 == null) { continue; } - var id26 = element$1._private.data.id; - if (!unique || !map5.has(id26)) { + var id27 = element$1._private.data.id; + if (!unique || !map5.has(id27)) { if (unique) { - map5.set(id26, { + map5.set(id27, { index: this.length, ele: element$1 }); @@ -105370,30 +106624,30 @@ g.stateGroup line { elesfn$1.unique = function() { return new Collection(this._private.cy, this, true); }; - elesfn$1.hasElementWithId = function(id26) { - id26 = "" + id26; - return this._private.map.has(id26); + elesfn$1.hasElementWithId = function(id27) { + id27 = "" + id27; + return this._private.map.has(id27); }; - elesfn$1.getElementById = function(id26) { - id26 = "" + id26; + elesfn$1.getElementById = function(id27) { + id27 = "" + id27; var cy = this._private.cy; - var entry = this._private.map.get(id26); + var entry = this._private.map.get(id27); return entry ? entry.ele : new Collection(cy); }; elesfn$1.$id = elesfn$1.getElementById; elesfn$1.poolIndex = function() { var cy = this._private.cy; var eles = cy._private.elements; - var id26 = this[0]._private.data.id; - return eles._private.map.get(id26).index; + var id27 = this[0]._private.data.id; + return eles._private.map.get(id27).index; }; elesfn$1.indexOf = function(ele) { - var id26 = ele[0]._private.data.id; - return this._private.map.get(id26).index; + var id27 = ele[0]._private.data.id; + return this._private.map.get(id27).index; }; - elesfn$1.indexOfId = function(id26) { - id26 = "" + id26; - return this._private.map.get(id26).index; + elesfn$1.indexOfId = function(id27) { + id27 = "" + id27; + return this._private.map.get(id27).index; }; elesfn$1.json = function(obj) { var ele = this.element(); @@ -105553,7 +106807,7 @@ g.stateGroup line { removeFromElements(); continue; } - var id26 = _data3.id; + var id27 = _data3.id; if (_ele2.isNode()) { var pos = _private.position; if (pos.x == null) { @@ -105575,10 +106829,10 @@ g.stateGroup line { val = _data3[field] = "" + _data3[field]; } if (val == null || val === "") { - error("Can not create edge `" + id26 + "` with unspecified " + field); + error("Can not create edge `" + id27 + "` with unspecified " + field); badSourceOrTarget = true; } else if (!cy.hasElementWithId(val)) { - error("Can not create edge `" + id26 + "` with nonexistant " + field + " `" + val + "`"); + error("Can not create edge `" + id27 + "` with nonexistant " + field + " `" + val + "`"); badSourceOrTarget = true; } } @@ -105598,7 +106852,7 @@ g.stateGroup line { edge._private.target = tgt; } _private.map = new Map$2(); - _private.map.set(id26, { + _private.map.set(id27, { ele: _ele2, index: 0 }); @@ -105801,8 +107055,8 @@ g.stateGroup line { var eles = this; var notifyRenderer = false; var modifyPool = false; - var toString6 = /* @__PURE__ */ __name(function toString7(id26) { - return id26 == null ? id26 : "" + id26; + var toString6 = /* @__PURE__ */ __name(function toString7(id27) { + return id27 == null ? id27 : "" + id27; }, "toString"); if (struct.source !== void 0 || struct.target !== void 0) { var srcId = toString6(struct.source); @@ -105907,31 +107161,31 @@ g.stateGroup line { }; __name(generateCubicBezier, "generateCubicBezier"); generateSpringRK4 = /* @__PURE__ */ function() { - function springAccelerationForState(state4) { - return -state4.tension * state4.x - state4.friction * state4.v; + function springAccelerationForState(state5) { + return -state5.tension * state5.x - state5.friction * state5.v; } __name(springAccelerationForState, "springAccelerationForState"); function springEvaluateStateWithDerivative(initialState, dt, derivative) { - var state4 = { + var state5 = { x: initialState.x + derivative.dx * dt, v: initialState.v + derivative.dv * dt, tension: initialState.tension, friction: initialState.friction }; return { - dx: state4.v, - dv: springAccelerationForState(state4) + dx: state5.v, + dv: springAccelerationForState(state5) }; } __name(springEvaluateStateWithDerivative, "springEvaluateStateWithDerivative"); - function springIntegrateState(state4, dt) { + function springIntegrateState(state5, dt) { var a2 = { - dx: state4.v, - dv: springAccelerationForState(state4) - }, b2 = springEvaluateStateWithDerivative(state4, dt * 0.5, a2), c3 = springEvaluateStateWithDerivative(state4, dt * 0.5, b2), d2 = springEvaluateStateWithDerivative(state4, dt, c3), dxdt = 1 / 6 * (a2.dx + 2 * (b2.dx + c3.dx) + d2.dx), dvdt = 1 / 6 * (a2.dv + 2 * (b2.dv + c3.dv) + d2.dv); - state4.x = state4.x + dxdt * dt; - state4.v = state4.v + dvdt * dt; - return state4; + dx: state5.v, + dv: springAccelerationForState(state5) + }, b2 = springEvaluateStateWithDerivative(state5, dt * 0.5, a2), c3 = springEvaluateStateWithDerivative(state5, dt * 0.5, b2), d2 = springEvaluateStateWithDerivative(state5, dt, c3), dxdt = 1 / 6 * (a2.dx + 2 * (b2.dx + c3.dx) + d2.dx), dvdt = 1 / 6 * (a2.dv + 2 * (b2.dv + c3.dv) + d2.dv); + state5.x = state5.x + dxdt * dt; + state5.v = state5.v + dvdt * dt; + return state5; } __name(springIntegrateState, "springIntegrateState"); return /* @__PURE__ */ __name(function springRK4Factory(tension, friction, duration) { @@ -106063,11 +107317,11 @@ g.stateGroup line { }, "animationStep")); } __name(headlessStep, "headlessStep"); - var renderer7 = cy.renderer(); - if (renderer7 && renderer7.beforeRender) { - renderer7.beforeRender(/* @__PURE__ */ __name(function rendererAnimationStep(willDraw, now4) { + var renderer8 = cy.renderer(); + if (renderer8 && renderer8.beforeRender) { + renderer8.beforeRender(/* @__PURE__ */ __name(function rendererAnimationStep(willDraw, now4) { stepAll(now4, cy); - }, "rendererAnimationStep"), renderer7.beforeRenderPriorities.animations); + }, "rendererAnimationStep"), renderer8.beforeRenderPriorities.animations); } else { headlessStep(); } @@ -106147,15 +107401,15 @@ g.stateGroup line { define2.eventAliasesOn(elesfn); corefn$7 = { png: /* @__PURE__ */ __name(function png(options3) { - var renderer7 = this._private.renderer; + var renderer8 = this._private.renderer; options3 = options3 || {}; - return renderer7.png(options3); + return renderer8.png(options3); }, "png"), jpg: /* @__PURE__ */ __name(function jpg(options3) { - var renderer7 = this._private.renderer; + var renderer8 = this._private.renderer; options3 = options3 || {}; options3.bg = options3.bg || "#fff"; - return renderer7.jpg(options3); + return renderer8.jpg(options3); }, "jpg") }; corefn$7.jpeg = corefn$7.jpg; @@ -106204,11 +107458,11 @@ g.stateGroup line { if (!_p.notificationsEnabled) { return; } - var renderer7 = this.renderer(); - if (this.destroyed() || !renderer7) { + var renderer8 = this.renderer(); + if (this.destroyed() || !renderer8) { return; } - renderer7.notify(eventName, eventEles); + renderer8.notify(eventName, eventEles); }, "notify"), notifications: /* @__PURE__ */ __name(function notifications(bool2) { var p3 = this._private; @@ -106247,13 +107501,13 @@ g.stateGroup line { _p.batchCount--; if (_p.batchCount === 0) { _p.batchStyleEles.updateStyle(); - var renderer7 = this.renderer(); + var renderer8 = this.renderer(); Object.keys(_p.batchNotifications).forEach(function(eventName) { var eles = _p.batchNotifications[eventName]; if (eles.empty()) { - renderer7.notify(eventName); + renderer8.notify(eventName); } else { - renderer7.notify(eventName, eles); + renderer8.notify(eventName, eles); } }); } @@ -106271,9 +107525,9 @@ g.stateGroup line { return this.batch(function() { var ids = Object.keys(map5); for (var i2 = 0; i2 < ids.length; i2++) { - var id26 = ids[i2]; - var data5 = map5[id26]; - var ele = cy.getElementById(id26); + var id27 = ids[i2]; + var data5 = map5[id27]; + var ele = cy.getElementById(id27); ele.data(data5); } }); @@ -109138,8 +110392,8 @@ g.stateGroup line { } var regexes = type3.regexes ? type3.regexes : [type3.regex]; for (var _i3 = 0; _i3 < regexes.length; _i3++) { - var regex = new RegExp(regexes[_i3]); - var m2 = regex.exec(value2); + var regex2 = new RegExp(regexes[_i3]); + var m2 = regex2.exec(value2); if (m2) { return { name, @@ -110006,11 +111260,11 @@ g.stateGroup line { cy._private.destroyed = true; return cy; }, "destroy"), - hasElementWithId: /* @__PURE__ */ __name(function hasElementWithId(id26) { - return this._private.elements.hasElementWithId(id26); + hasElementWithId: /* @__PURE__ */ __name(function hasElementWithId(id27) { + return this._private.elements.hasElementWithId(id27); }, "hasElementWithId"), - getElementById: /* @__PURE__ */ __name(function getElementById2(id26) { - return this._private.elements.getElementById(id26); + getElementById: /* @__PURE__ */ __name(function getElementById2(id27) { + return this._private.elements.getElementById(id27); }, "getElementById"), hasCompoundNodes: /* @__PURE__ */ __name(function hasCompoundNodes() { return this._private.hasCompoundNodes; @@ -110098,9 +111352,9 @@ g.stateGroup line { warn("cy.json() cannot handle elements without an ID attribute"); continue; } - var id26 = "" + json4.data.id; - var ele = cy.getElementById(id26); - idInJson[id26] = true; + var id27 = "" + json4.data.id; + var ele = cy.getElementById(id27); + idInJson[id27] = true; if (ele.length !== 0) { toMod.push({ ele, @@ -110298,8 +111552,8 @@ g.stateGroup line { } else if (array2(options3.roots)) { var rootsArray = []; for (var i2 = 0; i2 < options3.roots.length; i2++) { - var id26 = options3.roots[i2]; - var ele = cy.getElementById(id26); + var id27 = options3.roots[i2]; + var ele = cy.getElementById(id27); rootsArray.push(ele); } roots = cy.collection(rootsArray); @@ -110347,9 +111601,9 @@ g.stateGroup line { directed: options3.directed, visit: /* @__PURE__ */ __name(function visit(node2, edge, pNode, i3, depth) { var ele2 = node2[0]; - var id27 = ele2.id(); + var id28 = ele2.id(); addToDepth(ele2, depth); - foundByBfs[id27] = true; + foundByBfs[id28] = true; }, "visit") }); var orphanNodes = []; @@ -110387,19 +111641,19 @@ g.stateGroup line { return el.isNode() && eles.has(el); }); var maxDepth = -1; - var id27 = ele2.id(); + var id28 = ele2.id(); for (var k2 = 0; k2 < incomers.length; k2++) { var incmr = incomers[k2]; var iInfo = getInfo(incmr); maxDepth = Math.max(maxDepth, iInfo.depth); } if (eInfo.depth <= maxDepth) { - if (!options3.acyclic && shifted2[id27]) { + if (!options3.acyclic && shifted2[id28]) { return null; } var newDepth = maxDepth + 1; changeDepth(ele2, newDepth); - shifted2[id27] = newDepth; + shifted2[id28] = newDepth; return true; } return false; @@ -110800,8 +112054,8 @@ g.stateGroup line { } } eles.nodes().layoutPositions(this, options3, function(ele) { - var id26 = ele.id(); - return pos[id26]; + var id27 = ele.id(); + return pos[id27]; }); return this; }; @@ -111957,7 +113211,7 @@ g.stateGroup line { BRp$f.arrowShapeWidth = 0.3; BRp$f.registerArrowShapes = function() { var arrowShapes = this.arrowShapes = {}; - var renderer7 = this; + var renderer8 = this; var bbCollide = /* @__PURE__ */ __name(function bbCollide2(x5, y5, size5, angle2, translation, edgeWidth, padding3) { var x1 = translation.x - size5 / 2 - padding3; var x22 = translation.x + size5 / 2 + padding3; @@ -112011,9 +113265,9 @@ g.stateGroup line { return inside; }, "collide"), roughCollide: bbCollide, - draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation) { + draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation) { var points = transformPoints(this.points, size5, angle2, translation); - renderer7.arrowShapeImpl("polygon")(context, points); + renderer8.arrowShapeImpl("polygon")(context, points); }, "draw"), spacing: /* @__PURE__ */ __name(function spacing2(edge) { return 0; @@ -112036,11 +113290,11 @@ g.stateGroup line { points: arrowShapes["triangle"].points, controlPoint: [0, -0.15], roughCollide: bbCollide, - draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation, edgeWidth) { + draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) { var ptsTrans = transformPoints(this.points, size5, angle2, translation); var ctrlPt = this.controlPoint; var ctrlPtTrans = transform8(ctrlPt[0], ctrlPt[1], size5, angle2, translation); - renderer7.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans); + renderer8.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans); }, "draw"), gap: /* @__PURE__ */ __name(function gap(edge) { return standardGap(edge) * 0.8; @@ -112055,10 +113309,10 @@ g.stateGroup line { var inside = pointInsidePolygonPoints(x5, y5, triPts) || pointInsidePolygonPoints(x5, y5, teePts); return inside; }, "collide"), - draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation, edgeWidth) { + draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) { var triPts = transformPoints(this.points, size5, angle2, translation); var teePts = transformPoints(this.pointsTee, size5, angle2, translation); - renderer7.arrowShapeImpl(this.name)(context, triPts, teePts); + renderer8.arrowShapeImpl(this.name)(context, triPts, teePts); }, "draw") }); defineArrowShape("circle-triangle", { @@ -112070,12 +113324,12 @@ g.stateGroup line { var triPts = pointsToArr(transformPoints(this.points, size5 + 2 * padding3, angle2, translation)); return pointInsidePolygonPoints(x5, y5, triPts) || circleInside; }, "collide"), - draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation, edgeWidth) { + draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) { var triPts = transformPoints(this.pointsTr, size5, angle2, translation); - renderer7.arrowShapeImpl(this.name)(context, triPts, translation.x, translation.y, this.radius * size5); + renderer8.arrowShapeImpl(this.name)(context, triPts, translation.x, translation.y, this.radius * size5); }, "draw"), spacing: /* @__PURE__ */ __name(function spacing2(edge) { - return renderer7.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius; + return renderer8.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius; }, "spacing") }); defineArrowShape("triangle-cross", { @@ -112107,10 +113361,10 @@ g.stateGroup line { var inside = pointInsidePolygonPoints(x5, y5, triPts) || pointInsidePolygonPoints(x5, y5, teePts); return inside; }, "collide"), - draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation, edgeWidth) { + draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) { var triPts = transformPoints(this.points, size5, angle2, translation); var crossLinePts = transformPoints(this.crossLinePts(size5, edgeWidth), size5, angle2, translation); - renderer7.arrowShapeImpl(this.name)(context, triPts, crossLinePts); + renderer8.arrowShapeImpl(this.name)(context, triPts, crossLinePts); }, "draw") }); defineArrowShape("vee", { @@ -112126,11 +113380,11 @@ g.stateGroup line { var inside = Math.pow(t4.x - x5, 2) + Math.pow(t4.y - y5, 2) <= Math.pow((size5 + 2 * padding3) * this.radius, 2); return inside; }, "collide"), - draw: /* @__PURE__ */ __name(function draw23(context, size5, angle2, translation, edgeWidth) { - renderer7.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size5); + draw: /* @__PURE__ */ __name(function draw24(context, size5, angle2, translation, edgeWidth) { + renderer8.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size5); }, "draw"), spacing: /* @__PURE__ */ __name(function spacing2(edge) { - return renderer7.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius; + return renderer8.getArrowWidth(edge.pstyle("width").pfValue, edge.pstyle("arrow-scale").value) * this.radius; }, "spacing") }); defineArrowShape("tee", { @@ -116138,7 +117392,7 @@ g.stateGroup line { renderer: this, name, points, - draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) { this.renderer.nodeShapeImpl("polygon", context, centerX, centerY, width3, height2, this.points); }, "draw"), intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { @@ -116153,7 +117407,7 @@ g.stateGroup line { return this.nodeShapes["ellipse"] = { renderer: this, name: "ellipse", - draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) { this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2); }, "draw"), intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { @@ -116197,7 +117451,7 @@ g.stateGroup line { } return rs[field]; }, "getOrCreateCorners"), - draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius, rs) { + draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius, rs) { this.renderer.nodeShapeImpl("round-polygon", context, centerX, centerY, width3, height2, this.points, this.getOrCreateCorners(centerX, centerY, width3, height2, cornerRadius, rs, "drawCorners")); }, "draw"), intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius, rs) { @@ -116213,7 +117467,7 @@ g.stateGroup line { renderer: this, name: "round-rectangle", points: generateUnitNgonPointsFitToSquare(4, 0), - draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) { this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2, this.points, cornerRadius); }, "draw"), intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { @@ -116253,7 +117507,7 @@ g.stateGroup line { name: "cut-rectangle", cornerLength: getCutRectangleCornerLength(), points: generateUnitNgonPointsFitToSquare(4, 0), - draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) { this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2, null, cornerRadius); }, "draw"), generateCutTrianglePts: /* @__PURE__ */ __name(function generateCutTrianglePts(width3, height2, centerX, centerY, cornerRadius) { @@ -116294,7 +117548,7 @@ g.stateGroup line { renderer: this, name: "barrel", points: generateUnitNgonPointsFitToSquare(4, 0), - draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) { this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2); }, "draw"), intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { @@ -116422,7 +117676,7 @@ g.stateGroup line { renderer: this, name: "bottom-round-rectangle", points: generateUnitNgonPointsFitToSquare(4, 0), - draw: /* @__PURE__ */ __name(function draw23(context, centerX, centerY, width3, height2, cornerRadius) { + draw: /* @__PURE__ */ __name(function draw24(context, centerX, centerY, width3, height2, cornerRadius) { this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width3, height2, this.points, cornerRadius); }, "draw"), intersectLine: /* @__PURE__ */ __name(function intersectLine3(nodeX, nodeY, width3, height2, x5, y5, padding3, cornerRadius) { @@ -116463,7 +117717,7 @@ g.stateGroup line { }; BRp$2.registerNodeShapes = function() { var nodeShapes = this.nodeShapes = {}; - var renderer7 = this; + var renderer8 = this; this.generateEllipse(); this.generatePolygon("triangle", generateUnitNgonPointsFitToSquare(3, 0)); this.generateRoundPolygon("round-triangle", generateUnitNgonPointsFitToSquare(3, 0)); @@ -116521,7 +117775,7 @@ g.stateGroup line { if (shape = this[name]) { return shape; } - return renderer7.generatePolygon(name, points); + return renderer8.generatePolygon(name, points); }; }; BRp$1 = {}; @@ -116855,16 +118109,16 @@ g.stateGroup line { }, "getIdsFor") }, { key: "addIdForKey", - value: /* @__PURE__ */ __name(function addIdForKey(key, id26) { + value: /* @__PURE__ */ __name(function addIdForKey(key, id27) { if (key != null) { - this.getIdsFor(key).add(id26); + this.getIdsFor(key).add(id27); } }, "addIdForKey") }, { key: "deleteIdForKey", - value: /* @__PURE__ */ __name(function deleteIdForKey(key, id26) { + value: /* @__PURE__ */ __name(function deleteIdForKey(key, id27) { if (key != null) { - this.getIdsFor(key)["delete"](id26); + this.getIdsFor(key)["delete"](id27); } }, "deleteIdForKey") }, { @@ -116879,26 +118133,26 @@ g.stateGroup line { }, { key: "updateKeyMappingFor", value: /* @__PURE__ */ __name(function updateKeyMappingFor(ele) { - var id26 = ele.id(); - var prevKey = this.keyForId.get(id26); + var id27 = ele.id(); + var prevKey = this.keyForId.get(id27); var currKey = this.getKey(ele); - this.deleteIdForKey(prevKey, id26); - this.addIdForKey(currKey, id26); - this.keyForId.set(id26, currKey); + this.deleteIdForKey(prevKey, id27); + this.addIdForKey(currKey, id27); + this.keyForId.set(id27, currKey); }, "updateKeyMappingFor") }, { key: "deleteKeyMappingFor", value: /* @__PURE__ */ __name(function deleteKeyMappingFor(ele) { - var id26 = ele.id(); - var prevKey = this.keyForId.get(id26); - this.deleteIdForKey(prevKey, id26); - this.keyForId["delete"](id26); + var id27 = ele.id(); + var prevKey = this.keyForId.get(id27); + this.deleteIdForKey(prevKey, id27); + this.keyForId["delete"](id27); }, "deleteKeyMappingFor") }, { key: "keyHasChangedFor", value: /* @__PURE__ */ __name(function keyHasChangedFor(ele) { - var id26 = ele.id(); - var prevKey = this.keyForId.get(id26); + var id27 = ele.id(); + var prevKey = this.keyForId.get(id27); var newKey = this.getKey(ele); return prevKey !== newKey; }, "keyHasChangedFor") @@ -116988,8 +118242,8 @@ g.stateGroup line { }, { key: "invalidate", value: /* @__PURE__ */ __name(function invalidate(ele) { - var id26 = ele.id(); - var key = this.keyForId.get(id26); + var id27 = ele.id(); + var key = this.keyForId.get(id27); this.deleteKeyMappingFor(ele); var entireKeyInvalidated = this.doesEleInvalidateKey(ele); if (entireKeyInvalidated) { @@ -117034,9 +118288,9 @@ g.stateGroup line { allowEdgeTxrCaching: true, allowParentTxrCaching: true }); - ElementTextureCache = /* @__PURE__ */ __name(function ElementTextureCache2(renderer7, initOptions) { + ElementTextureCache = /* @__PURE__ */ __name(function ElementTextureCache2(renderer8, initOptions) { var self2 = this; - self2.renderer = renderer7; + self2.renderer = renderer8; self2.onDequeues = []; var opts = initDefaults(initOptions); extend2(self2, opts); @@ -117406,9 +118660,9 @@ g.stateGroup line { invalidThreshold = 250; maxLayerArea = 4e3 * 4e3; useHighQualityEleTxrReqs = true; - LayeredTextureCache = /* @__PURE__ */ __name(function LayeredTextureCache2(renderer7) { + LayeredTextureCache = /* @__PURE__ */ __name(function LayeredTextureCache2(renderer8) { var self2 = this; - var r2 = self2.renderer = renderer7; + var r2 = self2.renderer = renderer8; var cy = r2.cy; self2.layersByLevel = {}; self2.firstGet = true; @@ -119554,7 +120808,7 @@ g.stateGroup line { context2.globalCompositeOperation = gco; } __name(mbclear, "mbclear"); - function setContextTransform(context2, clear30) { + function setContextTransform(context2, clear31) { var ePan, eZoom, w3, h2; if (!r2.clearingMotionBlur && (context2 === data5.bufferContexts[r2.MOTIONBLUR_BUFFER_NODE] || context2 === data5.bufferContexts[r2.MOTIONBLUR_BUFFER_DRAG])) { ePan = { @@ -119571,9 +120825,9 @@ g.stateGroup line { h2 = r2.canvasHeight; } context2.setTransform(1, 0, 0, 1, 0, 0); - if (clear30 === "motionBlur") { + if (clear31 === "motionBlur") { mbclear(context2, 0, 0, w3, h2); - } else if (!forcedContext && (clear30 === void 0 || clear30)) { + } else if (!forcedContext && (clear31 === void 0 || clear31)) { context2.clearRect(0, 0, w3, h2); } if (!drawAllLayers) { @@ -119653,8 +120907,8 @@ g.stateGroup line { if (needDraw[r2.NODE] || drawAllLayers || drawOnlyNodeLayer || needMbClear[r2.NODE]) { var useBuffer = motionBlur && !needMbClear[r2.NODE] && mbPxRatio !== 1; var context = forcedContext || (useBuffer ? r2.data.bufferContexts[r2.MOTIONBLUR_BUFFER_NODE] : data5.contexts[r2.NODE]); - var clear29 = motionBlur && !useBuffer ? "motionBlur" : void 0; - setContextTransform(context, clear29); + var clear30 = motionBlur && !useBuffer ? "motionBlur" : void 0; + setContextTransform(context, clear30); if (hideEdges) { r2.drawCachedNodes(context, eles.nondrag, pixelRatio, extent2); } else { @@ -122130,9 +123384,9 @@ g.stateGroup line { UniqueIDGeneretor.lastID++; return obj.uniqueID; }; - UniqueIDGeneretor.getString = function(id26) { - if (id26 == null) id26 = UniqueIDGeneretor.lastID; - return "Object#" + id26; + UniqueIDGeneretor.getString = function(id27) { + if (id27 == null) id27 = UniqueIDGeneretor.lastID; + return "Object#" + id27; }; UniqueIDGeneretor.isPrimitive = function(arg) { var type3 = typeof arg === "undefined" ? "undefined" : _typeof2(arg); @@ -123317,7 +124571,7 @@ g.stateGroup line { }, "getScore") }, { key: "getAlignments", - value: /* @__PURE__ */ __name(function getAlignments() { + value: /* @__PURE__ */ __name(function getAlignments2() { return this.alignments; }, "getAlignments") // Main dynamic programming procedure @@ -123896,9 +125150,9 @@ g.stateGroup line { var pData = {}; for (var i2 = 0; i2 < allNodes.length; i2++) { var rect4 = allNodes[i2].rect; - var id26 = allNodes[i2].id; - pData[id26] = { - id: id26, + var id27 = allNodes[i2].id; + pData[id27] = { + id: id27, x: rect4.getCenterX(), y: rect4.getCenterY(), w: rect4.width, @@ -124139,47 +125393,47 @@ g.stateGroup line { CoSELayout.prototype.clearZeroDegreeMembers = function() { var self2 = this; var tiledZeroDegreePack = this.tiledZeroDegreePack = []; - Object.keys(this.memberGroups).forEach(function(id26) { - var compoundNode = self2.idToDummyNode[id26]; - tiledZeroDegreePack[id26] = self2.tileNodes(self2.memberGroups[id26], compoundNode.paddingLeft + compoundNode.paddingRight); - compoundNode.rect.width = tiledZeroDegreePack[id26].width; - compoundNode.rect.height = tiledZeroDegreePack[id26].height; + Object.keys(this.memberGroups).forEach(function(id27) { + var compoundNode = self2.idToDummyNode[id27]; + tiledZeroDegreePack[id27] = self2.tileNodes(self2.memberGroups[id27], compoundNode.paddingLeft + compoundNode.paddingRight); + compoundNode.rect.width = tiledZeroDegreePack[id27].width; + compoundNode.rect.height = tiledZeroDegreePack[id27].height; }); }; CoSELayout.prototype.repopulateCompounds = function() { for (var i2 = this.compoundOrder.length - 1; i2 >= 0; i2--) { var lCompoundNode = this.compoundOrder[i2]; - var id26 = lCompoundNode.id; + var id27 = lCompoundNode.id; var horizontalMargin = lCompoundNode.paddingLeft; var verticalMargin = lCompoundNode.paddingTop; - this.adjustLocations(this.tiledMemberPack[id26], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin); + this.adjustLocations(this.tiledMemberPack[id27], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin); } }; CoSELayout.prototype.repopulateZeroDegreeMembers = function() { var self2 = this; var tiledPack = this.tiledZeroDegreePack; - Object.keys(tiledPack).forEach(function(id26) { - var compoundNode = self2.idToDummyNode[id26]; + Object.keys(tiledPack).forEach(function(id27) { + var compoundNode = self2.idToDummyNode[id27]; var horizontalMargin = compoundNode.paddingLeft; var verticalMargin = compoundNode.paddingTop; - self2.adjustLocations(tiledPack[id26], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin); + self2.adjustLocations(tiledPack[id27], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin); }); }; CoSELayout.prototype.getToBeTiled = function(node2) { - var id26 = node2.id; - if (this.toBeTiled[id26] != null) { - return this.toBeTiled[id26]; + var id27 = node2.id; + if (this.toBeTiled[id27] != null) { + return this.toBeTiled[id27]; } var childGraph = node2.getChild(); if (childGraph == null) { - this.toBeTiled[id26] = false; + this.toBeTiled[id27] = false; return false; } var children2 = childGraph.getNodes(); for (var i2 = 0; i2 < children2.length; i2++) { var theChild = children2[i2]; if (this.getNodeDegree(theChild) > 0) { - this.toBeTiled[id26] = false; + this.toBeTiled[id27] = false; return false; } if (theChild.getChild() == null) { @@ -124187,15 +125441,15 @@ g.stateGroup line { continue; } if (!this.getToBeTiled(theChild)) { - this.toBeTiled[id26] = false; + this.toBeTiled[id27] = false; return false; } } - this.toBeTiled[id26] = true; + this.toBeTiled[id27] = true; return true; }; CoSELayout.prototype.getNodeDegree = function(node2) { - var id26 = node2.id; + var id27 = node2.id; var edges5 = node2.getEdges(); var degree = 0; for (var i2 = 0; i2 < edges5.length; i2++) { @@ -124254,11 +125508,11 @@ g.stateGroup line { CoSELayout.prototype.tileCompoundMembers = function(childGraphMap, idToNode) { var self2 = this; this.tiledMemberPack = []; - Object.keys(childGraphMap).forEach(function(id26) { - var compoundNode = idToNode[id26]; - self2.tiledMemberPack[id26] = self2.tileNodes(childGraphMap[id26], compoundNode.paddingLeft + compoundNode.paddingRight); - compoundNode.rect.width = self2.tiledMemberPack[id26].width; - compoundNode.rect.height = self2.tiledMemberPack[id26].height; + Object.keys(childGraphMap).forEach(function(id27) { + var compoundNode = idToNode[id27]; + self2.tiledMemberPack[id27] = self2.tileNodes(childGraphMap[id27], compoundNode.paddingLeft + compoundNode.paddingRight); + compoundNode.rect.width = self2.tiledMemberPack[id27].width; + compoundNode.rect.height = self2.tiledMemberPack[id27].height; }); }; CoSELayout.prototype.tileNodes = function(nodes6, minWidth) { @@ -124440,25 +125694,25 @@ g.stateGroup line { CoSELayout.prototype.growTree = function(prunedNodesAll) { var lengthOfPrunedNodesInStep = prunedNodesAll.length; var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1]; - var nodeData; + var nodeData2; for (var i2 = 0; i2 < prunedNodesInStep.length; i2++) { - nodeData = prunedNodesInStep[i2]; - this.findPlaceforPrunedNode(nodeData); - nodeData[2].add(nodeData[0]); - nodeData[2].add(nodeData[1], nodeData[1].source, nodeData[1].target); + nodeData2 = prunedNodesInStep[i2]; + this.findPlaceforPrunedNode(nodeData2); + nodeData2[2].add(nodeData2[0]); + nodeData2[2].add(nodeData2[1], nodeData2[1].source, nodeData2[1].target); } prunedNodesAll.splice(prunedNodesAll.length - 1, 1); this.graphManager.resetAllNodes(); this.graphManager.resetAllEdges(); }; - CoSELayout.prototype.findPlaceforPrunedNode = function(nodeData) { + CoSELayout.prototype.findPlaceforPrunedNode = function(nodeData2) { var gridForPrunedNode; var nodeToConnect; - var prunedNode = nodeData[0]; - if (prunedNode == nodeData[1].source) { - nodeToConnect = nodeData[1].target; + var prunedNode = nodeData2[0]; + if (prunedNode == nodeData2[1].source) { + nodeToConnect = nodeData2[1].target; } else { - nodeToConnect = nodeData[1].source; + nodeToConnect = nodeData2[1].source; } var startGridX = nodeToConnect.startX; var finishGridX = nodeToConnect.finishX; @@ -124985,25 +126239,25 @@ g.stateGroup line { init_createText(); init_utils2(); MAX_SECTIONS2 = 12; - defaultBkg2 = /* @__PURE__ */ __name(function(db7, elem, node2, section) { + defaultBkg2 = /* @__PURE__ */ __name(function(db8, elem, node2, section) { const rd = 5; - elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr( + elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr( "d", `M0 ${node2.height - rd} v${-node2.height + 2 * rd} q0,-5 5,-5 h${node2.width - 2 * rd} q5,0 5,5 v${node2.height - rd} H0 Z` ); elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node2.height).attr("x2", node2.width).attr("y2", node2.height); }, "defaultBkg"); - rectBkg = /* @__PURE__ */ __name(function(db7, elem, node2) { - elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr("height", node2.height).attr("width", node2.width); + rectBkg = /* @__PURE__ */ __name(function(db8, elem, node2) { + elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr("height", node2.height).attr("width", node2.width); }, "rectBkg"); - cloudBkg = /* @__PURE__ */ __name(function(db7, elem, node2) { + cloudBkg = /* @__PURE__ */ __name(function(db8, elem, node2) { const w3 = node2.width; const h2 = node2.height; const r1 = 0.15 * w3; const r2 = 0.25 * w3; const r3 = 0.35 * w3; const r4 = 0.2 * w3; - elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr( + elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr( "d", `M0 0 a${r1},${r1} 0 0,1 ${w3 * 0.25},${-1 * w3 * 0.1} a${r3},${r3} 1 0,1 ${w3 * 0.4},${-1 * w3 * 0.1} @@ -125022,11 +126276,11 @@ g.stateGroup line { H0 V0 Z` ); }, "cloudBkg"); - bangBkg = /* @__PURE__ */ __name(function(db7, elem, node2) { + bangBkg = /* @__PURE__ */ __name(function(db8, elem, node2) { const w3 = node2.width; const h2 = node2.height; const r2 = 0.15 * w3; - elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr( + elem.append("path").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr( "d", `M0 0 a${r2},${r2} 1 0,0 ${w3 * 0.25},${-1 * h2 * 0.1} a${r2},${r2} 1 0,0 ${w3 * 0.25},${0} @@ -125049,8 +126303,8 @@ g.stateGroup line { H0 V0 Z` ); }, "bangBkg"); - circleBkg = /* @__PURE__ */ __name(function(db7, elem, node2) { - elem.append("circle").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr("r", node2.width / 2); + circleBkg = /* @__PURE__ */ __name(function(db8, elem, node2) { + elem.append("circle").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr("r", node2.width / 2); }, "circleBkg"); __name(insertPolygonShape3, "insertPolygonShape"); hexagonBkg = /* @__PURE__ */ __name(function(_db, elem, node2) { @@ -125068,10 +126322,10 @@ g.stateGroup line { ]; insertPolygonShape3(elem, w3, h2, points, node2); }, "hexagonBkg"); - roundedRectBkg = /* @__PURE__ */ __name(function(db7, elem, node2) { - elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db7.type2Str(node2.type)).attr("height", node2.height).attr("rx", node2.padding).attr("ry", node2.padding).attr("width", node2.width); + roundedRectBkg = /* @__PURE__ */ __name(function(db8, elem, node2) { + elem.append("rect").attr("id", "node-" + node2.id).attr("class", "node-bkg node-" + db8.type2Str(node2.type)).attr("height", node2.height).attr("rx", node2.padding).attr("ry", node2.padding).attr("width", node2.width); }, "roundedRectBkg"); - drawNode2 = /* @__PURE__ */ __name(async function(db7, elem, node2, fullSection, conf8) { + drawNode2 = /* @__PURE__ */ __name(async function(db8, elem, node2, fullSection, conf8) { const htmlLabels = conf8.htmlLabels; const section = fullSection % (MAX_SECTIONS2 - 1); const nodeElem = elem.append("g"); @@ -125102,7 +126356,7 @@ g.stateGroup line { node2.height = bbox.height + fontSize * 1.1 * 0.5 + node2.padding; node2.width = bbox.width + 2 * node2.padding; if (node2.icon) { - if (node2.type === db7.nodeType.CIRCLE) { + if (node2.type === db8.nodeType.CIRCLE) { node2.height += 50; node2.width += 50; const icon = nodeElem.append("foreignObject").attr("height", "50px").attr("width", node2.width).attr("style", "text-align: center;"); @@ -125135,34 +126389,34 @@ g.stateGroup line { } } switch (node2.type) { - case db7.nodeType.DEFAULT: - defaultBkg2(db7, bkgElem, node2, section); + case db8.nodeType.DEFAULT: + defaultBkg2(db8, bkgElem, node2, section); break; - case db7.nodeType.ROUNDED_RECT: - roundedRectBkg(db7, bkgElem, node2, section); + case db8.nodeType.ROUNDED_RECT: + roundedRectBkg(db8, bkgElem, node2, section); break; - case db7.nodeType.RECT: - rectBkg(db7, bkgElem, node2, section); + case db8.nodeType.RECT: + rectBkg(db8, bkgElem, node2, section); break; - case db7.nodeType.CIRCLE: + case db8.nodeType.CIRCLE: bkgElem.attr("transform", "translate(" + node2.width / 2 + ", " + +node2.height / 2 + ")"); - circleBkg(db7, bkgElem, node2, section); + circleBkg(db8, bkgElem, node2, section); break; - case db7.nodeType.CLOUD: - cloudBkg(db7, bkgElem, node2, section); + case db8.nodeType.CLOUD: + cloudBkg(db8, bkgElem, node2, section); break; - case db7.nodeType.BANG: - bangBkg(db7, bkgElem, node2, section); + case db8.nodeType.BANG: + bangBkg(db8, bkgElem, node2, section); break; - case db7.nodeType.HEXAGON: - hexagonBkg(db7, bkgElem, node2, section); + case db8.nodeType.HEXAGON: + hexagonBkg(db8, bkgElem, node2, section); break; } - db7.setElementForId(node2.id, nodeElem); + db8.setElementForId(node2.id, nodeElem); return node2.height; }, "drawNode"); - positionNode3 = /* @__PURE__ */ __name(function(db7, node2) { - const nodeElem = db7.getElementById(node2.id); + positionNode3 = /* @__PURE__ */ __name(function(db8, node2) { + const nodeElem = db8.getElementById(node2.id); const x5 = node2.x || 0; const y5 = node2.y || 0; nodeElem.attr("transform", "translate(" + x5 + "," + y5 + ")"); @@ -125171,22 +126425,22 @@ g.stateGroup line { }); // src/diagrams/mindmap/mindmapRenderer.ts - async function drawNodes(db7, svg, mindmap, section, conf8) { - await drawNode2(db7, svg, mindmap, section, conf8); + async function drawNodes(db8, svg, mindmap, section, conf8) { + await drawNode2(db8, svg, mindmap, section, conf8); if (mindmap.children) { await Promise.all( mindmap.children.map( - (child, index) => drawNodes(db7, svg, child, section < 0 ? index : section, conf8) + (child, index) => drawNodes(db8, svg, child, section < 0 ? index : section, conf8) ) ); } } function drawEdges(edgesEl, cy) { - cy.edges().map((edge, id26) => { + cy.edges().map((edge, id27) => { const data5 = edge.data(); if (edge[0]._private.bodyBounds) { const bounds4 = edge[0]._private.rscratch; - log.trace("Edge: ", id26, data5); + log.trace("Edge: ", id27, data5); edgesEl.insert("path").attr( "d", `M ${bounds4.startX},${bounds4.startY} L ${bounds4.midX},${bounds4.midY} L${bounds4.endX},${bounds4.endY} ` @@ -125264,19 +126518,19 @@ g.stateGroup line { }); }); } - function positionNodes(db7, cy) { - cy.nodes().map((node2, id26) => { + function positionNodes(db8, cy) { + cy.nodes().map((node2, id27) => { const data5 = node2.data(); data5.x = node2.position().x; data5.y = node2.position().y; - positionNode3(db7, data5); - const el = db7.getElementById(data5.nodeId); - log.info("Id:", id26, "Position: (", node2.position().x, ", ", node2.position().y, ")", data5); + positionNode3(db8, data5); + const el = db8.getElementById(data5.nodeId); + log.info("Id:", id27, "Position: (", node2.position().x, ", ", node2.position().y, ")", data5); el.attr( "transform", `translate(${node2.position().x - data5.width / 2}, ${node2.position().y - data5.height / 2})` ); - el.attr("attr", `apa-${id26})`); + el.attr("attr", `apa-${id27})`); }); } var import_cytoscape_cose_bilkent, draw19, mindmapRenderer_default; @@ -125298,24 +126552,24 @@ g.stateGroup line { __name(addNodes, "addNodes"); __name(layoutMindmap, "layoutMindmap"); __name(positionNodes, "positionNodes"); - draw19 = /* @__PURE__ */ __name(async (text2, id26, _version, diagObj) => { + draw19 = /* @__PURE__ */ __name(async (text2, id27, _version, diagObj) => { log.debug("Rendering mindmap diagram\n" + text2); - const db7 = diagObj.db; - const mm = db7.getMindmap(); + const db8 = diagObj.db; + const mm = db8.getMindmap(); if (!mm) { return; } const conf8 = getConfig2(); conf8.htmlLabels = false; - const svg = selectSvgElement(id26); + const svg = selectSvgElement(id27); const edgesElem = svg.append("g"); edgesElem.attr("class", "mindmap-edges"); const nodesElem = svg.append("g"); nodesElem.attr("class", "mindmap-nodes"); - await drawNodes(db7, nodesElem, mm, -1, conf8); + await drawNodes(db8, nodesElem, mm, -1, conf8); const cy = await layoutMindmap(mm, conf8); drawEdges(edgesElem, cy); - positionNodes(db7, cy); + positionNodes(db8, cy); setupGraphViewbox( void 0, svg, @@ -125443,7 +126697,7 @@ g.stateGroup line { for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 9], $V1 = [1, 10], $V2 = [1, 5, 10, 12]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -125523,21 +126777,21 @@ g.stateGroup line { return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -125556,7 +126810,7 @@ g.stateGroup line { }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -125940,13 +127194,13 @@ g.stateGroup line { }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser18.parser = parser18; @@ -126182,9 +127436,9 @@ g.stateGroup line { function defaultLinks(graph) { return graph.links; } - function find3(nodeById, id26) { - const node2 = nodeById.get(id26); - if (!node2) throw new Error("missing: " + id26); + function find3(nodeById, id27) { + const node2 = nodeById.get(id27); + if (!node2) throw new Error("missing: " + id27); return node2; } function computeLinkBreadths({ nodes: nodes6 }) { @@ -126205,7 +127459,7 @@ g.stateGroup line { let x0 = 0, y0 = 0, x1 = 1, y1 = 1; let dx = 24; let dy = 8, py; - let id26 = defaultId; + let id27 = defaultId; let align = justify; let sort3; let linkSort; @@ -126228,7 +127482,7 @@ g.stateGroup line { return graph; }; sankey.nodeId = function(_2) { - return arguments.length ? (id26 = typeof _2 === "function" ? _2 : constant2(_2), sankey) : id26; + return arguments.length ? (id27 = typeof _2 === "function" ? _2 : constant2(_2), sankey) : id27; }; sankey.nodeAlign = function(_2) { return arguments.length ? (align = typeof _2 === "function" ? _2 : constant2(_2), sankey) : align; @@ -126266,7 +127520,7 @@ g.stateGroup line { node2.sourceLinks = []; node2.targetLinks = []; } - const nodeById = new Map(nodes7.map((d2, i2) => [id26(d2, i2, nodes7), d2])); + const nodeById = new Map(nodes7.map((d2, i2) => [id27(d2, i2, nodes7), d2])); for (const [i2, link3] of links4.entries()) { link3.index = i2; let { source, target } = link3; @@ -126752,9 +128006,9 @@ g.stateGroup line { static next(name) { return new _Uid(name + ++_Uid.count); } - constructor(id26) { - this.id = id26; - this.href = `#${id26}`; + constructor(id27) { + this.id = id27; + this.href = `#${id27}`; } toString() { return "url(" + this.href + ")"; @@ -126779,15 +128033,15 @@ g.stateGroup line { center: center3, justify }; - draw20 = /* @__PURE__ */ __name(function(text2, id26, _version, diagObj) { + draw20 = /* @__PURE__ */ __name(function(text2, id27, _version, diagObj) { const { securityLevel, sankey: conf8 } = getConfig2(); const defaultSankeyConfig = defaultConfig2.sankey; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); - const svg = securityLevel === "sandbox" ? root4.select(`[id="${id26}"]`) : select_default2(`[id="${id26}"]`); + const svg = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`); const width3 = conf8?.width ?? defaultSankeyConfig.width; const height2 = conf8?.height ?? defaultSankeyConfig.width; const useMaxWidth = conf8?.useMaxWidth ?? defaultSankeyConfig.useMaxWidth; @@ -126809,11 +128063,11 @@ g.stateGroup line { }).attr("x", (d2) => d2.x0).attr("y", (d2) => d2.y0).append("rect").attr("height", (d2) => { return d2.y1 - d2.y0; }).attr("width", (d2) => d2.x1 - d2.x0).attr("fill", (d2) => colorScheme(d2.id)); - const getText = /* @__PURE__ */ __name(({ id: id27, value: value2 }) => { + const getText = /* @__PURE__ */ __name(({ id: id28, value: value2 }) => { if (!showValues) { - return id27; + return id28; } - return `${id27} + return `${id28} ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; }, "getText"); svg.append("g").attr("class", "node-labels").attr("font-family", "sans-serif").attr("font-size", 14).selectAll("text").data(graph.nodes).join("text").attr("x", (d2) => d2.x0 < width3 / 2 ? d2.x1 + 6 : d2.x0 - 6).attr("y", (d2) => (d2.y1 + d2.y0) / 2).attr("dy", `${showValues ? "0" : "0.35"}em`).attr("text-anchor", (d2) => d2.x0 < width3 / 2 ? "start" : "end").text(getText); @@ -127014,16 +128268,16 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; "use strict"; init_selectSvgElement(); init_setupGraphViewbox(); - draw21 = /* @__PURE__ */ __name((_text, id26, _version, diagram23) => { - const db7 = diagram23.db; - const config6 = db7.getConfig(); + draw21 = /* @__PURE__ */ __name((_text, id27, _version, diagram24) => { + const db8 = diagram24.db; + const config6 = db8.getConfig(); const { rowHeight, paddingY, bitWidth, bitsPerRow } = config6; - const words = db7.getPacket(); - const title2 = db7.getDiagramTitle(); + const words = db8.getPacket(); + const title2 = db8.getDiagramTitle(); const totalRowHeight = rowHeight + paddingY; const svgHeight = totalRowHeight * (words.length + 1) - (title2 ? 0 : rowHeight); const svgWidth = bitWidth * bitsPerRow + 2; - const svg = selectSvgElement(id26); + const svg = selectSvgElement(id27); svg.attr("viewbox", `0 0 ${svgWidth} ${svgHeight}`); configureSvgSize(svg, svgHeight, svgWidth, config6.useMaxWidth); for (const [word, packet2] of words.entries()) { @@ -127134,7 +128388,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; for (o3 = o3 || {}, l2 = k2.length; l2--; o3[k2[l2]] = v3) ; return o3; }, "o"), $V0 = [1, 7], $V1 = [1, 13], $V2 = [1, 14], $V3 = [1, 15], $V4 = [1, 19], $V5 = [1, 16], $V6 = [1, 17], $V7 = [1, 18], $V8 = [8, 30], $V9 = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Va = [1, 23], $Vb = [1, 24], $Vc = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], $Vd = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], $Ve = [1, 49]; - var parser21 = { + var parser22 = { trace: /* @__PURE__ */ __name(function trace() { }, "trace"), yy: {}, @@ -127192,10 +128446,10 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; break; case 23: yy.getLogger().debug("Rule: (nodeStatement link node) ", $$[$0 - 2], $$[$0 - 1], $$[$0], " typestr: ", $$[$0 - 1].edgeTypeStr); - const edgeData = yy.edgeStrToEdgeData($$[$0 - 1].edgeTypeStr); + const edgeData2 = yy.edgeStrToEdgeData($$[$0 - 1].edgeTypeStr); this.$ = [ { id: $$[$0 - 2].id, label: $$[$0 - 2].label, type: $$[$0 - 2].type, directions: $$[$0 - 2].directions }, - { id: $$[$0 - 2].id + "-" + $$[$0].id, start: $$[$0 - 2].id, end: $$[$0].id, label: $$[$0 - 1].label, type: "edge", directions: $$[$0].directions, arrowTypeEnd: edgeData, arrowTypeStart: "arrow_open" }, + { id: $$[$0 - 2].id + "-" + $$[$0].id, start: $$[$0 - 2].id, end: $$[$0].id, label: $$[$0 - 1].label, type: "edge", directions: $$[$0].directions, arrowTypeEnd: edgeData2, arrowTypeStart: "arrow_open" }, { id: $$[$0].id, label: $$[$0].label, type: yy.typeStr2Type($$[$0].typeStr), directions: $$[$0].directions } ]; break; @@ -127214,13 +128468,13 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; break; case 27: yy.getLogger().debug("Rule: id-block statement : ", $$[$0 - 2], $$[$0 - 1]); - const id26 = yy.generateId(); + const id27 = yy.generateId(); this.$ = { ...$$[$0 - 2], type: "composite", children: $$[$0 - 1] }; break; case 28: yy.getLogger().debug("Rule: blockStatement : ", $$[$0 - 2], $$[$0 - 1], $$[$0]); - const id27 = yy.generateId(); - this.$ = { id: id27, type: "composite", label: "", children: $$[$0 - 1] }; + const id28 = yy.generateId(); + this.$ = { id: id28, type: "composite", label: "", children: $$[$0 - 1] }; break; case 29: yy.getLogger().debug("Rule: node (NODE_ID separator): ", $$[$0]); @@ -127312,21 +128566,21 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; return token2; } __name(lex2, "lex"); - var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected; + var symbol, preErrorSymbol, state5, action, a2, r2, yyval = {}, p3, len, newState2, expected; while (true) { - state4 = stack[stack.length - 1]; - if (this.defaultActions[state4]) { - action = this.defaultActions[state4]; + state5 = stack[stack.length - 1]; + if (this.defaultActions[state5]) { + action = this.defaultActions[state5]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex2(); } - action = table[state4] && table[state4][symbol]; + action = table[state5] && table[state5][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; - for (p3 in table[state4]) { + for (p3 in table[state5]) { if (this.terminals_[p3] && p3 > TERROR) { expected.push("'" + this.terminals_[p3] + "'"); } @@ -127345,7 +128599,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; }); } if (action[0] instanceof Array && action.length > 1) { - throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol); + throw new Error("Parse Error: multiple actions possible at state: " + state5 + ", token: " + symbol); } switch (action[0]) { case 1: @@ -128160,13 +129414,13 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; }; return lexer3; }(); - parser21.lexer = lexer2; + parser22.lexer = lexer2; function Parser3() { this.yy = {}; } __name(Parser3, "Parser"); - Parser3.prototype = parser21; - parser21.Parser = Parser3; + Parser3.prototype = parser22; + parser22.Parser = Parser3; return new Parser3(); }(); parser20.parser = parser20; @@ -128252,11 +129506,11 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; config5 = getConfig2(); classes5 = /* @__PURE__ */ new Map(); sanitizeText7 = /* @__PURE__ */ __name((txt) => common_default.sanitizeText(txt, config5), "sanitizeText"); - addStyleClass2 = /* @__PURE__ */ __name(function(id26, styleAttributes = "") { - let foundClass = classes5.get(id26); + addStyleClass2 = /* @__PURE__ */ __name(function(id27, styleAttributes = "") { + let foundClass = classes5.get(id27); if (!foundClass) { - foundClass = { id: id26, styles: [], textStyles: [] }; - classes5.set(id26, foundClass); + foundClass = { id: id27, styles: [], textStyles: [] }; + classes5.set(id27, foundClass); } if (styleAttributes !== void 0 && styleAttributes !== null) { styleAttributes.split(STYLECLASS_SEP2).forEach((attrib) => { @@ -128270,17 +129524,17 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; }); } }, "addStyleClass"); - addStyle2Node = /* @__PURE__ */ __name(function(id26, styles3 = "") { - const foundBlock = blockDatabase.get(id26); + addStyle2Node = /* @__PURE__ */ __name(function(id27, styles3 = "") { + const foundBlock = blockDatabase.get(id27); if (styles3 !== void 0 && styles3 !== null) { foundBlock.styles = styles3.split(STYLECLASS_SEP2); } }, "addStyle2Node"); setCssClass3 = /* @__PURE__ */ __name(function(itemIds, cssClassName) { - itemIds.split(",").forEach(function(id26) { - let foundBlock = blockDatabase.get(id26); + itemIds.split(",").forEach(function(id27) { + let foundBlock = blockDatabase.get(id27); if (foundBlock === void 0) { - const trimmedId = id26.trim(); + const trimmedId = id27.trim(); foundBlock = { id: trimmedId, type: "na", children: [] }; blockDatabase.set(trimmedId, foundBlock); } @@ -128402,8 +129656,8 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; getEdges2 = /* @__PURE__ */ __name(() => { return edgeList; }, "getEdges"); - getBlock = /* @__PURE__ */ __name((id26) => { - return blockDatabase.get(id26); + getBlock = /* @__PURE__ */ __name((id27) => { + return blockDatabase.get(id27); }, "getBlock"); setBlock = /* @__PURE__ */ __name((block3) => { blockDatabase.set(block3.id, block3); @@ -128581,7 +129835,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; const py = Math.floor(position5 / columns); return { px, py }; } - function setBlockSizes(block3, db7, siblingWidth = 0, siblingHeight = 0) { + function setBlockSizes(block3, db8, siblingWidth = 0, siblingHeight = 0) { log.debug( "setBlockSizes abc95 (start)", block3.id, @@ -128603,7 +129857,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; let maxHeight = 0; if (block3.children?.length > 0) { for (const child of block3.children) { - setBlockSizes(child, db7); + setBlockSizes(child, db8); } const childSize = getMaxChildSize(block3); maxWidth = childSize.width; @@ -128624,7 +129878,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } } for (const child of block3.children) { - setBlockSizes(child, db7, maxWidth, maxHeight); + setBlockSizes(child, db8, maxWidth, maxHeight); } const columns = block3.columns ?? -1; let numItems = 0; @@ -128690,7 +129944,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; block3?.size?.height ); } - function layoutBlocks(block3, db7) { + function layoutBlocks(block3, db8) { log.debug( `abc85 layout blocks (=>layoutBlocks) ${block3.id} x: ${block3?.size?.x} y: ${block3?.size?.y} width: ${block3?.size?.width}` ); @@ -128733,7 +129987,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; ); } if (child.children) { - layoutBlocks(child, db7); + layoutBlocks(child, db8); } columnPos += child?.widthInColumns ?? 1; log.debug("abc88 columnsPos", child, columnPos); @@ -128766,13 +130020,13 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } return { minX, minY, maxX, maxY }; } - function layout5(db7) { - const root4 = db7.getBlock("root"); + function layout5(db8) { + const root4 = db8.getBlock("root"); if (!root4) { return; } - setBlockSizes(root4, db7, 0, 0); - layoutBlocks(root4, db7); + setBlockSizes(root4, db8, 0, 0); + layoutBlocks(root4, db8); log.debug("getBlocks", JSON.stringify(root4, null, 2)); const { minX, minY, maxX, maxY } = findBounds(root4); const height2 = maxY - minY; @@ -128825,7 +130079,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; }); // src/diagrams/block/renderHelpers.ts - function getNodeFromBlock(block3, db7, positioned = false) { + function getNodeFromBlock(block3, db8, positioned = false) { const vertex = block3; let classStr = "default"; if ((vertex?.classes?.length || 0) > 0) { @@ -128923,42 +130177,42 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; }; return node2; } - async function calculateBlockSize(elem, block3, db7) { - const node2 = getNodeFromBlock(block3, db7, false); + async function calculateBlockSize(elem, block3, db8) { + const node2 = getNodeFromBlock(block3, db8, false); if (node2.type === "group") { return; } const nodeEl = await insertNode(elem, node2); const boundingBox3 = nodeEl.node().getBBox(); - const obj = db7.getBlock(node2.id); + const obj = db8.getBlock(node2.id); obj.size = { width: boundingBox3.width, height: boundingBox3.height, x: 0, y: 0, node: nodeEl }; - db7.setBlock(obj); + db8.setBlock(obj); nodeEl.remove(); } - async function insertBlockPositioned(elem, block3, db7) { - const node2 = getNodeFromBlock(block3, db7, true); - const obj = db7.getBlock(node2.id); + async function insertBlockPositioned(elem, block3, db8) { + const node2 = getNodeFromBlock(block3, db8, true); + const obj = db8.getBlock(node2.id); if (obj.type !== "space") { await insertNode(elem, node2); block3.intersect = node2?.intersect; positionNode(node2); } } - async function performOperations(elem, blocks2, db7, operation) { + async function performOperations(elem, blocks2, db8, operation) { for (const block3 of blocks2) { - await operation(elem, block3, db7); + await operation(elem, block3, db8); if (block3.children) { - await performOperations(elem, block3.children, db7, operation); + await performOperations(elem, block3.children, db8, operation); } } } - async function calculateBlockSizes(elem, blocks2, db7) { - await performOperations(elem, blocks2, db7, calculateBlockSize); + async function calculateBlockSizes(elem, blocks2, db8) { + await performOperations(elem, blocks2, db8, calculateBlockSize); } - async function insertBlocks(elem, blocks2, db7) { - await performOperations(elem, blocks2, db7, insertBlockPositioned); + async function insertBlocks(elem, blocks2, db8) { + await performOperations(elem, blocks2, db8, insertBlockPositioned); } - async function insertEdges(elem, edges5, blocks2, db7, id26) { + async function insertEdges(elem, edges5, blocks2, db8, id27) { const g2 = new Graph({ multigraph: true, compound: true @@ -128981,8 +130235,8 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } for (const edge of edges5) { if (edge.start && edge.end) { - const startBlock = db7.getBlock(edge.start); - const endBlock = db7.getBlock(edge.end); + const startBlock = db8.getBlock(edge.start); + const endBlock = db8.getBlock(edge.end); if (startBlock?.size && endBlock?.size) { const start3 = startBlock.size; const end2 = endBlock.size; @@ -129004,7 +130258,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; void 0, "block", g2, - id26 + id27 ); if (edge.label) { await insertEdgeLabel2(elem, { @@ -129060,25 +130314,25 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; getClasses7 = /* @__PURE__ */ __name(function(text2, diagObj) { return diagObj.db.getClasses(); }, "getClasses"); - draw22 = /* @__PURE__ */ __name(async function(text2, id26, _version, diagObj) { + draw22 = /* @__PURE__ */ __name(async function(text2, id27, _version, diagObj) { const { securityLevel, block: conf8 } = getConfig(); - const db7 = diagObj.db; + const db8 = diagObj.db; let sandboxElement; if (securityLevel === "sandbox") { - sandboxElement = select_default2("#i" + id26); + sandboxElement = select_default2("#i" + id27); } const root4 = securityLevel === "sandbox" ? select_default2(sandboxElement.nodes()[0].contentDocument.body) : select_default2("body"); - const svg = securityLevel === "sandbox" ? root4.select(`[id="${id26}"]`) : select_default2(`[id="${id26}"]`); + const svg = securityLevel === "sandbox" ? root4.select(`[id="${id27}"]`) : select_default2(`[id="${id27}"]`); const markers3 = ["point", "circle", "cross"]; - markers_default2(svg, markers3, diagObj.type, id26); - const bl = db7.getBlocks(); - const blArr = db7.getBlocksFlat(); - const edges5 = db7.getEdges(); + markers_default2(svg, markers3, diagObj.type, id27); + const bl = db8.getBlocks(); + const blArr = db8.getBlocksFlat(); + const edges5 = db8.getEdges(); const nodes6 = svg.insert("g").attr("class", "block"); - await calculateBlockSizes(nodes6, bl, db7); - const bounds4 = layout5(db7); - await insertBlocks(nodes6, bl, db7); - await insertEdges(nodes6, edges5, blArr, db7, id26); + await calculateBlockSizes(nodes6, bl, db8); + const bounds4 = layout5(db8); + await insertBlocks(nodes6, bl, db8); + await insertEdges(nodes6, edges5, blArr, db8, id27); if (bounds4) { const bounds22 = bounds4; const magicFactor = Math.max(1, Math.round(0.125 * (bounds22.width / bounds22.height))); @@ -129122,818 +130376,9688 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } }); - // src/mermaid.ts - var mermaid_exports = {}; - __export(mermaid_exports, { - default: () => mermaid_default - }); - init_esm(); - init_detectType(); - - // src/diagrams/c4/c4Detector.ts - var id2 = "c4"; - var detector = /* @__PURE__ */ __name((txt) => { - return /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(txt); - }, "detector"); - var loader = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_c4Diagram2(), c4Diagram_exports)); - return { id: id2, diagram: diagram23 }; - }, "loader"); - var plugin = { - id: id2, - detector, - loader - }; - var c4Detector_default = plugin; - - // src/diagrams/flowchart/flowDetector.ts - var id3 = "flowchart"; - var detector2 = /* @__PURE__ */ __name((txt, config6) => { - if (config6?.flowchart?.defaultRenderer === "dagre-wrapper" || config6?.flowchart?.defaultRenderer === "elk") { - return false; - } - return /^\s*graph/.test(txt); - }, "detector"); - var loader2 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); - return { id: id3, diagram: diagram23 }; - }, "loader"); - var plugin2 = { - id: id3, - detector: detector2, - loader: loader2 - }; - var flowDetector_default = plugin2; - - // src/diagrams/flowchart/flowDetector-v2.ts - var id4 = "flowchart-v2"; - var detector3 = /* @__PURE__ */ __name((txt, config6) => { - if (config6?.flowchart?.defaultRenderer === "dagre-d3" || config6?.flowchart?.defaultRenderer === "elk") { - return false; - } - if (/^\s*graph/.test(txt) && config6?.flowchart?.defaultRenderer === "dagre-wrapper") { - return true; - } - return /^\s*flowchart/.test(txt); - }, "detector"); - var loader3 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); - return { id: id4, diagram: diagram23 }; - }, "loader"); - var plugin3 = { - id: id4, - detector: detector3, - loader: loader3 - }; - var flowDetector_v2_default = plugin3; - - // src/diagrams/er/erDetector.ts - var id5 = "er"; - var detector4 = /* @__PURE__ */ __name((txt) => { - return /^\s*erDiagram/.test(txt); - }, "detector"); - var loader4 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_erDiagram2(), erDiagram_exports)); - return { id: id5, diagram: diagram23 }; - }, "loader"); - var plugin4 = { - id: id5, - detector: detector4, - loader: loader4 - }; - var erDetector_default = plugin4; - - // src/diagrams/git/gitGraphDetector.ts - var id6 = "gitGraph"; - var detector5 = /* @__PURE__ */ __name((txt) => { - return /^\s*gitGraph/.test(txt); - }, "detector"); - var loader5 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_gitGraphDiagram(), gitGraphDiagram_exports)); - return { id: id6, diagram: diagram23 }; - }, "loader"); - var plugin5 = { - id: id6, - detector: detector5, - loader: loader5 - }; - var gitGraphDetector_default = plugin5; - - // src/diagrams/gantt/ganttDetector.ts - var id7 = "gantt"; - var detector6 = /* @__PURE__ */ __name((txt) => { - return /^\s*gantt/.test(txt); - }, "detector"); - var loader6 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_ganttDiagram(), ganttDiagram_exports)); - return { id: id7, diagram: diagram23 }; - }, "loader"); - var plugin6 = { - id: id7, - detector: detector6, - loader: loader6 - }; - var ganttDetector_default = plugin6; - - // src/diagrams/info/infoDetector.ts - var id8 = "info"; - var detector7 = /* @__PURE__ */ __name((txt) => { - return /^\s*info/.test(txt); - }, "detector"); - var loader7 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_infoDiagram(), infoDiagram_exports)); - return { id: id8, diagram: diagram23 }; - }, "loader"); - var info = { - id: id8, - detector: detector7, - loader: loader7 - }; - - // src/diagrams/pie/pieDetector.ts - var id9 = "pie"; - var detector8 = /* @__PURE__ */ __name((txt) => { - return /^\s*pie/.test(txt); - }, "detector"); - var loader8 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_pieDiagram(), pieDiagram_exports)); - return { id: id9, diagram: diagram23 }; - }, "loader"); - var pie = { - id: id9, - detector: detector8, - loader: loader8 - }; - - // src/diagrams/quadrant-chart/quadrantDetector.ts - var id10 = "quadrantChart"; - var detector9 = /* @__PURE__ */ __name((txt) => { - return /^\s*quadrantChart/.test(txt); - }, "detector"); - var loader9 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_quadrantDiagram(), quadrantDiagram_exports)); - return { id: id10, diagram: diagram23 }; - }, "loader"); - var plugin7 = { - id: id10, - detector: detector9, - loader: loader9 - }; - var quadrantDetector_default = plugin7; - - // src/diagrams/xychart/xychartDetector.ts - var id11 = "xychart"; - var detector10 = /* @__PURE__ */ __name((txt) => { - return /^\s*xychart-beta/.test(txt); - }, "detector"); - var loader10 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_xychartDiagram(), xychartDiagram_exports)); - return { id: id11, diagram: diagram23 }; - }, "loader"); - var plugin8 = { - id: id11, - detector: detector10, - loader: loader10 - }; - var xychartDetector_default = plugin8; - - // src/diagrams/requirement/requirementDetector.ts - var id12 = "requirement"; - var detector11 = /* @__PURE__ */ __name((txt) => { - return /^\s*requirement(Diagram)?/.test(txt); - }, "detector"); - var loader11 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_requirementDiagram2(), requirementDiagram_exports)); - return { id: id12, diagram: diagram23 }; - }, "loader"); - var plugin9 = { - id: id12, - detector: detector11, - loader: loader11 - }; - var requirementDetector_default = plugin9; - - // src/diagrams/sequence/sequenceDetector.ts - var id13 = "sequence"; - var detector12 = /* @__PURE__ */ __name((txt) => { - return /^\s*sequenceDiagram/.test(txt); - }, "detector"); - var loader12 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_sequenceDiagram2(), sequenceDiagram_exports)); - return { id: id13, diagram: diagram23 }; - }, "loader"); - var plugin10 = { - id: id13, - detector: detector12, - loader: loader12 - }; - var sequenceDetector_default = plugin10; - - // src/diagrams/class/classDetector.ts - var id14 = "class"; - var detector13 = /* @__PURE__ */ __name((txt, config6) => { - if (config6?.class?.defaultRenderer === "dagre-wrapper") { - return false; - } - return /^\s*classDiagram/.test(txt); - }, "detector"); - var loader13 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_classDiagram2(), classDiagram_exports)); - return { id: id14, diagram: diagram23 }; - }, "loader"); - var plugin11 = { - id: id14, - detector: detector13, - loader: loader13 - }; - var classDetector_default = plugin11; - - // src/diagrams/class/classDetector-V2.ts - var id15 = "classDiagram"; - var detector14 = /* @__PURE__ */ __name((txt, config6) => { - if (/^\s*classDiagram/.test(txt) && config6?.class?.defaultRenderer === "dagre-wrapper") { - return true; - } - return /^\s*classDiagram-v2/.test(txt); - }, "detector"); - var loader14 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_classDiagram_v2(), classDiagram_v2_exports)); - return { id: id15, diagram: diagram23 }; - }, "loader"); - var plugin12 = { - id: id15, - detector: detector14, - loader: loader14 - }; - var classDetector_V2_default = plugin12; - - // src/diagrams/state/stateDetector.ts - var id16 = "state"; - var detector15 = /* @__PURE__ */ __name((txt, config6) => { - if (config6?.state?.defaultRenderer === "dagre-wrapper") { - return false; - } - return /^\s*stateDiagram/.test(txt); - }, "detector"); - var loader15 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_stateDiagram2(), stateDiagram_exports)); - return { id: id16, diagram: diagram23 }; - }, "loader"); - var plugin13 = { - id: id16, - detector: detector15, - loader: loader15 - }; - var stateDetector_default = plugin13; - - // src/diagrams/state/stateDetector-V2.ts - var id17 = "stateDiagram"; - var detector16 = /* @__PURE__ */ __name((txt, config6) => { - if (/^\s*stateDiagram-v2/.test(txt)) { - return true; - } - if (/^\s*stateDiagram/.test(txt) && config6?.state?.defaultRenderer === "dagre-wrapper") { - return true; - } - return false; - }, "detector"); - var loader16 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_stateDiagram_v2(), stateDiagram_v2_exports)); - return { id: id17, diagram: diagram23 }; - }, "loader"); - var plugin14 = { - id: id17, - detector: detector16, - loader: loader16 - }; - var stateDetector_V2_default = plugin14; - - // src/diagrams/user-journey/journeyDetector.ts - var id18 = "journey"; - var detector17 = /* @__PURE__ */ __name((txt) => { - return /^\s*journey/.test(txt); - }, "detector"); - var loader17 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_journeyDiagram(), journeyDiagram_exports)); - return { id: id18, diagram: diagram23 }; - }, "loader"); - var plugin15 = { - id: id18, - detector: detector17, - loader: loader17 - }; - var journeyDetector_default = plugin15; - - // src/diagrams/error/errorRenderer.ts - init_logger(); - init_selectSvgElement(); - init_setupGraphViewbox(); - var draw17 = /* @__PURE__ */ __name((_text, id26, version4) => { - log.debug("rendering svg for syntax error\n"); - const svg = selectSvgElement(id26); - const g2 = svg.append("g"); - svg.attr("viewBox", "0 0 2412 512"); - configureSvgSize(svg, 100, 512, true); - g2.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" - ); - g2.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" - ); - g2.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" - ); - g2.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" - ); - g2.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" - ); - g2.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" - ); - g2.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"); - g2.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${version4}`); - }, "draw"); - var renderer3 = { draw: draw17 }; - var errorRenderer_default = renderer3; - - // src/diagrams/error/errorDiagram.ts - var diagram17 = { - db: {}, - renderer: renderer3, - parser: { - parse: /* @__PURE__ */ __name(() => { - return; - }, "parse") - } - }; - var errorDiagram_default = diagram17; - - // src/diagrams/flowchart/elk/detector.ts - var id19 = "flowchart-elk"; - var detector18 = /* @__PURE__ */ __name((txt, config6 = {}) => { - if ( - // If diagram explicitly states flowchart-elk - /^\s*flowchart-elk/.test(txt) || // If a flowchart/graph diagram has their default renderer set to elk - /^\s*flowchart|graph/.test(txt) && config6?.flowchart?.defaultRenderer === "elk" - ) { - config6.layout = "elk"; - return true; - } - return false; - }, "detector"); - var loader18 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); - return { id: id19, diagram: diagram23 }; - }, "loader"); - var plugin16 = { - id: id19, - detector: detector18, - loader: loader18 - }; - var detector_default = plugin16; - - // src/diagrams/timeline/detector.ts - var id20 = "timeline"; - var detector19 = /* @__PURE__ */ __name((txt) => { - return /^\s*timeline/.test(txt); - }, "detector"); - var loader19 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_timeline_definition(), timeline_definition_exports)); - return { id: id20, diagram: diagram23 }; - }, "loader"); - var plugin17 = { - id: id20, - detector: detector19, - loader: loader19 - }; - var detector_default2 = plugin17; - - // src/diagrams/mindmap/detector.ts - var id22 = "mindmap"; - var detector20 = /* @__PURE__ */ __name((txt) => { - return /^\s*mindmap/.test(txt); - }, "detector"); - var loader20 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_mindmap_definition(), mindmap_definition_exports)); - return { id: id22, diagram: diagram23 }; - }, "loader"); - var plugin18 = { - id: id22, - detector: detector20, - loader: loader20 - }; - var detector_default3 = plugin18; - - // src/diagrams/sankey/sankeyDetector.ts - var id23 = "sankey"; - var detector21 = /* @__PURE__ */ __name((txt) => { - return /^\s*sankey-beta/.test(txt); - }, "detector"); - var loader21 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_sankeyDiagram(), sankeyDiagram_exports)); - return { id: id23, diagram: diagram23 }; - }, "loader"); - var plugin19 = { - id: id23, - detector: detector21, - loader: loader21 - }; - var sankeyDetector_default = plugin19; - - // src/diagrams/packet/detector.ts - var id24 = "packet"; - var detector22 = /* @__PURE__ */ __name((txt) => { - return /^\s*packet-beta/.test(txt); - }, "detector"); - var loader22 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_diagram(), diagram_exports)); - return { id: id24, diagram: diagram23 }; - }, "loader"); - var packet = { - id: id24, - detector: detector22, - loader: loader22 - }; - - // src/diagrams/block/blockDetector.ts - var id25 = "block"; - var detector23 = /* @__PURE__ */ __name((txt) => { - return /^\s*block-beta/.test(txt); - }, "detector"); - var loader23 = /* @__PURE__ */ __name(async () => { - const { diagram: diagram23 } = await Promise.resolve().then(() => (init_blockDiagram(), blockDiagram_exports)); - return { id: id25, diagram: diagram23 }; - }, "loader"); - var plugin20 = { - id: id25, - detector: detector23, - loader: loader23 - }; - var blockDetector_default = plugin20; - - // src/diagram-api/diagram-orchestration.ts - init_detectType(); - init_diagramAPI(); - var hasLoadedDiagrams = false; - var addDiagrams = /* @__PURE__ */ __name(() => { - if (hasLoadedDiagrams) { - return; - } - hasLoadedDiagrams = true; - registerDiagram("error", errorDiagram_default, (text2) => { - return text2.toLowerCase().trim() === "error"; - }); - registerDiagram( - "---", - // --- diagram type may appear if YAML front-matter is not parsed correctly - { - db: { - clear: /* @__PURE__ */ __name(() => { - }, "clear") - }, - styles: {}, - // should never be used - renderer: { - draw: /* @__PURE__ */ __name(() => { - }, "draw") - }, - parser: { - parse: /* @__PURE__ */ __name(() => { + // src/diagrams/architecture/architectureTypes.ts + var ArchitectureDirectionName, ArchitectureDirectionArrow, ArchitectureDirectionArrowShift, getOppositeArchitectureDirection, isArchitectureDirection, isArchitectureDirectionX, isArchitectureDirectionY, isArchitectureDirectionXY, isArchitecturePairXY, isValidArchitectureDirectionPair, getArchitectureDirectionPair, shiftPositionByArchitectureDirectionPair, getArchitectureDirectionXYFactors, isArchitectureService, isArchitectureJunction, edgeData, nodeData; + var init_architectureTypes = __esm({ + "src/diagrams/architecture/architectureTypes.ts"() { + "use strict"; + ArchitectureDirectionName = { + L: "left", + R: "right", + T: "top", + B: "bottom" + }; + ArchitectureDirectionArrow = { + L: /* @__PURE__ */ __name((scale) => `${scale},${scale / 2} 0,${scale} 0,0`, "L"), + R: /* @__PURE__ */ __name((scale) => `0,${scale / 2} ${scale},0 ${scale},${scale}`, "R"), + T: /* @__PURE__ */ __name((scale) => `0,0 ${scale},0 ${scale / 2},${scale}`, "T"), + B: /* @__PURE__ */ __name((scale) => `${scale / 2},0 ${scale},${scale} 0,${scale}`, "B") + }; + ArchitectureDirectionArrowShift = { + L: /* @__PURE__ */ __name((orig, arrowSize) => orig - arrowSize + 2, "L"), + R: /* @__PURE__ */ __name((orig, _arrowSize) => orig - 2, "R"), + T: /* @__PURE__ */ __name((orig, arrowSize) => orig - arrowSize + 2, "T"), + B: /* @__PURE__ */ __name((orig, _arrowSize) => orig - 2, "B") + }; + getOppositeArchitectureDirection = /* @__PURE__ */ __name(function(x5) { + if (isArchitectureDirectionX(x5)) { + return x5 === "L" ? "R" : "L"; + } else { + return x5 === "T" ? "B" : "T"; + } + }, "getOppositeArchitectureDirection"); + isArchitectureDirection = /* @__PURE__ */ __name(function(x5) { + const temp = x5; + return temp === "L" || temp === "R" || temp === "T" || temp === "B"; + }, "isArchitectureDirection"); + isArchitectureDirectionX = /* @__PURE__ */ __name(function(x5) { + const temp = x5; + return temp === "L" || temp === "R"; + }, "isArchitectureDirectionX"); + isArchitectureDirectionY = /* @__PURE__ */ __name(function(x5) { + const temp = x5; + return temp === "T" || temp === "B"; + }, "isArchitectureDirectionY"); + isArchitectureDirectionXY = /* @__PURE__ */ __name(function(a2, b2) { + const aX_bY = isArchitectureDirectionX(a2) && isArchitectureDirectionY(b2); + const aY_bX = isArchitectureDirectionY(a2) && isArchitectureDirectionX(b2); + return aX_bY || aY_bX; + }, "isArchitectureDirectionXY"); + isArchitecturePairXY = /* @__PURE__ */ __name(function(pair) { + const lhs = pair[0]; + const rhs = pair[1]; + const aX_bY = isArchitectureDirectionX(lhs) && isArchitectureDirectionY(rhs); + const aY_bX = isArchitectureDirectionY(lhs) && isArchitectureDirectionX(rhs); + return aX_bY || aY_bX; + }, "isArchitecturePairXY"); + isValidArchitectureDirectionPair = /* @__PURE__ */ __name(function(x5) { + return x5 !== "LL" && x5 !== "RR" && x5 !== "TT" && x5 !== "BB"; + }, "isValidArchitectureDirectionPair"); + getArchitectureDirectionPair = /* @__PURE__ */ __name(function(sourceDir, targetDir) { + const pair = `${sourceDir}${targetDir}`; + return isValidArchitectureDirectionPair(pair) ? pair : void 0; + }, "getArchitectureDirectionPair"); + shiftPositionByArchitectureDirectionPair = /* @__PURE__ */ __name(function([x5, y5], pair) { + const lhs = pair[0]; + const rhs = pair[1]; + if (isArchitectureDirectionX(lhs)) { + if (isArchitectureDirectionY(rhs)) { + return [x5 + (lhs === "L" ? -1 : 1), y5 + (rhs === "T" ? 1 : -1)]; + } else { + return [x5 + (lhs === "L" ? -1 : 1), y5]; + } + } else { + if (isArchitectureDirectionX(rhs)) { + return [x5 + (rhs === "L" ? 1 : -1), y5 + (lhs === "T" ? 1 : -1)]; + } else { + return [x5, y5 + (lhs === "T" ? 1 : -1)]; + } + } + }, "shiftPositionByArchitectureDirectionPair"); + getArchitectureDirectionXYFactors = /* @__PURE__ */ __name(function(pair) { + if (pair === "LT" || pair === "TL") { + return [1, 1]; + } else if (pair === "BL" || pair === "LB") { + return [1, -1]; + } else if (pair === "BR" || pair === "RB") { + return [-1, -1]; + } else { + return [-1, 1]; + } + }, "getArchitectureDirectionXYFactors"); + isArchitectureService = /* @__PURE__ */ __name(function(x5) { + const temp = x5; + return temp.type === "service"; + }, "isArchitectureService"); + isArchitectureJunction = /* @__PURE__ */ __name(function(x5) { + const temp = x5; + return temp.type === "junction"; + }, "isArchitectureJunction"); + edgeData = /* @__PURE__ */ __name((edge) => { + return edge.data(); + }, "edgeData"); + nodeData = /* @__PURE__ */ __name((node2) => { + return node2.data(); + }, "nodeData"); + } + }); + + // src/diagrams/architecture/architectureDb.ts + function getConfigField(field) { + const arch = getConfig2().architecture; + if (arch?.[field]) { + return arch[field]; + } + return DEFAULT_ARCHITECTURE_CONFIG[field]; + } + var DEFAULT_ARCHITECTURE_CONFIG, state4, clear29, addService, getServices, addJunction, getJunctions, getNodes2, getNode, addGroup, getGroups, addEdge, getEdges3, getDataStructures, setElementForId2, getElementById3, db7; + var init_architectureDb = __esm({ + "src/diagrams/architecture/architectureDb.ts"() { + "use strict"; + init_defaultConfig(); + init_diagramAPI(); + init_imperativeState(); + init_commonDb(); + init_architectureTypes(); + DEFAULT_ARCHITECTURE_CONFIG = defaultConfig_default.architecture; + state4 = new ImperativeState(() => ({ + nodes: {}, + groups: {}, + edges: [], + registeredIds: {}, + config: DEFAULT_ARCHITECTURE_CONFIG, + dataStructures: void 0, + elements: {} + })); + clear29 = /* @__PURE__ */ __name(() => { + state4.reset(); + clear(); + }, "clear"); + addService = /* @__PURE__ */ __name(function({ + id: id27, + icon, + in: parent4, + title: title2, + iconText + }) { + if (state4.records.registeredIds[id27] !== void 0) { + throw new Error( + `The service id [${id27}] is already in use by another ${state4.records.registeredIds[id27]}` + ); + } + if (parent4 !== void 0) { + if (id27 === parent4) { + throw new Error(`The service [${id27}] cannot be placed within itself`); + } + if (state4.records.registeredIds[parent4] === void 0) { 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" + `The service [${id27}]'s parent does not exist. Please make sure the parent is created before this service` ); - }, "parse") - }, - init: /* @__PURE__ */ __name(() => null, "init") - // no op - }, - (text2) => { - return text2.toLowerCase().trimStart().startsWith("---"); - } - ); - registerLazyLoadedDiagrams( - c4Detector_default, - classDetector_V2_default, - classDetector_default, - erDetector_default, - ganttDetector_default, - info, - pie, - requirementDetector_default, - sequenceDetector_default, - detector_default, - flowDetector_v2_default, - flowDetector_default, - detector_default3, - detector_default2, - gitGraphDetector_default, - stateDetector_V2_default, - stateDetector_default, - journeyDetector_default, - quadrantDetector_default, - sankeyDetector_default, - packet, - xychartDetector_default, - blockDetector_default - ); - }, "addDiagrams"); - - // src/diagram-api/loadDiagram.ts - init_logger(); - init_detectType(); - init_diagramAPI(); - var loadRegisteredDiagrams = /* @__PURE__ */ __name(async () => { - log.debug(`Loading registered diagrams`); - const results = await Promise.allSettled( - Object.entries(detectors).map(async ([key, { detector: detector24, loader: loader25 }]) => { - if (loader25) { - try { - getDiagram(key); - } catch { - try { - const { diagram: diagram23, id: id26 } = await loader25(); - registerDiagram(id26, diagram23, detector24); - } catch (err) { - log.error(`Failed to load external diagram with key ${key}. Removing from detectors.`); - delete detectors[key]; - throw err; + } + if (state4.records.registeredIds[parent4] === "node") { + throw new Error(`The service [${id27}]'s parent is not a group`); + } + } + state4.records.registeredIds[id27] = "node"; + state4.records.nodes[id27] = { + id: id27, + type: "service", + icon, + iconText, + title: title2, + edges: [], + in: parent4 + }; + }, "addService"); + getServices = /* @__PURE__ */ __name(() => Object.values(state4.records.nodes).filter(isArchitectureService), "getServices"); + addJunction = /* @__PURE__ */ __name(function({ id: id27, in: parent4 }) { + state4.records.registeredIds[id27] = "node"; + state4.records.nodes[id27] = { + id: id27, + type: "junction", + edges: [], + in: parent4 + }; + }, "addJunction"); + getJunctions = /* @__PURE__ */ __name(() => Object.values(state4.records.nodes).filter(isArchitectureJunction), "getJunctions"); + getNodes2 = /* @__PURE__ */ __name(() => Object.values(state4.records.nodes), "getNodes"); + getNode = /* @__PURE__ */ __name((id27) => state4.records.nodes[id27], "getNode"); + addGroup = /* @__PURE__ */ __name(function({ id: id27, icon, in: parent4, title: title2 }) { + if (state4.records.registeredIds[id27] !== void 0) { + throw new Error( + `The group id [${id27}] is already in use by another ${state4.records.registeredIds[id27]}` + ); + } + if (parent4 !== void 0) { + if (id27 === parent4) { + throw new Error(`The group [${id27}] cannot be placed within itself`); + } + if (state4.records.registeredIds[parent4] === void 0) { + throw new Error( + `The group [${id27}]'s parent does not exist. Please make sure the parent is created before this group` + ); + } + if (state4.records.registeredIds[parent4] === "node") { + throw new Error(`The group [${id27}]'s parent is not a group`); + } + } + state4.records.registeredIds[id27] = "group"; + state4.records.groups[id27] = { + id: id27, + icon, + title: title2, + in: parent4 + }; + }, "addGroup"); + getGroups = /* @__PURE__ */ __name(() => { + return Object.values(state4.records.groups); + }, "getGroups"); + addEdge = /* @__PURE__ */ __name(function({ + lhsId, + rhsId, + lhsDir, + rhsDir, + lhsInto, + rhsInto, + lhsGroup, + rhsGroup, + title: title2 + }) { + if (!isArchitectureDirection(lhsDir)) { + throw new Error( + `Invalid direction given for left hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${lhsDir}` + ); + } + if (!isArchitectureDirection(rhsDir)) { + throw new Error( + `Invalid direction given for right hand side of edge ${lhsId}--${rhsId}. Expected (L,R,T,B) got ${rhsDir}` + ); + } + if (state4.records.nodes[lhsId] === void 0 && state4.records.groups[lhsId] === void 0) { + throw new Error( + `The left-hand id [${lhsId}] does not yet exist. Please create the service/group before declaring an edge to it.` + ); + } + if (state4.records.nodes[rhsId] === void 0 && state4.records.groups[lhsId] === void 0) { + throw new Error( + `The right-hand id [${rhsId}] does not yet exist. Please create the service/group before declaring an edge to it.` + ); + } + const lhsGroupId = state4.records.nodes[lhsId].in; + const rhsGroupId = state4.records.nodes[rhsId].in; + if (lhsGroup && lhsGroupId && rhsGroupId && lhsGroupId == rhsGroupId) { + throw new Error( + `The left-hand id [${lhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.` + ); + } + if (rhsGroup && lhsGroupId && rhsGroupId && lhsGroupId == rhsGroupId) { + throw new Error( + `The right-hand id [${rhsId}] is modified to traverse the group boundary, but the edge does not pass through two groups.` + ); + } + const edge = { + lhsId, + lhsDir, + lhsInto, + lhsGroup, + rhsId, + rhsDir, + rhsInto, + rhsGroup, + title: title2 + }; + state4.records.edges.push(edge); + if (state4.records.nodes[lhsId] && state4.records.nodes[rhsId]) { + state4.records.nodes[lhsId].edges.push(state4.records.edges[state4.records.edges.length - 1]); + state4.records.nodes[rhsId].edges.push(state4.records.edges[state4.records.edges.length - 1]); + } + }, "addEdge"); + getEdges3 = /* @__PURE__ */ __name(() => state4.records.edges, "getEdges"); + getDataStructures = /* @__PURE__ */ __name(() => { + if (state4.records.dataStructures === void 0) { + const adjList = Object.entries(state4.records.nodes).reduce((prevOuter, [id27, service]) => { + prevOuter[id27] = service.edges.reduce((prevInner, edge) => { + if (edge.lhsId === id27) { + const pair = getArchitectureDirectionPair(edge.lhsDir, edge.rhsDir); + if (pair) { + prevInner[pair] = edge.rhsId; + } + } else { + const pair = getArchitectureDirectionPair(edge.rhsDir, edge.lhsDir); + if (pair) { + prevInner[pair] = edge.lhsId; + } + } + return prevInner; + }, {}); + return prevOuter; + }, {}); + const firstId = Object.keys(adjList)[0]; + const visited = { [firstId]: 1 }; + const notVisited = Object.keys(adjList).reduce( + (prev2, id27) => id27 === firstId ? prev2 : { ...prev2, [id27]: 1 }, + {} + ); + const BFS = /* @__PURE__ */ __name((startingId) => { + const spatialMap = { [startingId]: [0, 0] }; + const queue = [startingId]; + while (queue.length > 0) { + const id27 = queue.shift(); + if (id27) { + visited[id27] = 1; + delete notVisited[id27]; + const adj = adjList[id27]; + const [posX, posY] = spatialMap[id27]; + Object.entries(adj).forEach(([dir2, rhsId]) => { + if (!visited[rhsId]) { + spatialMap[rhsId] = shiftPositionByArchitectureDirectionPair( + [posX, posY], + dir2 + ); + queue.push(rhsId); + } + }); + } } + return spatialMap; + }, "BFS"); + const spatialMaps = [BFS(firstId)]; + while (Object.keys(notVisited).length > 0) { + spatialMaps.push(BFS(Object.keys(notVisited)[0])); } + state4.records.dataStructures = { + adjList, + spatialMaps + }; } - }) - ); - const failed = results.filter((result) => result.status === "rejected"); - if (failed.length > 0) { - log.error(`Failed to load ${failed.length} external diagrams`); - for (const res of failed) { - log.error(res); - } - throw new Error(`Failed to load ${failed.length} external diagrams`); + return state4.records.dataStructures; + }, "getDataStructures"); + setElementForId2 = /* @__PURE__ */ __name((id27, element3) => { + state4.records.elements[id27] = element3; + }, "setElementForId"); + getElementById3 = /* @__PURE__ */ __name((id27) => state4.records.elements[id27], "getElementById"); + db7 = { + clear: clear29, + setDiagramTitle, + getDiagramTitle, + setAccTitle, + getAccTitle, + setAccDescription, + getAccDescription, + addService, + getServices, + addJunction, + getJunctions, + getNodes: getNodes2, + getNode, + addGroup, + getGroups, + addEdge, + getEdges: getEdges3, + setElementForId: setElementForId2, + getElementById: getElementById3, + getDataStructures + }; + __name(getConfigField, "getConfigField"); } - }, "loadRegisteredDiagrams"); - - // src/mermaid.ts - init_logger(); - - // src/mermaidAPI.ts - init_src32(); + }); - // ../../node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Enum.js - var COMMENT = "comm"; - var RULESET = "rule"; - var DECLARATION = "decl"; - var IMPORT = "@import"; - var KEYFRAMES = "@keyframes"; - var LAYER = "@layer"; + // src/diagrams/architecture/architectureParser.ts + var populateDb2, parser21; + var init_architectureParser = __esm({ + "src/diagrams/architecture/architectureParser.ts"() { + "use strict"; + init_mermaid_parser_core(); + init_logger(); + init_populateCommonDb(); + init_architectureDb(); + populateDb2 = /* @__PURE__ */ __name((ast, db8) => { + populateCommonDb(ast, db8); + ast.groups.map(db8.addGroup); + ast.services.map((service) => db8.addService({ ...service, type: "service" })); + ast.junctions.map((service) => db8.addJunction({ ...service, type: "junction" })); + ast.edges.map(db8.addEdge); + }, "populateDb"); + parser21 = { + parse: /* @__PURE__ */ __name(async (input) => { + const ast = await parse2("architecture", input); + log.debug(ast); + populateDb2(ast, db7); + }, "parse") + }; + } + }); - // ../../node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Utility.js - var abs3 = Math.abs; - var from = String.fromCharCode; - function trim(value2) { - return value2.trim(); - } - __name(trim, "trim"); - function replace(value2, pattern, replacement) { - return value2.replace(pattern, replacement); - } - __name(replace, "replace"); - function indexof(value2, search, position5) { - return value2.indexOf(search, position5); - } - __name(indexof, "indexof"); - function charat(value2, index) { - return value2.charCodeAt(index) | 0; - } - __name(charat, "charat"); - function substr(value2, begin, end2) { - return value2.slice(begin, end2); - } - __name(substr, "substr"); - function strlen(value2) { - return value2.length; - } - __name(strlen, "strlen"); - function sizeof(value2) { - return value2.length; - } - __name(sizeof, "sizeof"); - function append2(value2, array4) { - return array4.push(value2), value2; + // src/diagrams/architecture/architectureStyles.ts + var getStyles16, architectureStyles_default; + var init_architectureStyles = __esm({ + "src/diagrams/architecture/architectureStyles.ts"() { + "use strict"; + getStyles16 = /* @__PURE__ */ __name((options3) => ` + .edge { + stroke-width: ${options3.archEdgeWidth}; + stroke: ${options3.archEdgeColor}; + fill: none; } - __name(append2, "append"); - // ../../node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Tokenizer.js - var line = 1; - var column = 1; - var length = 0; - var position4 = 0; - var character = 0; - var characters = ""; - function node(value2, root4, parent4, type3, props, children2, length2, siblings2) { - return { value: value2, root: root4, parent: parent4, type: type3, props, children: children2, line, column, length: length2, return: "", siblings: siblings2 }; + .arrow { + fill: ${options3.archEdgeArrowColor}; } - __name(node, "node"); - function char() { - return character; - } - __name(char, "char"); - function prev() { - character = position4 > 0 ? charat(characters, --position4) : 0; - if (column--, character === 10) - column = 1, line--; - return character; - } - __name(prev, "prev"); - function next2() { - character = position4 < length ? charat(characters, position4++) : 0; - if (column++, character === 10) - column = 1, line++; - return character; - } - __name(next2, "next"); - function peek() { - return charat(characters, position4); + + .node-bkg { + fill: none; + stroke: ${options3.archGroupBorderColor}; + stroke-width: ${options3.archGroupBorderWidth}; + stroke-dasharray: 8; } - __name(peek, "peek"); - function caret2() { - return position4; + .node-icon-text { + display: flex; + align-items: center; } - __name(caret2, "caret"); - function slice4(begin, end2) { - return substr(characters, begin, end2); + + .node-icon-text > div { + color: #fff; + margin: 1px; + height: fit-content; + text-align: center; + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; } - __name(slice4, "slice"); - function token(type3) { - switch (type3) { - 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; +`, "getStyles"); + architectureStyles_default = getStyles16; } - return 0; - } - __name(token, "token"); - function alloc(value2) { - return line = column = 1, length = strlen(characters = value2), position4 = 0, []; - } - __name(alloc, "alloc"); - function dealloc(value2) { - return characters = "", value2; - } - __name(dealloc, "dealloc"); - function delimit(type3) { - return trim(slice4(position4 - 1, delimiter2(type3 === 91 ? type3 + 2 : type3 === 40 ? type3 + 1 : type3))); - } - __name(delimit, "delimit"); - function whitespace(type3) { - while (character = peek()) - if (character < 33) - next2(); - else - break; - return token(type3) > 2 || token(character) > 3 ? "" : " "; - } - __name(whitespace, "whitespace"); - function escaping(index, count) { - while (--count && next2()) - if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) - break; - return slice4(index, caret2() + (count < 6 && peek() == 32 && next2() == 32)); - } - __name(escaping, "escaping"); - function delimiter2(type3) { - while (next2()) - switch (character) { - case type3: - return position4; - case 34: - case 39: - if (type3 !== 34 && type3 !== 39) - delimiter2(character); - break; - case 40: - if (type3 === 41) - delimiter2(type3); - break; - case 92: - next2(); - break; - } - return position4; - } - __name(delimiter2, "delimiter"); - function commenter(type3, index) { - while (next2()) - if (type3 + character === 47 + 10) - break; - else if (type3 + character === 42 + 42 && peek() === 47) - break; - return "/*" + slice4(index, position4 - 1) + "*" + from(type3 === 47 ? type3 : next2()); - } - __name(commenter, "commenter"); - function identifier(index) { - while (!token(peek())) - next2(); - return slice4(index, position4); - } - __name(identifier, "identifier"); + }); - // ../../node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Parser.js - function compile(value2) { - return dealloc(parse5("", null, null, null, [""], value2 = alloc(value2), 0, [0], value2)); - } - __name(compile, "compile"); - function parse5(value2, root4, parent4, rule, rules, rulesets, pseudo, points, declarations) { - var index = 0; - var offset = 0; - var length2 = pseudo; - var atrule = 0; - var property2 = 0; - var previous = 0; - var variable = 1; - var scanning = 1; - var ampersand = 1; - var character2 = 0; - var type3 = ""; - var props = rules; - var children2 = rulesets; - var reference = rule; - var characters2 = type3; - while (scanning) - switch (previous = character2, character2 = next2()) { - case 40: - if (previous != 108 && charat(characters2, length2 - 1) == 58) { - if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs3(index ? points[index - 1] : 0)) != -1) - ampersand = -1; - break; - } - case 34: - case 39: - case 91: - characters2 += delimit(character2); - break; - case 9: - case 10: - case 13: - case 32: - characters2 += whitespace(previous); - break; - case 92: - characters2 += escaping(caret2() - 1, 7); - continue; - case 47: - switch (peek()) { - case 42: - case 47: - append2(comment(commenter(next2(), caret2()), root4, parent4, declarations), declarations); - break; - default: - characters2 += "/"; - } - break; - case 123 * variable: - points[index++] = strlen(characters2) * ampersand; - case 125 * variable: - case 59: - case 0: - switch (character2) { - case 0: - case 125: - scanning = 0; + // ../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js + var require_layout_base2 = __commonJS({ + "../../node_modules/.pnpm/layout-base@2.0.1/node_modules/layout-base/layout-base.js"(exports2, module2) { + "use strict"; + (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) { + if (typeof exports2 === "object" && typeof module2 === "object") + module2.exports = factory(); + else if (typeof define === "function" && define.amd) + define([], factory); + else if (typeof exports2 === "object") + exports2["layoutBase"] = factory(); + else + root4["layoutBase"] = factory(); + }, "webpackUniversalModuleDefinition"))(exports2, function() { + return ( + /******/ + function(modules2) { + var installedModules = {}; + function __webpack_require__(moduleId) { + if (installedModules[moduleId]) { + return installedModules[moduleId].exports; + } + var module3 = installedModules[moduleId] = { + /******/ + i: moduleId, + /******/ + l: false, + /******/ + exports: {} + /******/ + }; + modules2[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); + module3.l = true; + return module3.exports; + } + __name(__webpack_require__, "__webpack_require__"); + __webpack_require__.m = modules2; + __webpack_require__.c = installedModules; + __webpack_require__.i = function(value2) { + return value2; + }; + __webpack_require__.d = function(exports3, name, getter) { + if (!__webpack_require__.o(exports3, name)) { + Object.defineProperty(exports3, name, { + /******/ + configurable: false, + /******/ + enumerable: true, + /******/ + get: getter + /******/ + }); + } + }; + __webpack_require__.n = function(module3) { + var getter = module3 && module3.__esModule ? ( + /******/ + /* @__PURE__ */ __name(function getDefault() { + return module3["default"]; + }, "getDefault") + ) : ( + /******/ + /* @__PURE__ */ __name(function getModuleExports() { + return module3; + }, "getModuleExports") + ); + __webpack_require__.d(getter, "a", getter); + return getter; + }; + __webpack_require__.o = function(object3, property2) { + return Object.prototype.hasOwnProperty.call(object3, property2); + }; + __webpack_require__.p = ""; + return __webpack_require__(__webpack_require__.s = 28); + }([ + /* 0 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function LayoutConstants() { + } + __name(LayoutConstants, "LayoutConstants"); + LayoutConstants.QUALITY = 1; + LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED = false; + LayoutConstants.DEFAULT_INCREMENTAL = false; + LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT = true; + LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT = false; + LayoutConstants.DEFAULT_ANIMATION_PERIOD = 50; + LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES = false; + LayoutConstants.DEFAULT_GRAPH_MARGIN = 15; + LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = false; + LayoutConstants.SIMPLE_NODE_SIZE = 40; + LayoutConstants.SIMPLE_NODE_HALF_SIZE = LayoutConstants.SIMPLE_NODE_SIZE / 2; + LayoutConstants.EMPTY_COMPOUND_NODE_SIZE = 40; + LayoutConstants.MIN_EDGE_LENGTH = 1; + LayoutConstants.WORLD_BOUNDARY = 1e6; + LayoutConstants.INITIAL_WORLD_BOUNDARY = LayoutConstants.WORLD_BOUNDARY / 1e3; + LayoutConstants.WORLD_CENTER_X = 1200; + LayoutConstants.WORLD_CENTER_Y = 900; + module3.exports = LayoutConstants; + }, + /* 1 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LGraphObject = __webpack_require__(2); + var IGeometry = __webpack_require__(8); + var IMath = __webpack_require__(9); + function LEdge(source, target, vEdge) { + LGraphObject.call(this, vEdge); + this.isOverlapingSourceAndTarget = false; + this.vGraphObject = vEdge; + this.bendpoints = []; + this.source = source; + this.target = target; + } + __name(LEdge, "LEdge"); + LEdge.prototype = Object.create(LGraphObject.prototype); + for (var prop in LGraphObject) { + LEdge[prop] = LGraphObject[prop]; + } + LEdge.prototype.getSource = function() { + return this.source; + }; + LEdge.prototype.getTarget = function() { + return this.target; + }; + LEdge.prototype.isInterGraph = function() { + return this.isInterGraph; + }; + LEdge.prototype.getLength = function() { + return this.length; + }; + LEdge.prototype.isOverlapingSourceAndTarget = function() { + return this.isOverlapingSourceAndTarget; + }; + LEdge.prototype.getBendpoints = function() { + return this.bendpoints; + }; + LEdge.prototype.getLca = function() { + return this.lca; + }; + LEdge.prototype.getSourceInLca = function() { + return this.sourceInLca; + }; + LEdge.prototype.getTargetInLca = function() { + return this.targetInLca; + }; + LEdge.prototype.getOtherEnd = function(node2) { + if (this.source === node2) { + return this.target; + } else if (this.target === node2) { + return this.source; + } else { + throw "Node is not incident with this edge"; + } + }; + LEdge.prototype.getOtherEndInGraph = function(node2, graph) { + var otherEnd = this.getOtherEnd(node2); + var root4 = graph.getGraphManager().getRoot(); + while (true) { + if (otherEnd.getOwner() == graph) { + return otherEnd; + } + if (otherEnd.getOwner() == root4) { + break; + } + otherEnd = otherEnd.getOwner().getParent(); + } + return null; + }; + LEdge.prototype.updateLength = function() { + var clipPointCoordinates = new Array(4); + this.isOverlapingSourceAndTarget = IGeometry.getIntersection(this.target.getRect(), this.source.getRect(), clipPointCoordinates); + if (!this.isOverlapingSourceAndTarget) { + this.lengthX = clipPointCoordinates[0] - clipPointCoordinates[2]; + this.lengthY = clipPointCoordinates[1] - clipPointCoordinates[3]; + if (Math.abs(this.lengthX) < 1) { + this.lengthX = IMath.sign(this.lengthX); + } + if (Math.abs(this.lengthY) < 1) { + this.lengthY = IMath.sign(this.lengthY); + } + this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY); + } + }; + LEdge.prototype.updateLengthSimple = function() { + this.lengthX = this.target.getCenterX() - this.source.getCenterX(); + this.lengthY = this.target.getCenterY() - this.source.getCenterY(); + if (Math.abs(this.lengthX) < 1) { + this.lengthX = IMath.sign(this.lengthX); + } + if (Math.abs(this.lengthY) < 1) { + this.lengthY = IMath.sign(this.lengthY); + } + this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY); + }; + module3.exports = LEdge; + }, + /* 2 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function LGraphObject(vGraphObject) { + this.vGraphObject = vGraphObject; + } + __name(LGraphObject, "LGraphObject"); + module3.exports = LGraphObject; + }, + /* 3 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LGraphObject = __webpack_require__(2); + var Integer = __webpack_require__(10); + var RectangleD = __webpack_require__(13); + var LayoutConstants = __webpack_require__(0); + var RandomSeed = __webpack_require__(16); + var PointD = __webpack_require__(5); + function LNode(gm, loc, size5, vNode) { + if (size5 == null && vNode == null) { + vNode = loc; + } + LGraphObject.call(this, vNode); + if (gm.graphManager != null) gm = gm.graphManager; + this.estimatedSize = Integer.MIN_VALUE; + this.inclusionTreeDepth = Integer.MAX_VALUE; + this.vGraphObject = vNode; + this.edges = []; + this.graphManager = gm; + if (size5 != null && loc != null) this.rect = new RectangleD(loc.x, loc.y, size5.width, size5.height); + else this.rect = new RectangleD(); + } + __name(LNode, "LNode"); + LNode.prototype = Object.create(LGraphObject.prototype); + for (var prop in LGraphObject) { + LNode[prop] = LGraphObject[prop]; + } + LNode.prototype.getEdges = function() { + return this.edges; + }; + LNode.prototype.getChild = function() { + return this.child; + }; + LNode.prototype.getOwner = function() { + return this.owner; + }; + LNode.prototype.getWidth = function() { + return this.rect.width; + }; + LNode.prototype.setWidth = function(width3) { + this.rect.width = width3; + }; + LNode.prototype.getHeight = function() { + return this.rect.height; + }; + LNode.prototype.setHeight = function(height2) { + this.rect.height = height2; + }; + LNode.prototype.getCenterX = function() { + return this.rect.x + this.rect.width / 2; + }; + LNode.prototype.getCenterY = function() { + return this.rect.y + this.rect.height / 2; + }; + LNode.prototype.getCenter = function() { + return new PointD(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2); + }; + LNode.prototype.getLocation = function() { + return new PointD(this.rect.x, this.rect.y); + }; + LNode.prototype.getRect = function() { + return this.rect; + }; + LNode.prototype.getDiagonal = function() { + return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height); + }; + LNode.prototype.getHalfTheDiagonal = function() { + return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2; + }; + LNode.prototype.setRect = function(upperLeft, dimension) { + this.rect.x = upperLeft.x; + this.rect.y = upperLeft.y; + this.rect.width = dimension.width; + this.rect.height = dimension.height; + }; + LNode.prototype.setCenter = function(cx, cy) { + this.rect.x = cx - this.rect.width / 2; + this.rect.y = cy - this.rect.height / 2; + }; + LNode.prototype.setLocation = function(x5, y5) { + this.rect.x = x5; + this.rect.y = y5; + }; + LNode.prototype.moveBy = function(dx, dy) { + this.rect.x += dx; + this.rect.y += dy; + }; + LNode.prototype.getEdgeListToNode = function(to) { + var edgeList2 = []; + var edge; + var self2 = this; + self2.edges.forEach(function(edge2) { + if (edge2.target == to) { + if (edge2.source != self2) throw "Incorrect edge source!"; + edgeList2.push(edge2); + } + }); + return edgeList2; + }; + LNode.prototype.getEdgesBetween = function(other) { + var edgeList2 = []; + var edge; + var self2 = this; + self2.edges.forEach(function(edge2) { + if (!(edge2.source == self2 || edge2.target == self2)) throw "Incorrect edge source and/or target"; + if (edge2.target == other || edge2.source == other) { + edgeList2.push(edge2); + } + }); + return edgeList2; + }; + LNode.prototype.getNeighborsList = function() { + var neighbors = /* @__PURE__ */ new Set(); + var self2 = this; + self2.edges.forEach(function(edge) { + if (edge.source == self2) { + neighbors.add(edge.target); + } else { + if (edge.target != self2) { + throw "Incorrect incidency!"; + } + neighbors.add(edge.source); + } + }); + return neighbors; + }; + LNode.prototype.withChildren = function() { + var withNeighborsList = /* @__PURE__ */ new Set(); + var childNode; + var children2; + withNeighborsList.add(this); + if (this.child != null) { + var nodes6 = this.child.getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + childNode = nodes6[i2]; + children2 = childNode.withChildren(); + children2.forEach(function(node2) { + withNeighborsList.add(node2); + }); + } + } + return withNeighborsList; + }; + LNode.prototype.getNoOfChildren = function() { + var noOfChildren = 0; + var childNode; + if (this.child == null) { + noOfChildren = 1; + } else { + var nodes6 = this.child.getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + childNode = nodes6[i2]; + noOfChildren += childNode.getNoOfChildren(); + } + } + if (noOfChildren == 0) { + noOfChildren = 1; + } + return noOfChildren; + }; + LNode.prototype.getEstimatedSize = function() { + if (this.estimatedSize == Integer.MIN_VALUE) { + throw "assert failed"; + } + return this.estimatedSize; + }; + LNode.prototype.calcEstimatedSize = function() { + if (this.child == null) { + return this.estimatedSize = (this.rect.width + this.rect.height) / 2; + } else { + this.estimatedSize = this.child.calcEstimatedSize(); + this.rect.width = this.estimatedSize; + this.rect.height = this.estimatedSize; + return this.estimatedSize; + } + }; + LNode.prototype.scatter = function() { + var randomCenterX; + var randomCenterY; + var minX = -LayoutConstants.INITIAL_WORLD_BOUNDARY; + var maxX = LayoutConstants.INITIAL_WORLD_BOUNDARY; + randomCenterX = LayoutConstants.WORLD_CENTER_X + RandomSeed.nextDouble() * (maxX - minX) + minX; + var minY = -LayoutConstants.INITIAL_WORLD_BOUNDARY; + var maxY = LayoutConstants.INITIAL_WORLD_BOUNDARY; + randomCenterY = LayoutConstants.WORLD_CENTER_Y + RandomSeed.nextDouble() * (maxY - minY) + minY; + this.rect.x = randomCenterX; + this.rect.y = randomCenterY; + }; + LNode.prototype.updateBounds = function() { + if (this.getChild() == null) { + throw "assert failed"; + } + if (this.getChild().getNodes().length != 0) { + var childGraph = this.getChild(); + childGraph.updateBounds(true); + this.rect.x = childGraph.getLeft(); + this.rect.y = childGraph.getTop(); + this.setWidth(childGraph.getRight() - childGraph.getLeft()); + this.setHeight(childGraph.getBottom() - childGraph.getTop()); + if (LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS) { + var width3 = childGraph.getRight() - childGraph.getLeft(); + var height2 = childGraph.getBottom() - childGraph.getTop(); + if (this.labelWidth) { + if (this.labelPosHorizontal == "left") { + this.rect.x -= this.labelWidth; + this.setWidth(width3 + this.labelWidth); + } else if (this.labelPosHorizontal == "center" && this.labelWidth > width3) { + this.rect.x -= (this.labelWidth - width3) / 2; + this.setWidth(this.labelWidth); + } else if (this.labelPosHorizontal == "right") { + this.setWidth(width3 + this.labelWidth); + } + } + if (this.labelHeight) { + if (this.labelPosVertical == "top") { + this.rect.y -= this.labelHeight; + this.setHeight(height2 + this.labelHeight); + } else if (this.labelPosVertical == "center" && this.labelHeight > height2) { + this.rect.y -= (this.labelHeight - height2) / 2; + this.setHeight(this.labelHeight); + } else if (this.labelPosVertical == "bottom") { + this.setHeight(height2 + this.labelHeight); + } + } + } + } + }; + LNode.prototype.getInclusionTreeDepth = function() { + if (this.inclusionTreeDepth == Integer.MAX_VALUE) { + throw "assert failed"; + } + return this.inclusionTreeDepth; + }; + LNode.prototype.transform = function(trans) { + var left3 = this.rect.x; + if (left3 > LayoutConstants.WORLD_BOUNDARY) { + left3 = LayoutConstants.WORLD_BOUNDARY; + } else if (left3 < -LayoutConstants.WORLD_BOUNDARY) { + left3 = -LayoutConstants.WORLD_BOUNDARY; + } + var top2 = this.rect.y; + if (top2 > LayoutConstants.WORLD_BOUNDARY) { + top2 = LayoutConstants.WORLD_BOUNDARY; + } else if (top2 < -LayoutConstants.WORLD_BOUNDARY) { + top2 = -LayoutConstants.WORLD_BOUNDARY; + } + var leftTop = new PointD(left3, top2); + var vLeftTop = trans.inverseTransformPoint(leftTop); + this.setLocation(vLeftTop.x, vLeftTop.y); + }; + LNode.prototype.getLeft = function() { + return this.rect.x; + }; + LNode.prototype.getRight = function() { + return this.rect.x + this.rect.width; + }; + LNode.prototype.getTop = function() { + return this.rect.y; + }; + LNode.prototype.getBottom = function() { + return this.rect.y + this.rect.height; + }; + LNode.prototype.getParent = function() { + if (this.owner == null) { + return null; + } + return this.owner.getParent(); + }; + module3.exports = LNode; + }, + /* 4 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LayoutConstants = __webpack_require__(0); + function FDLayoutConstants() { + } + __name(FDLayoutConstants, "FDLayoutConstants"); + for (var prop in LayoutConstants) { + FDLayoutConstants[prop] = LayoutConstants[prop]; + } + FDLayoutConstants.MAX_ITERATIONS = 2500; + FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50; + FDLayoutConstants.DEFAULT_SPRING_STRENGTH = 0.45; + FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = 4500; + FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = 0.4; + FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1; + FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8; + FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5; + FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = true; + FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = true; + FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3; + FDLayoutConstants.COOLING_ADAPTATION_FACTOR = 0.33; + FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT = 1e3; + FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT = 5e3; + FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100; + FDLayoutConstants.MAX_NODE_DISPLACEMENT = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3; + FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10; + FDLayoutConstants.CONVERGENCE_CHECK_PERIOD = 100; + FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1; + FDLayoutConstants.MIN_EDGE_LENGTH = 1; + FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD = 10; + module3.exports = FDLayoutConstants; + }, + /* 5 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function PointD(x5, y5) { + if (x5 == null && y5 == null) { + this.x = 0; + this.y = 0; + } else { + this.x = x5; + this.y = y5; + } + } + __name(PointD, "PointD"); + PointD.prototype.getX = function() { + return this.x; + }; + PointD.prototype.getY = function() { + return this.y; + }; + PointD.prototype.setX = function(x5) { + this.x = x5; + }; + PointD.prototype.setY = function(y5) { + this.y = y5; + }; + PointD.prototype.getDifference = function(pt) { + return new DimensionD(this.x - pt.x, this.y - pt.y); + }; + PointD.prototype.getCopy = function() { + return new PointD(this.x, this.y); + }; + PointD.prototype.translate = function(dim) { + this.x += dim.width; + this.y += dim.height; + return this; + }; + module3.exports = PointD; + }, + /* 6 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LGraphObject = __webpack_require__(2); + var Integer = __webpack_require__(10); + var LayoutConstants = __webpack_require__(0); + var LGraphManager = __webpack_require__(7); + var LNode = __webpack_require__(3); + var LEdge = __webpack_require__(1); + var RectangleD = __webpack_require__(13); + var Point3 = __webpack_require__(12); + var LinkedList = __webpack_require__(11); + function LGraph(parent4, obj2, vGraph) { + LGraphObject.call(this, vGraph); + this.estimatedSize = Integer.MIN_VALUE; + this.margin = LayoutConstants.DEFAULT_GRAPH_MARGIN; + this.edges = []; + this.nodes = []; + this.isConnected = false; + this.parent = parent4; + if (obj2 != null && obj2 instanceof LGraphManager) { + this.graphManager = obj2; + } else if (obj2 != null && obj2 instanceof Layout) { + this.graphManager = obj2.graphManager; + } + } + __name(LGraph, "LGraph"); + LGraph.prototype = Object.create(LGraphObject.prototype); + for (var prop in LGraphObject) { + LGraph[prop] = LGraphObject[prop]; + } + LGraph.prototype.getNodes = function() { + return this.nodes; + }; + LGraph.prototype.getEdges = function() { + return this.edges; + }; + LGraph.prototype.getGraphManager = function() { + return this.graphManager; + }; + LGraph.prototype.getParent = function() { + return this.parent; + }; + LGraph.prototype.getLeft = function() { + return this.left; + }; + LGraph.prototype.getRight = function() { + return this.right; + }; + LGraph.prototype.getTop = function() { + return this.top; + }; + LGraph.prototype.getBottom = function() { + return this.bottom; + }; + LGraph.prototype.isConnected = function() { + return this.isConnected; + }; + LGraph.prototype.add = function(obj1, sourceNode, targetNode) { + if (sourceNode == null && targetNode == null) { + var newNode = obj1; + if (this.graphManager == null) { + throw "Graph has no graph mgr!"; + } + if (this.getNodes().indexOf(newNode) > -1) { + throw "Node already in graph!"; + } + newNode.owner = this; + this.getNodes().push(newNode); + return newNode; + } else { + var newEdge = obj1; + if (!(this.getNodes().indexOf(sourceNode) > -1 && this.getNodes().indexOf(targetNode) > -1)) { + throw "Source or target not in graph!"; + } + if (!(sourceNode.owner == targetNode.owner && sourceNode.owner == this)) { + throw "Both owners must be this graph!"; + } + if (sourceNode.owner != targetNode.owner) { + return null; + } + newEdge.source = sourceNode; + newEdge.target = targetNode; + newEdge.isInterGraph = false; + this.getEdges().push(newEdge); + sourceNode.edges.push(newEdge); + if (targetNode != sourceNode) { + targetNode.edges.push(newEdge); + } + return newEdge; + } + }; + LGraph.prototype.remove = function(obj) { + var node2 = obj; + if (obj instanceof LNode) { + if (node2 == null) { + throw "Node is null!"; + } + if (!(node2.owner != null && node2.owner == this)) { + throw "Owner graph is invalid!"; + } + if (this.graphManager == null) { + throw "Owner graph manager is invalid!"; + } + var edgesToBeRemoved = node2.edges.slice(); + var edge; + var s2 = edgesToBeRemoved.length; + for (var i2 = 0; i2 < s2; i2++) { + edge = edgesToBeRemoved[i2]; + if (edge.isInterGraph) { + this.graphManager.remove(edge); + } else { + edge.source.owner.remove(edge); + } + } + var index = this.nodes.indexOf(node2); + if (index == -1) { + throw "Node not in owner node list!"; + } + this.nodes.splice(index, 1); + } else if (obj instanceof LEdge) { + var edge = obj; + if (edge == null) { + throw "Edge is null!"; + } + if (!(edge.source != null && edge.target != null)) { + throw "Source and/or target is null!"; + } + if (!(edge.source.owner != null && edge.target.owner != null && edge.source.owner == this && edge.target.owner == this)) { + throw "Source and/or target owner is invalid!"; + } + var sourceIndex = edge.source.edges.indexOf(edge); + var targetIndex = edge.target.edges.indexOf(edge); + if (!(sourceIndex > -1 && targetIndex > -1)) { + throw "Source and/or target doesn't know this edge!"; + } + edge.source.edges.splice(sourceIndex, 1); + if (edge.target != edge.source) { + edge.target.edges.splice(targetIndex, 1); + } + var index = edge.source.owner.getEdges().indexOf(edge); + if (index == -1) { + throw "Not in owner's edge list!"; + } + edge.source.owner.getEdges().splice(index, 1); + } + }; + LGraph.prototype.updateLeftTop = function() { + var top2 = Integer.MAX_VALUE; + var left3 = Integer.MAX_VALUE; + var nodeTop; + var nodeLeft; + var margin; + var nodes6 = this.getNodes(); + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + var lNode = nodes6[i2]; + nodeTop = lNode.getTop(); + nodeLeft = lNode.getLeft(); + if (top2 > nodeTop) { + top2 = nodeTop; + } + if (left3 > nodeLeft) { + left3 = nodeLeft; + } + } + if (top2 == Integer.MAX_VALUE) { + return null; + } + if (nodes6[0].getParent().paddingLeft != void 0) { + margin = nodes6[0].getParent().paddingLeft; + } else { + margin = this.margin; + } + this.left = left3 - margin; + this.top = top2 - margin; + return new Point3(this.left, this.top); + }; + LGraph.prototype.updateBounds = function(recursive) { + var left3 = Integer.MAX_VALUE; + var right3 = -Integer.MAX_VALUE; + var top2 = Integer.MAX_VALUE; + var bottom2 = -Integer.MAX_VALUE; + var nodeLeft; + var nodeRight; + var nodeTop; + var nodeBottom; + var margin; + var nodes6 = this.nodes; + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + var lNode = nodes6[i2]; + if (recursive && lNode.child != null) { + lNode.updateBounds(); + } + nodeLeft = lNode.getLeft(); + nodeRight = lNode.getRight(); + nodeTop = lNode.getTop(); + nodeBottom = lNode.getBottom(); + if (left3 > nodeLeft) { + left3 = nodeLeft; + } + if (right3 < nodeRight) { + right3 = nodeRight; + } + if (top2 > nodeTop) { + top2 = nodeTop; + } + if (bottom2 < nodeBottom) { + bottom2 = nodeBottom; + } + } + var boundingRect = new RectangleD(left3, top2, right3 - left3, bottom2 - top2); + if (left3 == Integer.MAX_VALUE) { + this.left = this.parent.getLeft(); + this.right = this.parent.getRight(); + this.top = this.parent.getTop(); + this.bottom = this.parent.getBottom(); + } + if (nodes6[0].getParent().paddingLeft != void 0) { + margin = nodes6[0].getParent().paddingLeft; + } else { + margin = this.margin; + } + this.left = boundingRect.x - margin; + this.right = boundingRect.x + boundingRect.width + margin; + this.top = boundingRect.y - margin; + this.bottom = boundingRect.y + boundingRect.height + margin; + }; + LGraph.calculateBounds = function(nodes6) { + var left3 = Integer.MAX_VALUE; + var right3 = -Integer.MAX_VALUE; + var top2 = Integer.MAX_VALUE; + var bottom2 = -Integer.MAX_VALUE; + var nodeLeft; + var nodeRight; + var nodeTop; + var nodeBottom; + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + var lNode = nodes6[i2]; + nodeLeft = lNode.getLeft(); + nodeRight = lNode.getRight(); + nodeTop = lNode.getTop(); + nodeBottom = lNode.getBottom(); + if (left3 > nodeLeft) { + left3 = nodeLeft; + } + if (right3 < nodeRight) { + right3 = nodeRight; + } + if (top2 > nodeTop) { + top2 = nodeTop; + } + if (bottom2 < nodeBottom) { + bottom2 = nodeBottom; + } + } + var boundingRect = new RectangleD(left3, top2, right3 - left3, bottom2 - top2); + return boundingRect; + }; + LGraph.prototype.getInclusionTreeDepth = function() { + if (this == this.graphManager.getRoot()) { + return 1; + } else { + return this.parent.getInclusionTreeDepth(); + } + }; + LGraph.prototype.getEstimatedSize = function() { + if (this.estimatedSize == Integer.MIN_VALUE) { + throw "assert failed"; + } + return this.estimatedSize; + }; + LGraph.prototype.calcEstimatedSize = function() { + var size5 = 0; + var nodes6 = this.nodes; + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + var lNode = nodes6[i2]; + size5 += lNode.calcEstimatedSize(); + } + if (size5 == 0) { + this.estimatedSize = LayoutConstants.EMPTY_COMPOUND_NODE_SIZE; + } else { + this.estimatedSize = size5 / Math.sqrt(this.nodes.length); + } + return this.estimatedSize; + }; + LGraph.prototype.updateConnected = function() { + var self2 = this; + if (this.nodes.length == 0) { + this.isConnected = true; + return; + } + var queue = new LinkedList(); + var visited = /* @__PURE__ */ new Set(); + var currentNode = this.nodes[0]; + var neighborEdges; + var currentNeighbor; + var childrenOfNode = currentNode.withChildren(); + childrenOfNode.forEach(function(node2) { + queue.push(node2); + visited.add(node2); + }); + while (queue.length !== 0) { + currentNode = queue.shift(); + neighborEdges = currentNode.getEdges(); + var size5 = neighborEdges.length; + for (var i2 = 0; i2 < size5; i2++) { + var neighborEdge = neighborEdges[i2]; + currentNeighbor = neighborEdge.getOtherEndInGraph(currentNode, this); + if (currentNeighbor != null && !visited.has(currentNeighbor)) { + var childrenOfNeighbor = currentNeighbor.withChildren(); + childrenOfNeighbor.forEach(function(node2) { + queue.push(node2); + visited.add(node2); + }); + } + } + } + this.isConnected = false; + if (visited.size >= this.nodes.length) { + var noOfVisitedInThisGraph = 0; + visited.forEach(function(visitedNode) { + if (visitedNode.owner == self2) { + noOfVisitedInThisGraph++; + } + }); + if (noOfVisitedInThisGraph == this.nodes.length) { + this.isConnected = true; + } + } + }; + module3.exports = LGraph; + }, + /* 7 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LGraph; + var LEdge = __webpack_require__(1); + function LGraphManager(layout6) { + LGraph = __webpack_require__(6); + this.layout = layout6; + this.graphs = []; + this.edges = []; + } + __name(LGraphManager, "LGraphManager"); + LGraphManager.prototype.addRoot = function() { + var ngraph = this.layout.newGraph(); + var nnode = this.layout.newNode(null); + var root4 = this.add(ngraph, nnode); + this.setRootGraph(root4); + return this.rootGraph; + }; + LGraphManager.prototype.add = function(newGraph, parentNode, newEdge, sourceNode, targetNode) { + if (newEdge == null && sourceNode == null && targetNode == null) { + if (newGraph == null) { + throw "Graph is null!"; + } + if (parentNode == null) { + throw "Parent node is null!"; + } + if (this.graphs.indexOf(newGraph) > -1) { + throw "Graph already in this graph mgr!"; + } + this.graphs.push(newGraph); + if (newGraph.parent != null) { + throw "Already has a parent!"; + } + if (parentNode.child != null) { + throw "Already has a child!"; + } + newGraph.parent = parentNode; + parentNode.child = newGraph; + return newGraph; + } else { + targetNode = newEdge; + sourceNode = parentNode; + newEdge = newGraph; + var sourceGraph = sourceNode.getOwner(); + var targetGraph = targetNode.getOwner(); + if (!(sourceGraph != null && sourceGraph.getGraphManager() == this)) { + throw "Source not in this graph mgr!"; + } + if (!(targetGraph != null && targetGraph.getGraphManager() == this)) { + throw "Target not in this graph mgr!"; + } + if (sourceGraph == targetGraph) { + newEdge.isInterGraph = false; + return sourceGraph.add(newEdge, sourceNode, targetNode); + } else { + newEdge.isInterGraph = true; + newEdge.source = sourceNode; + newEdge.target = targetNode; + if (this.edges.indexOf(newEdge) > -1) { + throw "Edge already in inter-graph edge list!"; + } + this.edges.push(newEdge); + if (!(newEdge.source != null && newEdge.target != null)) { + throw "Edge source and/or target is null!"; + } + if (!(newEdge.source.edges.indexOf(newEdge) == -1 && newEdge.target.edges.indexOf(newEdge) == -1)) { + throw "Edge already in source and/or target incidency list!"; + } + newEdge.source.edges.push(newEdge); + newEdge.target.edges.push(newEdge); + return newEdge; + } + } + }; + LGraphManager.prototype.remove = function(lObj) { + if (lObj instanceof LGraph) { + var graph = lObj; + if (graph.getGraphManager() != this) { + throw "Graph not in this graph mgr"; + } + if (!(graph == this.rootGraph || graph.parent != null && graph.parent.graphManager == this)) { + throw "Invalid parent node!"; + } + var edgesToBeRemoved = []; + edgesToBeRemoved = edgesToBeRemoved.concat(graph.getEdges()); + var edge; + var s2 = edgesToBeRemoved.length; + for (var i2 = 0; i2 < s2; i2++) { + edge = edgesToBeRemoved[i2]; + graph.remove(edge); + } + var nodesToBeRemoved = []; + nodesToBeRemoved = nodesToBeRemoved.concat(graph.getNodes()); + var node2; + s2 = nodesToBeRemoved.length; + for (var i2 = 0; i2 < s2; i2++) { + node2 = nodesToBeRemoved[i2]; + graph.remove(node2); + } + if (graph == this.rootGraph) { + this.setRootGraph(null); + } + var index = this.graphs.indexOf(graph); + this.graphs.splice(index, 1); + graph.parent = null; + } else if (lObj instanceof LEdge) { + edge = lObj; + if (edge == null) { + throw "Edge is null!"; + } + if (!edge.isInterGraph) { + throw "Not an inter-graph edge!"; + } + if (!(edge.source != null && edge.target != null)) { + throw "Source and/or target is null!"; + } + if (!(edge.source.edges.indexOf(edge) != -1 && edge.target.edges.indexOf(edge) != -1)) { + throw "Source and/or target doesn't know this edge!"; + } + var index = edge.source.edges.indexOf(edge); + edge.source.edges.splice(index, 1); + index = edge.target.edges.indexOf(edge); + edge.target.edges.splice(index, 1); + if (!(edge.source.owner != null && edge.source.owner.getGraphManager() != null)) { + throw "Edge owner graph or owner graph manager is null!"; + } + if (edge.source.owner.getGraphManager().edges.indexOf(edge) == -1) { + throw "Not in owner graph manager's edge list!"; + } + var index = edge.source.owner.getGraphManager().edges.indexOf(edge); + edge.source.owner.getGraphManager().edges.splice(index, 1); + } + }; + LGraphManager.prototype.updateBounds = function() { + this.rootGraph.updateBounds(true); + }; + LGraphManager.prototype.getGraphs = function() { + return this.graphs; + }; + LGraphManager.prototype.getAllNodes = function() { + if (this.allNodes == null) { + var nodeList = []; + var graphs = this.getGraphs(); + var s2 = graphs.length; + for (var i2 = 0; i2 < s2; i2++) { + nodeList = nodeList.concat(graphs[i2].getNodes()); + } + this.allNodes = nodeList; + } + return this.allNodes; + }; + LGraphManager.prototype.resetAllNodes = function() { + this.allNodes = null; + }; + LGraphManager.prototype.resetAllEdges = function() { + this.allEdges = null; + }; + LGraphManager.prototype.resetAllNodesToApplyGravitation = function() { + this.allNodesToApplyGravitation = null; + }; + LGraphManager.prototype.getAllEdges = function() { + if (this.allEdges == null) { + var edgeList2 = []; + var graphs = this.getGraphs(); + var s2 = graphs.length; + for (var i2 = 0; i2 < graphs.length; i2++) { + edgeList2 = edgeList2.concat(graphs[i2].getEdges()); + } + edgeList2 = edgeList2.concat(this.edges); + this.allEdges = edgeList2; + } + return this.allEdges; + }; + LGraphManager.prototype.getAllNodesToApplyGravitation = function() { + return this.allNodesToApplyGravitation; + }; + LGraphManager.prototype.setAllNodesToApplyGravitation = function(nodeList) { + if (this.allNodesToApplyGravitation != null) { + throw "assert failed"; + } + this.allNodesToApplyGravitation = nodeList; + }; + LGraphManager.prototype.getRoot = function() { + return this.rootGraph; + }; + LGraphManager.prototype.setRootGraph = function(graph) { + if (graph.getGraphManager() != this) { + throw "Root not in this graph mgr!"; + } + this.rootGraph = graph; + if (graph.parent == null) { + graph.parent = this.layout.newNode("Root node"); + } + }; + LGraphManager.prototype.getLayout = function() { + return this.layout; + }; + LGraphManager.prototype.isOneAncestorOfOther = function(firstNode, secondNode) { + if (!(firstNode != null && secondNode != null)) { + throw "assert failed"; + } + if (firstNode == secondNode) { + return true; + } + var ownerGraph = firstNode.getOwner(); + var parentNode; + do { + parentNode = ownerGraph.getParent(); + if (parentNode == null) { + break; + } + if (parentNode == secondNode) { + return true; + } + ownerGraph = parentNode.getOwner(); + if (ownerGraph == null) { + break; + } + } while (true); + ownerGraph = secondNode.getOwner(); + do { + parentNode = ownerGraph.getParent(); + if (parentNode == null) { + break; + } + if (parentNode == firstNode) { + return true; + } + ownerGraph = parentNode.getOwner(); + if (ownerGraph == null) { + break; + } + } while (true); + return false; + }; + LGraphManager.prototype.calcLowestCommonAncestors = function() { + var edge; + var sourceNode; + var targetNode; + var sourceAncestorGraph; + var targetAncestorGraph; + var edges5 = this.getAllEdges(); + var s2 = edges5.length; + for (var i2 = 0; i2 < s2; i2++) { + edge = edges5[i2]; + sourceNode = edge.source; + targetNode = edge.target; + edge.lca = null; + edge.sourceInLca = sourceNode; + edge.targetInLca = targetNode; + if (sourceNode == targetNode) { + edge.lca = sourceNode.getOwner(); + continue; + } + sourceAncestorGraph = sourceNode.getOwner(); + while (edge.lca == null) { + edge.targetInLca = targetNode; + targetAncestorGraph = targetNode.getOwner(); + while (edge.lca == null) { + if (targetAncestorGraph == sourceAncestorGraph) { + edge.lca = targetAncestorGraph; + break; + } + if (targetAncestorGraph == this.rootGraph) { + break; + } + if (edge.lca != null) { + throw "assert failed"; + } + edge.targetInLca = targetAncestorGraph.getParent(); + targetAncestorGraph = edge.targetInLca.getOwner(); + } + if (sourceAncestorGraph == this.rootGraph) { + break; + } + if (edge.lca == null) { + edge.sourceInLca = sourceAncestorGraph.getParent(); + sourceAncestorGraph = edge.sourceInLca.getOwner(); + } + } + if (edge.lca == null) { + throw "assert failed"; + } + } + }; + LGraphManager.prototype.calcLowestCommonAncestor = function(firstNode, secondNode) { + if (firstNode == secondNode) { + return firstNode.getOwner(); + } + var firstOwnerGraph = firstNode.getOwner(); + do { + if (firstOwnerGraph == null) { + break; + } + var secondOwnerGraph = secondNode.getOwner(); + do { + if (secondOwnerGraph == null) { + break; + } + if (secondOwnerGraph == firstOwnerGraph) { + return secondOwnerGraph; + } + secondOwnerGraph = secondOwnerGraph.getParent().getOwner(); + } while (true); + firstOwnerGraph = firstOwnerGraph.getParent().getOwner(); + } while (true); + return firstOwnerGraph; + }; + LGraphManager.prototype.calcInclusionTreeDepths = function(graph, depth) { + if (graph == null && depth == null) { + graph = this.rootGraph; + depth = 1; + } + var node2; + var nodes6 = graph.getNodes(); + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + node2 = nodes6[i2]; + node2.inclusionTreeDepth = depth; + if (node2.child != null) { + this.calcInclusionTreeDepths(node2.child, depth + 1); + } + } + }; + LGraphManager.prototype.includesInvalidEdge = function() { + var edge; + var edgesToRemove = []; + var s2 = this.edges.length; + for (var i2 = 0; i2 < s2; i2++) { + edge = this.edges[i2]; + if (this.isOneAncestorOfOther(edge.source, edge.target)) { + edgesToRemove.push(edge); + } + } + for (var i2 = 0; i2 < edgesToRemove.length; i2++) { + this.remove(edgesToRemove[i2]); + } + return false; + }; + module3.exports = LGraphManager; + }, + /* 8 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var Point3 = __webpack_require__(12); + function IGeometry() { + } + __name(IGeometry, "IGeometry"); + IGeometry.calcSeparationAmount = function(rectA, rectB, overlapAmount, separationBuffer) { + if (!rectA.intersects(rectB)) { + throw "assert failed"; + } + var directions = new Array(2); + this.decideDirectionsForOverlappingNodes(rectA, rectB, directions); + overlapAmount[0] = Math.min(rectA.getRight(), rectB.getRight()) - Math.max(rectA.x, rectB.x); + overlapAmount[1] = Math.min(rectA.getBottom(), rectB.getBottom()) - Math.max(rectA.y, rectB.y); + if (rectA.getX() <= rectB.getX() && rectA.getRight() >= rectB.getRight()) { + overlapAmount[0] += Math.min(rectB.getX() - rectA.getX(), rectA.getRight() - rectB.getRight()); + } else if (rectB.getX() <= rectA.getX() && rectB.getRight() >= rectA.getRight()) { + overlapAmount[0] += Math.min(rectA.getX() - rectB.getX(), rectB.getRight() - rectA.getRight()); + } + if (rectA.getY() <= rectB.getY() && rectA.getBottom() >= rectB.getBottom()) { + overlapAmount[1] += Math.min(rectB.getY() - rectA.getY(), rectA.getBottom() - rectB.getBottom()); + } else if (rectB.getY() <= rectA.getY() && rectB.getBottom() >= rectA.getBottom()) { + overlapAmount[1] += Math.min(rectA.getY() - rectB.getY(), rectB.getBottom() - rectA.getBottom()); + } + var slope = Math.abs((rectB.getCenterY() - rectA.getCenterY()) / (rectB.getCenterX() - rectA.getCenterX())); + if (rectB.getCenterY() === rectA.getCenterY() && rectB.getCenterX() === rectA.getCenterX()) { + slope = 1; + } + var moveByY = slope * overlapAmount[0]; + var moveByX = overlapAmount[1] / slope; + if (overlapAmount[0] < moveByX) { + moveByX = overlapAmount[0]; + } else { + moveByY = overlapAmount[1]; + } + overlapAmount[0] = -1 * directions[0] * (moveByX / 2 + separationBuffer); + overlapAmount[1] = -1 * directions[1] * (moveByY / 2 + separationBuffer); + }; + IGeometry.decideDirectionsForOverlappingNodes = function(rectA, rectB, directions) { + if (rectA.getCenterX() < rectB.getCenterX()) { + directions[0] = -1; + } else { + directions[0] = 1; + } + if (rectA.getCenterY() < rectB.getCenterY()) { + directions[1] = -1; + } else { + directions[1] = 1; + } + }; + IGeometry.getIntersection2 = function(rectA, rectB, result) { + var p1x = rectA.getCenterX(); + var p1y = rectA.getCenterY(); + var p2x = rectB.getCenterX(); + var p2y = rectB.getCenterY(); + if (rectA.intersects(rectB)) { + result[0] = p1x; + result[1] = p1y; + result[2] = p2x; + result[3] = p2y; + return true; + } + var topLeftAx = rectA.getX(); + var topLeftAy = rectA.getY(); + var topRightAx = rectA.getRight(); + var bottomLeftAx = rectA.getX(); + var bottomLeftAy = rectA.getBottom(); + var bottomRightAx = rectA.getRight(); + var halfWidthA = rectA.getWidthHalf(); + var halfHeightA = rectA.getHeightHalf(); + var topLeftBx = rectB.getX(); + var topLeftBy = rectB.getY(); + var topRightBx = rectB.getRight(); + var bottomLeftBx = rectB.getX(); + var bottomLeftBy = rectB.getBottom(); + var bottomRightBx = rectB.getRight(); + var halfWidthB = rectB.getWidthHalf(); + var halfHeightB = rectB.getHeightHalf(); + var clipPointAFound = false; + var clipPointBFound = false; + if (p1x === p2x) { + if (p1y > p2y) { + result[0] = p1x; + result[1] = topLeftAy; + result[2] = p2x; + result[3] = bottomLeftBy; + return false; + } else if (p1y < p2y) { + result[0] = p1x; + result[1] = bottomLeftAy; + result[2] = p2x; + result[3] = topLeftBy; + return false; + } else { + } + } else if (p1y === p2y) { + if (p1x > p2x) { + result[0] = topLeftAx; + result[1] = p1y; + result[2] = topRightBx; + result[3] = p2y; + return false; + } else if (p1x < p2x) { + result[0] = topRightAx; + result[1] = p1y; + result[2] = topLeftBx; + result[3] = p2y; + return false; + } else { + } + } else { + var slopeA = rectA.height / rectA.width; + var slopeB = rectB.height / rectB.width; + var slopePrime = (p2y - p1y) / (p2x - p1x); + var cardinalDirectionA = void 0; + var cardinalDirectionB = void 0; + var tempPointAx = void 0; + var tempPointAy = void 0; + var tempPointBx = void 0; + var tempPointBy = void 0; + if (-slopeA === slopePrime) { + if (p1x > p2x) { + result[0] = bottomLeftAx; + result[1] = bottomLeftAy; + clipPointAFound = true; + } else { + result[0] = topRightAx; + result[1] = topLeftAy; + clipPointAFound = true; + } + } else if (slopeA === slopePrime) { + if (p1x > p2x) { + result[0] = topLeftAx; + result[1] = topLeftAy; + clipPointAFound = true; + } else { + result[0] = bottomRightAx; + result[1] = bottomLeftAy; + clipPointAFound = true; + } + } + if (-slopeB === slopePrime) { + if (p2x > p1x) { + result[2] = bottomLeftBx; + result[3] = bottomLeftBy; + clipPointBFound = true; + } else { + result[2] = topRightBx; + result[3] = topLeftBy; + clipPointBFound = true; + } + } else if (slopeB === slopePrime) { + if (p2x > p1x) { + result[2] = topLeftBx; + result[3] = topLeftBy; + clipPointBFound = true; + } else { + result[2] = bottomRightBx; + result[3] = bottomLeftBy; + clipPointBFound = true; + } + } + if (clipPointAFound && clipPointBFound) { + return false; + } + if (p1x > p2x) { + if (p1y > p2y) { + cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 4); + cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 2); + } else { + cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 3); + cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 1); + } + } else { + if (p1y > p2y) { + cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 1); + cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 3); + } else { + cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 2); + cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 4); + } + } + if (!clipPointAFound) { + switch (cardinalDirectionA) { + case 1: + tempPointAy = topLeftAy; + tempPointAx = p1x + -halfHeightA / slopePrime; + result[0] = tempPointAx; + result[1] = tempPointAy; + break; + case 2: + tempPointAx = bottomRightAx; + tempPointAy = p1y + halfWidthA * slopePrime; + result[0] = tempPointAx; + result[1] = tempPointAy; + break; + case 3: + tempPointAy = bottomLeftAy; + tempPointAx = p1x + halfHeightA / slopePrime; + result[0] = tempPointAx; + result[1] = tempPointAy; + break; + case 4: + tempPointAx = bottomLeftAx; + tempPointAy = p1y + -halfWidthA * slopePrime; + result[0] = tempPointAx; + result[1] = tempPointAy; + break; + } + } + if (!clipPointBFound) { + switch (cardinalDirectionB) { + case 1: + tempPointBy = topLeftBy; + tempPointBx = p2x + -halfHeightB / slopePrime; + result[2] = tempPointBx; + result[3] = tempPointBy; + break; + case 2: + tempPointBx = bottomRightBx; + tempPointBy = p2y + halfWidthB * slopePrime; + result[2] = tempPointBx; + result[3] = tempPointBy; + break; + case 3: + tempPointBy = bottomLeftBy; + tempPointBx = p2x + halfHeightB / slopePrime; + result[2] = tempPointBx; + result[3] = tempPointBy; + break; + case 4: + tempPointBx = bottomLeftBx; + tempPointBy = p2y + -halfWidthB * slopePrime; + result[2] = tempPointBx; + result[3] = tempPointBy; + break; + } + } + } + return false; + }; + IGeometry.getCardinalDirection = function(slope, slopePrime, line2) { + if (slope > slopePrime) { + return line2; + } else { + return 1 + line2 % 4; + } + }; + IGeometry.getIntersection = function(s1, s2, f1, f22) { + if (f22 == null) { + return this.getIntersection2(s1, s2, f1); + } + var x1 = s1.x; + var y1 = s1.y; + var x22 = s2.x; + var y22 = s2.y; + var x32 = f1.x; + var y32 = f1.y; + var x42 = f22.x; + var y42 = f22.y; + var x5 = void 0, y5 = void 0; + var a1 = void 0, a2 = void 0, b1 = void 0, b2 = void 0, c1 = void 0, c22 = void 0; + var denom = void 0; + a1 = y22 - y1; + b1 = x1 - x22; + c1 = x22 * y1 - x1 * y22; + a2 = y42 - y32; + b2 = x32 - x42; + c22 = x42 * y32 - x32 * y42; + denom = a1 * b2 - a2 * b1; + if (denom === 0) { + return null; + } + x5 = (b1 * c22 - b2 * c1) / denom; + y5 = (a2 * c1 - a1 * c22) / denom; + return new Point3(x5, y5); + }; + IGeometry.angleOfVector = function(Cx, Cy, Nx, Ny) { + var C_angle = void 0; + if (Cx !== Nx) { + C_angle = Math.atan((Ny - Cy) / (Nx - Cx)); + if (Nx < Cx) { + C_angle += Math.PI; + } else if (Ny < Cy) { + C_angle += this.TWO_PI; + } + } else if (Ny < Cy) { + C_angle = this.ONE_AND_HALF_PI; + } else { + C_angle = this.HALF_PI; + } + return C_angle; + }; + IGeometry.doIntersect = function(p1, p22, p3, p4) { + var a2 = p1.x; + var b2 = p1.y; + var c3 = p22.x; + var d2 = p22.y; + var p5 = p3.x; + var q2 = p3.y; + var r2 = p4.x; + var s2 = p4.y; + var det = (c3 - a2) * (s2 - q2) - (r2 - p5) * (d2 - b2); + if (det === 0) { + return false; + } else { + var lambda = ((s2 - q2) * (r2 - a2) + (p5 - r2) * (s2 - b2)) / det; + var gamma2 = ((b2 - d2) * (r2 - a2) + (c3 - a2) * (s2 - b2)) / det; + return 0 < lambda && lambda < 1 && 0 < gamma2 && gamma2 < 1; + } + }; + IGeometry.findCircleLineIntersections = function(Ex, Ey, Lx, Ly, Cx, Cy, r2) { + var a2 = (Lx - Ex) * (Lx - Ex) + (Ly - Ey) * (Ly - Ey); + var b2 = 2 * ((Ex - Cx) * (Lx - Ex) + (Ey - Cy) * (Ly - Ey)); + var c3 = (Ex - Cx) * (Ex - Cx) + (Ey - Cy) * (Ey - Cy) - r2 * r2; + var disc = b2 * b2 - 4 * a2 * c3; + if (disc >= 0) { + var t13 = (-b2 + Math.sqrt(b2 * b2 - 4 * a2 * c3)) / (2 * a2); + var t22 = (-b2 - Math.sqrt(b2 * b2 - 4 * a2 * c3)) / (2 * a2); + var intersections = null; + if (t13 >= 0 && t13 <= 1) { + return [t13]; + } + if (t22 >= 0 && t22 <= 1) { + return [t22]; + } + return intersections; + } else return null; + }; + IGeometry.HALF_PI = 0.5 * Math.PI; + IGeometry.ONE_AND_HALF_PI = 1.5 * Math.PI; + IGeometry.TWO_PI = 2 * Math.PI; + IGeometry.THREE_PI = 3 * Math.PI; + module3.exports = IGeometry; + }, + /* 9 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function IMath() { + } + __name(IMath, "IMath"); + IMath.sign = function(value2) { + if (value2 > 0) { + return 1; + } else if (value2 < 0) { + return -1; + } else { + return 0; + } + }; + IMath.floor = function(value2) { + return value2 < 0 ? Math.ceil(value2) : Math.floor(value2); + }; + IMath.ceil = function(value2) { + return value2 < 0 ? Math.floor(value2) : Math.ceil(value2); + }; + module3.exports = IMath; + }, + /* 10 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function Integer() { + } + __name(Integer, "Integer"); + Integer.MAX_VALUE = 2147483647; + Integer.MIN_VALUE = -2147483648; + module3.exports = Integer; + }, + /* 11 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var _createClass2 = /* @__PURE__ */ function() { + function defineProperties(target, props) { + for (var i2 = 0; i2 < props.length; i2++) { + var descriptor = props[i2]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + __name(defineProperties, "defineProperties"); + return function(Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + function _classCallCheck2(instance2, Constructor) { + if (!(instance2 instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + __name(_classCallCheck2, "_classCallCheck"); + var nodeFrom = /* @__PURE__ */ __name(function nodeFrom2(value2) { + return { value: value2, next: null, prev: null }; + }, "nodeFrom"); + var add3 = /* @__PURE__ */ __name(function add4(prev2, node2, next3, list2) { + if (prev2 !== null) { + prev2.next = node2; + } else { + list2.head = node2; + } + if (next3 !== null) { + next3.prev = node2; + } else { + list2.tail = node2; + } + node2.prev = prev2; + node2.next = next3; + list2.length++; + return node2; + }, "add"); + var _remove = /* @__PURE__ */ __name(function _remove2(node2, list2) { + var prev2 = node2.prev, next3 = node2.next; + if (prev2 !== null) { + prev2.next = next3; + } else { + list2.head = next3; + } + if (next3 !== null) { + next3.prev = prev2; + } else { + list2.tail = prev2; + } + node2.prev = node2.next = null; + list2.length--; + return node2; + }, "_remove"); + var LinkedList = function() { + function LinkedList2(vals) { + var _this = this; + _classCallCheck2(this, LinkedList2); + this.length = 0; + this.head = null; + this.tail = null; + if (vals != null) { + vals.forEach(function(v3) { + return _this.push(v3); + }); + } + } + __name(LinkedList2, "LinkedList"); + _createClass2(LinkedList2, [{ + key: "size", + value: /* @__PURE__ */ __name(function size5() { + return this.length; + }, "size") + }, { + key: "insertBefore", + value: /* @__PURE__ */ __name(function insertBefore(val, otherNode) { + return add3(otherNode.prev, nodeFrom(val), otherNode, this); + }, "insertBefore") + }, { + key: "insertAfter", + value: /* @__PURE__ */ __name(function insertAfter(val, otherNode) { + return add3(otherNode, nodeFrom(val), otherNode.next, this); + }, "insertAfter") + }, { + key: "insertNodeBefore", + value: /* @__PURE__ */ __name(function insertNodeBefore(newNode, otherNode) { + return add3(otherNode.prev, newNode, otherNode, this); + }, "insertNodeBefore") + }, { + key: "insertNodeAfter", + value: /* @__PURE__ */ __name(function insertNodeAfter(newNode, otherNode) { + return add3(otherNode, newNode, otherNode.next, this); + }, "insertNodeAfter") + }, { + key: "push", + value: /* @__PURE__ */ __name(function push3(val) { + return add3(this.tail, nodeFrom(val), null, this); + }, "push") + }, { + key: "unshift", + value: /* @__PURE__ */ __name(function unshift(val) { + return add3(null, nodeFrom(val), this.head, this); + }, "unshift") + }, { + key: "remove", + value: /* @__PURE__ */ __name(function remove3(node2) { + return _remove(node2, this); + }, "remove") + }, { + key: "pop", + value: /* @__PURE__ */ __name(function pop() { + return _remove(this.tail, this).value; + }, "pop") + }, { + key: "popNode", + value: /* @__PURE__ */ __name(function popNode() { + return _remove(this.tail, this); + }, "popNode") + }, { + key: "shift", + value: /* @__PURE__ */ __name(function shift2() { + return _remove(this.head, this).value; + }, "shift") + }, { + key: "shiftNode", + value: /* @__PURE__ */ __name(function shiftNode() { + return _remove(this.head, this); + }, "shiftNode") + }, { + key: "get_object_at", + value: /* @__PURE__ */ __name(function get_object_at(index) { + if (index <= this.length()) { + var i2 = 1; + var current = this.head; + while (i2 < index) { + current = current.next; + i2++; + } + return current.value; + } + }, "get_object_at") + }, { + key: "set_object_at", + value: /* @__PURE__ */ __name(function set_object_at(index, value2) { + if (index <= this.length()) { + var i2 = 1; + var current = this.head; + while (i2 < index) { + current = current.next; + i2++; + } + current.value = value2; + } + }, "set_object_at") + }]); + return LinkedList2; + }(); + module3.exports = LinkedList; + }, + /* 12 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function Point3(x5, y5, p3) { + this.x = null; + this.y = null; + if (x5 == null && y5 == null && p3 == null) { + this.x = 0; + this.y = 0; + } else if (typeof x5 == "number" && typeof y5 == "number" && p3 == null) { + this.x = x5; + this.y = y5; + } else if (x5.constructor.name == "Point" && y5 == null && p3 == null) { + p3 = x5; + this.x = p3.x; + this.y = p3.y; + } + } + __name(Point3, "Point"); + Point3.prototype.getX = function() { + return this.x; + }; + Point3.prototype.getY = function() { + return this.y; + }; + Point3.prototype.getLocation = function() { + return new Point3(this.x, this.y); + }; + Point3.prototype.setLocation = function(x5, y5, p3) { + if (x5.constructor.name == "Point" && y5 == null && p3 == null) { + p3 = x5; + this.setLocation(p3.x, p3.y); + } else if (typeof x5 == "number" && typeof y5 == "number" && p3 == null) { + if (parseInt(x5) == x5 && parseInt(y5) == y5) { + this.move(x5, y5); + } else { + this.x = Math.floor(x5 + 0.5); + this.y = Math.floor(y5 + 0.5); + } + } + }; + Point3.prototype.move = function(x5, y5) { + this.x = x5; + this.y = y5; + }; + Point3.prototype.translate = function(dx, dy) { + this.x += dx; + this.y += dy; + }; + Point3.prototype.equals = function(obj) { + if (obj.constructor.name == "Point") { + var pt = obj; + return this.x == pt.x && this.y == pt.y; + } + return this == obj; + }; + Point3.prototype.toString = function() { + return new Point3().constructor.name + "[x=" + this.x + ",y=" + this.y + "]"; + }; + module3.exports = Point3; + }, + /* 13 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function RectangleD(x5, y5, width3, height2) { + this.x = 0; + this.y = 0; + this.width = 0; + this.height = 0; + if (x5 != null && y5 != null && width3 != null && height2 != null) { + this.x = x5; + this.y = y5; + this.width = width3; + this.height = height2; + } + } + __name(RectangleD, "RectangleD"); + RectangleD.prototype.getX = function() { + return this.x; + }; + RectangleD.prototype.setX = function(x5) { + this.x = x5; + }; + RectangleD.prototype.getY = function() { + return this.y; + }; + RectangleD.prototype.setY = function(y5) { + this.y = y5; + }; + RectangleD.prototype.getWidth = function() { + return this.width; + }; + RectangleD.prototype.setWidth = function(width3) { + this.width = width3; + }; + RectangleD.prototype.getHeight = function() { + return this.height; + }; + RectangleD.prototype.setHeight = function(height2) { + this.height = height2; + }; + RectangleD.prototype.getRight = function() { + return this.x + this.width; + }; + RectangleD.prototype.getBottom = function() { + return this.y + this.height; + }; + RectangleD.prototype.intersects = function(a2) { + if (this.getRight() < a2.x) { + return false; + } + if (this.getBottom() < a2.y) { + return false; + } + if (a2.getRight() < this.x) { + return false; + } + if (a2.getBottom() < this.y) { + return false; + } + return true; + }; + RectangleD.prototype.getCenterX = function() { + return this.x + this.width / 2; + }; + RectangleD.prototype.getMinX = function() { + return this.getX(); + }; + RectangleD.prototype.getMaxX = function() { + return this.getX() + this.width; + }; + RectangleD.prototype.getCenterY = function() { + return this.y + this.height / 2; + }; + RectangleD.prototype.getMinY = function() { + return this.getY(); + }; + RectangleD.prototype.getMaxY = function() { + return this.getY() + this.height; + }; + RectangleD.prototype.getWidthHalf = function() { + return this.width / 2; + }; + RectangleD.prototype.getHeightHalf = function() { + return this.height / 2; + }; + module3.exports = RectangleD; + }, + /* 14 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { + return typeof obj; + } : function(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + function UniqueIDGeneretor() { + } + __name(UniqueIDGeneretor, "UniqueIDGeneretor"); + UniqueIDGeneretor.lastID = 0; + UniqueIDGeneretor.createID = function(obj) { + if (UniqueIDGeneretor.isPrimitive(obj)) { + return obj; + } + if (obj.uniqueID != null) { + return obj.uniqueID; + } + obj.uniqueID = UniqueIDGeneretor.getString(); + UniqueIDGeneretor.lastID++; + return obj.uniqueID; + }; + UniqueIDGeneretor.getString = function(id27) { + if (id27 == null) id27 = UniqueIDGeneretor.lastID; + return "Object#" + id27; + }; + UniqueIDGeneretor.isPrimitive = function(arg) { + var type3 = typeof arg === "undefined" ? "undefined" : _typeof2(arg); + return arg == null || type3 != "object" && type3 != "function"; + }; + module3.exports = UniqueIDGeneretor; + }, + /* 15 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function _toConsumableArray(arr) { + if (Array.isArray(arr)) { + for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { + arr2[i2] = arr[i2]; + } + return arr2; + } else { + return Array.from(arr); + } + } + __name(_toConsumableArray, "_toConsumableArray"); + var LayoutConstants = __webpack_require__(0); + var LGraphManager = __webpack_require__(7); + var LNode = __webpack_require__(3); + var LEdge = __webpack_require__(1); + var LGraph = __webpack_require__(6); + var PointD = __webpack_require__(5); + var Transform2 = __webpack_require__(17); + var Emitter3 = __webpack_require__(29); + function Layout2(isRemoteUse) { + Emitter3.call(this); + this.layoutQuality = LayoutConstants.QUALITY; + this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED; + this.incremental = LayoutConstants.DEFAULT_INCREMENTAL; + this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT; + this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT; + this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD; + this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES; + this.edgeToDummyNodes = /* @__PURE__ */ new Map(); + this.graphManager = new LGraphManager(this); + this.isLayoutFinished = false; + this.isSubLayout = false; + this.isRemoteUse = false; + if (isRemoteUse != null) { + this.isRemoteUse = isRemoteUse; + } + } + __name(Layout2, "Layout"); + Layout2.RANDOM_SEED = 1; + Layout2.prototype = Object.create(Emitter3.prototype); + Layout2.prototype.getGraphManager = function() { + return this.graphManager; + }; + Layout2.prototype.getAllNodes = function() { + return this.graphManager.getAllNodes(); + }; + Layout2.prototype.getAllEdges = function() { + return this.graphManager.getAllEdges(); + }; + Layout2.prototype.getAllNodesToApplyGravitation = function() { + return this.graphManager.getAllNodesToApplyGravitation(); + }; + Layout2.prototype.newGraphManager = function() { + var gm = new LGraphManager(this); + this.graphManager = gm; + return gm; + }; + Layout2.prototype.newGraph = function(vGraph) { + return new LGraph(null, this.graphManager, vGraph); + }; + Layout2.prototype.newNode = function(vNode) { + return new LNode(this.graphManager, vNode); + }; + Layout2.prototype.newEdge = function(vEdge) { + return new LEdge(null, null, vEdge); + }; + Layout2.prototype.checkLayoutSuccess = function() { + return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge(); + }; + Layout2.prototype.runLayout = function() { + this.isLayoutFinished = false; + if (this.tilingPreLayout) { + this.tilingPreLayout(); + } + this.initParameters(); + var isLayoutSuccessfull; + if (this.checkLayoutSuccess()) { + isLayoutSuccessfull = false; + } else { + isLayoutSuccessfull = this.layout(); + } + if (LayoutConstants.ANIMATE === "during") { + return false; + } + if (isLayoutSuccessfull) { + if (!this.isSubLayout) { + this.doPostLayout(); + } + } + if (this.tilingPostLayout) { + this.tilingPostLayout(); + } + this.isLayoutFinished = true; + return isLayoutSuccessfull; + }; + Layout2.prototype.doPostLayout = function() { + if (!this.incremental) { + this.transform(); + } + this.update(); + }; + Layout2.prototype.update2 = function() { + if (this.createBendsAsNeeded) { + this.createBendpointsFromDummyNodes(); + this.graphManager.resetAllEdges(); + } + if (!this.isRemoteUse) { + var edge; + var allEdges = this.graphManager.getAllEdges(); + for (var i2 = 0; i2 < allEdges.length; i2++) { + edge = allEdges[i2]; + } + var node2; + var nodes6 = this.graphManager.getRoot().getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + node2 = nodes6[i2]; + } + this.update(this.graphManager.getRoot()); + } + }; + Layout2.prototype.update = function(obj) { + if (obj == null) { + this.update2(); + } else if (obj instanceof LNode) { + var node2 = obj; + if (node2.getChild() != null) { + var nodes6 = node2.getChild().getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + update(nodes6[i2]); + } + } + if (node2.vGraphObject != null) { + var vNode = node2.vGraphObject; + vNode.update(node2); + } + } else if (obj instanceof LEdge) { + var edge = obj; + if (edge.vGraphObject != null) { + var vEdge = edge.vGraphObject; + vEdge.update(edge); + } + } else if (obj instanceof LGraph) { + var graph = obj; + if (graph.vGraphObject != null) { + var vGraph = graph.vGraphObject; + vGraph.update(graph); + } + } + }; + Layout2.prototype.initParameters = function() { + if (!this.isSubLayout) { + this.layoutQuality = LayoutConstants.QUALITY; + this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT; + this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD; + this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT; + this.incremental = LayoutConstants.DEFAULT_INCREMENTAL; + this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED; + this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES; + } + if (this.animationDuringLayout) { + this.animationOnLayout = false; + } + }; + Layout2.prototype.transform = function(newLeftTop) { + if (newLeftTop == void 0) { + this.transform(new PointD(0, 0)); + } else { + var trans = new Transform2(); + var leftTop = this.graphManager.getRoot().updateLeftTop(); + if (leftTop != null) { + trans.setWorldOrgX(newLeftTop.x); + trans.setWorldOrgY(newLeftTop.y); + trans.setDeviceOrgX(leftTop.x); + trans.setDeviceOrgY(leftTop.y); + var nodes6 = this.getAllNodes(); + var node2; + for (var i2 = 0; i2 < nodes6.length; i2++) { + node2 = nodes6[i2]; + node2.transform(trans); + } + } + } + }; + Layout2.prototype.positionNodesRandomly = function(graph) { + if (graph == void 0) { + this.positionNodesRandomly(this.getGraphManager().getRoot()); + this.getGraphManager().getRoot().updateBounds(true); + } else { + var lNode; + var childGraph; + var nodes6 = graph.getNodes(); + for (var i2 = 0; i2 < nodes6.length; i2++) { + lNode = nodes6[i2]; + childGraph = lNode.getChild(); + if (childGraph == null) { + lNode.scatter(); + } else if (childGraph.getNodes().length == 0) { + lNode.scatter(); + } else { + this.positionNodesRandomly(childGraph); + lNode.updateBounds(); + } + } + } + }; + Layout2.prototype.getFlatForest = function() { + var flatForest = []; + var isForest = true; + var allNodes = this.graphManager.getRoot().getNodes(); + var isFlat = true; + for (var i2 = 0; i2 < allNodes.length; i2++) { + if (allNodes[i2].getChild() != null) { + isFlat = false; + } + } + if (!isFlat) { + return flatForest; + } + var visited = /* @__PURE__ */ new Set(); + var toBeVisited = []; + var parents4 = /* @__PURE__ */ new Map(); + var unProcessedNodes = []; + unProcessedNodes = unProcessedNodes.concat(allNodes); + while (unProcessedNodes.length > 0 && isForest) { + toBeVisited.push(unProcessedNodes[0]); + while (toBeVisited.length > 0 && isForest) { + var currentNode = toBeVisited[0]; + toBeVisited.splice(0, 1); + visited.add(currentNode); + var neighborEdges = currentNode.getEdges(); + for (var i2 = 0; i2 < neighborEdges.length; i2++) { + var currentNeighbor = neighborEdges[i2].getOtherEnd(currentNode); + if (parents4.get(currentNode) != currentNeighbor) { + if (!visited.has(currentNeighbor)) { + toBeVisited.push(currentNeighbor); + parents4.set(currentNeighbor, currentNode); + } else { + isForest = false; + break; + } + } + } + } + if (!isForest) { + flatForest = []; + } else { + var temp = [].concat(_toConsumableArray(visited)); + flatForest.push(temp); + for (var i2 = 0; i2 < temp.length; i2++) { + var value2 = temp[i2]; + var index = unProcessedNodes.indexOf(value2); + if (index > -1) { + unProcessedNodes.splice(index, 1); + } + } + visited = /* @__PURE__ */ new Set(); + parents4 = /* @__PURE__ */ new Map(); + } + } + return flatForest; + }; + Layout2.prototype.createDummyNodesForBendpoints = function(edge) { + var dummyNodes = []; + var prev2 = edge.source; + var graph = this.graphManager.calcLowestCommonAncestor(edge.source, edge.target); + for (var i2 = 0; i2 < edge.bendpoints.length; i2++) { + var dummyNode = this.newNode(null); + dummyNode.setRect(new Point(0, 0), new Dimension(1, 1)); + graph.add(dummyNode); + var dummyEdge = this.newEdge(null); + this.graphManager.add(dummyEdge, prev2, dummyNode); + dummyNodes.add(dummyNode); + prev2 = dummyNode; + } + var dummyEdge = this.newEdge(null); + this.graphManager.add(dummyEdge, prev2, edge.target); + this.edgeToDummyNodes.set(edge, dummyNodes); + if (edge.isInterGraph()) { + this.graphManager.remove(edge); + } else { + graph.remove(edge); + } + return dummyNodes; + }; + Layout2.prototype.createBendpointsFromDummyNodes = function() { + var edges5 = []; + edges5 = edges5.concat(this.graphManager.getAllEdges()); + edges5 = [].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges5); + for (var k2 = 0; k2 < edges5.length; k2++) { + var lEdge = edges5[k2]; + if (lEdge.bendpoints.length > 0) { + var path4 = this.edgeToDummyNodes.get(lEdge); + for (var i2 = 0; i2 < path4.length; i2++) { + var dummyNode = path4[i2]; + var p3 = new PointD(dummyNode.getCenterX(), dummyNode.getCenterY()); + var ebp = lEdge.bendpoints.get(i2); + ebp.x = p3.x; + ebp.y = p3.y; + dummyNode.getOwner().remove(dummyNode); + } + this.graphManager.add(lEdge, lEdge.source, lEdge.target); + } + } + }; + Layout2.transform = function(sliderValue, defaultValue, minDiv, maxMul) { + if (minDiv != void 0 && maxMul != void 0) { + var value2 = defaultValue; + if (sliderValue <= 50) { + var minValue = defaultValue / minDiv; + value2 -= (defaultValue - minValue) / 50 * (50 - sliderValue); + } else { + var maxValue = defaultValue * maxMul; + value2 += (maxValue - defaultValue) / 50 * (sliderValue - 50); + } + return value2; + } else { + var a2, b2; + if (sliderValue <= 50) { + a2 = 9 * defaultValue / 500; + b2 = defaultValue / 10; + } else { + a2 = 9 * defaultValue / 50; + b2 = -8 * defaultValue; + } + return a2 * sliderValue + b2; + } + }; + Layout2.findCenterOfTree = function(nodes6) { + var list2 = []; + list2 = list2.concat(nodes6); + var removedNodes = []; + var remainingDegrees = /* @__PURE__ */ new Map(); + var foundCenter = false; + var centerNode = null; + if (list2.length == 1 || list2.length == 2) { + foundCenter = true; + centerNode = list2[0]; + } + for (var i2 = 0; i2 < list2.length; i2++) { + var node2 = list2[i2]; + var degree = node2.getNeighborsList().size; + remainingDegrees.set(node2, node2.getNeighborsList().size); + if (degree == 1) { + removedNodes.push(node2); + } + } + var tempList = []; + tempList = tempList.concat(removedNodes); + while (!foundCenter) { + var tempList2 = []; + tempList2 = tempList2.concat(tempList); + tempList = []; + for (var i2 = 0; i2 < list2.length; i2++) { + var node2 = list2[i2]; + var index = list2.indexOf(node2); + if (index >= 0) { + list2.splice(index, 1); + } + var neighbours = node2.getNeighborsList(); + neighbours.forEach(function(neighbour) { + if (removedNodes.indexOf(neighbour) < 0) { + var otherDegree = remainingDegrees.get(neighbour); + var newDegree = otherDegree - 1; + if (newDegree == 1) { + tempList.push(neighbour); + } + remainingDegrees.set(neighbour, newDegree); + } + }); + } + removedNodes = removedNodes.concat(tempList); + if (list2.length == 1 || list2.length == 2) { + foundCenter = true; + centerNode = list2[0]; + } + } + return centerNode; + }; + Layout2.prototype.setGraphManager = function(gm) { + this.graphManager = gm; + }; + module3.exports = Layout2; + }, + /* 16 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function RandomSeed() { + } + __name(RandomSeed, "RandomSeed"); + RandomSeed.seed = 1; + RandomSeed.x = 0; + RandomSeed.nextDouble = function() { + RandomSeed.x = Math.sin(RandomSeed.seed++) * 1e4; + return RandomSeed.x - Math.floor(RandomSeed.x); + }; + module3.exports = RandomSeed; + }, + /* 17 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var PointD = __webpack_require__(5); + function Transform2(x5, y5) { + this.lworldOrgX = 0; + this.lworldOrgY = 0; + this.ldeviceOrgX = 0; + this.ldeviceOrgY = 0; + this.lworldExtX = 1; + this.lworldExtY = 1; + this.ldeviceExtX = 1; + this.ldeviceExtY = 1; + } + __name(Transform2, "Transform"); + Transform2.prototype.getWorldOrgX = function() { + return this.lworldOrgX; + }; + Transform2.prototype.setWorldOrgX = function(wox) { + this.lworldOrgX = wox; + }; + Transform2.prototype.getWorldOrgY = function() { + return this.lworldOrgY; + }; + Transform2.prototype.setWorldOrgY = function(woy) { + this.lworldOrgY = woy; + }; + Transform2.prototype.getWorldExtX = function() { + return this.lworldExtX; + }; + Transform2.prototype.setWorldExtX = function(wex) { + this.lworldExtX = wex; + }; + Transform2.prototype.getWorldExtY = function() { + return this.lworldExtY; + }; + Transform2.prototype.setWorldExtY = function(wey) { + this.lworldExtY = wey; + }; + Transform2.prototype.getDeviceOrgX = function() { + return this.ldeviceOrgX; + }; + Transform2.prototype.setDeviceOrgX = function(dox) { + this.ldeviceOrgX = dox; + }; + Transform2.prototype.getDeviceOrgY = function() { + return this.ldeviceOrgY; + }; + Transform2.prototype.setDeviceOrgY = function(doy) { + this.ldeviceOrgY = doy; + }; + Transform2.prototype.getDeviceExtX = function() { + return this.ldeviceExtX; + }; + Transform2.prototype.setDeviceExtX = function(dex) { + this.ldeviceExtX = dex; + }; + Transform2.prototype.getDeviceExtY = function() { + return this.ldeviceExtY; + }; + Transform2.prototype.setDeviceExtY = function(dey) { + this.ldeviceExtY = dey; + }; + Transform2.prototype.transformX = function(x5) { + var xDevice = 0; + var worldExtX = this.lworldExtX; + if (worldExtX != 0) { + xDevice = this.ldeviceOrgX + (x5 - this.lworldOrgX) * this.ldeviceExtX / worldExtX; + } + return xDevice; + }; + Transform2.prototype.transformY = function(y5) { + var yDevice = 0; + var worldExtY = this.lworldExtY; + if (worldExtY != 0) { + yDevice = this.ldeviceOrgY + (y5 - this.lworldOrgY) * this.ldeviceExtY / worldExtY; + } + return yDevice; + }; + Transform2.prototype.inverseTransformX = function(x5) { + var xWorld = 0; + var deviceExtX = this.ldeviceExtX; + if (deviceExtX != 0) { + xWorld = this.lworldOrgX + (x5 - this.ldeviceOrgX) * this.lworldExtX / deviceExtX; + } + return xWorld; + }; + Transform2.prototype.inverseTransformY = function(y5) { + var yWorld = 0; + var deviceExtY = this.ldeviceExtY; + if (deviceExtY != 0) { + yWorld = this.lworldOrgY + (y5 - this.ldeviceOrgY) * this.lworldExtY / deviceExtY; + } + return yWorld; + }; + Transform2.prototype.inverseTransformPoint = function(inPoint) { + var outPoint = new PointD(this.inverseTransformX(inPoint.x), this.inverseTransformY(inPoint.y)); + return outPoint; + }; + module3.exports = Transform2; + }, + /* 18 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function _toConsumableArray(arr) { + if (Array.isArray(arr)) { + for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { + arr2[i2] = arr[i2]; + } + return arr2; + } else { + return Array.from(arr); + } + } + __name(_toConsumableArray, "_toConsumableArray"); + var Layout2 = __webpack_require__(15); + var FDLayoutConstants = __webpack_require__(4); + var LayoutConstants = __webpack_require__(0); + var IGeometry = __webpack_require__(8); + var IMath = __webpack_require__(9); + function FDLayout() { + Layout2.call(this); + this.useSmartIdealEdgeLengthCalculation = FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION; + this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH; + this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH; + this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR; + this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR; + this.displacementThresholdPerNode = 3 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100; + this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL; + this.initialCoolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL; + this.totalDisplacement = 0; + this.oldTotalDisplacement = 0; + this.maxIterations = FDLayoutConstants.MAX_ITERATIONS; + } + __name(FDLayout, "FDLayout"); + FDLayout.prototype = Object.create(Layout2.prototype); + for (var prop in Layout2) { + FDLayout[prop] = Layout2[prop]; + } + FDLayout.prototype.initParameters = function() { + Layout2.prototype.initParameters.call(this, arguments); + this.totalIterations = 0; + this.notAnimatedIterations = 0; + this.useFRGridVariant = FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION; + this.grid = []; + }; + FDLayout.prototype.calcIdealEdgeLengths = function() { + var edge; + var originalIdealLength; + var lcaDepth; + var source; + var target; + var sizeOfSourceInLca; + var sizeOfTargetInLca; + var allEdges = this.getGraphManager().getAllEdges(); + for (var i2 = 0; i2 < allEdges.length; i2++) { + edge = allEdges[i2]; + originalIdealLength = edge.idealLength; + if (edge.isInterGraph) { + source = edge.getSource(); + target = edge.getTarget(); + sizeOfSourceInLca = edge.getSourceInLca().getEstimatedSize(); + sizeOfTargetInLca = edge.getTargetInLca().getEstimatedSize(); + if (this.useSmartIdealEdgeLengthCalculation) { + edge.idealLength += sizeOfSourceInLca + sizeOfTargetInLca - 2 * LayoutConstants.SIMPLE_NODE_SIZE; + } + lcaDepth = edge.getLca().getInclusionTreeDepth(); + edge.idealLength += originalIdealLength * FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (source.getInclusionTreeDepth() + target.getInclusionTreeDepth() - 2 * lcaDepth); + } + } + }; + FDLayout.prototype.initSpringEmbedder = function() { + var s2 = this.getAllNodes().length; + if (this.incremental) { + if (s2 > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) { + this.coolingFactor = Math.max(this.coolingFactor * FDLayoutConstants.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (s2 - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR)); + } + this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL; + } else { + if (s2 > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) { + this.coolingFactor = Math.max(FDLayoutConstants.COOLING_ADAPTATION_FACTOR, 1 - (s2 - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR)); + } else { + this.coolingFactor = 1; + } + this.initialCoolingFactor = this.coolingFactor; + this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT; + } + this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations); + this.displacementThresholdPerNode = 3 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100; + this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length; + this.repulsionRange = this.calcRepulsionRange(); + }; + FDLayout.prototype.calcSpringForces = function() { + var lEdges = this.getAllEdges(); + var edge; + for (var i2 = 0; i2 < lEdges.length; i2++) { + edge = lEdges[i2]; + this.calcSpringForce(edge, edge.idealLength); + } + }; + FDLayout.prototype.calcRepulsionForces = function() { + var gridUpdateAllowed = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true; + var forceToNodeSurroundingUpdate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; + var i2, j2; + var nodeA, nodeB; + var lNodes = this.getAllNodes(); + var processedNodeSet; + if (this.useFRGridVariant) { + if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed) { + this.updateGrid(); + } + processedNodeSet = /* @__PURE__ */ new Set(); + for (i2 = 0; i2 < lNodes.length; i2++) { + nodeA = lNodes[i2]; + this.calculateRepulsionForceOfANode(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate); + processedNodeSet.add(nodeA); + } + } else { + for (i2 = 0; i2 < lNodes.length; i2++) { + nodeA = lNodes[i2]; + for (j2 = i2 + 1; j2 < lNodes.length; j2++) { + nodeB = lNodes[j2]; + if (nodeA.getOwner() != nodeB.getOwner()) { + continue; + } + this.calcRepulsionForce(nodeA, nodeB); + } + } + } + }; + FDLayout.prototype.calcGravitationalForces = function() { + var node2; + var lNodes = this.getAllNodesToApplyGravitation(); + for (var i2 = 0; i2 < lNodes.length; i2++) { + node2 = lNodes[i2]; + this.calcGravitationalForce(node2); + } + }; + FDLayout.prototype.moveNodes = function() { + var lNodes = this.getAllNodes(); + var node2; + for (var i2 = 0; i2 < lNodes.length; i2++) { + node2 = lNodes[i2]; + node2.move(); + } + }; + FDLayout.prototype.calcSpringForce = function(edge, idealLength) { + var sourceNode = edge.getSource(); + var targetNode = edge.getTarget(); + var length2; + var springForce; + var springForceX; + var springForceY; + if (this.uniformLeafNodeSizes && sourceNode.getChild() == null && targetNode.getChild() == null) { + edge.updateLengthSimple(); + } else { + edge.updateLength(); + if (edge.isOverlapingSourceAndTarget) { + return; + } + } + length2 = edge.getLength(); + if (length2 == 0) return; + springForce = edge.edgeElasticity * (length2 - idealLength); + springForceX = springForce * (edge.lengthX / length2); + springForceY = springForce * (edge.lengthY / length2); + sourceNode.springForceX += springForceX; + sourceNode.springForceY += springForceY; + targetNode.springForceX -= springForceX; + targetNode.springForceY -= springForceY; + }; + FDLayout.prototype.calcRepulsionForce = function(nodeA, nodeB) { + var rectA = nodeA.getRect(); + var rectB = nodeB.getRect(); + var overlapAmount = new Array(2); + var clipPoints = new Array(4); + var distanceX; + var distanceY; + var distanceSquared; + var distance2; + var repulsionForce; + var repulsionForceX; + var repulsionForceY; + if (rectA.intersects(rectB)) { + IGeometry.calcSeparationAmount(rectA, rectB, overlapAmount, FDLayoutConstants.DEFAULT_EDGE_LENGTH / 2); + repulsionForceX = 2 * overlapAmount[0]; + repulsionForceY = 2 * overlapAmount[1]; + var childrenConstant = nodeA.noOfChildren * nodeB.noOfChildren / (nodeA.noOfChildren + nodeB.noOfChildren); + nodeA.repulsionForceX -= childrenConstant * repulsionForceX; + nodeA.repulsionForceY -= childrenConstant * repulsionForceY; + nodeB.repulsionForceX += childrenConstant * repulsionForceX; + nodeB.repulsionForceY += childrenConstant * repulsionForceY; + } else { + if (this.uniformLeafNodeSizes && nodeA.getChild() == null && nodeB.getChild() == null) { + distanceX = rectB.getCenterX() - rectA.getCenterX(); + distanceY = rectB.getCenterY() - rectA.getCenterY(); + } else { + IGeometry.getIntersection(rectA, rectB, clipPoints); + distanceX = clipPoints[2] - clipPoints[0]; + distanceY = clipPoints[3] - clipPoints[1]; + } + if (Math.abs(distanceX) < FDLayoutConstants.MIN_REPULSION_DIST) { + distanceX = IMath.sign(distanceX) * FDLayoutConstants.MIN_REPULSION_DIST; + } + if (Math.abs(distanceY) < FDLayoutConstants.MIN_REPULSION_DIST) { + distanceY = IMath.sign(distanceY) * FDLayoutConstants.MIN_REPULSION_DIST; + } + distanceSquared = distanceX * distanceX + distanceY * distanceY; + distance2 = Math.sqrt(distanceSquared); + repulsionForce = (nodeA.nodeRepulsion / 2 + nodeB.nodeRepulsion / 2) * nodeA.noOfChildren * nodeB.noOfChildren / distanceSquared; + repulsionForceX = repulsionForce * distanceX / distance2; + repulsionForceY = repulsionForce * distanceY / distance2; + nodeA.repulsionForceX -= repulsionForceX; + nodeA.repulsionForceY -= repulsionForceY; + nodeB.repulsionForceX += repulsionForceX; + nodeB.repulsionForceY += repulsionForceY; + } + }; + FDLayout.prototype.calcGravitationalForce = function(node2) { + var ownerGraph; + var ownerCenterX; + var ownerCenterY; + var distanceX; + var distanceY; + var absDistanceX; + var absDistanceY; + var estimatedSize; + ownerGraph = node2.getOwner(); + ownerCenterX = (ownerGraph.getRight() + ownerGraph.getLeft()) / 2; + ownerCenterY = (ownerGraph.getTop() + ownerGraph.getBottom()) / 2; + distanceX = node2.getCenterX() - ownerCenterX; + distanceY = node2.getCenterY() - ownerCenterY; + absDistanceX = Math.abs(distanceX) + node2.getWidth() / 2; + absDistanceY = Math.abs(distanceY) + node2.getHeight() / 2; + if (node2.getOwner() == this.graphManager.getRoot()) { + estimatedSize = ownerGraph.getEstimatedSize() * this.gravityRangeFactor; + if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) { + node2.gravitationForceX = -this.gravityConstant * distanceX; + node2.gravitationForceY = -this.gravityConstant * distanceY; + } + } else { + estimatedSize = ownerGraph.getEstimatedSize() * this.compoundGravityRangeFactor; + if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) { + node2.gravitationForceX = -this.gravityConstant * distanceX * this.compoundGravityConstant; + node2.gravitationForceY = -this.gravityConstant * distanceY * this.compoundGravityConstant; + } + } + }; + FDLayout.prototype.isConverged = function() { + var converged; + var oscilating = false; + if (this.totalIterations > this.maxIterations / 3) { + oscilating = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2; + } + converged = this.totalDisplacement < this.totalDisplacementThreshold; + this.oldTotalDisplacement = this.totalDisplacement; + return converged || oscilating; + }; + FDLayout.prototype.animate = function() { + if (this.animationDuringLayout && !this.isSubLayout) { + if (this.notAnimatedIterations == this.animationPeriod) { + this.update(); + this.notAnimatedIterations = 0; + } else { + this.notAnimatedIterations++; + } + } + }; + FDLayout.prototype.calcNoOfChildrenForAllNodes = function() { + var node2; + var allNodes = this.graphManager.getAllNodes(); + for (var i2 = 0; i2 < allNodes.length; i2++) { + node2 = allNodes[i2]; + node2.noOfChildren = node2.getNoOfChildren(); + } + }; + FDLayout.prototype.calcGrid = function(graph) { + var sizeX = 0; + var sizeY = 0; + sizeX = parseInt(Math.ceil((graph.getRight() - graph.getLeft()) / this.repulsionRange)); + sizeY = parseInt(Math.ceil((graph.getBottom() - graph.getTop()) / this.repulsionRange)); + var grid = new Array(sizeX); + for (var i2 = 0; i2 < sizeX; i2++) { + grid[i2] = new Array(sizeY); + } + for (var i2 = 0; i2 < sizeX; i2++) { + for (var j2 = 0; j2 < sizeY; j2++) { + grid[i2][j2] = new Array(); + } + } + return grid; + }; + FDLayout.prototype.addNodeToGrid = function(v3, left3, top2) { + var startX2 = 0; + var finishX = 0; + var startY2 = 0; + var finishY = 0; + startX2 = parseInt(Math.floor((v3.getRect().x - left3) / this.repulsionRange)); + finishX = parseInt(Math.floor((v3.getRect().width + v3.getRect().x - left3) / this.repulsionRange)); + startY2 = parseInt(Math.floor((v3.getRect().y - top2) / this.repulsionRange)); + finishY = parseInt(Math.floor((v3.getRect().height + v3.getRect().y - top2) / this.repulsionRange)); + for (var i2 = startX2; i2 <= finishX; i2++) { + for (var j2 = startY2; j2 <= finishY; j2++) { + this.grid[i2][j2].push(v3); + v3.setGridCoordinates(startX2, finishX, startY2, finishY); + } + } + }; + FDLayout.prototype.updateGrid = function() { + var i2; + var nodeA; + var lNodes = this.getAllNodes(); + this.grid = this.calcGrid(this.graphManager.getRoot()); + for (i2 = 0; i2 < lNodes.length; i2++) { + nodeA = lNodes[i2]; + this.addNodeToGrid(nodeA, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop()); + } + }; + FDLayout.prototype.calculateRepulsionForceOfANode = function(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate) { + if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed || forceToNodeSurroundingUpdate) { + var surrounding = /* @__PURE__ */ new Set(); + nodeA.surrounding = new Array(); + var nodeB; + var grid = this.grid; + for (var i2 = nodeA.startX - 1; i2 < nodeA.finishX + 2; i2++) { + for (var j2 = nodeA.startY - 1; j2 < nodeA.finishY + 2; j2++) { + if (!(i2 < 0 || j2 < 0 || i2 >= grid.length || j2 >= grid[0].length)) { + for (var k2 = 0; k2 < grid[i2][j2].length; k2++) { + nodeB = grid[i2][j2][k2]; + if (nodeA.getOwner() != nodeB.getOwner() || nodeA == nodeB) { + continue; + } + if (!processedNodeSet.has(nodeB) && !surrounding.has(nodeB)) { + var distanceX = Math.abs(nodeA.getCenterX() - nodeB.getCenterX()) - (nodeA.getWidth() / 2 + nodeB.getWidth() / 2); + var distanceY = Math.abs(nodeA.getCenterY() - nodeB.getCenterY()) - (nodeA.getHeight() / 2 + nodeB.getHeight() / 2); + if (distanceX <= this.repulsionRange && distanceY <= this.repulsionRange) { + surrounding.add(nodeB); + } + } + } + } + } + } + nodeA.surrounding = [].concat(_toConsumableArray(surrounding)); + } + for (i2 = 0; i2 < nodeA.surrounding.length; i2++) { + this.calcRepulsionForce(nodeA, nodeA.surrounding[i2]); + } + }; + FDLayout.prototype.calcRepulsionRange = function() { + return 0; + }; + module3.exports = FDLayout; + }, + /* 19 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LEdge = __webpack_require__(1); + var FDLayoutConstants = __webpack_require__(4); + function FDLayoutEdge(source, target, vEdge) { + LEdge.call(this, source, target, vEdge); + this.idealLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH; + this.edgeElasticity = FDLayoutConstants.DEFAULT_SPRING_STRENGTH; + } + __name(FDLayoutEdge, "FDLayoutEdge"); + FDLayoutEdge.prototype = Object.create(LEdge.prototype); + for (var prop in LEdge) { + FDLayoutEdge[prop] = LEdge[prop]; + } + module3.exports = FDLayoutEdge; + }, + /* 20 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var LNode = __webpack_require__(3); + var FDLayoutConstants = __webpack_require__(4); + function FDLayoutNode(gm, loc, size5, vNode) { + LNode.call(this, gm, loc, size5, vNode); + this.nodeRepulsion = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH; + this.springForceX = 0; + this.springForceY = 0; + this.repulsionForceX = 0; + this.repulsionForceY = 0; + this.gravitationForceX = 0; + this.gravitationForceY = 0; + this.displacementX = 0; + this.displacementY = 0; + this.startX = 0; + this.finishX = 0; + this.startY = 0; + this.finishY = 0; + this.surrounding = []; + } + __name(FDLayoutNode, "FDLayoutNode"); + FDLayoutNode.prototype = Object.create(LNode.prototype); + for (var prop in LNode) { + FDLayoutNode[prop] = LNode[prop]; + } + FDLayoutNode.prototype.setGridCoordinates = function(_startX, _finishX, _startY, _finishY) { + this.startX = _startX; + this.finishX = _finishX; + this.startY = _startY; + this.finishY = _finishY; + }; + module3.exports = FDLayoutNode; + }, + /* 21 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function DimensionD2(width3, height2) { + this.width = 0; + this.height = 0; + if (width3 !== null && height2 !== null) { + this.height = height2; + this.width = width3; + } + } + __name(DimensionD2, "DimensionD"); + DimensionD2.prototype.getWidth = function() { + return this.width; + }; + DimensionD2.prototype.setWidth = function(width3) { + this.width = width3; + }; + DimensionD2.prototype.getHeight = function() { + return this.height; + }; + DimensionD2.prototype.setHeight = function(height2) { + this.height = height2; + }; + module3.exports = DimensionD2; + }, + /* 22 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var UniqueIDGeneretor = __webpack_require__(14); + function HashMap() { + this.map = {}; + this.keys = []; + } + __name(HashMap, "HashMap"); + HashMap.prototype.put = function(key, value2) { + var theId = UniqueIDGeneretor.createID(key); + if (!this.contains(theId)) { + this.map[theId] = value2; + this.keys.push(key); + } + }; + HashMap.prototype.contains = function(key) { + var theId = UniqueIDGeneretor.createID(key); + return this.map[key] != null; + }; + HashMap.prototype.get = function(key) { + var theId = UniqueIDGeneretor.createID(key); + return this.map[theId]; + }; + HashMap.prototype.keySet = function() { + return this.keys; + }; + module3.exports = HashMap; + }, + /* 23 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var UniqueIDGeneretor = __webpack_require__(14); + function HashSet() { + this.set = {}; + } + __name(HashSet, "HashSet"); + ; + HashSet.prototype.add = function(obj) { + var theId = UniqueIDGeneretor.createID(obj); + if (!this.contains(theId)) this.set[theId] = obj; + }; + HashSet.prototype.remove = function(obj) { + delete this.set[UniqueIDGeneretor.createID(obj)]; + }; + HashSet.prototype.clear = function() { + this.set = {}; + }; + HashSet.prototype.contains = function(obj) { + return this.set[UniqueIDGeneretor.createID(obj)] == obj; + }; + HashSet.prototype.isEmpty = function() { + return this.size() === 0; + }; + HashSet.prototype.size = function() { + return Object.keys(this.set).length; + }; + HashSet.prototype.addAllTo = function(list2) { + var keys3 = Object.keys(this.set); + var length2 = keys3.length; + for (var i2 = 0; i2 < length2; i2++) { + list2.push(this.set[keys3[i2]]); + } + }; + HashSet.prototype.size = function() { + return Object.keys(this.set).length; + }; + HashSet.prototype.addAll = function(list2) { + var s2 = list2.length; + for (var i2 = 0; i2 < s2; i2++) { + var v3 = list2[i2]; + this.add(v3); + } + }; + module3.exports = HashSet; + }, + /* 24 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function Matrix() { + } + __name(Matrix, "Matrix"); + Matrix.multMat = function(array1, array22) { + var result = []; + for (var i2 = 0; i2 < array1.length; i2++) { + result[i2] = []; + for (var j2 = 0; j2 < array22[0].length; j2++) { + result[i2][j2] = 0; + for (var k2 = 0; k2 < array1[0].length; k2++) { + result[i2][j2] += array1[i2][k2] * array22[k2][j2]; + } + } + } + return result; + }; + Matrix.transpose = function(array4) { + var result = []; + for (var i2 = 0; i2 < array4[0].length; i2++) { + result[i2] = []; + for (var j2 = 0; j2 < array4.length; j2++) { + result[i2][j2] = array4[j2][i2]; + } + } + return result; + }; + Matrix.multCons = function(array4, constant3) { + var result = []; + for (var i2 = 0; i2 < array4.length; i2++) { + result[i2] = array4[i2] * constant3; + } + return result; + }; + Matrix.minusOp = function(array1, array22) { + var result = []; + for (var i2 = 0; i2 < array1.length; i2++) { + result[i2] = array1[i2] - array22[i2]; + } + return result; + }; + Matrix.dotProduct = function(array1, array22) { + var product = 0; + for (var i2 = 0; i2 < array1.length; i2++) { + product += array1[i2] * array22[i2]; + } + return product; + }; + Matrix.mag = function(array4) { + return Math.sqrt(this.dotProduct(array4, array4)); + }; + Matrix.normalize = function(array4) { + var result = []; + var magnitude = this.mag(array4); + for (var i2 = 0; i2 < array4.length; i2++) { + result[i2] = array4[i2] / magnitude; + } + return result; + }; + Matrix.multGamma = function(array4) { + var result = []; + var sum2 = 0; + for (var i2 = 0; i2 < array4.length; i2++) { + sum2 += array4[i2]; + } + sum2 *= -1 / array4.length; + for (var _i = 0; _i < array4.length; _i++) { + result[_i] = sum2 + array4[_i]; + } + return result; + }; + Matrix.multL = function(array4, C2, INV) { + var result = []; + var temp1 = []; + var temp2 = []; + for (var i2 = 0; i2 < C2[0].length; i2++) { + var sum2 = 0; + for (var j2 = 0; j2 < C2.length; j2++) { + sum2 += -0.5 * C2[j2][i2] * array4[j2]; + } + temp1[i2] = sum2; + } + for (var _i2 = 0; _i2 < INV.length; _i2++) { + var _sum = 0; + for (var _j = 0; _j < INV.length; _j++) { + _sum += INV[_i2][_j] * temp1[_j]; + } + temp2[_i2] = _sum; + } + for (var _i3 = 0; _i3 < C2.length; _i3++) { + var _sum2 = 0; + for (var _j2 = 0; _j2 < C2[0].length; _j2++) { + _sum2 += C2[_i3][_j2] * temp2[_j2]; + } + result[_i3] = _sum2; + } + return result; + }; + module3.exports = Matrix; + }, + /* 25 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var _createClass2 = /* @__PURE__ */ function() { + function defineProperties(target, props) { + for (var i2 = 0; i2 < props.length; i2++) { + var descriptor = props[i2]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + __name(defineProperties, "defineProperties"); + return function(Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + function _classCallCheck2(instance2, Constructor) { + if (!(instance2 instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + __name(_classCallCheck2, "_classCallCheck"); + var LinkedList = __webpack_require__(11); + var Quicksort = function() { + function Quicksort2(A2, compareFunction) { + _classCallCheck2(this, Quicksort2); + if (compareFunction !== null || compareFunction !== void 0) this.compareFunction = this._defaultCompareFunction; + var length2 = void 0; + if (A2 instanceof LinkedList) length2 = A2.size(); + else length2 = A2.length; + this._quicksort(A2, 0, length2 - 1); + } + __name(Quicksort2, "Quicksort"); + _createClass2(Quicksort2, [{ + key: "_quicksort", + value: /* @__PURE__ */ __name(function _quicksort(A2, p3, r2) { + if (p3 < r2) { + var q2 = this._partition(A2, p3, r2); + this._quicksort(A2, p3, q2); + this._quicksort(A2, q2 + 1, r2); + } + }, "_quicksort") + }, { + key: "_partition", + value: /* @__PURE__ */ __name(function _partition(A2, p3, r2) { + var x5 = this._get(A2, p3); + var i2 = p3; + var j2 = r2; + while (true) { + while (this.compareFunction(x5, this._get(A2, j2))) { + j2--; + } + while (this.compareFunction(this._get(A2, i2), x5)) { + i2++; + } + if (i2 < j2) { + this._swap(A2, i2, j2); + i2++; + j2--; + } else return j2; + } + }, "_partition") + }, { + key: "_get", + value: /* @__PURE__ */ __name(function _get(object3, index) { + if (object3 instanceof LinkedList) return object3.get_object_at(index); + else return object3[index]; + }, "_get") + }, { + key: "_set", + value: /* @__PURE__ */ __name(function _set(object3, index, value2) { + if (object3 instanceof LinkedList) object3.set_object_at(index, value2); + else object3[index] = value2; + }, "_set") + }, { + key: "_swap", + value: /* @__PURE__ */ __name(function _swap(A2, i2, j2) { + var temp = this._get(A2, i2); + this._set(A2, i2, this._get(A2, j2)); + this._set(A2, j2, temp); + }, "_swap") + }, { + key: "_defaultCompareFunction", + value: /* @__PURE__ */ __name(function _defaultCompareFunction(a2, b2) { + return b2 > a2; + }, "_defaultCompareFunction") + }]); + return Quicksort2; + }(); + module3.exports = Quicksort; + }, + /* 26 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function SVD() { + } + __name(SVD, "SVD"); + ; + SVD.svd = function(A2) { + this.U = null; + this.V = null; + this.s = null; + this.m = 0; + this.n = 0; + this.m = A2.length; + this.n = A2[0].length; + var nu = Math.min(this.m, this.n); + this.s = function(s2) { + var a2 = []; + while (s2-- > 0) { + a2.push(0); + } + return a2; + }(Math.min(this.m + 1, this.n)); + this.U = function(dims) { + var allocate = /* @__PURE__ */ __name(function allocate2(dims2) { + if (dims2.length == 0) { + return 0; + } else { + var array4 = []; + for (var i3 = 0; i3 < dims2[0]; i3++) { + array4.push(allocate2(dims2.slice(1))); + } + return array4; + } + }, "allocate"); + return allocate(dims); + }([this.m, nu]); + this.V = function(dims) { + var allocate = /* @__PURE__ */ __name(function allocate2(dims2) { + if (dims2.length == 0) { + return 0; + } else { + var array4 = []; + for (var i3 = 0; i3 < dims2[0]; i3++) { + array4.push(allocate2(dims2.slice(1))); + } + return array4; + } + }, "allocate"); + return allocate(dims); + }([this.n, this.n]); + var e3 = function(s2) { + var a2 = []; + while (s2-- > 0) { + a2.push(0); + } + return a2; + }(this.n); + var work = function(s2) { + var a2 = []; + while (s2-- > 0) { + a2.push(0); + } + return a2; + }(this.m); + var wantu = true; + var wantv = true; + var nct = Math.min(this.m - 1, this.n); + var nrt = Math.max(0, Math.min(this.n - 2, this.m)); + for (var k2 = 0; k2 < Math.max(nct, nrt); k2++) { + if (k2 < nct) { + this.s[k2] = 0; + for (var i2 = k2; i2 < this.m; i2++) { + this.s[k2] = SVD.hypot(this.s[k2], A2[i2][k2]); + } + ; + if (this.s[k2] !== 0) { + if (A2[k2][k2] < 0) { + this.s[k2] = -this.s[k2]; + } + for (var _i = k2; _i < this.m; _i++) { + A2[_i][k2] /= this.s[k2]; + } + ; + A2[k2][k2] += 1; + } + this.s[k2] = -this.s[k2]; + } + for (var j2 = k2 + 1; j2 < this.n; j2++) { + if (/* @__PURE__ */ function(lhs, rhs) { + return lhs && rhs; + }(k2 < nct, this.s[k2] !== 0)) { + var t4 = 0; + for (var _i2 = k2; _i2 < this.m; _i2++) { + t4 += A2[_i2][k2] * A2[_i2][j2]; + } + ; + t4 = -t4 / A2[k2][k2]; + for (var _i3 = k2; _i3 < this.m; _i3++) { + A2[_i3][j2] += t4 * A2[_i3][k2]; + } + ; + } + e3[j2] = A2[k2][j2]; + } + ; + if (/* @__PURE__ */ function(lhs, rhs) { + return lhs && rhs; + }(wantu, k2 < nct)) { + for (var _i4 = k2; _i4 < this.m; _i4++) { + this.U[_i4][k2] = A2[_i4][k2]; + } + ; + } + if (k2 < nrt) { + e3[k2] = 0; + for (var _i5 = k2 + 1; _i5 < this.n; _i5++) { + e3[k2] = SVD.hypot(e3[k2], e3[_i5]); + } + ; + if (e3[k2] !== 0) { + if (e3[k2 + 1] < 0) { + e3[k2] = -e3[k2]; + } + for (var _i6 = k2 + 1; _i6 < this.n; _i6++) { + e3[_i6] /= e3[k2]; + } + ; + e3[k2 + 1] += 1; + } + e3[k2] = -e3[k2]; + if (/* @__PURE__ */ function(lhs, rhs) { + return lhs && rhs; + }(k2 + 1 < this.m, e3[k2] !== 0)) { + for (var _i7 = k2 + 1; _i7 < this.m; _i7++) { + work[_i7] = 0; + } + ; + for (var _j = k2 + 1; _j < this.n; _j++) { + for (var _i8 = k2 + 1; _i8 < this.m; _i8++) { + work[_i8] += e3[_j] * A2[_i8][_j]; + } + ; + } + ; + for (var _j2 = k2 + 1; _j2 < this.n; _j2++) { + var _t = -e3[_j2] / e3[k2 + 1]; + for (var _i9 = k2 + 1; _i9 < this.m; _i9++) { + A2[_i9][_j2] += _t * work[_i9]; + } + ; + } + ; + } + if (wantv) { + for (var _i10 = k2 + 1; _i10 < this.n; _i10++) { + this.V[_i10][k2] = e3[_i10]; + } + ; + } + } + } + ; + var p3 = Math.min(this.n, this.m + 1); + if (nct < this.n) { + this.s[nct] = A2[nct][nct]; + } + if (this.m < p3) { + this.s[p3 - 1] = 0; + } + if (nrt + 1 < p3) { + e3[nrt] = A2[nrt][p3 - 1]; + } + e3[p3 - 1] = 0; + if (wantu) { + for (var _j3 = nct; _j3 < nu; _j3++) { + for (var _i11 = 0; _i11 < this.m; _i11++) { + this.U[_i11][_j3] = 0; + } + ; + this.U[_j3][_j3] = 1; + } + ; + for (var _k = nct - 1; _k >= 0; _k--) { + if (this.s[_k] !== 0) { + for (var _j4 = _k + 1; _j4 < nu; _j4++) { + var _t2 = 0; + for (var _i12 = _k; _i12 < this.m; _i12++) { + _t2 += this.U[_i12][_k] * this.U[_i12][_j4]; + } + ; + _t2 = -_t2 / this.U[_k][_k]; + for (var _i13 = _k; _i13 < this.m; _i13++) { + this.U[_i13][_j4] += _t2 * this.U[_i13][_k]; + } + ; + } + ; + for (var _i14 = _k; _i14 < this.m; _i14++) { + this.U[_i14][_k] = -this.U[_i14][_k]; + } + ; + this.U[_k][_k] = 1 + this.U[_k][_k]; + for (var _i15 = 0; _i15 < _k - 1; _i15++) { + this.U[_i15][_k] = 0; + } + ; + } else { + for (var _i16 = 0; _i16 < this.m; _i16++) { + this.U[_i16][_k] = 0; + } + ; + this.U[_k][_k] = 1; + } + } + ; + } + if (wantv) { + for (var _k2 = this.n - 1; _k2 >= 0; _k2--) { + if (/* @__PURE__ */ function(lhs, rhs) { + return lhs && rhs; + }(_k2 < nrt, e3[_k2] !== 0)) { + for (var _j5 = _k2 + 1; _j5 < nu; _j5++) { + var _t3 = 0; + for (var _i17 = _k2 + 1; _i17 < this.n; _i17++) { + _t3 += this.V[_i17][_k2] * this.V[_i17][_j5]; + } + ; + _t3 = -_t3 / this.V[_k2 + 1][_k2]; + for (var _i18 = _k2 + 1; _i18 < this.n; _i18++) { + this.V[_i18][_j5] += _t3 * this.V[_i18][_k2]; + } + ; + } + ; + } + for (var _i19 = 0; _i19 < this.n; _i19++) { + this.V[_i19][_k2] = 0; + } + ; + this.V[_k2][_k2] = 1; + } + ; + } + var pp = p3 - 1; + var iter = 0; + var eps = Math.pow(2, -52); + var tiny = Math.pow(2, -966); + while (p3 > 0) { + var _k3 = void 0; + var kase = void 0; + for (_k3 = p3 - 2; _k3 >= -1; _k3--) { + if (_k3 === -1) { + break; + } + if (Math.abs(e3[_k3]) <= tiny + eps * (Math.abs(this.s[_k3]) + Math.abs(this.s[_k3 + 1]))) { + e3[_k3] = 0; + break; + } + } + ; + if (_k3 === p3 - 2) { + kase = 4; + } else { + var ks = void 0; + for (ks = p3 - 1; ks >= _k3; ks--) { + if (ks === _k3) { + break; + } + var _t4 = (ks !== p3 ? Math.abs(e3[ks]) : 0) + (ks !== _k3 + 1 ? Math.abs(e3[ks - 1]) : 0); + if (Math.abs(this.s[ks]) <= tiny + eps * _t4) { + this.s[ks] = 0; + break; + } + } + ; + if (ks === _k3) { + kase = 3; + } else if (ks === p3 - 1) { + kase = 1; + } else { + kase = 2; + _k3 = ks; + } + } + _k3++; + switch (kase) { + case 1: + { + var f3 = e3[p3 - 2]; + e3[p3 - 2] = 0; + for (var _j6 = p3 - 2; _j6 >= _k3; _j6--) { + var _t5 = SVD.hypot(this.s[_j6], f3); + var cs = this.s[_j6] / _t5; + var sn = f3 / _t5; + this.s[_j6] = _t5; + if (_j6 !== _k3) { + f3 = -sn * e3[_j6 - 1]; + e3[_j6 - 1] = cs * e3[_j6 - 1]; + } + if (wantv) { + for (var _i20 = 0; _i20 < this.n; _i20++) { + _t5 = cs * this.V[_i20][_j6] + sn * this.V[_i20][p3 - 1]; + this.V[_i20][p3 - 1] = -sn * this.V[_i20][_j6] + cs * this.V[_i20][p3 - 1]; + this.V[_i20][_j6] = _t5; + } + ; + } + } + ; + } + ; + break; + case 2: + { + var _f = e3[_k3 - 1]; + e3[_k3 - 1] = 0; + for (var _j7 = _k3; _j7 < p3; _j7++) { + var _t6 = SVD.hypot(this.s[_j7], _f); + var _cs = this.s[_j7] / _t6; + var _sn = _f / _t6; + this.s[_j7] = _t6; + _f = -_sn * e3[_j7]; + e3[_j7] = _cs * e3[_j7]; + if (wantu) { + for (var _i21 = 0; _i21 < this.m; _i21++) { + _t6 = _cs * this.U[_i21][_j7] + _sn * this.U[_i21][_k3 - 1]; + this.U[_i21][_k3 - 1] = -_sn * this.U[_i21][_j7] + _cs * this.U[_i21][_k3 - 1]; + this.U[_i21][_j7] = _t6; + } + ; + } + } + ; + } + ; + break; + case 3: + { + var scale = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[p3 - 1]), Math.abs(this.s[p3 - 2])), Math.abs(e3[p3 - 2])), Math.abs(this.s[_k3])), Math.abs(e3[_k3])); + var sp = this.s[p3 - 1] / scale; + var spm1 = this.s[p3 - 2] / scale; + var epm1 = e3[p3 - 2] / scale; + var sk = this.s[_k3] / scale; + var ek = e3[_k3] / scale; + var b2 = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2; + var c3 = sp * epm1 * (sp * epm1); + var shift2 = 0; + if (/* @__PURE__ */ function(lhs, rhs) { + return lhs || rhs; + }(b2 !== 0, c3 !== 0)) { + shift2 = Math.sqrt(b2 * b2 + c3); + if (b2 < 0) { + shift2 = -shift2; + } + shift2 = c3 / (b2 + shift2); + } + var _f2 = (sk + sp) * (sk - sp) + shift2; + var g2 = sk * ek; + for (var _j8 = _k3; _j8 < p3 - 1; _j8++) { + var _t7 = SVD.hypot(_f2, g2); + var _cs2 = _f2 / _t7; + var _sn2 = g2 / _t7; + if (_j8 !== _k3) { + e3[_j8 - 1] = _t7; + } + _f2 = _cs2 * this.s[_j8] + _sn2 * e3[_j8]; + e3[_j8] = _cs2 * e3[_j8] - _sn2 * this.s[_j8]; + g2 = _sn2 * this.s[_j8 + 1]; + this.s[_j8 + 1] = _cs2 * this.s[_j8 + 1]; + if (wantv) { + for (var _i22 = 0; _i22 < this.n; _i22++) { + _t7 = _cs2 * this.V[_i22][_j8] + _sn2 * this.V[_i22][_j8 + 1]; + this.V[_i22][_j8 + 1] = -_sn2 * this.V[_i22][_j8] + _cs2 * this.V[_i22][_j8 + 1]; + this.V[_i22][_j8] = _t7; + } + ; + } + _t7 = SVD.hypot(_f2, g2); + _cs2 = _f2 / _t7; + _sn2 = g2 / _t7; + this.s[_j8] = _t7; + _f2 = _cs2 * e3[_j8] + _sn2 * this.s[_j8 + 1]; + this.s[_j8 + 1] = -_sn2 * e3[_j8] + _cs2 * this.s[_j8 + 1]; + g2 = _sn2 * e3[_j8 + 1]; + e3[_j8 + 1] = _cs2 * e3[_j8 + 1]; + if (wantu && _j8 < this.m - 1) { + for (var _i23 = 0; _i23 < this.m; _i23++) { + _t7 = _cs2 * this.U[_i23][_j8] + _sn2 * this.U[_i23][_j8 + 1]; + this.U[_i23][_j8 + 1] = -_sn2 * this.U[_i23][_j8] + _cs2 * this.U[_i23][_j8 + 1]; + this.U[_i23][_j8] = _t7; + } + ; + } + } + ; + e3[p3 - 2] = _f2; + iter = iter + 1; + } + ; + break; + case 4: + { + if (this.s[_k3] <= 0) { + this.s[_k3] = this.s[_k3] < 0 ? -this.s[_k3] : 0; + if (wantv) { + for (var _i24 = 0; _i24 <= pp; _i24++) { + this.V[_i24][_k3] = -this.V[_i24][_k3]; + } + ; + } + } + while (_k3 < pp) { + if (this.s[_k3] >= this.s[_k3 + 1]) { + break; + } + var _t8 = this.s[_k3]; + this.s[_k3] = this.s[_k3 + 1]; + this.s[_k3 + 1] = _t8; + if (wantv && _k3 < this.n - 1) { + for (var _i25 = 0; _i25 < this.n; _i25++) { + _t8 = this.V[_i25][_k3 + 1]; + this.V[_i25][_k3 + 1] = this.V[_i25][_k3]; + this.V[_i25][_k3] = _t8; + } + ; + } + if (wantu && _k3 < this.m - 1) { + for (var _i26 = 0; _i26 < this.m; _i26++) { + _t8 = this.U[_i26][_k3 + 1]; + this.U[_i26][_k3 + 1] = this.U[_i26][_k3]; + this.U[_i26][_k3] = _t8; + } + ; + } + _k3++; + } + ; + iter = 0; + p3--; + } + ; + break; + } + } + ; + var result = { U: this.U, V: this.V, S: this.s }; + return result; + }; + SVD.hypot = function(a2, b2) { + var r2 = void 0; + if (Math.abs(a2) > Math.abs(b2)) { + r2 = b2 / a2; + r2 = Math.abs(a2) * Math.sqrt(1 + r2 * r2); + } else if (b2 != 0) { + r2 = a2 / b2; + r2 = Math.abs(b2) * Math.sqrt(1 + r2 * r2); + } else { + r2 = 0; + } + return r2; + }; + module3.exports = SVD; + }, + /* 27 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var _createClass2 = /* @__PURE__ */ function() { + function defineProperties(target, props) { + for (var i2 = 0; i2 < props.length; i2++) { + var descriptor = props[i2]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + __name(defineProperties, "defineProperties"); + return function(Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + function _classCallCheck2(instance2, Constructor) { + if (!(instance2 instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + __name(_classCallCheck2, "_classCallCheck"); + var NeedlemanWunsch = function() { + function NeedlemanWunsch2(sequence1, sequence2) { + var match_score = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1; + var mismatch_penalty = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1; + var gap_penalty = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1; + _classCallCheck2(this, NeedlemanWunsch2); + this.sequence1 = sequence1; + this.sequence2 = sequence2; + this.match_score = match_score; + this.mismatch_penalty = mismatch_penalty; + this.gap_penalty = gap_penalty; + this.iMax = sequence1.length + 1; + this.jMax = sequence2.length + 1; + this.grid = new Array(this.iMax); + for (var i2 = 0; i2 < this.iMax; i2++) { + this.grid[i2] = new Array(this.jMax); + for (var j2 = 0; j2 < this.jMax; j2++) { + this.grid[i2][j2] = 0; + } + } + this.tracebackGrid = new Array(this.iMax); + for (var _i = 0; _i < this.iMax; _i++) { + this.tracebackGrid[_i] = new Array(this.jMax); + for (var _j = 0; _j < this.jMax; _j++) { + this.tracebackGrid[_i][_j] = [null, null, null]; + } + } + this.alignments = []; + this.score = -1; + this.computeGrids(); + } + __name(NeedlemanWunsch2, "NeedlemanWunsch"); + _createClass2(NeedlemanWunsch2, [{ + key: "getScore", + value: /* @__PURE__ */ __name(function getScore() { + return this.score; + }, "getScore") + }, { + key: "getAlignments", + value: /* @__PURE__ */ __name(function getAlignments2() { + return this.alignments; + }, "getAlignments") + // Main dynamic programming procedure + }, { + key: "computeGrids", + value: /* @__PURE__ */ __name(function computeGrids() { + for (var j2 = 1; j2 < this.jMax; j2++) { + this.grid[0][j2] = this.grid[0][j2 - 1] + this.gap_penalty; + this.tracebackGrid[0][j2] = [false, false, true]; + } + for (var i2 = 1; i2 < this.iMax; i2++) { + this.grid[i2][0] = this.grid[i2 - 1][0] + this.gap_penalty; + this.tracebackGrid[i2][0] = [false, true, false]; + } + for (var _i2 = 1; _i2 < this.iMax; _i2++) { + for (var _j2 = 1; _j2 < this.jMax; _j2++) { + var diag = void 0; + if (this.sequence1[_i2 - 1] === this.sequence2[_j2 - 1]) diag = this.grid[_i2 - 1][_j2 - 1] + this.match_score; + else diag = this.grid[_i2 - 1][_j2 - 1] + this.mismatch_penalty; + var up = this.grid[_i2 - 1][_j2] + this.gap_penalty; + var left3 = this.grid[_i2][_j2 - 1] + this.gap_penalty; + var maxOf = [diag, up, left3]; + var indices = this.arrayAllMaxIndexes(maxOf); + this.grid[_i2][_j2] = maxOf[indices[0]]; + this.tracebackGrid[_i2][_j2] = [indices.includes(0), indices.includes(1), indices.includes(2)]; + } + } + this.score = this.grid[this.iMax - 1][this.jMax - 1]; + }, "computeGrids") + // Gets all possible valid sequence combinations + }, { + key: "alignmentTraceback", + value: /* @__PURE__ */ __name(function alignmentTraceback() { + var inProcessAlignments = []; + inProcessAlignments.push({ + pos: [this.sequence1.length, this.sequence2.length], + seq1: "", + seq2: "" + }); + while (inProcessAlignments[0]) { + var current = inProcessAlignments[0]; + var directions = this.tracebackGrid[current.pos[0]][current.pos[1]]; + if (directions[0]) { + inProcessAlignments.push({ + pos: [current.pos[0] - 1, current.pos[1] - 1], + seq1: this.sequence1[current.pos[0] - 1] + current.seq1, + seq2: this.sequence2[current.pos[1] - 1] + current.seq2 + }); + } + if (directions[1]) { + inProcessAlignments.push({ + pos: [current.pos[0] - 1, current.pos[1]], + seq1: this.sequence1[current.pos[0] - 1] + current.seq1, + seq2: "-" + current.seq2 + }); + } + if (directions[2]) { + inProcessAlignments.push({ + pos: [current.pos[0], current.pos[1] - 1], + seq1: "-" + current.seq1, + seq2: this.sequence2[current.pos[1] - 1] + current.seq2 + }); + } + if (current.pos[0] === 0 && current.pos[1] === 0) this.alignments.push({ + sequence1: current.seq1, + sequence2: current.seq2 + }); + inProcessAlignments.shift(); + } + return this.alignments; + }, "alignmentTraceback") + // Helper Functions + }, { + key: "getAllIndexes", + value: /* @__PURE__ */ __name(function getAllIndexes(arr, val) { + var indexes = [], i2 = -1; + while ((i2 = arr.indexOf(val, i2 + 1)) !== -1) { + indexes.push(i2); + } + return indexes; + }, "getAllIndexes") + }, { + key: "arrayAllMaxIndexes", + value: /* @__PURE__ */ __name(function arrayAllMaxIndexes(array4) { + return this.getAllIndexes(array4, Math.max.apply(null, array4)); + }, "arrayAllMaxIndexes") + }]); + return NeedlemanWunsch2; + }(); + module3.exports = NeedlemanWunsch; + }, + /* 28 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + var layoutBase = /* @__PURE__ */ __name(function layoutBase2() { + return; + }, "layoutBase"); + layoutBase.FDLayout = __webpack_require__(18); + layoutBase.FDLayoutConstants = __webpack_require__(4); + layoutBase.FDLayoutEdge = __webpack_require__(19); + layoutBase.FDLayoutNode = __webpack_require__(20); + layoutBase.DimensionD = __webpack_require__(21); + layoutBase.HashMap = __webpack_require__(22); + layoutBase.HashSet = __webpack_require__(23); + layoutBase.IGeometry = __webpack_require__(8); + layoutBase.IMath = __webpack_require__(9); + layoutBase.Integer = __webpack_require__(10); + layoutBase.Point = __webpack_require__(12); + layoutBase.PointD = __webpack_require__(5); + layoutBase.RandomSeed = __webpack_require__(16); + layoutBase.RectangleD = __webpack_require__(13); + layoutBase.Transform = __webpack_require__(17); + layoutBase.UniqueIDGeneretor = __webpack_require__(14); + layoutBase.Quicksort = __webpack_require__(25); + layoutBase.LinkedList = __webpack_require__(11); + layoutBase.LGraphObject = __webpack_require__(2); + layoutBase.LGraph = __webpack_require__(6); + layoutBase.LEdge = __webpack_require__(1); + layoutBase.LGraphManager = __webpack_require__(7); + layoutBase.LNode = __webpack_require__(3); + layoutBase.Layout = __webpack_require__(15); + layoutBase.LayoutConstants = __webpack_require__(0); + layoutBase.NeedlemanWunsch = __webpack_require__(27); + layoutBase.Matrix = __webpack_require__(24); + layoutBase.SVD = __webpack_require__(26); + module3.exports = layoutBase; + }, + /* 29 */ + /***/ + function(module3, exports3, __webpack_require__) { + "use strict"; + function Emitter3() { + this.listeners = []; + } + __name(Emitter3, "Emitter"); + var p3 = Emitter3.prototype; + p3.addListener = function(event3, callback) { + this.listeners.push({ + event: event3, + callback + }); + }; + p3.removeListener = function(event3, callback) { + for (var i2 = this.listeners.length; i2 >= 0; i2--) { + var l2 = this.listeners[i2]; + if (l2.event === event3 && l2.callback === callback) { + this.listeners.splice(i2, 1); + } + } + }; + p3.emit = function(event3, data5) { + for (var i2 = 0; i2 < this.listeners.length; i2++) { + var l2 = this.listeners[i2]; + if (event3 === l2.event) { + l2.callback(data5); + } + } + }; + module3.exports = Emitter3; + } + /******/ + ]) + ); + }); + } + }); + + // ../../node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js + var require_cose_base2 = __commonJS({ + "../../node_modules/.pnpm/cose-base@2.2.0/node_modules/cose-base/cose-base.js"(exports2, module2) { + "use strict"; + (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) { + if (typeof exports2 === "object" && typeof module2 === "object") + module2.exports = factory(require_layout_base2()); + else if (typeof define === "function" && define.amd) + define(["layout-base"], factory); + else if (typeof exports2 === "object") + exports2["coseBase"] = factory(require_layout_base2()); + else + root4["coseBase"] = factory(root4["layoutBase"]); + }, "webpackUniversalModuleDefinition"))(exports2, function(__WEBPACK_EXTERNAL_MODULE__551__) { + return ( + /******/ + (() => { + "use strict"; + var __webpack_modules__ = { + /***/ + 45: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var coseBase = {}; + coseBase.layoutBase = __webpack_require__2(551); + coseBase.CoSEConstants = __webpack_require__2(806); + coseBase.CoSEEdge = __webpack_require__2(767); + coseBase.CoSEGraph = __webpack_require__2(880); + coseBase.CoSEGraphManager = __webpack_require__2(578); + coseBase.CoSELayout = __webpack_require__2(765); + coseBase.CoSENode = __webpack_require__2(991); + coseBase.ConstraintHandler = __webpack_require__2(902); + module3.exports = coseBase; + } + ), + /***/ + 806: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var FDLayoutConstants = __webpack_require__2(551).FDLayoutConstants; + function CoSEConstants() { + } + __name(CoSEConstants, "CoSEConstants"); + for (var prop in FDLayoutConstants) { + CoSEConstants[prop] = FDLayoutConstants[prop]; + } + CoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false; + CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH; + CoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60; + CoSEConstants.TILE = true; + CoSEConstants.TILING_PADDING_VERTICAL = 10; + CoSEConstants.TILING_PADDING_HORIZONTAL = 10; + CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true; + CoSEConstants.ENFORCE_CONSTRAINTS = true; + CoSEConstants.APPLY_LAYOUT = true; + CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS = true; + CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = true; + CoSEConstants.PURE_INCREMENTAL = CoSEConstants.DEFAULT_INCREMENTAL; + module3.exports = CoSEConstants; + } + ), + /***/ + 767: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var FDLayoutEdge = __webpack_require__2(551).FDLayoutEdge; + function CoSEEdge(source, target, vEdge) { + FDLayoutEdge.call(this, source, target, vEdge); + } + __name(CoSEEdge, "CoSEEdge"); + CoSEEdge.prototype = Object.create(FDLayoutEdge.prototype); + for (var prop in FDLayoutEdge) { + CoSEEdge[prop] = FDLayoutEdge[prop]; + } + module3.exports = CoSEEdge; + } + ), + /***/ + 880: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var LGraph = __webpack_require__2(551).LGraph; + function CoSEGraph(parent4, graphMgr, vGraph) { + LGraph.call(this, parent4, graphMgr, vGraph); + } + __name(CoSEGraph, "CoSEGraph"); + CoSEGraph.prototype = Object.create(LGraph.prototype); + for (var prop in LGraph) { + CoSEGraph[prop] = LGraph[prop]; + } + module3.exports = CoSEGraph; + } + ), + /***/ + 578: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var LGraphManager = __webpack_require__2(551).LGraphManager; + function CoSEGraphManager(layout6) { + LGraphManager.call(this, layout6); + } + __name(CoSEGraphManager, "CoSEGraphManager"); + CoSEGraphManager.prototype = Object.create(LGraphManager.prototype); + for (var prop in LGraphManager) { + CoSEGraphManager[prop] = LGraphManager[prop]; + } + module3.exports = CoSEGraphManager; + } + ), + /***/ + 765: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var FDLayout = __webpack_require__2(551).FDLayout; + var CoSEGraphManager = __webpack_require__2(578); + var CoSEGraph = __webpack_require__2(880); + var CoSENode = __webpack_require__2(991); + var CoSEEdge = __webpack_require__2(767); + var CoSEConstants = __webpack_require__2(806); + var ConstraintHandler = __webpack_require__2(902); + var FDLayoutConstants = __webpack_require__2(551).FDLayoutConstants; + var LayoutConstants = __webpack_require__2(551).LayoutConstants; + var Point3 = __webpack_require__2(551).Point; + var PointD = __webpack_require__2(551).PointD; + var DimensionD2 = __webpack_require__2(551).DimensionD; + var Layout2 = __webpack_require__2(551).Layout; + var Integer = __webpack_require__2(551).Integer; + var IGeometry = __webpack_require__2(551).IGeometry; + var LGraph = __webpack_require__2(551).LGraph; + var Transform2 = __webpack_require__2(551).Transform; + var LinkedList = __webpack_require__2(551).LinkedList; + function CoSELayout() { + FDLayout.call(this); + this.toBeTiled = {}; + this.constraints = {}; + } + __name(CoSELayout, "CoSELayout"); + CoSELayout.prototype = Object.create(FDLayout.prototype); + for (var prop in FDLayout) { + CoSELayout[prop] = FDLayout[prop]; + } + CoSELayout.prototype.newGraphManager = function() { + var gm = new CoSEGraphManager(this); + this.graphManager = gm; + return gm; + }; + CoSELayout.prototype.newGraph = function(vGraph) { + return new CoSEGraph(null, this.graphManager, vGraph); + }; + CoSELayout.prototype.newNode = function(vNode) { + return new CoSENode(this.graphManager, vNode); + }; + CoSELayout.prototype.newEdge = function(vEdge) { + return new CoSEEdge(null, null, vEdge); + }; + CoSELayout.prototype.initParameters = function() { + FDLayout.prototype.initParameters.call(this, arguments); + if (!this.isSubLayout) { + if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) { + this.idealEdgeLength = 10; + } else { + this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH; + } + this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION; + this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH; + this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH; + this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR; + this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR; + this.prunedNodesAll = []; + this.growTreeIterations = 0; + this.afterGrowthIterations = 0; + this.isTreeGrowing = false; + this.isGrowthFinished = false; + } + }; + CoSELayout.prototype.initSpringEmbedder = function() { + FDLayout.prototype.initSpringEmbedder.call(this); + this.coolingCycle = 0; + this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD; + this.finalTemperature = 0.04; + this.coolingAdjuster = 1; + }; + CoSELayout.prototype.layout = function() { + var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED; + if (createBendsAsNeeded) { + this.createBendpoints(); + this.graphManager.resetAllEdges(); + } + this.level = 0; + return this.classicLayout(); + }; + CoSELayout.prototype.classicLayout = function() { + this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(); + this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity); + this.calcNoOfChildrenForAllNodes(); + this.graphManager.calcLowestCommonAncestors(); + this.graphManager.calcInclusionTreeDepths(); + this.graphManager.getRoot().calcEstimatedSize(); + this.calcIdealEdgeLengths(); + if (!this.incremental) { + var forest = this.getFlatForest(); + if (forest.length > 0) { + this.positionNodesRadially(forest); + } else { + this.reduceTrees(); + this.graphManager.resetAllNodesToApplyGravitation(); + var allNodes = new Set(this.getAllNodes()); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); + }); + this.graphManager.setAllNodesToApplyGravitation(intersection3); + this.positionNodesRandomly(); + } + } else { + if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) { + this.reduceTrees(); + this.graphManager.resetAllNodesToApplyGravitation(); + var allNodes = new Set(this.getAllNodes()); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); + }); + this.graphManager.setAllNodesToApplyGravitation(intersection3); + } + } + if (Object.keys(this.constraints).length > 0) { + ConstraintHandler.handleConstraints(this); + this.initConstraintVariables(); + } + this.initSpringEmbedder(); + if (CoSEConstants.APPLY_LAYOUT) { + this.runSpringEmbedder(); + } + return true; + }; + CoSELayout.prototype.tick = function() { + this.totalIterations++; + if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) { + if (this.prunedNodesAll.length > 0) { + this.isTreeGrowing = true; + } else { + return true; + } + } + if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) { + if (this.isConverged()) { + if (this.prunedNodesAll.length > 0) { + this.isTreeGrowing = true; + } else { + return true; + } + } + this.coolingCycle++; + if (this.layoutQuality == 0) { + this.coolingAdjuster = this.coolingCycle; + } else if (this.layoutQuality == 1) { + this.coolingAdjuster = this.coolingCycle / 3; + } + this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(this.coolingCycle, Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature); + this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor)); + } + if (this.isTreeGrowing) { + if (this.growTreeIterations % 10 == 0) { + if (this.prunedNodesAll.length > 0) { + this.graphManager.updateBounds(); + this.updateGrid(); + this.growTree(this.prunedNodesAll); + this.graphManager.resetAllNodesToApplyGravitation(); + var allNodes = new Set(this.getAllNodes()); + var intersection3 = this.nodesWithGravity.filter(function(x5) { + return allNodes.has(x5); + }); + this.graphManager.setAllNodesToApplyGravitation(intersection3); + this.graphManager.updateBounds(); + this.updateGrid(); + if (CoSEConstants.PURE_INCREMENTAL) this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2; + else this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL; + } else { + this.isTreeGrowing = false; + this.isGrowthFinished = true; + } + } + this.growTreeIterations++; + } + if (this.isGrowthFinished) { + if (this.isConverged()) { + return true; + } + if (this.afterGrowthIterations % 10 == 0) { + this.graphManager.updateBounds(); + this.updateGrid(); + } + if (CoSEConstants.PURE_INCREMENTAL) this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100); + else this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100); + this.afterGrowthIterations++; + } + var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished; + var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished; + this.totalDisplacement = 0; + this.graphManager.updateBounds(); + this.calcSpringForces(); + this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate); + this.calcGravitationalForces(); + this.moveNodes(); + this.animate(); + return false; + }; + CoSELayout.prototype.getPositionsData = function() { + var allNodes = this.graphManager.getAllNodes(); + var pData = {}; + for (var i2 = 0; i2 < allNodes.length; i2++) { + var rect4 = allNodes[i2].rect; + var id27 = allNodes[i2].id; + pData[id27] = { + id: id27, + x: rect4.getCenterX(), + y: rect4.getCenterY(), + w: rect4.width, + h: rect4.height + }; + } + return pData; + }; + CoSELayout.prototype.runSpringEmbedder = function() { + this.initialAnimationPeriod = 25; + this.animationPeriod = this.initialAnimationPeriod; + var layoutEnded = false; + if (FDLayoutConstants.ANIMATE === "during") { + this.emit("layoutstarted"); + } else { + while (!layoutEnded) { + layoutEnded = this.tick(); + } + this.graphManager.updateBounds(); + } + }; + CoSELayout.prototype.moveNodes = function() { + var lNodes = this.getAllNodes(); + var node2; + for (var i2 = 0; i2 < lNodes.length; i2++) { + node2 = lNodes[i2]; + node2.calculateDisplacement(); + } + if (Object.keys(this.constraints).length > 0) { + this.updateDisplacements(); + } + for (var i2 = 0; i2 < lNodes.length; i2++) { + node2 = lNodes[i2]; + node2.move(); + } + }; + CoSELayout.prototype.initConstraintVariables = function() { + var self2 = this; + this.idToNodeMap = /* @__PURE__ */ new Map(); + this.fixedNodeSet = /* @__PURE__ */ new Set(); + var allNodes = this.graphManager.getAllNodes(); + for (var i2 = 0; i2 < allNodes.length; i2++) { + var node2 = allNodes[i2]; + this.idToNodeMap.set(node2.id, node2); + } + var calculateCompoundWeight = /* @__PURE__ */ __name(function calculateCompoundWeight2(compoundNode) { + var nodes6 = compoundNode.getChild().getNodes(); + var node3; + var fixedNodeWeight2 = 0; + for (var i3 = 0; i3 < nodes6.length; i3++) { + node3 = nodes6[i3]; + if (node3.getChild() == null) { + if (self2.fixedNodeSet.has(node3.id)) { + fixedNodeWeight2 += 100; + } + } else { + fixedNodeWeight2 += calculateCompoundWeight2(node3); + } + } + return fixedNodeWeight2; + }, "calculateCompoundWeight"); + if (this.constraints.fixedNodeConstraint) { + this.constraints.fixedNodeConstraint.forEach(function(nodeData2) { + self2.fixedNodeSet.add(nodeData2.nodeId); + }); + var allNodes = this.graphManager.getAllNodes(); + var node2; + for (var i2 = 0; i2 < allNodes.length; i2++) { + node2 = allNodes[i2]; + if (node2.getChild() != null) { + var fixedNodeWeight = calculateCompoundWeight(node2); + if (fixedNodeWeight > 0) { + node2.fixedNodeWeight = fixedNodeWeight; + } + } + } + } + if (this.constraints.relativePlacementConstraint) { + var nodeToDummyForVerticalAlignment = /* @__PURE__ */ new Map(); + var nodeToDummyForHorizontalAlignment = /* @__PURE__ */ new Map(); + this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(); + this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(); + this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set(); + this.fixedNodesOnVertical = /* @__PURE__ */ new Set(); + this.fixedNodeSet.forEach(function(nodeId) { + self2.fixedNodesOnHorizontal.add(nodeId); + self2.fixedNodesOnVertical.add(nodeId); + }); + if (this.constraints.alignmentConstraint) { + if (this.constraints.alignmentConstraint.vertical) { + var verticalAlignment2 = this.constraints.alignmentConstraint.vertical; + for (var i2 = 0; i2 < verticalAlignment2.length; i2++) { + this.dummyToNodeForVerticalAlignment.set("dummy" + i2, []); + verticalAlignment2[i2].forEach(function(nodeId) { + nodeToDummyForVerticalAlignment.set(nodeId, "dummy" + i2); + self2.dummyToNodeForVerticalAlignment.get("dummy" + i2).push(nodeId); + if (self2.fixedNodeSet.has(nodeId)) { + self2.fixedNodesOnHorizontal.add("dummy" + i2); + } + }); + } + } + if (this.constraints.alignmentConstraint.horizontal) { + var horizontalAlignment = this.constraints.alignmentConstraint.horizontal; + for (var i2 = 0; i2 < horizontalAlignment.length; i2++) { + this.dummyToNodeForHorizontalAlignment.set("dummy" + i2, []); + horizontalAlignment[i2].forEach(function(nodeId) { + nodeToDummyForHorizontalAlignment.set(nodeId, "dummy" + i2); + self2.dummyToNodeForHorizontalAlignment.get("dummy" + i2).push(nodeId); + if (self2.fixedNodeSet.has(nodeId)) { + self2.fixedNodesOnVertical.add("dummy" + i2); + } + }); + } + } + } + if (CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS) { + this.shuffle = function(array4) { + var j2, x5, i3; + for (i3 = array4.length - 1; i3 >= 2 * array4.length / 3; i3--) { + j2 = Math.floor(Math.random() * (i3 + 1)); + x5 = array4[i3]; + array4[i3] = array4[j2]; + array4[j2] = x5; + } + return array4; + }; + this.nodesInRelativeHorizontal = []; + this.nodesInRelativeVertical = []; + this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map(); + this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map(); + this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map(); + this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map(); + this.constraints.relativePlacementConstraint.forEach(function(constraint) { + if (constraint.left) { + var nodeIdLeft = nodeToDummyForVerticalAlignment.has(constraint.left) ? nodeToDummyForVerticalAlignment.get(constraint.left) : constraint.left; + var nodeIdRight = nodeToDummyForVerticalAlignment.has(constraint.right) ? nodeToDummyForVerticalAlignment.get(constraint.right) : constraint.right; + if (!self2.nodesInRelativeHorizontal.includes(nodeIdLeft)) { + self2.nodesInRelativeHorizontal.push(nodeIdLeft); + self2.nodeToRelativeConstraintMapHorizontal.set(nodeIdLeft, []); + if (self2.dummyToNodeForVerticalAlignment.has(nodeIdLeft)) { + self2.nodeToTempPositionMapHorizontal.set(nodeIdLeft, self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeIdLeft)[0]).getCenterX()); + } else { + self2.nodeToTempPositionMapHorizontal.set(nodeIdLeft, self2.idToNodeMap.get(nodeIdLeft).getCenterX()); + } + } + if (!self2.nodesInRelativeHorizontal.includes(nodeIdRight)) { + self2.nodesInRelativeHorizontal.push(nodeIdRight); + self2.nodeToRelativeConstraintMapHorizontal.set(nodeIdRight, []); + if (self2.dummyToNodeForVerticalAlignment.has(nodeIdRight)) { + self2.nodeToTempPositionMapHorizontal.set(nodeIdRight, self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeIdRight)[0]).getCenterX()); + } else { + self2.nodeToTempPositionMapHorizontal.set(nodeIdRight, self2.idToNodeMap.get(nodeIdRight).getCenterX()); + } + } + self2.nodeToRelativeConstraintMapHorizontal.get(nodeIdLeft).push({ right: nodeIdRight, gap: constraint.gap }); + self2.nodeToRelativeConstraintMapHorizontal.get(nodeIdRight).push({ left: nodeIdLeft, gap: constraint.gap }); + } else { + var nodeIdTop = nodeToDummyForHorizontalAlignment.has(constraint.top) ? nodeToDummyForHorizontalAlignment.get(constraint.top) : constraint.top; + var nodeIdBottom = nodeToDummyForHorizontalAlignment.has(constraint.bottom) ? nodeToDummyForHorizontalAlignment.get(constraint.bottom) : constraint.bottom; + if (!self2.nodesInRelativeVertical.includes(nodeIdTop)) { + self2.nodesInRelativeVertical.push(nodeIdTop); + self2.nodeToRelativeConstraintMapVertical.set(nodeIdTop, []); + if (self2.dummyToNodeForHorizontalAlignment.has(nodeIdTop)) { + self2.nodeToTempPositionMapVertical.set(nodeIdTop, self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeIdTop)[0]).getCenterY()); + } else { + self2.nodeToTempPositionMapVertical.set(nodeIdTop, self2.idToNodeMap.get(nodeIdTop).getCenterY()); + } + } + if (!self2.nodesInRelativeVertical.includes(nodeIdBottom)) { + self2.nodesInRelativeVertical.push(nodeIdBottom); + self2.nodeToRelativeConstraintMapVertical.set(nodeIdBottom, []); + if (self2.dummyToNodeForHorizontalAlignment.has(nodeIdBottom)) { + self2.nodeToTempPositionMapVertical.set(nodeIdBottom, self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeIdBottom)[0]).getCenterY()); + } else { + self2.nodeToTempPositionMapVertical.set(nodeIdBottom, self2.idToNodeMap.get(nodeIdBottom).getCenterY()); + } + } + self2.nodeToRelativeConstraintMapVertical.get(nodeIdTop).push({ bottom: nodeIdBottom, gap: constraint.gap }); + self2.nodeToRelativeConstraintMapVertical.get(nodeIdBottom).push({ top: nodeIdTop, gap: constraint.gap }); + } + }); + } else { + var subGraphOnHorizontal = /* @__PURE__ */ new Map(); + var subGraphOnVertical = /* @__PURE__ */ new Map(); + this.constraints.relativePlacementConstraint.forEach(function(constraint) { + if (constraint.left) { + var left3 = nodeToDummyForVerticalAlignment.has(constraint.left) ? nodeToDummyForVerticalAlignment.get(constraint.left) : constraint.left; + var right3 = nodeToDummyForVerticalAlignment.has(constraint.right) ? nodeToDummyForVerticalAlignment.get(constraint.right) : constraint.right; + if (subGraphOnHorizontal.has(left3)) { + subGraphOnHorizontal.get(left3).push(right3); + } else { + subGraphOnHorizontal.set(left3, [right3]); + } + if (subGraphOnHorizontal.has(right3)) { + subGraphOnHorizontal.get(right3).push(left3); + } else { + subGraphOnHorizontal.set(right3, [left3]); + } + } else { + var top2 = nodeToDummyForHorizontalAlignment.has(constraint.top) ? nodeToDummyForHorizontalAlignment.get(constraint.top) : constraint.top; + var bottom2 = nodeToDummyForHorizontalAlignment.has(constraint.bottom) ? nodeToDummyForHorizontalAlignment.get(constraint.bottom) : constraint.bottom; + if (subGraphOnVertical.has(top2)) { + subGraphOnVertical.get(top2).push(bottom2); + } else { + subGraphOnVertical.set(top2, [bottom2]); + } + if (subGraphOnVertical.has(bottom2)) { + subGraphOnVertical.get(bottom2).push(top2); + } else { + subGraphOnVertical.set(bottom2, [top2]); + } + } + }); + var constructComponents = /* @__PURE__ */ __name(function constructComponents2(graph, fixedNodes) { + var components3 = []; + var isFixed = []; + var queue = new LinkedList(); + var visited = /* @__PURE__ */ new Set(); + var count = 0; + graph.forEach(function(value2, key) { + if (!visited.has(key)) { + components3[count] = []; + isFixed[count] = false; + var currentNode = key; + queue.push(currentNode); + visited.add(currentNode); + components3[count].push(currentNode); + while (queue.length != 0) { + currentNode = queue.shift(); + if (fixedNodes.has(currentNode)) { + isFixed[count] = true; + } + var neighbors = graph.get(currentNode); + neighbors.forEach(function(neighbor) { + if (!visited.has(neighbor)) { + queue.push(neighbor); + visited.add(neighbor); + components3[count].push(neighbor); + } + }); + } + count++; + } + }); + return { components: components3, isFixed }; + }, "constructComponents"); + var resultOnHorizontal = constructComponents(subGraphOnHorizontal, self2.fixedNodesOnHorizontal); + this.componentsOnHorizontal = resultOnHorizontal.components; + this.fixedComponentsOnHorizontal = resultOnHorizontal.isFixed; + var resultOnVertical = constructComponents(subGraphOnVertical, self2.fixedNodesOnVertical); + this.componentsOnVertical = resultOnVertical.components; + this.fixedComponentsOnVertical = resultOnVertical.isFixed; + } + } + }; + CoSELayout.prototype.updateDisplacements = function() { + var self2 = this; + if (this.constraints.fixedNodeConstraint) { + this.constraints.fixedNodeConstraint.forEach(function(nodeData2) { + var fixedNode = self2.idToNodeMap.get(nodeData2.nodeId); + fixedNode.displacementX = 0; + fixedNode.displacementY = 0; + }); + } + if (this.constraints.alignmentConstraint) { + if (this.constraints.alignmentConstraint.vertical) { + var allVerticalAlignments = this.constraints.alignmentConstraint.vertical; + for (var i2 = 0; i2 < allVerticalAlignments.length; i2++) { + var totalDisplacementX = 0; + for (var j2 = 0; j2 < allVerticalAlignments[i2].length; j2++) { + if (this.fixedNodeSet.has(allVerticalAlignments[i2][j2])) { + totalDisplacementX = 0; + break; + } + totalDisplacementX += this.idToNodeMap.get(allVerticalAlignments[i2][j2]).displacementX; + } + var averageDisplacementX = totalDisplacementX / allVerticalAlignments[i2].length; + for (var j2 = 0; j2 < allVerticalAlignments[i2].length; j2++) { + this.idToNodeMap.get(allVerticalAlignments[i2][j2]).displacementX = averageDisplacementX; + } + } + } + if (this.constraints.alignmentConstraint.horizontal) { + var allHorizontalAlignments = this.constraints.alignmentConstraint.horizontal; + for (var i2 = 0; i2 < allHorizontalAlignments.length; i2++) { + var totalDisplacementY = 0; + for (var j2 = 0; j2 < allHorizontalAlignments[i2].length; j2++) { + if (this.fixedNodeSet.has(allHorizontalAlignments[i2][j2])) { + totalDisplacementY = 0; + break; + } + totalDisplacementY += this.idToNodeMap.get(allHorizontalAlignments[i2][j2]).displacementY; + } + var averageDisplacementY = totalDisplacementY / allHorizontalAlignments[i2].length; + for (var j2 = 0; j2 < allHorizontalAlignments[i2].length; j2++) { + this.idToNodeMap.get(allHorizontalAlignments[i2][j2]).displacementY = averageDisplacementY; + } + } + } + } + if (this.constraints.relativePlacementConstraint) { + if (CoSEConstants.RELAX_MOVEMENT_ON_CONSTRAINTS) { + if (this.totalIterations % 10 == 0) { + this.shuffle(this.nodesInRelativeHorizontal); + this.shuffle(this.nodesInRelativeVertical); + } + this.nodesInRelativeHorizontal.forEach(function(nodeId) { + if (!self2.fixedNodesOnHorizontal.has(nodeId)) { + var displacement = 0; + if (self2.dummyToNodeForVerticalAlignment.has(nodeId)) { + displacement = self2.idToNodeMap.get(self2.dummyToNodeForVerticalAlignment.get(nodeId)[0]).displacementX; + } else { + displacement = self2.idToNodeMap.get(nodeId).displacementX; + } + self2.nodeToRelativeConstraintMapHorizontal.get(nodeId).forEach(function(constraint) { + if (constraint.right) { + var diff2 = self2.nodeToTempPositionMapHorizontal.get(constraint.right) - self2.nodeToTempPositionMapHorizontal.get(nodeId) - displacement; + if (diff2 < constraint.gap) { + displacement -= constraint.gap - diff2; + } + } else { + var diff2 = self2.nodeToTempPositionMapHorizontal.get(nodeId) - self2.nodeToTempPositionMapHorizontal.get(constraint.left) + displacement; + if (diff2 < constraint.gap) { + displacement += constraint.gap - diff2; + } + } + }); + self2.nodeToTempPositionMapHorizontal.set(nodeId, self2.nodeToTempPositionMapHorizontal.get(nodeId) + displacement); + if (self2.dummyToNodeForVerticalAlignment.has(nodeId)) { + self2.dummyToNodeForVerticalAlignment.get(nodeId).forEach(function(nodeId2) { + self2.idToNodeMap.get(nodeId2).displacementX = displacement; + }); + } else { + self2.idToNodeMap.get(nodeId).displacementX = displacement; + } + } + }); + this.nodesInRelativeVertical.forEach(function(nodeId) { + if (!self2.fixedNodesOnHorizontal.has(nodeId)) { + var displacement = 0; + if (self2.dummyToNodeForHorizontalAlignment.has(nodeId)) { + displacement = self2.idToNodeMap.get(self2.dummyToNodeForHorizontalAlignment.get(nodeId)[0]).displacementY; + } else { + displacement = self2.idToNodeMap.get(nodeId).displacementY; + } + self2.nodeToRelativeConstraintMapVertical.get(nodeId).forEach(function(constraint) { + if (constraint.bottom) { + var diff2 = self2.nodeToTempPositionMapVertical.get(constraint.bottom) - self2.nodeToTempPositionMapVertical.get(nodeId) - displacement; + if (diff2 < constraint.gap) { + displacement -= constraint.gap - diff2; + } + } else { + var diff2 = self2.nodeToTempPositionMapVertical.get(nodeId) - self2.nodeToTempPositionMapVertical.get(constraint.top) + displacement; + if (diff2 < constraint.gap) { + displacement += constraint.gap - diff2; + } + } + }); + self2.nodeToTempPositionMapVertical.set(nodeId, self2.nodeToTempPositionMapVertical.get(nodeId) + displacement); + if (self2.dummyToNodeForHorizontalAlignment.has(nodeId)) { + self2.dummyToNodeForHorizontalAlignment.get(nodeId).forEach(function(nodeId2) { + self2.idToNodeMap.get(nodeId2).displacementY = displacement; + }); + } else { + self2.idToNodeMap.get(nodeId).displacementY = displacement; + } + } + }); + } else { + for (var i2 = 0; i2 < this.componentsOnHorizontal.length; i2++) { + var component2 = this.componentsOnHorizontal[i2]; + if (this.fixedComponentsOnHorizontal[i2]) { + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) { + this.dummyToNodeForVerticalAlignment.get(component2[j2]).forEach(function(nodeId) { + self2.idToNodeMap.get(nodeId).displacementX = 0; + }); + } else { + this.idToNodeMap.get(component2[j2]).displacementX = 0; + } + } + } else { + var sum2 = 0; + var count = 0; + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) { + var actualNodes = this.dummyToNodeForVerticalAlignment.get(component2[j2]); + sum2 += actualNodes.length * this.idToNodeMap.get(actualNodes[0]).displacementX; + count += actualNodes.length; + } else { + sum2 += this.idToNodeMap.get(component2[j2]).displacementX; + count++; + } + } + var averageDisplacement = sum2 / count; + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForVerticalAlignment.has(component2[j2])) { + this.dummyToNodeForVerticalAlignment.get(component2[j2]).forEach(function(nodeId) { + self2.idToNodeMap.get(nodeId).displacementX = averageDisplacement; + }); + } else { + this.idToNodeMap.get(component2[j2]).displacementX = averageDisplacement; + } + } + } + } + for (var i2 = 0; i2 < this.componentsOnVertical.length; i2++) { + var component2 = this.componentsOnVertical[i2]; + if (this.fixedComponentsOnVertical[i2]) { + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) { + this.dummyToNodeForHorizontalAlignment.get(component2[j2]).forEach(function(nodeId) { + self2.idToNodeMap.get(nodeId).displacementY = 0; + }); + } else { + this.idToNodeMap.get(component2[j2]).displacementY = 0; + } + } + } else { + var sum2 = 0; + var count = 0; + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) { + var actualNodes = this.dummyToNodeForHorizontalAlignment.get(component2[j2]); + sum2 += actualNodes.length * this.idToNodeMap.get(actualNodes[0]).displacementY; + count += actualNodes.length; + } else { + sum2 += this.idToNodeMap.get(component2[j2]).displacementY; + count++; + } + } + var averageDisplacement = sum2 / count; + for (var j2 = 0; j2 < component2.length; j2++) { + if (this.dummyToNodeForHorizontalAlignment.has(component2[j2])) { + this.dummyToNodeForHorizontalAlignment.get(component2[j2]).forEach(function(nodeId) { + self2.idToNodeMap.get(nodeId).displacementY = averageDisplacement; + }); + } else { + this.idToNodeMap.get(component2[j2]).displacementY = averageDisplacement; + } + } + } + } + } + } + }; + CoSELayout.prototype.calculateNodesToApplyGravitationTo = function() { + var nodeList = []; + var graph; + var graphs = this.graphManager.getGraphs(); + var size5 = graphs.length; + var i2; + for (i2 = 0; i2 < size5; i2++) { + graph = graphs[i2]; + graph.updateConnected(); + if (!graph.isConnected) { + nodeList = nodeList.concat(graph.getNodes()); + } + } + return nodeList; + }; + CoSELayout.prototype.createBendpoints = function() { + var edges5 = []; + edges5 = edges5.concat(this.graphManager.getAllEdges()); + var visited = /* @__PURE__ */ new Set(); + var i2; + for (i2 = 0; i2 < edges5.length; i2++) { + var edge = edges5[i2]; + if (!visited.has(edge)) { + var source = edge.getSource(); + var target = edge.getTarget(); + if (source == target) { + edge.getBendpoints().push(new PointD()); + edge.getBendpoints().push(new PointD()); + this.createDummyNodesForBendpoints(edge); + visited.add(edge); + } else { + var edgeList2 = []; + edgeList2 = edgeList2.concat(source.getEdgeListToNode(target)); + edgeList2 = edgeList2.concat(target.getEdgeListToNode(source)); + if (!visited.has(edgeList2[0])) { + if (edgeList2.length > 1) { + var k2; + for (k2 = 0; k2 < edgeList2.length; k2++) { + var multiEdge = edgeList2[k2]; + multiEdge.getBendpoints().push(new PointD()); + this.createDummyNodesForBendpoints(multiEdge); + } + } + edgeList2.forEach(function(edge2) { + visited.add(edge2); + }); + } + } + } + if (visited.size == edges5.length) { + break; + } + } + }; + CoSELayout.prototype.positionNodesRadially = function(forest) { + var currentStartingPoint = new Point3(0, 0); + var numberOfColumns = Math.ceil(Math.sqrt(forest.length)); + var height2 = 0; + var currentY = 0; + var currentX = 0; + var point8 = new PointD(0, 0); + for (var i2 = 0; i2 < forest.length; i2++) { + if (i2 % numberOfColumns == 0) { + currentX = 0; + currentY = height2; + if (i2 != 0) { + currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION; + } + height2 = 0; + } + var tree = forest[i2]; + var centerNode = Layout2.findCenterOfTree(tree); + currentStartingPoint.x = currentX; + currentStartingPoint.y = currentY; + point8 = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint); + if (point8.y > height2) { + height2 = Math.floor(point8.y); + } + currentX = Math.floor(point8.x + CoSEConstants.DEFAULT_COMPONENT_SEPERATION); + } + this.transform(new PointD(LayoutConstants.WORLD_CENTER_X - point8.x / 2, LayoutConstants.WORLD_CENTER_Y - point8.y / 2)); + }; + CoSELayout.radialLayout = function(tree, centerNode, startingPoint) { + var radialSep = Math.max(this.maxDiagonalInTree(tree), CoSEConstants.DEFAULT_RADIAL_SEPARATION); + CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep); + var bounds4 = LGraph.calculateBounds(tree); + var transform8 = new Transform2(); + transform8.setDeviceOrgX(bounds4.getMinX()); + transform8.setDeviceOrgY(bounds4.getMinY()); + transform8.setWorldOrgX(startingPoint.x); + transform8.setWorldOrgY(startingPoint.y); + for (var i2 = 0; i2 < tree.length; i2++) { + var node2 = tree[i2]; + node2.transform(transform8); + } + var bottomRight = new PointD(bounds4.getMaxX(), bounds4.getMaxY()); + return transform8.inverseTransformPoint(bottomRight); + }; + CoSELayout.branchRadialLayout = function(node2, parentOfNode, startAngle, endAngle, distance2, radialSeparation) { + var halfInterval = (endAngle - startAngle + 1) / 2; + if (halfInterval < 0) { + halfInterval += 180; + } + var nodeAngle = (halfInterval + startAngle) % 360; + var teta = nodeAngle * IGeometry.TWO_PI / 360; + var cos_teta = Math.cos(teta); + var x_ = distance2 * Math.cos(teta); + var y_ = distance2 * Math.sin(teta); + node2.setCenter(x_, y_); + var neighborEdges = []; + neighborEdges = neighborEdges.concat(node2.getEdges()); + var childCount = neighborEdges.length; + if (parentOfNode != null) { + childCount--; + } + var branchCount = 0; + var incEdgesCount = neighborEdges.length; + var startIndex; + var edges5 = node2.getEdgesBetween(parentOfNode); + while (edges5.length > 1) { + var temp = edges5[0]; + edges5.splice(0, 1); + var index = neighborEdges.indexOf(temp); + if (index >= 0) { + neighborEdges.splice(index, 1); + } + incEdgesCount--; + childCount--; + } + if (parentOfNode != null) { + startIndex = (neighborEdges.indexOf(edges5[0]) + 1) % incEdgesCount; + } else { + startIndex = 0; + } + var stepAngle = Math.abs(endAngle - startAngle) / childCount; + for (var i2 = startIndex; branchCount != childCount; i2 = ++i2 % incEdgesCount) { + var currentNeighbor = neighborEdges[i2].getOtherEnd(node2); + if (currentNeighbor == parentOfNode) { + continue; + } + var childStartAngle = (startAngle + branchCount * stepAngle) % 360; + var childEndAngle = (childStartAngle + stepAngle) % 360; + CoSELayout.branchRadialLayout(currentNeighbor, node2, childStartAngle, childEndAngle, distance2 + radialSeparation, radialSeparation); + branchCount++; + } + }; + CoSELayout.maxDiagonalInTree = function(tree) { + var maxDiagonal = Integer.MIN_VALUE; + for (var i2 = 0; i2 < tree.length; i2++) { + var node2 = tree[i2]; + var diagonal = node2.getDiagonal(); + if (diagonal > maxDiagonal) { + maxDiagonal = diagonal; + } + } + return maxDiagonal; + }; + CoSELayout.prototype.calcRepulsionRange = function() { + return 2 * (this.level + 1) * this.idealEdgeLength; + }; + CoSELayout.prototype.groupZeroDegreeMembers = function() { + var self2 = this; + var tempMemberGroups = {}; + this.memberGroups = {}; + this.idToDummyNode = {}; + var zeroDegree = []; + var allNodes = this.graphManager.getAllNodes(); + for (var i2 = 0; i2 < allNodes.length; i2++) { + var node2 = allNodes[i2]; + var parent4 = node2.getParent(); + if (this.getNodeDegreeWithChildren(node2) === 0 && (parent4.id == void 0 || !this.getToBeTiled(parent4))) { + zeroDegree.push(node2); + } + } + for (var i2 = 0; i2 < zeroDegree.length; i2++) { + var node2 = zeroDegree[i2]; + var p_id = node2.getParent().id; + if (typeof tempMemberGroups[p_id] === "undefined") tempMemberGroups[p_id] = []; + tempMemberGroups[p_id] = tempMemberGroups[p_id].concat(node2); + } + Object.keys(tempMemberGroups).forEach(function(p_id2) { + if (tempMemberGroups[p_id2].length > 1) { + var dummyCompoundId = "DummyCompound_" + p_id2; + self2.memberGroups[dummyCompoundId] = tempMemberGroups[p_id2]; + var parent5 = tempMemberGroups[p_id2][0].getParent(); + var dummyCompound = new CoSENode(self2.graphManager); + dummyCompound.id = dummyCompoundId; + dummyCompound.paddingLeft = parent5.paddingLeft || 0; + dummyCompound.paddingRight = parent5.paddingRight || 0; + dummyCompound.paddingBottom = parent5.paddingBottom || 0; + dummyCompound.paddingTop = parent5.paddingTop || 0; + self2.idToDummyNode[dummyCompoundId] = dummyCompound; + var dummyParentGraph = self2.getGraphManager().add(self2.newGraph(), dummyCompound); + var parentGraph = parent5.getChild(); + parentGraph.add(dummyCompound); + for (var i3 = 0; i3 < tempMemberGroups[p_id2].length; i3++) { + var node3 = tempMemberGroups[p_id2][i3]; + parentGraph.remove(node3); + dummyParentGraph.add(node3); + } + } + }); + }; + CoSELayout.prototype.clearCompounds = function() { + var childGraphMap = {}; + var idToNode = {}; + this.performDFSOnCompounds(); + for (var i2 = 0; i2 < this.compoundOrder.length; i2++) { + idToNode[this.compoundOrder[i2].id] = this.compoundOrder[i2]; + childGraphMap[this.compoundOrder[i2].id] = [].concat(this.compoundOrder[i2].getChild().getNodes()); + this.graphManager.remove(this.compoundOrder[i2].getChild()); + this.compoundOrder[i2].child = null; + } + this.graphManager.resetAllNodes(); + this.tileCompoundMembers(childGraphMap, idToNode); + }; + CoSELayout.prototype.clearZeroDegreeMembers = function() { + var self2 = this; + var tiledZeroDegreePack = this.tiledZeroDegreePack = []; + Object.keys(this.memberGroups).forEach(function(id27) { + var compoundNode = self2.idToDummyNode[id27]; + tiledZeroDegreePack[id27] = self2.tileNodes(self2.memberGroups[id27], compoundNode.paddingLeft + compoundNode.paddingRight); + compoundNode.rect.width = tiledZeroDegreePack[id27].width; + compoundNode.rect.height = tiledZeroDegreePack[id27].height; + compoundNode.setCenter(tiledZeroDegreePack[id27].centerX, tiledZeroDegreePack[id27].centerY); + compoundNode.labelMarginLeft = 0; + compoundNode.labelMarginTop = 0; + if (CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS) { + var width3 = compoundNode.rect.width; + var height2 = compoundNode.rect.height; + if (compoundNode.labelWidth) { + if (compoundNode.labelPosHorizontal == "left") { + compoundNode.rect.x -= compoundNode.labelWidth; + compoundNode.setWidth(width3 + compoundNode.labelWidth); + compoundNode.labelMarginLeft = compoundNode.labelWidth; + } else if (compoundNode.labelPosHorizontal == "center" && compoundNode.labelWidth > width3) { + compoundNode.rect.x -= (compoundNode.labelWidth - width3) / 2; + compoundNode.setWidth(compoundNode.labelWidth); + compoundNode.labelMarginLeft = (compoundNode.labelWidth - width3) / 2; + } else if (compoundNode.labelPosHorizontal == "right") { + compoundNode.setWidth(width3 + compoundNode.labelWidth); + } + } + if (compoundNode.labelHeight) { + if (compoundNode.labelPosVertical == "top") { + compoundNode.rect.y -= compoundNode.labelHeight; + compoundNode.setHeight(height2 + compoundNode.labelHeight); + compoundNode.labelMarginTop = compoundNode.labelHeight; + } else if (compoundNode.labelPosVertical == "center" && compoundNode.labelHeight > height2) { + compoundNode.rect.y -= (compoundNode.labelHeight - height2) / 2; + compoundNode.setHeight(compoundNode.labelHeight); + compoundNode.labelMarginTop = (compoundNode.labelHeight - height2) / 2; + } else if (compoundNode.labelPosVertical == "bottom") { + compoundNode.setHeight(height2 + compoundNode.labelHeight); + } + } + } + }); + }; + CoSELayout.prototype.repopulateCompounds = function() { + for (var i2 = this.compoundOrder.length - 1; i2 >= 0; i2--) { + var lCompoundNode = this.compoundOrder[i2]; + var id27 = lCompoundNode.id; + var horizontalMargin = lCompoundNode.paddingLeft; + var verticalMargin = lCompoundNode.paddingTop; + var labelMarginLeft = lCompoundNode.labelMarginLeft; + var labelMarginTop = lCompoundNode.labelMarginTop; + this.adjustLocations(this.tiledMemberPack[id27], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin, labelMarginLeft, labelMarginTop); + } + }; + CoSELayout.prototype.repopulateZeroDegreeMembers = function() { + var self2 = this; + var tiledPack = this.tiledZeroDegreePack; + Object.keys(tiledPack).forEach(function(id27) { + var compoundNode = self2.idToDummyNode[id27]; + var horizontalMargin = compoundNode.paddingLeft; + var verticalMargin = compoundNode.paddingTop; + var labelMarginLeft = compoundNode.labelMarginLeft; + var labelMarginTop = compoundNode.labelMarginTop; + self2.adjustLocations(tiledPack[id27], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin, labelMarginLeft, labelMarginTop); + }); + }; + CoSELayout.prototype.getToBeTiled = function(node2) { + var id27 = node2.id; + if (this.toBeTiled[id27] != null) { + return this.toBeTiled[id27]; + } + var childGraph = node2.getChild(); + if (childGraph == null) { + this.toBeTiled[id27] = false; + return false; + } + var children2 = childGraph.getNodes(); + for (var i2 = 0; i2 < children2.length; i2++) { + var theChild = children2[i2]; + if (this.getNodeDegree(theChild) > 0) { + this.toBeTiled[id27] = false; + return false; + } + if (theChild.getChild() == null) { + this.toBeTiled[theChild.id] = false; + continue; + } + if (!this.getToBeTiled(theChild)) { + this.toBeTiled[id27] = false; + return false; + } + } + this.toBeTiled[id27] = true; + return true; + }; + CoSELayout.prototype.getNodeDegree = function(node2) { + var id27 = node2.id; + var edges5 = node2.getEdges(); + var degree = 0; + for (var i2 = 0; i2 < edges5.length; i2++) { + var edge = edges5[i2]; + if (edge.getSource().id !== edge.getTarget().id) { + degree = degree + 1; + } + } + return degree; + }; + CoSELayout.prototype.getNodeDegreeWithChildren = function(node2) { + var degree = this.getNodeDegree(node2); + if (node2.getChild() == null) { + return degree; + } + var children2 = node2.getChild().getNodes(); + for (var i2 = 0; i2 < children2.length; i2++) { + var child = children2[i2]; + degree += this.getNodeDegreeWithChildren(child); + } + return degree; + }; + CoSELayout.prototype.performDFSOnCompounds = function() { + this.compoundOrder = []; + this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes()); + }; + CoSELayout.prototype.fillCompexOrderByDFS = function(children2) { + for (var i2 = 0; i2 < children2.length; i2++) { + var child = children2[i2]; + if (child.getChild() != null) { + this.fillCompexOrderByDFS(child.getChild().getNodes()); + } + if (this.getToBeTiled(child)) { + this.compoundOrder.push(child); + } + } + }; + CoSELayout.prototype.adjustLocations = function(organization, x5, y5, compoundHorizontalMargin, compoundVerticalMargin, compoundLabelMarginLeft, compoundLabelMarginTop) { + x5 += compoundHorizontalMargin + compoundLabelMarginLeft; + y5 += compoundVerticalMargin + compoundLabelMarginTop; + var left3 = x5; + for (var i2 = 0; i2 < organization.rows.length; i2++) { + var row = organization.rows[i2]; + x5 = left3; + var maxHeight = 0; + for (var j2 = 0; j2 < row.length; j2++) { + var lnode = row[j2]; + lnode.rect.x = x5; + lnode.rect.y = y5; + x5 += lnode.rect.width + organization.horizontalPadding; + if (lnode.rect.height > maxHeight) maxHeight = lnode.rect.height; + } + y5 += maxHeight + organization.verticalPadding; + } + }; + CoSELayout.prototype.tileCompoundMembers = function(childGraphMap, idToNode) { + var self2 = this; + this.tiledMemberPack = []; + Object.keys(childGraphMap).forEach(function(id27) { + var compoundNode = idToNode[id27]; + self2.tiledMemberPack[id27] = self2.tileNodes(childGraphMap[id27], compoundNode.paddingLeft + compoundNode.paddingRight); + compoundNode.rect.width = self2.tiledMemberPack[id27].width; + compoundNode.rect.height = self2.tiledMemberPack[id27].height; + compoundNode.setCenter(self2.tiledMemberPack[id27].centerX, self2.tiledMemberPack[id27].centerY); + compoundNode.labelMarginLeft = 0; + compoundNode.labelMarginTop = 0; + if (CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS) { + var width3 = compoundNode.rect.width; + var height2 = compoundNode.rect.height; + if (compoundNode.labelWidth) { + if (compoundNode.labelPosHorizontal == "left") { + compoundNode.rect.x -= compoundNode.labelWidth; + compoundNode.setWidth(width3 + compoundNode.labelWidth); + compoundNode.labelMarginLeft = compoundNode.labelWidth; + } else if (compoundNode.labelPosHorizontal == "center" && compoundNode.labelWidth > width3) { + compoundNode.rect.x -= (compoundNode.labelWidth - width3) / 2; + compoundNode.setWidth(compoundNode.labelWidth); + compoundNode.labelMarginLeft = (compoundNode.labelWidth - width3) / 2; + } else if (compoundNode.labelPosHorizontal == "right") { + compoundNode.setWidth(width3 + compoundNode.labelWidth); + } + } + if (compoundNode.labelHeight) { + if (compoundNode.labelPosVertical == "top") { + compoundNode.rect.y -= compoundNode.labelHeight; + compoundNode.setHeight(height2 + compoundNode.labelHeight); + compoundNode.labelMarginTop = compoundNode.labelHeight; + } else if (compoundNode.labelPosVertical == "center" && compoundNode.labelHeight > height2) { + compoundNode.rect.y -= (compoundNode.labelHeight - height2) / 2; + compoundNode.setHeight(compoundNode.labelHeight); + compoundNode.labelMarginTop = (compoundNode.labelHeight - height2) / 2; + } else if (compoundNode.labelPosVertical == "bottom") { + compoundNode.setHeight(height2 + compoundNode.labelHeight); + } + } + } + }); + }; + CoSELayout.prototype.tileNodes = function(nodes6, minWidth) { + var horizontalOrg = this.tileNodesByFavoringDim(nodes6, minWidth, true); + var verticalOrg = this.tileNodesByFavoringDim(nodes6, minWidth, false); + var horizontalRatio = this.getOrgRatio(horizontalOrg); + var verticalRatio = this.getOrgRatio(verticalOrg); + var bestOrg; + if (verticalRatio < horizontalRatio) { + bestOrg = verticalOrg; + } else { + bestOrg = horizontalOrg; + } + return bestOrg; + }; + CoSELayout.prototype.getOrgRatio = function(organization) { + var width3 = organization.width; + var height2 = organization.height; + var ratio = width3 / height2; + if (ratio < 1) { + ratio = 1 / ratio; + } + return ratio; + }; + CoSELayout.prototype.calcIdealRowWidth = function(members, favorHorizontalDim) { + var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL; + var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL; + var membersSize = members.length; + var totalWidth = 0; + var totalHeight = 0; + var maxWidth = 0; + members.forEach(function(node2) { + totalWidth += node2.getWidth(); + totalHeight += node2.getHeight(); + if (node2.getWidth() > maxWidth) { + maxWidth = node2.getWidth(); + } + }); + var averageWidth = totalWidth / membersSize; + var averageHeight = totalHeight / membersSize; + var delta = Math.pow(verticalPadding - horizontalPadding, 2) + 4 * (averageWidth + horizontalPadding) * (averageHeight + verticalPadding) * membersSize; + var horizontalCountDouble = (horizontalPadding - verticalPadding + Math.sqrt(delta)) / (2 * (averageWidth + horizontalPadding)); + var horizontalCount; + if (favorHorizontalDim) { + horizontalCount = Math.ceil(horizontalCountDouble); + if (horizontalCount == horizontalCountDouble) { + horizontalCount++; + } + } else { + horizontalCount = Math.floor(horizontalCountDouble); + } + var idealWidth = horizontalCount * (averageWidth + horizontalPadding) - horizontalPadding; + if (maxWidth > idealWidth) { + idealWidth = maxWidth; + } + idealWidth += horizontalPadding * 2; + return idealWidth; + }; + CoSELayout.prototype.tileNodesByFavoringDim = function(nodes6, minWidth, favorHorizontalDim) { + var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL; + var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL; + var tilingCompareBy = CoSEConstants.TILING_COMPARE_BY; + var organization = { + rows: [], + rowWidth: [], + rowHeight: [], + width: 0, + height: minWidth, + // assume minHeight equals to minWidth + verticalPadding, + horizontalPadding, + centerX: 0, + centerY: 0 + }; + if (tilingCompareBy) { + organization.idealRowWidth = this.calcIdealRowWidth(nodes6, favorHorizontalDim); + } + var getNodeArea = /* @__PURE__ */ __name(function getNodeArea2(n2) { + return n2.rect.width * n2.rect.height; + }, "getNodeArea"); + var areaCompareFcn = /* @__PURE__ */ __name(function areaCompareFcn2(n1, n2) { + return getNodeArea(n2) - getNodeArea(n1); + }, "areaCompareFcn"); + nodes6.sort(function(n1, n2) { + var cmpBy = areaCompareFcn; + if (organization.idealRowWidth) { + cmpBy = tilingCompareBy; + return cmpBy(n1.id, n2.id); + } + return cmpBy(n1, n2); + }); + var sumCenterX = 0; + var sumCenterY = 0; + for (var i2 = 0; i2 < nodes6.length; i2++) { + var lNode = nodes6[i2]; + sumCenterX += lNode.getCenterX(); + sumCenterY += lNode.getCenterY(); + } + organization.centerX = sumCenterX / nodes6.length; + organization.centerY = sumCenterY / nodes6.length; + for (var i2 = 0; i2 < nodes6.length; i2++) { + var lNode = nodes6[i2]; + if (organization.rows.length == 0) { + this.insertNodeToRow(organization, lNode, 0, minWidth); + } else if (this.canAddHorizontal(organization, lNode.rect.width, lNode.rect.height)) { + var rowIndex = organization.rows.length - 1; + if (!organization.idealRowWidth) { + rowIndex = this.getShortestRowIndex(organization); + } + this.insertNodeToRow(organization, lNode, rowIndex, minWidth); + } else { + this.insertNodeToRow(organization, lNode, organization.rows.length, minWidth); + } + this.shiftToLastRow(organization); + } + return organization; + }; + CoSELayout.prototype.insertNodeToRow = function(organization, node2, rowIndex, minWidth) { + var minCompoundSize = minWidth; + if (rowIndex == organization.rows.length) { + var secondDimension = []; + organization.rows.push(secondDimension); + organization.rowWidth.push(minCompoundSize); + organization.rowHeight.push(0); + } + var w3 = organization.rowWidth[rowIndex] + node2.rect.width; + if (organization.rows[rowIndex].length > 0) { + w3 += organization.horizontalPadding; + } + organization.rowWidth[rowIndex] = w3; + if (organization.width < w3) { + organization.width = w3; + } + var h2 = node2.rect.height; + if (rowIndex > 0) h2 += organization.verticalPadding; + var extraHeight = 0; + if (h2 > organization.rowHeight[rowIndex]) { + extraHeight = organization.rowHeight[rowIndex]; + organization.rowHeight[rowIndex] = h2; + extraHeight = organization.rowHeight[rowIndex] - extraHeight; + } + organization.height += extraHeight; + organization.rows[rowIndex].push(node2); + }; + CoSELayout.prototype.getShortestRowIndex = function(organization) { + var r2 = -1; + var min9 = Number.MAX_VALUE; + for (var i2 = 0; i2 < organization.rows.length; i2++) { + if (organization.rowWidth[i2] < min9) { + r2 = i2; + min9 = organization.rowWidth[i2]; + } + } + return r2; + }; + CoSELayout.prototype.getLongestRowIndex = function(organization) { + var r2 = -1; + var max10 = Number.MIN_VALUE; + for (var i2 = 0; i2 < organization.rows.length; i2++) { + if (organization.rowWidth[i2] > max10) { + r2 = i2; + max10 = organization.rowWidth[i2]; + } + } + return r2; + }; + CoSELayout.prototype.canAddHorizontal = function(organization, extraWidth, extraHeight) { + if (organization.idealRowWidth) { + var lastRowIndex = organization.rows.length - 1; + var lastRowWidth = organization.rowWidth[lastRowIndex]; + return lastRowWidth + extraWidth + organization.horizontalPadding <= organization.idealRowWidth; + } + var sri = this.getShortestRowIndex(organization); + if (sri < 0) { + return true; + } + var min9 = organization.rowWidth[sri]; + if (min9 + organization.horizontalPadding + extraWidth <= organization.width) return true; + var hDiff = 0; + if (organization.rowHeight[sri] < extraHeight) { + if (sri > 0) hDiff = extraHeight + organization.verticalPadding - organization.rowHeight[sri]; + } + var add_to_row_ratio; + if (organization.width - min9 >= extraWidth + organization.horizontalPadding) { + add_to_row_ratio = (organization.height + hDiff) / (min9 + extraWidth + organization.horizontalPadding); + } else { + add_to_row_ratio = (organization.height + hDiff) / organization.width; + } + hDiff = extraHeight + organization.verticalPadding; + var add_new_row_ratio; + if (organization.width < extraWidth) { + add_new_row_ratio = (organization.height + hDiff) / extraWidth; + } else { + add_new_row_ratio = (organization.height + hDiff) / organization.width; + } + if (add_new_row_ratio < 1) add_new_row_ratio = 1 / add_new_row_ratio; + if (add_to_row_ratio < 1) add_to_row_ratio = 1 / add_to_row_ratio; + return add_to_row_ratio < add_new_row_ratio; + }; + CoSELayout.prototype.shiftToLastRow = function(organization) { + var longest = this.getLongestRowIndex(organization); + var last3 = organization.rowWidth.length - 1; + var row = organization.rows[longest]; + var node2 = row[row.length - 1]; + var diff2 = node2.width + organization.horizontalPadding; + if (organization.width - organization.rowWidth[last3] > diff2 && longest != last3) { + row.splice(-1, 1); + organization.rows[last3].push(node2); + organization.rowWidth[longest] = organization.rowWidth[longest] - diff2; + organization.rowWidth[last3] = organization.rowWidth[last3] + diff2; + organization.width = organization.rowWidth[instance.getLongestRowIndex(organization)]; + var maxHeight = Number.MIN_VALUE; + for (var i2 = 0; i2 < row.length; i2++) { + if (row[i2].height > maxHeight) maxHeight = row[i2].height; + } + if (longest > 0) maxHeight += organization.verticalPadding; + var prevTotal = organization.rowHeight[longest] + organization.rowHeight[last3]; + organization.rowHeight[longest] = maxHeight; + if (organization.rowHeight[last3] < node2.height + organization.verticalPadding) organization.rowHeight[last3] = node2.height + organization.verticalPadding; + var finalTotal = organization.rowHeight[longest] + organization.rowHeight[last3]; + organization.height += finalTotal - prevTotal; + this.shiftToLastRow(organization); + } + }; + CoSELayout.prototype.tilingPreLayout = function() { + if (CoSEConstants.TILE) { + this.groupZeroDegreeMembers(); + this.clearCompounds(); + this.clearZeroDegreeMembers(); + } + }; + CoSELayout.prototype.tilingPostLayout = function() { + if (CoSEConstants.TILE) { + this.repopulateZeroDegreeMembers(); + this.repopulateCompounds(); + } + }; + CoSELayout.prototype.reduceTrees = function() { + var prunedNodesAll = []; + var containsLeaf = true; + var node2; + while (containsLeaf) { + var allNodes = this.graphManager.getAllNodes(); + var prunedNodesInStepTemp = []; + containsLeaf = false; + for (var i2 = 0; i2 < allNodes.length; i2++) { + node2 = allNodes[i2]; + if (node2.getEdges().length == 1 && !node2.getEdges()[0].isInterGraph && node2.getChild() == null) { + if (CoSEConstants.PURE_INCREMENTAL) { + var otherEnd = node2.getEdges()[0].getOtherEnd(node2); + var relativePosition2 = new DimensionD2(node2.getCenterX() - otherEnd.getCenterX(), node2.getCenterY() - otherEnd.getCenterY()); + prunedNodesInStepTemp.push([node2, node2.getEdges()[0], node2.getOwner(), relativePosition2]); + } else { + prunedNodesInStepTemp.push([node2, node2.getEdges()[0], node2.getOwner()]); + } + containsLeaf = true; + } + } + if (containsLeaf == true) { + var prunedNodesInStep = []; + for (var j2 = 0; j2 < prunedNodesInStepTemp.length; j2++) { + if (prunedNodesInStepTemp[j2][0].getEdges().length == 1) { + prunedNodesInStep.push(prunedNodesInStepTemp[j2]); + prunedNodesInStepTemp[j2][0].getOwner().remove(prunedNodesInStepTemp[j2][0]); + } + } + prunedNodesAll.push(prunedNodesInStep); + this.graphManager.resetAllNodes(); + this.graphManager.resetAllEdges(); + } + } + this.prunedNodesAll = prunedNodesAll; + }; + CoSELayout.prototype.growTree = function(prunedNodesAll) { + var lengthOfPrunedNodesInStep = prunedNodesAll.length; + var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1]; + var nodeData2; + for (var i2 = 0; i2 < prunedNodesInStep.length; i2++) { + nodeData2 = prunedNodesInStep[i2]; + this.findPlaceforPrunedNode(nodeData2); + nodeData2[2].add(nodeData2[0]); + nodeData2[2].add(nodeData2[1], nodeData2[1].source, nodeData2[1].target); + } + prunedNodesAll.splice(prunedNodesAll.length - 1, 1); + this.graphManager.resetAllNodes(); + this.graphManager.resetAllEdges(); + }; + CoSELayout.prototype.findPlaceforPrunedNode = function(nodeData2) { + var gridForPrunedNode; + var nodeToConnect; + var prunedNode = nodeData2[0]; + if (prunedNode == nodeData2[1].source) { + nodeToConnect = nodeData2[1].target; + } else { + nodeToConnect = nodeData2[1].source; + } + if (CoSEConstants.PURE_INCREMENTAL) { + prunedNode.setCenter(nodeToConnect.getCenterX() + nodeData2[3].getWidth(), nodeToConnect.getCenterY() + nodeData2[3].getHeight()); + } else { + var startGridX = nodeToConnect.startX; + var finishGridX = nodeToConnect.finishX; + var startGridY = nodeToConnect.startY; + var finishGridY = nodeToConnect.finishY; + var upNodeCount = 0; + var downNodeCount = 0; + var rightNodeCount = 0; + var leftNodeCount = 0; + var controlRegions = [upNodeCount, rightNodeCount, downNodeCount, leftNodeCount]; + if (startGridY > 0) { + for (var i2 = startGridX; i2 <= finishGridX; i2++) { + controlRegions[0] += this.grid[i2][startGridY - 1].length + this.grid[i2][startGridY].length - 1; + } + } + if (finishGridX < this.grid.length - 1) { + for (var i2 = startGridY; i2 <= finishGridY; i2++) { + controlRegions[1] += this.grid[finishGridX + 1][i2].length + this.grid[finishGridX][i2].length - 1; + } + } + if (finishGridY < this.grid[0].length - 1) { + for (var i2 = startGridX; i2 <= finishGridX; i2++) { + controlRegions[2] += this.grid[i2][finishGridY + 1].length + this.grid[i2][finishGridY].length - 1; + } + } + if (startGridX > 0) { + for (var i2 = startGridY; i2 <= finishGridY; i2++) { + controlRegions[3] += this.grid[startGridX - 1][i2].length + this.grid[startGridX][i2].length - 1; + } + } + var min9 = Integer.MAX_VALUE; + var minCount; + var minIndex; + for (var j2 = 0; j2 < controlRegions.length; j2++) { + if (controlRegions[j2] < min9) { + min9 = controlRegions[j2]; + minCount = 1; + minIndex = j2; + } else if (controlRegions[j2] == min9) { + minCount++; + } + } + if (minCount == 3 && min9 == 0) { + if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[2] == 0) { + gridForPrunedNode = 1; + } else if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[3] == 0) { + gridForPrunedNode = 0; + } else if (controlRegions[0] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) { + gridForPrunedNode = 3; + } else if (controlRegions[1] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) { + gridForPrunedNode = 2; + } + } else if (minCount == 2 && min9 == 0) { + var random2 = Math.floor(Math.random() * 2); + if (controlRegions[0] == 0 && controlRegions[1] == 0) { + ; + if (random2 == 0) { + gridForPrunedNode = 0; + } else { + gridForPrunedNode = 1; + } + } else if (controlRegions[0] == 0 && controlRegions[2] == 0) { + if (random2 == 0) { + gridForPrunedNode = 0; + } else { + gridForPrunedNode = 2; + } + } else if (controlRegions[0] == 0 && controlRegions[3] == 0) { + if (random2 == 0) { + gridForPrunedNode = 0; + } else { + gridForPrunedNode = 3; + } + } else if (controlRegions[1] == 0 && controlRegions[2] == 0) { + if (random2 == 0) { + gridForPrunedNode = 1; + } else { + gridForPrunedNode = 2; + } + } else if (controlRegions[1] == 0 && controlRegions[3] == 0) { + if (random2 == 0) { + gridForPrunedNode = 1; + } else { + gridForPrunedNode = 3; + } + } else { + if (random2 == 0) { + gridForPrunedNode = 2; + } else { + gridForPrunedNode = 3; + } + } + } else if (minCount == 4 && min9 == 0) { + var random2 = Math.floor(Math.random() * 4); + gridForPrunedNode = random2; + } else { + gridForPrunedNode = minIndex; + } + if (gridForPrunedNode == 0) { + prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() - nodeToConnect.getHeight() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getHeight() / 2); + } else if (gridForPrunedNode == 1) { + prunedNode.setCenter(nodeToConnect.getCenterX() + nodeToConnect.getWidth() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getWidth() / 2, nodeToConnect.getCenterY()); + } else if (gridForPrunedNode == 2) { + prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() + nodeToConnect.getHeight() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getHeight() / 2); + } else { + prunedNode.setCenter(nodeToConnect.getCenterX() - nodeToConnect.getWidth() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getWidth() / 2, nodeToConnect.getCenterY()); + } + } + }; + module3.exports = CoSELayout; + } + ), + /***/ + 991: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var FDLayoutNode = __webpack_require__2(551).FDLayoutNode; + var IMath = __webpack_require__2(551).IMath; + function CoSENode(gm, loc, size5, vNode) { + FDLayoutNode.call(this, gm, loc, size5, vNode); + } + __name(CoSENode, "CoSENode"); + CoSENode.prototype = Object.create(FDLayoutNode.prototype); + for (var prop in FDLayoutNode) { + CoSENode[prop] = FDLayoutNode[prop]; + } + CoSENode.prototype.calculateDisplacement = function() { + var layout6 = this.graphManager.getLayout(); + if (this.getChild() != null && this.fixedNodeWeight) { + this.displacementX += layout6.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight; + this.displacementY += layout6.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight; + } else { + this.displacementX += layout6.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren; + this.displacementY += layout6.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren; + } + if (Math.abs(this.displacementX) > layout6.coolingFactor * layout6.maxNodeDisplacement) { + this.displacementX = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementX); + } + if (Math.abs(this.displacementY) > layout6.coolingFactor * layout6.maxNodeDisplacement) { + this.displacementY = layout6.coolingFactor * layout6.maxNodeDisplacement * IMath.sign(this.displacementY); + } + if (this.child && this.child.getNodes().length > 0) { + this.propogateDisplacementToChildren(this.displacementX, this.displacementY); + } + }; + CoSENode.prototype.propogateDisplacementToChildren = function(dX, dY) { + var nodes6 = this.getChild().getNodes(); + var node2; + for (var i2 = 0; i2 < nodes6.length; i2++) { + node2 = nodes6[i2]; + if (node2.getChild() == null) { + node2.displacementX += dX; + node2.displacementY += dY; + } else { + node2.propogateDisplacementToChildren(dX, dY); + } + } + }; + CoSENode.prototype.move = function() { + var layout6 = this.graphManager.getLayout(); + if (this.child == null || this.child.getNodes().length == 0) { + this.moveBy(this.displacementX, this.displacementY); + layout6.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY); + } + this.springForceX = 0; + this.springForceY = 0; + this.repulsionForceX = 0; + this.repulsionForceY = 0; + this.gravitationForceX = 0; + this.gravitationForceY = 0; + this.displacementX = 0; + this.displacementY = 0; + }; + CoSENode.prototype.setPred1 = function(pred12) { + this.pred1 = pred12; + }; + CoSENode.prototype.getPred1 = function() { + return pred1; + }; + CoSENode.prototype.getPred2 = function() { + return pred2; + }; + CoSENode.prototype.setNext = function(next3) { + this.next = next3; + }; + CoSENode.prototype.getNext = function() { + return next; + }; + CoSENode.prototype.setProcessed = function(processed2) { + this.processed = processed2; + }; + CoSENode.prototype.isProcessed = function() { + return processed; + }; + module3.exports = CoSENode; + } + ), + /***/ + 902: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + function _toConsumableArray(arr) { + if (Array.isArray(arr)) { + for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) { + arr2[i2] = arr[i2]; + } + return arr2; + } else { + return Array.from(arr); + } + } + __name(_toConsumableArray, "_toConsumableArray"); + var CoSEConstants = __webpack_require__2(806); + var LinkedList = __webpack_require__2(551).LinkedList; + var Matrix = __webpack_require__2(551).Matrix; + var SVD = __webpack_require__2(551).SVD; + function ConstraintHandler() { + } + __name(ConstraintHandler, "ConstraintHandler"); + ConstraintHandler.handleConstraints = function(layout6) { + var constraints = {}; + constraints.fixedNodeConstraint = layout6.constraints.fixedNodeConstraint; + constraints.alignmentConstraint = layout6.constraints.alignmentConstraint; + constraints.relativePlacementConstraint = layout6.constraints.relativePlacementConstraint; + var idToNodeMap = /* @__PURE__ */ new Map(); + var nodeIndexes = /* @__PURE__ */ new Map(); + var xCoords = []; + var yCoords = []; + var allNodes = layout6.getAllNodes(); + var index = 0; + for (var i2 = 0; i2 < allNodes.length; i2++) { + var node2 = allNodes[i2]; + if (node2.getChild() == null) { + nodeIndexes.set(node2.id, index++); + xCoords.push(node2.getCenterX()); + yCoords.push(node2.getCenterY()); + idToNodeMap.set(node2.id, node2); + } + } + if (constraints.relativePlacementConstraint) { + constraints.relativePlacementConstraint.forEach(function(constraint) { + if (!constraint.gap && constraint.gap != 0) { + if (constraint.left) { + constraint.gap = CoSEConstants.DEFAULT_EDGE_LENGTH + idToNodeMap.get(constraint.left).getWidth() / 2 + idToNodeMap.get(constraint.right).getWidth() / 2; + } else { + constraint.gap = CoSEConstants.DEFAULT_EDGE_LENGTH + idToNodeMap.get(constraint.top).getHeight() / 2 + idToNodeMap.get(constraint.bottom).getHeight() / 2; + } + } + }); + } + var calculatePositionDiff = /* @__PURE__ */ __name(function calculatePositionDiff2(pos1, pos2) { + return { x: pos1.x - pos2.x, y: pos1.y - pos2.y }; + }, "calculatePositionDiff"); + var calculateAvgPosition = /* @__PURE__ */ __name(function calculateAvgPosition2(nodeIdSet) { + var xPosSum = 0; + var yPosSum = 0; + nodeIdSet.forEach(function(nodeId) { + xPosSum += xCoords[nodeIndexes.get(nodeId)]; + yPosSum += yCoords[nodeIndexes.get(nodeId)]; + }); + return { x: xPosSum / nodeIdSet.size, y: yPosSum / nodeIdSet.size }; + }, "calculateAvgPosition"); + var findAppropriatePositionForRelativePlacement = /* @__PURE__ */ __name(function findAppropriatePositionForRelativePlacement2(graph, direction4, fixedNodes2, dummyPositions, componentSources) { + function setUnion(setA, setB) { + var union2 = new Set(setA); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = void 0; + try { + for (var _iterator = setB[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var elem = _step.value; + union2.add(elem); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return union2; + } + __name(setUnion, "setUnion"); + var inDegrees = /* @__PURE__ */ new Map(); + graph.forEach(function(value2, key) { + inDegrees.set(key, 0); + }); + graph.forEach(function(value2, key) { + value2.forEach(function(adjacent) { + inDegrees.set(adjacent.id, inDegrees.get(adjacent.id) + 1); + }); + }); + var positionMap = /* @__PURE__ */ new Map(); + var pastMap = /* @__PURE__ */ new Map(); + var queue = new LinkedList(); + inDegrees.forEach(function(value2, key) { + if (value2 == 0) { + queue.push(key); + if (!fixedNodes2) { + if (direction4 == "horizontal") { + positionMap.set(key, nodeIndexes.has(key) ? xCoords[nodeIndexes.get(key)] : dummyPositions.get(key)); + } else { + positionMap.set(key, nodeIndexes.has(key) ? yCoords[nodeIndexes.get(key)] : dummyPositions.get(key)); + } + } + } else { + positionMap.set(key, Number.NEGATIVE_INFINITY); + } + if (fixedNodes2) { + pastMap.set(key, /* @__PURE__ */ new Set([key])); + } + }); + if (fixedNodes2) { + componentSources.forEach(function(component2) { + var fixedIds = []; + component2.forEach(function(nodeId) { + if (fixedNodes2.has(nodeId)) { + fixedIds.push(nodeId); + } + }); + if (fixedIds.length > 0) { + var position5 = 0; + fixedIds.forEach(function(fixedId) { + if (direction4 == "horizontal") { + positionMap.set(fixedId, nodeIndexes.has(fixedId) ? xCoords[nodeIndexes.get(fixedId)] : dummyPositions.get(fixedId)); + position5 += positionMap.get(fixedId); + } else { + positionMap.set(fixedId, nodeIndexes.has(fixedId) ? yCoords[nodeIndexes.get(fixedId)] : dummyPositions.get(fixedId)); + position5 += positionMap.get(fixedId); + } + }); + position5 = position5 / fixedIds.length; + component2.forEach(function(nodeId) { + if (!fixedNodes2.has(nodeId)) { + positionMap.set(nodeId, position5); + } + }); + } else { + var _position = 0; + component2.forEach(function(nodeId) { + if (direction4 == "horizontal") { + _position += nodeIndexes.has(nodeId) ? xCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId); + } else { + _position += nodeIndexes.has(nodeId) ? yCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId); + } + }); + _position = _position / component2.length; + component2.forEach(function(nodeId) { + positionMap.set(nodeId, _position); + }); + } + }); + } + var _loop = /* @__PURE__ */ __name(function _loop2() { + var currentNode = queue.shift(); + var neighbors = graph.get(currentNode); + neighbors.forEach(function(neighbor) { + if (positionMap.get(neighbor.id) < positionMap.get(currentNode) + neighbor.gap) { + if (fixedNodes2 && fixedNodes2.has(neighbor.id)) { + var fixedPosition = void 0; + if (direction4 == "horizontal") { + fixedPosition = nodeIndexes.has(neighbor.id) ? xCoords[nodeIndexes.get(neighbor.id)] : dummyPositions.get(neighbor.id); + } else { + fixedPosition = nodeIndexes.has(neighbor.id) ? yCoords[nodeIndexes.get(neighbor.id)] : dummyPositions.get(neighbor.id); + } + positionMap.set(neighbor.id, fixedPosition); + if (fixedPosition < positionMap.get(currentNode) + neighbor.gap) { + var diff2 = positionMap.get(currentNode) + neighbor.gap - fixedPosition; + pastMap.get(currentNode).forEach(function(nodeId) { + positionMap.set(nodeId, positionMap.get(nodeId) - diff2); + }); + } + } else { + positionMap.set(neighbor.id, positionMap.get(currentNode) + neighbor.gap); + } + } + inDegrees.set(neighbor.id, inDegrees.get(neighbor.id) - 1); + if (inDegrees.get(neighbor.id) == 0) { + queue.push(neighbor.id); + } + if (fixedNodes2) { + pastMap.set(neighbor.id, setUnion(pastMap.get(currentNode), pastMap.get(neighbor.id))); + } + }); + }, "_loop"); + while (queue.length != 0) { + _loop(); + } + if (fixedNodes2) { + var sinkNodes = /* @__PURE__ */ new Set(); + graph.forEach(function(value2, key) { + if (value2.length == 0) { + sinkNodes.add(key); + } + }); + var _components = []; + pastMap.forEach(function(value2, key) { + if (sinkNodes.has(key)) { + var isFixedComponent = false; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = void 0; + try { + for (var _iterator2 = value2[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var nodeId = _step2.value; + if (fixedNodes2.has(nodeId)) { + isFixedComponent = true; + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + if (!isFixedComponent) { + var isExist = false; + var existAt = void 0; + _components.forEach(function(component2, index2) { + if (component2.has([].concat(_toConsumableArray(value2))[0])) { + isExist = true; + existAt = index2; + } + }); + if (!isExist) { + _components.push(new Set(value2)); + } else { + value2.forEach(function(ele) { + _components[existAt].add(ele); + }); + } + } + } + }); + _components.forEach(function(component2, index2) { + var minBefore = Number.POSITIVE_INFINITY; + var minAfter = Number.POSITIVE_INFINITY; + var maxBefore = Number.NEGATIVE_INFINITY; + var maxAfter = Number.NEGATIVE_INFINITY; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = void 0; + try { + for (var _iterator3 = component2[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var nodeId = _step3.value; + var posBefore = void 0; + if (direction4 == "horizontal") { + posBefore = nodeIndexes.has(nodeId) ? xCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId); + } else { + posBefore = nodeIndexes.has(nodeId) ? yCoords[nodeIndexes.get(nodeId)] : dummyPositions.get(nodeId); + } + var posAfter = positionMap.get(nodeId); + if (posBefore < minBefore) { + minBefore = posBefore; + } + if (posBefore > maxBefore) { + maxBefore = posBefore; + } + if (posAfter < minAfter) { + minAfter = posAfter; + } + if (posAfter > maxAfter) { + maxAfter = posAfter; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + var diff2 = (minBefore + maxBefore) / 2 - (minAfter + maxAfter) / 2; + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = void 0; + try { + for (var _iterator4 = component2[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var _nodeId = _step4.value; + positionMap.set(_nodeId, positionMap.get(_nodeId) + diff2); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + }); + } + return positionMap; + }, "findAppropriatePositionForRelativePlacement"); + var applyReflectionForRelativePlacement = /* @__PURE__ */ __name(function applyReflectionForRelativePlacement2(relativePlacementConstraints) { + var reflectOnY = 0, notReflectOnY = 0; + var reflectOnX = 0, notReflectOnX = 0; + relativePlacementConstraints.forEach(function(constraint) { + if (constraint.left) { + xCoords[nodeIndexes.get(constraint.left)] - xCoords[nodeIndexes.get(constraint.right)] >= 0 ? reflectOnY++ : notReflectOnY++; + } else { + yCoords[nodeIndexes.get(constraint.top)] - yCoords[nodeIndexes.get(constraint.bottom)] >= 0 ? reflectOnX++ : notReflectOnX++; + } + }); + if (reflectOnY > notReflectOnY && reflectOnX > notReflectOnX) { + for (var _i = 0; _i < nodeIndexes.size; _i++) { + xCoords[_i] = -1 * xCoords[_i]; + yCoords[_i] = -1 * yCoords[_i]; + } + } else if (reflectOnY > notReflectOnY) { + for (var _i2 = 0; _i2 < nodeIndexes.size; _i2++) { + xCoords[_i2] = -1 * xCoords[_i2]; + } + } else if (reflectOnX > notReflectOnX) { + for (var _i3 = 0; _i3 < nodeIndexes.size; _i3++) { + yCoords[_i3] = -1 * yCoords[_i3]; + } + } + }, "applyReflectionForRelativePlacement"); + var findComponents = /* @__PURE__ */ __name(function findComponents2(graph) { + var components4 = []; + var queue = new LinkedList(); + var visited = /* @__PURE__ */ new Set(); + var count = 0; + graph.forEach(function(value2, key) { + if (!visited.has(key)) { + components4[count] = []; + var _currentNode = key; + queue.push(_currentNode); + visited.add(_currentNode); + components4[count].push(_currentNode); + while (queue.length != 0) { + _currentNode = queue.shift(); + var neighbors = graph.get(_currentNode); + neighbors.forEach(function(neighbor) { + if (!visited.has(neighbor.id)) { + queue.push(neighbor.id); + visited.add(neighbor.id); + components4[count].push(neighbor.id); + } + }); + } + count++; + } + }); + return components4; + }, "findComponents"); + var dagToUndirected = /* @__PURE__ */ __name(function dagToUndirected2(dag2) { + var undirected = /* @__PURE__ */ new Map(); + dag2.forEach(function(value2, key) { + undirected.set(key, []); + }); + dag2.forEach(function(value2, key) { + value2.forEach(function(adjacent) { + undirected.get(key).push(adjacent); + undirected.get(adjacent.id).push({ id: key, gap: adjacent.gap, direction: adjacent.direction }); + }); + }); + return undirected; + }, "dagToUndirected"); + var dagToReversed = /* @__PURE__ */ __name(function dagToReversed2(dag2) { + var reversed = /* @__PURE__ */ new Map(); + dag2.forEach(function(value2, key) { + reversed.set(key, []); + }); + dag2.forEach(function(value2, key) { + value2.forEach(function(adjacent) { + reversed.get(adjacent.id).push({ id: key, gap: adjacent.gap, direction: adjacent.direction }); + }); + }); + return reversed; + }, "dagToReversed"); + var targetMatrix = []; + var sourceMatrix = []; + var standardTransformation = false; + var reflectionType = false; + var fixedNodes = /* @__PURE__ */ new Set(); + var dag = /* @__PURE__ */ new Map(); + var dagUndirected = /* @__PURE__ */ new Map(); + var components3 = []; + if (constraints.fixedNodeConstraint) { + constraints.fixedNodeConstraint.forEach(function(nodeData2) { + fixedNodes.add(nodeData2.nodeId); + }); + } + if (constraints.relativePlacementConstraint) { + constraints.relativePlacementConstraint.forEach(function(constraint) { + if (constraint.left) { + if (dag.has(constraint.left)) { + dag.get(constraint.left).push({ id: constraint.right, gap: constraint.gap, direction: "horizontal" }); + } else { + dag.set(constraint.left, [{ id: constraint.right, gap: constraint.gap, direction: "horizontal" }]); + } + if (!dag.has(constraint.right)) { + dag.set(constraint.right, []); + } + } else { + if (dag.has(constraint.top)) { + dag.get(constraint.top).push({ id: constraint.bottom, gap: constraint.gap, direction: "vertical" }); + } else { + dag.set(constraint.top, [{ id: constraint.bottom, gap: constraint.gap, direction: "vertical" }]); + } + if (!dag.has(constraint.bottom)) { + dag.set(constraint.bottom, []); + } + } + }); + dagUndirected = dagToUndirected(dag); + components3 = findComponents(dagUndirected); + } + if (CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING) { + if (constraints.fixedNodeConstraint && constraints.fixedNodeConstraint.length > 1) { + constraints.fixedNodeConstraint.forEach(function(nodeData2, i3) { + targetMatrix[i3] = [nodeData2.position.x, nodeData2.position.y]; + sourceMatrix[i3] = [xCoords[nodeIndexes.get(nodeData2.nodeId)], yCoords[nodeIndexes.get(nodeData2.nodeId)]]; + }); + standardTransformation = true; + } else if (constraints.alignmentConstraint) { + (function() { + var count = 0; + if (constraints.alignmentConstraint.vertical) { + var verticalAlign = constraints.alignmentConstraint.vertical; + var _loop2 = /* @__PURE__ */ __name(function _loop22(_i42) { + var alignmentSet = /* @__PURE__ */ new Set(); + verticalAlign[_i42].forEach(function(nodeId) { + alignmentSet.add(nodeId); + }); + var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) { + return fixedNodes.has(x5); + })); + var xPos = void 0; + if (intersection3.size > 0) xPos = xCoords[nodeIndexes.get(intersection3.values().next().value)]; + else xPos = calculateAvgPosition(alignmentSet).x; + verticalAlign[_i42].forEach(function(nodeId) { + targetMatrix[count] = [xPos, yCoords[nodeIndexes.get(nodeId)]]; + sourceMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]]; + count++; + }); + }, "_loop2"); + for (var _i4 = 0; _i4 < verticalAlign.length; _i4++) { + _loop2(_i4); + } + standardTransformation = true; + } + if (constraints.alignmentConstraint.horizontal) { + var horizontalAlign = constraints.alignmentConstraint.horizontal; + var _loop3 = /* @__PURE__ */ __name(function _loop32(_i52) { + var alignmentSet = /* @__PURE__ */ new Set(); + horizontalAlign[_i52].forEach(function(nodeId) { + alignmentSet.add(nodeId); + }); + var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) { + return fixedNodes.has(x5); + })); + var yPos = void 0; + if (intersection3.size > 0) yPos = xCoords[nodeIndexes.get(intersection3.values().next().value)]; + else yPos = calculateAvgPosition(alignmentSet).y; + horizontalAlign[_i52].forEach(function(nodeId) { + targetMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yPos]; + sourceMatrix[count] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]]; + count++; + }); + }, "_loop3"); + for (var _i5 = 0; _i5 < horizontalAlign.length; _i5++) { + _loop3(_i5); + } + standardTransformation = true; + } + if (constraints.relativePlacementConstraint) { + reflectionType = true; + } + })(); + } else if (constraints.relativePlacementConstraint) { + var largestComponentSize = 0; + var largestComponentIndex = 0; + for (var _i6 = 0; _i6 < components3.length; _i6++) { + if (components3[_i6].length > largestComponentSize) { + largestComponentSize = components3[_i6].length; + largestComponentIndex = _i6; + } + } + if (largestComponentSize < dagUndirected.size / 2) { + applyReflectionForRelativePlacement(constraints.relativePlacementConstraint); + standardTransformation = false; + reflectionType = false; + } else { + var subGraphOnHorizontal = /* @__PURE__ */ new Map(); + var subGraphOnVertical = /* @__PURE__ */ new Map(); + var constraintsInlargestComponent = []; + components3[largestComponentIndex].forEach(function(nodeId) { + dag.get(nodeId).forEach(function(adjacent) { + if (adjacent.direction == "horizontal") { + if (subGraphOnHorizontal.has(nodeId)) { + subGraphOnHorizontal.get(nodeId).push(adjacent); + } else { + subGraphOnHorizontal.set(nodeId, [adjacent]); + } + if (!subGraphOnHorizontal.has(adjacent.id)) { + subGraphOnHorizontal.set(adjacent.id, []); + } + constraintsInlargestComponent.push({ left: nodeId, right: adjacent.id }); + } else { + if (subGraphOnVertical.has(nodeId)) { + subGraphOnVertical.get(nodeId).push(adjacent); + } else { + subGraphOnVertical.set(nodeId, [adjacent]); + } + if (!subGraphOnVertical.has(adjacent.id)) { + subGraphOnVertical.set(adjacent.id, []); + } + constraintsInlargestComponent.push({ top: nodeId, bottom: adjacent.id }); + } + }); + }); + applyReflectionForRelativePlacement(constraintsInlargestComponent); + reflectionType = false; + var positionMapHorizontal = findAppropriatePositionForRelativePlacement(subGraphOnHorizontal, "horizontal"); + var positionMapVertical = findAppropriatePositionForRelativePlacement(subGraphOnVertical, "vertical"); + components3[largestComponentIndex].forEach(function(nodeId, i3) { + sourceMatrix[i3] = [xCoords[nodeIndexes.get(nodeId)], yCoords[nodeIndexes.get(nodeId)]]; + targetMatrix[i3] = []; + if (positionMapHorizontal.has(nodeId)) { + targetMatrix[i3][0] = positionMapHorizontal.get(nodeId); + } else { + targetMatrix[i3][0] = xCoords[nodeIndexes.get(nodeId)]; + } + if (positionMapVertical.has(nodeId)) { + targetMatrix[i3][1] = positionMapVertical.get(nodeId); + } else { + targetMatrix[i3][1] = yCoords[nodeIndexes.get(nodeId)]; + } + }); + standardTransformation = true; + } + } + if (standardTransformation) { + var transformationMatrix = void 0; + var targetMatrixTranspose = Matrix.transpose(targetMatrix); + var sourceMatrixTranspose = Matrix.transpose(sourceMatrix); + for (var _i7 = 0; _i7 < targetMatrixTranspose.length; _i7++) { + targetMatrixTranspose[_i7] = Matrix.multGamma(targetMatrixTranspose[_i7]); + sourceMatrixTranspose[_i7] = Matrix.multGamma(sourceMatrixTranspose[_i7]); + } + var tempMatrix = Matrix.multMat(targetMatrixTranspose, Matrix.transpose(sourceMatrixTranspose)); + var SVDResult = SVD.svd(tempMatrix); + transformationMatrix = Matrix.multMat(SVDResult.V, Matrix.transpose(SVDResult.U)); + for (var _i8 = 0; _i8 < nodeIndexes.size; _i8++) { + var temp1 = [xCoords[_i8], yCoords[_i8]]; + var temp2 = [transformationMatrix[0][0], transformationMatrix[1][0]]; + var temp3 = [transformationMatrix[0][1], transformationMatrix[1][1]]; + xCoords[_i8] = Matrix.dotProduct(temp1, temp2); + yCoords[_i8] = Matrix.dotProduct(temp1, temp3); + } + if (reflectionType) { + applyReflectionForRelativePlacement(constraints.relativePlacementConstraint); + } + } + } + if (CoSEConstants.ENFORCE_CONSTRAINTS) { + if (constraints.fixedNodeConstraint && constraints.fixedNodeConstraint.length > 0) { + var translationAmount = { x: 0, y: 0 }; + constraints.fixedNodeConstraint.forEach(function(nodeData2, i3) { + var posInTheory = { x: xCoords[nodeIndexes.get(nodeData2.nodeId)], y: yCoords[nodeIndexes.get(nodeData2.nodeId)] }; + var posDesired = nodeData2.position; + var posDiff = calculatePositionDiff(posDesired, posInTheory); + translationAmount.x += posDiff.x; + translationAmount.y += posDiff.y; + }); + translationAmount.x /= constraints.fixedNodeConstraint.length; + translationAmount.y /= constraints.fixedNodeConstraint.length; + xCoords.forEach(function(value2, i3) { + xCoords[i3] += translationAmount.x; + }); + yCoords.forEach(function(value2, i3) { + yCoords[i3] += translationAmount.y; + }); + constraints.fixedNodeConstraint.forEach(function(nodeData2) { + xCoords[nodeIndexes.get(nodeData2.nodeId)] = nodeData2.position.x; + yCoords[nodeIndexes.get(nodeData2.nodeId)] = nodeData2.position.y; + }); + } + if (constraints.alignmentConstraint) { + if (constraints.alignmentConstraint.vertical) { + var xAlign = constraints.alignmentConstraint.vertical; + var _loop4 = /* @__PURE__ */ __name(function _loop42(_i92) { + var alignmentSet = /* @__PURE__ */ new Set(); + xAlign[_i92].forEach(function(nodeId) { + alignmentSet.add(nodeId); + }); + var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) { + return fixedNodes.has(x5); + })); + var xPos = void 0; + if (intersection3.size > 0) xPos = xCoords[nodeIndexes.get(intersection3.values().next().value)]; + else xPos = calculateAvgPosition(alignmentSet).x; + alignmentSet.forEach(function(nodeId) { + if (!fixedNodes.has(nodeId)) xCoords[nodeIndexes.get(nodeId)] = xPos; + }); + }, "_loop4"); + for (var _i9 = 0; _i9 < xAlign.length; _i9++) { + _loop4(_i9); + } + } + if (constraints.alignmentConstraint.horizontal) { + var yAlign = constraints.alignmentConstraint.horizontal; + var _loop5 = /* @__PURE__ */ __name(function _loop52(_i102) { + var alignmentSet = /* @__PURE__ */ new Set(); + yAlign[_i102].forEach(function(nodeId) { + alignmentSet.add(nodeId); + }); + var intersection3 = new Set([].concat(_toConsumableArray(alignmentSet)).filter(function(x5) { + return fixedNodes.has(x5); + })); + var yPos = void 0; + if (intersection3.size > 0) yPos = yCoords[nodeIndexes.get(intersection3.values().next().value)]; + else yPos = calculateAvgPosition(alignmentSet).y; + alignmentSet.forEach(function(nodeId) { + if (!fixedNodes.has(nodeId)) yCoords[nodeIndexes.get(nodeId)] = yPos; + }); + }, "_loop5"); + for (var _i10 = 0; _i10 < yAlign.length; _i10++) { + _loop5(_i10); + } + } + } + if (constraints.relativePlacementConstraint) { + (function() { + var nodeToDummyForVerticalAlignment = /* @__PURE__ */ new Map(); + var nodeToDummyForHorizontalAlignment = /* @__PURE__ */ new Map(); + var dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(); + var dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(); + var dummyPositionsForVerticalAlignment = /* @__PURE__ */ new Map(); + var dummyPositionsForHorizontalAlignment = /* @__PURE__ */ new Map(); + var fixedNodesOnHorizontal = /* @__PURE__ */ new Set(); + var fixedNodesOnVertical = /* @__PURE__ */ new Set(); + fixedNodes.forEach(function(nodeId2) { + fixedNodesOnHorizontal.add(nodeId2); + fixedNodesOnVertical.add(nodeId2); + }); + if (constraints.alignmentConstraint) { + if (constraints.alignmentConstraint.vertical) { + var verticalAlignment2 = constraints.alignmentConstraint.vertical; + var _loop6 = /* @__PURE__ */ __name(function _loop62(_i112) { + dummyToNodeForVerticalAlignment.set("dummy" + _i112, []); + verticalAlignment2[_i112].forEach(function(nodeId2) { + nodeToDummyForVerticalAlignment.set(nodeId2, "dummy" + _i112); + dummyToNodeForVerticalAlignment.get("dummy" + _i112).push(nodeId2); + if (fixedNodes.has(nodeId2)) { + fixedNodesOnHorizontal.add("dummy" + _i112); + } + }); + dummyPositionsForVerticalAlignment.set("dummy" + _i112, xCoords[nodeIndexes.get(verticalAlignment2[_i112][0])]); + }, "_loop6"); + for (var _i11 = 0; _i11 < verticalAlignment2.length; _i11++) { + _loop6(_i11); + } + } + if (constraints.alignmentConstraint.horizontal) { + var horizontalAlignment = constraints.alignmentConstraint.horizontal; + var _loop7 = /* @__PURE__ */ __name(function _loop72(_i122) { + dummyToNodeForHorizontalAlignment.set("dummy" + _i122, []); + horizontalAlignment[_i122].forEach(function(nodeId2) { + nodeToDummyForHorizontalAlignment.set(nodeId2, "dummy" + _i122); + dummyToNodeForHorizontalAlignment.get("dummy" + _i122).push(nodeId2); + if (fixedNodes.has(nodeId2)) { + fixedNodesOnVertical.add("dummy" + _i122); + } + }); + dummyPositionsForHorizontalAlignment.set("dummy" + _i122, yCoords[nodeIndexes.get(horizontalAlignment[_i122][0])]); + }, "_loop7"); + for (var _i12 = 0; _i12 < horizontalAlignment.length; _i12++) { + _loop7(_i12); + } + } + } + var dagOnHorizontal = /* @__PURE__ */ new Map(); + var dagOnVertical = /* @__PURE__ */ new Map(); + var _loop8 = /* @__PURE__ */ __name(function _loop82(nodeId2) { + dag.get(nodeId2).forEach(function(adjacent) { + var sourceId = void 0; + var targetNode = void 0; + if (adjacent["direction"] == "horizontal") { + sourceId = nodeToDummyForVerticalAlignment.get(nodeId2) ? nodeToDummyForVerticalAlignment.get(nodeId2) : nodeId2; + if (nodeToDummyForVerticalAlignment.get(adjacent.id)) { + targetNode = { id: nodeToDummyForVerticalAlignment.get(adjacent.id), gap: adjacent.gap, direction: adjacent.direction }; + } else { + targetNode = adjacent; + } + if (dagOnHorizontal.has(sourceId)) { + dagOnHorizontal.get(sourceId).push(targetNode); + } else { + dagOnHorizontal.set(sourceId, [targetNode]); + } + if (!dagOnHorizontal.has(targetNode.id)) { + dagOnHorizontal.set(targetNode.id, []); + } + } else { + sourceId = nodeToDummyForHorizontalAlignment.get(nodeId2) ? nodeToDummyForHorizontalAlignment.get(nodeId2) : nodeId2; + if (nodeToDummyForHorizontalAlignment.get(adjacent.id)) { + targetNode = { id: nodeToDummyForHorizontalAlignment.get(adjacent.id), gap: adjacent.gap, direction: adjacent.direction }; + } else { + targetNode = adjacent; + } + if (dagOnVertical.has(sourceId)) { + dagOnVertical.get(sourceId).push(targetNode); + } else { + dagOnVertical.set(sourceId, [targetNode]); + } + if (!dagOnVertical.has(targetNode.id)) { + dagOnVertical.set(targetNode.id, []); + } + } + }); + }, "_loop8"); + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = void 0; + try { + for (var _iterator5 = dag.keys()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var nodeId = _step5.value; + _loop8(nodeId); + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + var undirectedOnHorizontal = dagToUndirected(dagOnHorizontal); + var undirectedOnVertical = dagToUndirected(dagOnVertical); + var componentsOnHorizontal = findComponents(undirectedOnHorizontal); + var componentsOnVertical = findComponents(undirectedOnVertical); + var reversedDagOnHorizontal = dagToReversed(dagOnHorizontal); + var reversedDagOnVertical = dagToReversed(dagOnVertical); + var componentSourcesOnHorizontal = []; + var componentSourcesOnVertical = []; + componentsOnHorizontal.forEach(function(component2, index2) { + componentSourcesOnHorizontal[index2] = []; + component2.forEach(function(nodeId2) { + if (reversedDagOnHorizontal.get(nodeId2).length == 0) { + componentSourcesOnHorizontal[index2].push(nodeId2); + } + }); + }); + componentsOnVertical.forEach(function(component2, index2) { + componentSourcesOnVertical[index2] = []; + component2.forEach(function(nodeId2) { + if (reversedDagOnVertical.get(nodeId2).length == 0) { + componentSourcesOnVertical[index2].push(nodeId2); + } + }); + }); + var positionMapHorizontal2 = findAppropriatePositionForRelativePlacement(dagOnHorizontal, "horizontal", fixedNodesOnHorizontal, dummyPositionsForVerticalAlignment, componentSourcesOnHorizontal); + var positionMapVertical2 = findAppropriatePositionForRelativePlacement(dagOnVertical, "vertical", fixedNodesOnVertical, dummyPositionsForHorizontalAlignment, componentSourcesOnVertical); + var _loop9 = /* @__PURE__ */ __name(function _loop92(key2) { + if (dummyToNodeForVerticalAlignment.get(key2)) { + dummyToNodeForVerticalAlignment.get(key2).forEach(function(nodeId2) { + xCoords[nodeIndexes.get(nodeId2)] = positionMapHorizontal2.get(key2); + }); + } else { + xCoords[nodeIndexes.get(key2)] = positionMapHorizontal2.get(key2); + } + }, "_loop9"); + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = void 0; + try { + for (var _iterator6 = positionMapHorizontal2.keys()[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { + var key = _step6.value; + _loop9(key); + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if (!_iteratorNormalCompletion6 && _iterator6.return) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + var _loop10 = /* @__PURE__ */ __name(function _loop102(key2) { + if (dummyToNodeForHorizontalAlignment.get(key2)) { + dummyToNodeForHorizontalAlignment.get(key2).forEach(function(nodeId2) { + yCoords[nodeIndexes.get(nodeId2)] = positionMapVertical2.get(key2); + }); + } else { + yCoords[nodeIndexes.get(key2)] = positionMapVertical2.get(key2); + } + }, "_loop10"); + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = void 0; + try { + for (var _iterator7 = positionMapVertical2.keys()[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { + var key = _step7.value; + _loop10(key); + } + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if (!_iteratorNormalCompletion7 && _iterator7.return) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } + })(); + } + } + for (var _i13 = 0; _i13 < allNodes.length; _i13++) { + var _node = allNodes[_i13]; + if (_node.getChild() == null) { + _node.setCenter(xCoords[nodeIndexes.get(_node.id)], yCoords[nodeIndexes.get(_node.id)]); + } + } + }; + module3.exports = ConstraintHandler; + } + ), + /***/ + 551: ( + /***/ + (module3) => { + module3.exports = __WEBPACK_EXTERNAL_MODULE__551__; + } + ) + /******/ + }; + var __webpack_module_cache__ = {}; + function __webpack_require__(moduleId) { + var cachedModule = __webpack_module_cache__[moduleId]; + if (cachedModule !== void 0) { + return cachedModule.exports; + } + var module3 = __webpack_module_cache__[moduleId] = { + /******/ + // no module.id needed + /******/ + // no module.loaded needed + /******/ + exports: {} + /******/ + }; + __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__); + return module3.exports; + } + __name(__webpack_require__, "__webpack_require__"); + var __webpack_exports__ = __webpack_require__(45); + return __webpack_exports__; + })() + ); + }); + } + }); + + // ../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.30.1/node_modules/cytoscape-fcose/cytoscape-fcose.js + var require_cytoscape_fcose = __commonJS({ + "../../node_modules/.pnpm/cytoscape-fcose@2.2.0_cytoscape@3.30.1/node_modules/cytoscape-fcose/cytoscape-fcose.js"(exports2, module2) { + "use strict"; + (/* @__PURE__ */ __name(function webpackUniversalModuleDefinition(root4, factory) { + if (typeof exports2 === "object" && typeof module2 === "object") + module2.exports = factory(require_cose_base2()); + else if (typeof define === "function" && define.amd) + define(["cose-base"], factory); + else if (typeof exports2 === "object") + exports2["cytoscapeFcose"] = factory(require_cose_base2()); + else + root4["cytoscapeFcose"] = factory(root4["coseBase"]); + }, "webpackUniversalModuleDefinition"))(exports2, function(__WEBPACK_EXTERNAL_MODULE__140__) { + return ( + /******/ + (() => { + "use strict"; + var __webpack_modules__ = { + /***/ + 658: ( + /***/ + (module3) => { + module3.exports = Object.assign != null ? Object.assign.bind(Object) : function(tgt) { + for (var _len = arguments.length, srcs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + srcs[_key - 1] = arguments[_key]; + } + srcs.forEach(function(src) { + Object.keys(src).forEach(function(k2) { + return tgt[k2] = src[k2]; + }); + }); + return tgt; + }; + } + ), + /***/ + 548: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var _slicedToArray2 = /* @__PURE__ */ function() { + function sliceIterator(arr, i2) { + var _arr = []; + var _n = true; + var _d = false; + var _e = void 0; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i2 && _arr.length === i2) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + __name(sliceIterator, "sliceIterator"); + return function(arr, i2) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i2); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; + }(); + var LinkedList = __webpack_require__2(140).layoutBase.LinkedList; + var auxiliary = {}; + auxiliary.getTopMostNodes = function(nodes6) { + var nodesMap2 = {}; + for (var i2 = 0; i2 < nodes6.length; i2++) { + nodesMap2[nodes6[i2].id()] = true; + } + var roots = nodes6.filter(function(ele, i3) { + if (typeof ele === "number") { + ele = i3; + } + var parent4 = ele.parent()[0]; + while (parent4 != null) { + if (nodesMap2[parent4.id()]) { + return false; + } + parent4 = parent4.parent()[0]; + } + return true; + }); + return roots; + }; + auxiliary.connectComponents = function(cy, eles, topMostNodes, dummyNodes) { + var queue = new LinkedList(); + var visited = /* @__PURE__ */ new Set(); + var visitedTopMostNodes = []; + var currentNeighbor = void 0; + var minDegreeNode = void 0; + var minDegree = void 0; + var isConnected = false; + var count = 1; + var nodesConnectedToDummy = []; + var components3 = []; + var _loop = /* @__PURE__ */ __name(function _loop2() { + var cmpt = cy.collection(); + components3.push(cmpt); + var currentNode = topMostNodes[0]; + var childrenOfCurrentNode = cy.collection(); + childrenOfCurrentNode.merge(currentNode).merge(currentNode.descendants().intersection(eles)); + visitedTopMostNodes.push(currentNode); + childrenOfCurrentNode.forEach(function(node2) { + queue.push(node2); + visited.add(node2); + cmpt.merge(node2); + }); + var _loop22 = /* @__PURE__ */ __name(function _loop23() { + currentNode = queue.shift(); + var neighborNodes = cy.collection(); + currentNode.neighborhood().nodes().forEach(function(node2) { + if (eles.intersection(currentNode.edgesWith(node2)).length > 0) { + neighborNodes.merge(node2); + } + }); + for (var i2 = 0; i2 < neighborNodes.length; i2++) { + var neighborNode = neighborNodes[i2]; + currentNeighbor = topMostNodes.intersection(neighborNode.union(neighborNode.ancestors())); + if (currentNeighbor != null && !visited.has(currentNeighbor[0])) { + var childrenOfNeighbor = currentNeighbor.union(currentNeighbor.descendants()); + childrenOfNeighbor.forEach(function(node2) { + queue.push(node2); + visited.add(node2); + cmpt.merge(node2); + if (topMostNodes.has(node2)) { + visitedTopMostNodes.push(node2); + } + }); + } + } + }, "_loop2"); + while (queue.length != 0) { + _loop22(); + } + cmpt.forEach(function(node2) { + eles.intersection(node2.connectedEdges()).forEach(function(e3) { + if (cmpt.has(e3.source()) && cmpt.has(e3.target())) { + cmpt.merge(e3); + } + }); + }); + if (visitedTopMostNodes.length == topMostNodes.length) { + isConnected = true; + } + if (!isConnected || isConnected && count > 1) { + minDegreeNode = visitedTopMostNodes[0]; + minDegree = minDegreeNode.connectedEdges().length; + visitedTopMostNodes.forEach(function(node2) { + if (node2.connectedEdges().length < minDegree) { + minDegree = node2.connectedEdges().length; + minDegreeNode = node2; + } + }); + nodesConnectedToDummy.push(minDegreeNode.id()); + var temp = cy.collection(); + temp.merge(visitedTopMostNodes[0]); + visitedTopMostNodes.forEach(function(node2) { + temp.merge(node2); + }); + visitedTopMostNodes = []; + topMostNodes = topMostNodes.difference(temp); + count++; + } + }, "_loop"); + do { + _loop(); + } while (!isConnected); + if (dummyNodes) { + if (nodesConnectedToDummy.length > 0) { + dummyNodes.set("dummy" + (dummyNodes.size + 1), nodesConnectedToDummy); + } + } + return components3; + }; + auxiliary.relocateComponent = function(originalCenter, componentResult, options3) { + if (!options3.fixedNodeConstraint) { + var minXCoord = Number.POSITIVE_INFINITY; + var maxXCoord = Number.NEGATIVE_INFINITY; + var minYCoord = Number.POSITIVE_INFINITY; + var maxYCoord = Number.NEGATIVE_INFINITY; + if (options3.quality == "draft") { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = void 0; + try { + for (var _iterator = componentResult.nodeIndexes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _ref = _step.value; + var _ref2 = _slicedToArray2(_ref, 2); + var key = _ref2[0]; + var value2 = _ref2[1]; + var cyNode = options3.cy.getElementById(key); + if (cyNode) { + var nodeBB = cyNode.boundingBox(); + var leftX = componentResult.xCoords[value2] - nodeBB.w / 2; + var rightX = componentResult.xCoords[value2] + nodeBB.w / 2; + var topY = componentResult.yCoords[value2] - nodeBB.h / 2; + var bottomY = componentResult.yCoords[value2] + nodeBB.h / 2; + if (leftX < minXCoord) minXCoord = leftX; + if (rightX > maxXCoord) maxXCoord = rightX; + if (topY < minYCoord) minYCoord = topY; + if (bottomY > maxYCoord) maxYCoord = bottomY; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + var diffOnX = originalCenter.x - (maxXCoord + minXCoord) / 2; + var diffOnY = originalCenter.y - (maxYCoord + minYCoord) / 2; + componentResult.xCoords = componentResult.xCoords.map(function(x5) { + return x5 + diffOnX; + }); + componentResult.yCoords = componentResult.yCoords.map(function(y5) { + return y5 + diffOnY; + }); + } else { + Object.keys(componentResult).forEach(function(item) { + var node2 = componentResult[item]; + var leftX2 = node2.getRect().x; + var rightX2 = node2.getRect().x + node2.getRect().width; + var topY2 = node2.getRect().y; + var bottomY2 = node2.getRect().y + node2.getRect().height; + if (leftX2 < minXCoord) minXCoord = leftX2; + if (rightX2 > maxXCoord) maxXCoord = rightX2; + if (topY2 < minYCoord) minYCoord = topY2; + if (bottomY2 > maxYCoord) maxYCoord = bottomY2; + }); + var _diffOnX = originalCenter.x - (maxXCoord + minXCoord) / 2; + var _diffOnY = originalCenter.y - (maxYCoord + minYCoord) / 2; + Object.keys(componentResult).forEach(function(item) { + var node2 = componentResult[item]; + node2.setCenter(node2.getCenterX() + _diffOnX, node2.getCenterY() + _diffOnY); + }); + } + } + }; + auxiliary.calcBoundingBox = function(parentNode, xCoords, yCoords, nodeIndexes) { + var left3 = Number.MAX_SAFE_INTEGER; + var right3 = Number.MIN_SAFE_INTEGER; + var top2 = Number.MAX_SAFE_INTEGER; + var bottom2 = Number.MIN_SAFE_INTEGER; + var nodeLeft = void 0; + var nodeRight = void 0; + var nodeTop = void 0; + var nodeBottom = void 0; + var nodes6 = parentNode.descendants().not(":parent"); + var s2 = nodes6.length; + for (var i2 = 0; i2 < s2; i2++) { + var node2 = nodes6[i2]; + nodeLeft = xCoords[nodeIndexes.get(node2.id())] - node2.width() / 2; + nodeRight = xCoords[nodeIndexes.get(node2.id())] + node2.width() / 2; + nodeTop = yCoords[nodeIndexes.get(node2.id())] - node2.height() / 2; + nodeBottom = yCoords[nodeIndexes.get(node2.id())] + node2.height() / 2; + if (left3 > nodeLeft) { + left3 = nodeLeft; + } + if (right3 < nodeRight) { + right3 = nodeRight; + } + if (top2 > nodeTop) { + top2 = nodeTop; + } + if (bottom2 < nodeBottom) { + bottom2 = nodeBottom; + } + } + var boundingBox3 = {}; + boundingBox3.topLeftX = left3; + boundingBox3.topLeftY = top2; + boundingBox3.width = right3 - left3; + boundingBox3.height = bottom2 - top2; + return boundingBox3; + }; + auxiliary.calcParentsWithoutChildren = function(cy, eles) { + var parentsWithoutChildren = cy.collection(); + eles.nodes(":parent").forEach(function(parent4) { + var check = false; + parent4.children().forEach(function(child) { + if (child.css("display") != "none") { + check = true; + } + }); + if (!check) { + parentsWithoutChildren.merge(parent4); + } + }); + return parentsWithoutChildren; + }; + module3.exports = auxiliary; + } + ), + /***/ + 816: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var aux = __webpack_require__2(548); + var CoSELayout = __webpack_require__2(140).CoSELayout; + var CoSENode = __webpack_require__2(140).CoSENode; + var PointD = __webpack_require__2(140).layoutBase.PointD; + var DimensionD2 = __webpack_require__2(140).layoutBase.DimensionD; + var LayoutConstants = __webpack_require__2(140).layoutBase.LayoutConstants; + var FDLayoutConstants = __webpack_require__2(140).layoutBase.FDLayoutConstants; + var CoSEConstants = __webpack_require__2(140).CoSEConstants; + var coseLayout = /* @__PURE__ */ __name(function coseLayout2(options3, spectralResult) { + var cy = options3.cy; + var eles = options3.eles; + var nodes6 = eles.nodes(); + var edges5 = eles.edges(); + var nodeIndexes = void 0; + var xCoords = void 0; + var yCoords = void 0; + var idToLNode = {}; + if (options3.randomize) { + nodeIndexes = spectralResult["nodeIndexes"]; + xCoords = spectralResult["xCoords"]; + yCoords = spectralResult["yCoords"]; + } + var isFn = /* @__PURE__ */ __name(function isFn2(fn3) { + return typeof fn3 === "function"; + }, "isFn"); + var optFn = /* @__PURE__ */ __name(function optFn2(opt, ele) { + if (isFn(opt)) { + return opt(ele); + } else { + return opt; + } + }, "optFn"); + var parentsWithoutChildren = aux.calcParentsWithoutChildren(cy, eles); + var processChildrenList = /* @__PURE__ */ __name(function processChildrenList2(parent4, children2, layout6, options4) { + var size5 = children2.length; + for (var i2 = 0; i2 < size5; i2++) { + var theChild = children2[i2]; + var children_of_children = null; + if (theChild.intersection(parentsWithoutChildren).length == 0) { + children_of_children = theChild.children(); + } + var theNode = void 0; + var dimensions2 = theChild.layoutDimensions({ + nodeDimensionsIncludeLabels: options4.nodeDimensionsIncludeLabels + }); + if (theChild.outerWidth() != null && theChild.outerHeight() != null) { + if (options4.randomize) { + if (!theChild.isParent()) { + theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(xCoords[nodeIndexes.get(theChild.id())] - dimensions2.w / 2, yCoords[nodeIndexes.get(theChild.id())] - dimensions2.h / 2), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h)))); + } else { + var parentInfo = aux.calcBoundingBox(theChild, xCoords, yCoords, nodeIndexes); + if (theChild.intersection(parentsWithoutChildren).length == 0) { + theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(parentInfo.topLeftX, parentInfo.topLeftY), new DimensionD2(parentInfo.width, parentInfo.height))); + } else { + theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(parentInfo.topLeftX, parentInfo.topLeftY), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h)))); + } + } + } else { + theNode = parent4.add(new CoSENode(layout6.graphManager, new PointD(theChild.position("x") - dimensions2.w / 2, theChild.position("y") - dimensions2.h / 2), new DimensionD2(parseFloat(dimensions2.w), parseFloat(dimensions2.h)))); + } + } else { + theNode = parent4.add(new CoSENode(this.graphManager)); + } + theNode.id = theChild.data("id"); + theNode.nodeRepulsion = optFn(options4.nodeRepulsion, theChild); + theNode.paddingLeft = parseInt(theChild.css("padding")); + theNode.paddingTop = parseInt(theChild.css("padding")); + theNode.paddingRight = parseInt(theChild.css("padding")); + theNode.paddingBottom = parseInt(theChild.css("padding")); + if (options4.nodeDimensionsIncludeLabels) { + theNode.labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).w; + theNode.labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).h; + theNode.labelPosVertical = theChild.css("text-valign"); + theNode.labelPosHorizontal = theChild.css("text-halign"); + } + idToLNode[theChild.data("id")] = theNode; + if (isNaN(theNode.rect.x)) { + theNode.rect.x = 0; + } + if (isNaN(theNode.rect.y)) { + theNode.rect.y = 0; + } + if (children_of_children != null && children_of_children.length > 0) { + var theNewGraph = void 0; + theNewGraph = layout6.getGraphManager().add(layout6.newGraph(), theNode); + processChildrenList2(theNewGraph, children_of_children, layout6, options4); + } + } + }, "processChildrenList"); + var processEdges = /* @__PURE__ */ __name(function processEdges2(layout6, gm2, edges6) { + var idealLengthTotal = 0; + var edgeCount4 = 0; + for (var i2 = 0; i2 < edges6.length; i2++) { + var edge = edges6[i2]; + var sourceNode = idToLNode[edge.data("source")]; + var targetNode = idToLNode[edge.data("target")]; + if (sourceNode && targetNode && sourceNode !== targetNode && sourceNode.getEdgesBetween(targetNode).length == 0) { + var e1 = gm2.add(layout6.newEdge(), sourceNode, targetNode); + e1.id = edge.id(); + e1.idealLength = optFn(options3.idealEdgeLength, edge); + e1.edgeElasticity = optFn(options3.edgeElasticity, edge); + idealLengthTotal += e1.idealLength; + edgeCount4++; + } + } + if (options3.idealEdgeLength != null) { + if (edgeCount4 > 0) CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = idealLengthTotal / edgeCount4; + else if (!isFn(options3.idealEdgeLength)) + CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = options3.idealEdgeLength; + else + CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = 50; + CoSEConstants.MIN_REPULSION_DIST = FDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10; + CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH; + } + }, "processEdges"); + var processConstraints = /* @__PURE__ */ __name(function processConstraints2(layout6, options4) { + if (options4.fixedNodeConstraint) { + layout6.constraints["fixedNodeConstraint"] = options4.fixedNodeConstraint; + } + if (options4.alignmentConstraint) { + layout6.constraints["alignmentConstraint"] = options4.alignmentConstraint; + } + if (options4.relativePlacementConstraint) { + layout6.constraints["relativePlacementConstraint"] = options4.relativePlacementConstraint; + } + }, "processConstraints"); + if (options3.nestingFactor != null) CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = options3.nestingFactor; + if (options3.gravity != null) CoSEConstants.DEFAULT_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = options3.gravity; + if (options3.numIter != null) CoSEConstants.MAX_ITERATIONS = FDLayoutConstants.MAX_ITERATIONS = options3.numIter; + if (options3.gravityRange != null) CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = options3.gravityRange; + if (options3.gravityCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = options3.gravityCompound; + if (options3.gravityRangeCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = options3.gravityRangeCompound; + if (options3.initialEnergyOnIncremental != null) CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = options3.initialEnergyOnIncremental; + if (options3.tilingCompareBy != null) CoSEConstants.TILING_COMPARE_BY = options3.tilingCompareBy; + if (options3.quality == "proof") LayoutConstants.QUALITY = 2; + else LayoutConstants.QUALITY = 0; + CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS = FDLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = options3.nodeDimensionsIncludeLabels; + CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = !options3.randomize; + CoSEConstants.ANIMATE = FDLayoutConstants.ANIMATE = LayoutConstants.ANIMATE = options3.animate; + CoSEConstants.TILE = options3.tile; + CoSEConstants.TILING_PADDING_VERTICAL = typeof options3.tilingPaddingVertical === "function" ? options3.tilingPaddingVertical.call() : options3.tilingPaddingVertical; + CoSEConstants.TILING_PADDING_HORIZONTAL = typeof options3.tilingPaddingHorizontal === "function" ? options3.tilingPaddingHorizontal.call() : options3.tilingPaddingHorizontal; + CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = true; + CoSEConstants.PURE_INCREMENTAL = !options3.randomize; + LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES = options3.uniformNodeDimensions; + if (options3.step == "transformed") { + CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true; + CoSEConstants.ENFORCE_CONSTRAINTS = false; + CoSEConstants.APPLY_LAYOUT = false; + } + if (options3.step == "enforced") { + CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false; + CoSEConstants.ENFORCE_CONSTRAINTS = true; + CoSEConstants.APPLY_LAYOUT = false; + } + if (options3.step == "cose") { + CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false; + CoSEConstants.ENFORCE_CONSTRAINTS = false; + CoSEConstants.APPLY_LAYOUT = true; + } + if (options3.step == "all") { + if (options3.randomize) CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = true; + else CoSEConstants.TRANSFORM_ON_CONSTRAINT_HANDLING = false; + CoSEConstants.ENFORCE_CONSTRAINTS = true; + CoSEConstants.APPLY_LAYOUT = true; + } + if (options3.fixedNodeConstraint || options3.alignmentConstraint || options3.relativePlacementConstraint) { + CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false; + } else { + CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = true; + } + var coseLayout3 = new CoSELayout(); + var gm = coseLayout3.newGraphManager(); + processChildrenList(gm.addRoot(), aux.getTopMostNodes(nodes6), coseLayout3, options3); + processEdges(coseLayout3, gm, edges5); + processConstraints(coseLayout3, options3); + coseLayout3.runLayout(); + return idToLNode; + }, "coseLayout"); + module3.exports = { coseLayout }; + } + ), + /***/ + 212: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var _createClass2 = /* @__PURE__ */ function() { + function defineProperties(target, props) { + for (var i2 = 0; i2 < props.length; i2++) { + var descriptor = props[i2]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + __name(defineProperties, "defineProperties"); + return function(Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + function _classCallCheck2(instance2, Constructor) { + if (!(instance2 instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + __name(_classCallCheck2, "_classCallCheck"); + var assign7 = __webpack_require__2(658); + var aux = __webpack_require__2(548); + var _require = __webpack_require__2(657), spectralLayout = _require.spectralLayout; + var _require2 = __webpack_require__2(816), coseLayout = _require2.coseLayout; + var defaults4 = Object.freeze({ + // 'draft', 'default' or 'proof' + // - 'draft' only applies spectral layout + // - 'default' improves the quality with subsequent CoSE layout (fast cooling rate) + // - 'proof' improves the quality with subsequent CoSE layout (slow cooling rate) + quality: "default", + // Use random node positions at beginning of layout + // if this is set to false, then quality option must be "proof" + randomize: true, + // Whether or not to animate the layout + animate: true, + // Duration of animation in ms, if enabled + animationDuration: 1e3, + // Easing of animation, if enabled + animationEasing: void 0, + // Fit the viewport to the repositioned nodes + fit: true, + // Padding around layout + padding: 30, + // Whether to include labels in node dimensions. Valid in "proof" quality + nodeDimensionsIncludeLabels: false, + // Whether or not simple nodes (non-compound nodes) are of uniform dimensions + uniformNodeDimensions: false, + // Whether to pack disconnected components - valid only if randomize: true + packComponents: true, + // Layout step - all, transformed, enforced, cose - for debug purpose only + step: "all", + /* spectral layout options */ + // False for random, true for greedy + samplingType: true, + // Sample size to construct distance matrix + sampleSize: 25, + // Separation amount between nodes + nodeSeparation: 75, + // Power iteration tolerance + piTol: 1e-7, + /* CoSE layout options */ + // Node repulsion (non overlapping) multiplier + nodeRepulsion: /* @__PURE__ */ __name(function nodeRepulsion4(node2) { + return 4500; + }, "nodeRepulsion"), + // Ideal edge (non nested) length + idealEdgeLength: /* @__PURE__ */ __name(function idealEdgeLength2(edge) { + return 50; + }, "idealEdgeLength"), + // Divisor to compute edge forces + edgeElasticity: /* @__PURE__ */ __name(function edgeElasticity2(edge) { + return 0.45; + }, "edgeElasticity"), + // Nesting factor (multiplier) to compute ideal edge length for nested edges + nestingFactor: 0.1, + // Gravity force (constant) + gravity: 0.25, + // Maximum number of iterations to perform + numIter: 2500, + // For enabling tiling + tile: true, + // The function that specifies the criteria for comparing nodes while sorting them during tiling operation. + // Takes the node id as a parameter and the default tiling operation is perfomed when this option is not set. + tilingCompareBy: void 0, + // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function) + tilingPaddingVertical: 10, + // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function) + tilingPaddingHorizontal: 10, + // Gravity range (constant) for compounds + gravityRangeCompound: 1.5, + // Gravity force (constant) for compounds + gravityCompound: 1, + // Gravity range (constant) + gravityRange: 3.8, + // Initial cooling factor for incremental layout + initialEnergyOnIncremental: 0.3, + /* constraint options */ + // Fix required nodes to predefined positions + // [{nodeId: 'n1', position: {x: 100, y: 200}, {...}] + fixedNodeConstraint: void 0, + // Align required nodes in vertical/horizontal direction + // {vertical: [['n1', 'n2')], ['n3', 'n4']], horizontal: ['n2', 'n4']} + alignmentConstraint: void 0, + // Place two nodes relatively in vertical/horizontal direction + // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}] + relativePlacementConstraint: void 0, + /* layout event callbacks */ + ready: /* @__PURE__ */ __name(function ready4() { + }, "ready"), + // on layoutready + stop: /* @__PURE__ */ __name(function stop5() { + }, "stop") + // on layoutstop + }); + var Layout2 = function() { + function Layout3(options3) { + _classCallCheck2(this, Layout3); + this.options = assign7({}, defaults4, options3); + } + __name(Layout3, "Layout"); + _createClass2(Layout3, [{ + key: "run", + value: /* @__PURE__ */ __name(function run5() { + var layout6 = this; + var options3 = this.options; + var cy = options3.cy; + var eles = options3.eles; + var spectralResult = []; + var xCoords = void 0; + var yCoords = void 0; + var coseResult = []; + var components3 = void 0; + var componentCenters = []; + if (options3.fixedNodeConstraint && (!Array.isArray(options3.fixedNodeConstraint) || options3.fixedNodeConstraint.length == 0)) { + options3.fixedNodeConstraint = void 0; + } + if (options3.alignmentConstraint) { + if (options3.alignmentConstraint.vertical && (!Array.isArray(options3.alignmentConstraint.vertical) || options3.alignmentConstraint.vertical.length == 0)) { + options3.alignmentConstraint.vertical = void 0; + } + if (options3.alignmentConstraint.horizontal && (!Array.isArray(options3.alignmentConstraint.horizontal) || options3.alignmentConstraint.horizontal.length == 0)) { + options3.alignmentConstraint.horizontal = void 0; + } + } + if (options3.relativePlacementConstraint && (!Array.isArray(options3.relativePlacementConstraint) || options3.relativePlacementConstraint.length == 0)) { + options3.relativePlacementConstraint = void 0; + } + var constraintExist = options3.fixedNodeConstraint || options3.alignmentConstraint || options3.relativePlacementConstraint; + if (constraintExist) { + options3.tile = false; + options3.packComponents = false; + } + var layUtil = void 0; + var packingEnabled = false; + if (cy.layoutUtilities && options3.packComponents) { + layUtil = cy.layoutUtilities("get"); + if (!layUtil) layUtil = cy.layoutUtilities(); + packingEnabled = true; + } + if (eles.nodes().length > 0) { + if (!packingEnabled) { + var boundingBox3 = options3.eles.boundingBox(); + componentCenters.push({ x: boundingBox3.x1 + boundingBox3.w / 2, y: boundingBox3.y1 + boundingBox3.h / 2 }); + if (options3.randomize) { + var result = spectralLayout(options3); + spectralResult.push(result); + } + if (options3.quality == "default" || options3.quality == "proof") { + coseResult.push(coseLayout(options3, spectralResult[0])); + aux.relocateComponent(componentCenters[0], coseResult[0], options3); + } else { + aux.relocateComponent(componentCenters[0], spectralResult[0], options3); + } + } else { + var topMostNodes = aux.getTopMostNodes(options3.eles.nodes()); + components3 = aux.connectComponents(cy, options3.eles, topMostNodes); + components3.forEach(function(component2) { + var boundingBox4 = component2.boundingBox(); + componentCenters.push({ x: boundingBox4.x1 + boundingBox4.w / 2, y: boundingBox4.y1 + boundingBox4.h / 2 }); + }); + if (options3.randomize) { + components3.forEach(function(component2) { + options3.eles = component2; + spectralResult.push(spectralLayout(options3)); + }); + } + if (options3.quality == "default" || options3.quality == "proof") { + var toBeTiledNodes = cy.collection(); + if (options3.tile) { + var nodeIndexes = /* @__PURE__ */ new Map(); + var _xCoords = []; + var _yCoords = []; + var count = 0; + var tempSpectralResult = { nodeIndexes, xCoords: _xCoords, yCoords: _yCoords }; + var indexesToBeDeleted = []; + components3.forEach(function(component2, index) { + if (component2.edges().length == 0) { + component2.nodes().forEach(function(node2, i3) { + toBeTiledNodes.merge(component2.nodes()[i3]); + if (!node2.isParent()) { + tempSpectralResult.nodeIndexes.set(component2.nodes()[i3].id(), count++); + tempSpectralResult.xCoords.push(component2.nodes()[0].position().x); + tempSpectralResult.yCoords.push(component2.nodes()[0].position().y); + } + }); + indexesToBeDeleted.push(index); + } + }); + if (toBeTiledNodes.length > 1) { + var _boundingBox = toBeTiledNodes.boundingBox(); + componentCenters.push({ x: _boundingBox.x1 + _boundingBox.w / 2, y: _boundingBox.y1 + _boundingBox.h / 2 }); + components3.push(toBeTiledNodes); + spectralResult.push(tempSpectralResult); + for (var i2 = indexesToBeDeleted.length - 1; i2 >= 0; i2--) { + components3.splice(indexesToBeDeleted[i2], 1); + spectralResult.splice(indexesToBeDeleted[i2], 1); + componentCenters.splice(indexesToBeDeleted[i2], 1); + } + ; + } + } + components3.forEach(function(component2, index) { + options3.eles = component2; + coseResult.push(coseLayout(options3, spectralResult[index])); + aux.relocateComponent(componentCenters[index], coseResult[index], options3); + }); + } else { + components3.forEach(function(component2, index) { + aux.relocateComponent(componentCenters[index], spectralResult[index], options3); + }); + } + var componentsEvaluated = /* @__PURE__ */ new Set(); + if (components3.length > 1) { + var subgraphs = []; + var hiddenEles = eles.filter(function(ele) { + return ele.css("display") == "none"; + }); + components3.forEach(function(component2, index) { + var nodeIndexes2 = void 0; + if (options3.quality == "draft") { + nodeIndexes2 = spectralResult[index].nodeIndexes; + } + if (component2.nodes().not(hiddenEles).length > 0) { + var subgraph = {}; + subgraph.edges = []; + subgraph.nodes = []; + var nodeIndex = void 0; + component2.nodes().not(hiddenEles).forEach(function(node2) { + if (options3.quality == "draft") { + if (!node2.isParent()) { + nodeIndex = nodeIndexes2.get(node2.id()); + subgraph.nodes.push({ x: spectralResult[index].xCoords[nodeIndex] - node2.boundingbox().w / 2, y: spectralResult[index].yCoords[nodeIndex] - node2.boundingbox().h / 2, width: node2.boundingbox().w, height: node2.boundingbox().h }); + } else { + var parentInfo = aux.calcBoundingBox(node2, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2); + subgraph.nodes.push({ x: parentInfo.topLeftX, y: parentInfo.topLeftY, width: parentInfo.width, height: parentInfo.height }); + } + } else { + if (coseResult[index][node2.id()]) { + subgraph.nodes.push({ x: coseResult[index][node2.id()].getLeft(), y: coseResult[index][node2.id()].getTop(), width: coseResult[index][node2.id()].getWidth(), height: coseResult[index][node2.id()].getHeight() }); + } + } + }); + component2.edges().forEach(function(edge) { + var source = edge.source(); + var target = edge.target(); + if (source.css("display") != "none" && target.css("display") != "none") { + if (options3.quality == "draft") { + var sourceNodeIndex = nodeIndexes2.get(source.id()); + var targetNodeIndex = nodeIndexes2.get(target.id()); + var sourceCenter = []; + var targetCenter = []; + if (source.isParent()) { + var parentInfo = aux.calcBoundingBox(source, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2); + sourceCenter.push(parentInfo.topLeftX + parentInfo.width / 2); + sourceCenter.push(parentInfo.topLeftY + parentInfo.height / 2); + } else { + sourceCenter.push(spectralResult[index].xCoords[sourceNodeIndex]); + sourceCenter.push(spectralResult[index].yCoords[sourceNodeIndex]); + } + if (target.isParent()) { + var _parentInfo = aux.calcBoundingBox(target, spectralResult[index].xCoords, spectralResult[index].yCoords, nodeIndexes2); + targetCenter.push(_parentInfo.topLeftX + _parentInfo.width / 2); + targetCenter.push(_parentInfo.topLeftY + _parentInfo.height / 2); + } else { + targetCenter.push(spectralResult[index].xCoords[targetNodeIndex]); + targetCenter.push(spectralResult[index].yCoords[targetNodeIndex]); + } + subgraph.edges.push({ startX: sourceCenter[0], startY: sourceCenter[1], endX: targetCenter[0], endY: targetCenter[1] }); + } else { + if (coseResult[index][source.id()] && coseResult[index][target.id()]) { + subgraph.edges.push({ startX: coseResult[index][source.id()].getCenterX(), startY: coseResult[index][source.id()].getCenterY(), endX: coseResult[index][target.id()].getCenterX(), endY: coseResult[index][target.id()].getCenterY() }); + } + } + } + }); + if (subgraph.nodes.length > 0) { + subgraphs.push(subgraph); + componentsEvaluated.add(index); + } + } + }); + var shiftResult = layUtil.packComponents(subgraphs, options3.randomize).shifts; + if (options3.quality == "draft") { + spectralResult.forEach(function(result2, index) { + var newXCoords = result2.xCoords.map(function(x5) { + return x5 + shiftResult[index].dx; + }); + var newYCoords = result2.yCoords.map(function(y5) { + return y5 + shiftResult[index].dy; + }); + result2.xCoords = newXCoords; + result2.yCoords = newYCoords; + }); + } else { + var _count = 0; + componentsEvaluated.forEach(function(index) { + Object.keys(coseResult[index]).forEach(function(item) { + var nodeRectangle = coseResult[index][item]; + nodeRectangle.setCenter(nodeRectangle.getCenterX() + shiftResult[_count].dx, nodeRectangle.getCenterY() + shiftResult[_count].dy); + }); + _count++; + }); + } + } + } + } + var getPositions = /* @__PURE__ */ __name(function getPositions2(ele, i3) { + if (options3.quality == "default" || options3.quality == "proof") { + if (typeof ele === "number") { + ele = i3; + } + var pos = void 0; + var node2 = void 0; + var theId = ele.data("id"); + coseResult.forEach(function(result2) { + if (theId in result2) { + pos = { x: result2[theId].getRect().getCenterX(), y: result2[theId].getRect().getCenterY() }; + node2 = result2[theId]; + } + }); + if (options3.nodeDimensionsIncludeLabels) { + if (node2.labelWidth) { + if (node2.labelPosHorizontal == "left") { + pos.x += node2.labelWidth / 2; + } else if (node2.labelPosHorizontal == "right") { + pos.x -= node2.labelWidth / 2; + } + } + if (node2.labelHeight) { + if (node2.labelPosVertical == "top") { + pos.y += node2.labelHeight / 2; + } else if (node2.labelPosVertical == "bottom") { + pos.y -= node2.labelHeight / 2; + } + } + } + if (pos == void 0) pos = { x: ele.position("x"), y: ele.position("y") }; + return { + x: pos.x, + y: pos.y + }; + } else { + var _pos = void 0; + spectralResult.forEach(function(result2) { + var index = result2.nodeIndexes.get(ele.id()); + if (index != void 0) { + _pos = { x: result2.xCoords[index], y: result2.yCoords[index] }; + } + }); + if (_pos == void 0) _pos = { x: ele.position("x"), y: ele.position("y") }; + return { + x: _pos.x, + y: _pos.y + }; + } + }, "getPositions"); + if (options3.quality == "default" || options3.quality == "proof" || options3.randomize) { + var parentsWithoutChildren = aux.calcParentsWithoutChildren(cy, eles); + var _hiddenEles = eles.filter(function(ele) { + return ele.css("display") == "none"; + }); + options3.eles = eles.not(_hiddenEles); + eles.nodes().not(":parent").not(_hiddenEles).layoutPositions(layout6, options3, getPositions); + if (parentsWithoutChildren.length > 0) { + parentsWithoutChildren.forEach(function(ele) { + ele.position(getPositions(ele)); + }); + } + } else { + console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'."); + } + }, "run") + }]); + return Layout3; + }(); + module3.exports = Layout2; + } + ), + /***/ + 657: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var aux = __webpack_require__2(548); + var Matrix = __webpack_require__2(140).layoutBase.Matrix; + var SVD = __webpack_require__2(140).layoutBase.SVD; + var spectralLayout = /* @__PURE__ */ __name(function spectralLayout2(options3) { + var cy = options3.cy; + var eles = options3.eles; + var nodes6 = eles.nodes(); + var parentNodes = eles.nodes(":parent"); + var dummyNodes = /* @__PURE__ */ new Map(); + var nodeIndexes = /* @__PURE__ */ new Map(); + var parentChildMap = /* @__PURE__ */ new Map(); + var allNodesNeighborhood = []; + var xCoords = []; + var yCoords = []; + var samplesColumn = []; + var minDistancesColumn = []; + var C2 = []; + var PHI = []; + var INV = []; + var firstSample = void 0; + var nodeSize = void 0; + var infinity = 1e8; + var small = 1e-9; + var piTol = options3.piTol; + var samplingType = options3.samplingType; + var nodeSeparation = options3.nodeSeparation; + var sampleSize = void 0; + var randomSampleCR = /* @__PURE__ */ __name(function randomSampleCR2() { + var sample2 = 0; + var count = 0; + var flag = false; + while (count < sampleSize) { + sample2 = Math.floor(Math.random() * nodeSize); + flag = false; + for (var i3 = 0; i3 < count; i3++) { + if (samplesColumn[i3] == sample2) { + flag = true; + break; + } + } + if (!flag) { + samplesColumn[count] = sample2; + count++; + } else { + continue; + } + } + }, "randomSampleCR"); + var BFS = /* @__PURE__ */ __name(function BFS2(pivot, index2, samplingMethod) { + var path4 = []; + var front = 0; + var back = 0; + var current = 0; + var temp = void 0; + var distance2 = []; + var max_dist = 0; + var max_ind = 1; + for (var i3 = 0; i3 < nodeSize; i3++) { + distance2[i3] = infinity; + } + path4[back] = pivot; + distance2[pivot] = 0; + while (back >= front) { + current = path4[front++]; + var neighbors = allNodesNeighborhood[current]; + for (var _i = 0; _i < neighbors.length; _i++) { + temp = nodeIndexes.get(neighbors[_i]); + if (distance2[temp] == infinity) { + distance2[temp] = distance2[current] + 1; + path4[++back] = temp; + } + } + C2[current][index2] = distance2[current] * nodeSeparation; + } + if (samplingMethod) { + for (var _i2 = 0; _i2 < nodeSize; _i2++) { + if (C2[_i2][index2] < minDistancesColumn[_i2]) minDistancesColumn[_i2] = C2[_i2][index2]; + } + for (var _i3 = 0; _i3 < nodeSize; _i3++) { + if (minDistancesColumn[_i3] > max_dist) { + max_dist = minDistancesColumn[_i3]; + max_ind = _i3; + } + } + } + return max_ind; + }, "BFS"); + var allBFS = /* @__PURE__ */ __name(function allBFS2(samplingMethod) { + var sample2 = void 0; + if (!samplingMethod) { + randomSampleCR(); + for (var i3 = 0; i3 < sampleSize; i3++) { + BFS(samplesColumn[i3], i3, samplingMethod, false); + } + } else { + sample2 = Math.floor(Math.random() * nodeSize); + firstSample = sample2; + for (var _i4 = 0; _i4 < nodeSize; _i4++) { + minDistancesColumn[_i4] = infinity; + } + for (var _i5 = 0; _i5 < sampleSize; _i5++) { + samplesColumn[_i5] = sample2; + sample2 = BFS(sample2, _i5, samplingMethod); + } + } + for (var _i6 = 0; _i6 < nodeSize; _i6++) { + for (var j2 = 0; j2 < sampleSize; j2++) { + C2[_i6][j2] *= C2[_i6][j2]; + } + } + for (var _i7 = 0; _i7 < sampleSize; _i7++) { + PHI[_i7] = []; + } + for (var _i8 = 0; _i8 < sampleSize; _i8++) { + for (var _j = 0; _j < sampleSize; _j++) { + PHI[_i8][_j] = C2[samplesColumn[_j]][_i8]; + } + } + }, "allBFS"); + var sample = /* @__PURE__ */ __name(function sample2() { + var SVDResult = SVD.svd(PHI); + var a_q = SVDResult.S; + var a_u = SVDResult.U; + var a_v = SVDResult.V; + var max_s = a_q[0] * a_q[0] * a_q[0]; + var a_Sig = []; + for (var i3 = 0; i3 < sampleSize; i3++) { + a_Sig[i3] = []; + for (var j2 = 0; j2 < sampleSize; j2++) { + a_Sig[i3][j2] = 0; + if (i3 == j2) { + a_Sig[i3][j2] = a_q[i3] / (a_q[i3] * a_q[i3] + max_s / (a_q[i3] * a_q[i3])); + } + } + } + INV = Matrix.multMat(Matrix.multMat(a_v, a_Sig), Matrix.transpose(a_u)); + }, "sample"); + var powerIteration = /* @__PURE__ */ __name(function powerIteration2() { + var theta1 = void 0; + var theta2 = void 0; + var Y1 = []; + var Y22 = []; + var V1 = []; + var V2 = []; + for (var i3 = 0; i3 < nodeSize; i3++) { + Y1[i3] = Math.random(); + Y22[i3] = Math.random(); + } + Y1 = Matrix.normalize(Y1); + Y22 = Matrix.normalize(Y22); + var count = 0; + var current = small; + var previous = small; + var temp = void 0; + while (true) { + count++; + for (var _i9 = 0; _i9 < nodeSize; _i9++) { + V1[_i9] = Y1[_i9]; + } + Y1 = Matrix.multGamma(Matrix.multL(Matrix.multGamma(V1), C2, INV)); + theta1 = Matrix.dotProduct(V1, Y1); + Y1 = Matrix.normalize(Y1); + current = Matrix.dotProduct(V1, Y1); + temp = Math.abs(current / previous); + if (temp <= 1 + piTol && temp >= 1) { + break; + } + previous = current; + } + for (var _i10 = 0; _i10 < nodeSize; _i10++) { + V1[_i10] = Y1[_i10]; + } + count = 0; + previous = small; + while (true) { + count++; + for (var _i11 = 0; _i11 < nodeSize; _i11++) { + V2[_i11] = Y22[_i11]; + } + V2 = Matrix.minusOp(V2, Matrix.multCons(V1, Matrix.dotProduct(V1, V2))); + Y22 = Matrix.multGamma(Matrix.multL(Matrix.multGamma(V2), C2, INV)); + theta2 = Matrix.dotProduct(V2, Y22); + Y22 = Matrix.normalize(Y22); + current = Matrix.dotProduct(V2, Y22); + temp = Math.abs(current / previous); + if (temp <= 1 + piTol && temp >= 1) { + break; + } + previous = current; + } + for (var _i12 = 0; _i12 < nodeSize; _i12++) { + V2[_i12] = Y22[_i12]; + } + xCoords = Matrix.multCons(V1, Math.sqrt(Math.abs(theta1))); + yCoords = Matrix.multCons(V2, Math.sqrt(Math.abs(theta2))); + }, "powerIteration"); + aux.connectComponents(cy, eles, aux.getTopMostNodes(nodes6), dummyNodes); + parentNodes.forEach(function(ele) { + aux.connectComponents(cy, eles, aux.getTopMostNodes(ele.descendants().intersection(eles)), dummyNodes); + }); + var index = 0; + for (var i2 = 0; i2 < nodes6.length; i2++) { + if (!nodes6[i2].isParent()) { + nodeIndexes.set(nodes6[i2].id(), index++); + } + } + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = void 0; + try { + for (var _iterator = dummyNodes.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var key = _step.value; + nodeIndexes.set(key, index++); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + for (var _i13 = 0; _i13 < nodeIndexes.size; _i13++) { + allNodesNeighborhood[_i13] = []; + } + parentNodes.forEach(function(ele) { + var children2 = ele.children().intersection(eles); + while (children2.nodes(":childless").length == 0) { + children2 = children2.nodes()[0].children().intersection(eles); + } + var index2 = 0; + var min9 = children2.nodes(":childless")[0].connectedEdges().length; + children2.nodes(":childless").forEach(function(ele2, i3) { + if (ele2.connectedEdges().length < min9) { + min9 = ele2.connectedEdges().length; + index2 = i3; + } + }); + parentChildMap.set(ele.id(), children2.nodes(":childless")[index2].id()); + }); + nodes6.forEach(function(ele) { + var eleIndex = void 0; + if (ele.isParent()) eleIndex = nodeIndexes.get(parentChildMap.get(ele.id())); + else eleIndex = nodeIndexes.get(ele.id()); + ele.neighborhood().nodes().forEach(function(node2) { + if (eles.intersection(ele.edgesWith(node2)).length > 0) { + if (node2.isParent()) allNodesNeighborhood[eleIndex].push(parentChildMap.get(node2.id())); + else allNodesNeighborhood[eleIndex].push(node2.id()); + } + }); + }); + var _loop = /* @__PURE__ */ __name(function _loop2(_key2) { + var eleIndex = nodeIndexes.get(_key2); + var disconnectedId = void 0; + dummyNodes.get(_key2).forEach(function(id27) { + if (cy.getElementById(id27).isParent()) disconnectedId = parentChildMap.get(id27); + else disconnectedId = id27; + allNodesNeighborhood[eleIndex].push(disconnectedId); + allNodesNeighborhood[nodeIndexes.get(disconnectedId)].push(_key2); + }); + }, "_loop"); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = void 0; + try { + for (var _iterator2 = dummyNodes.keys()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var _key = _step2.value; + _loop(_key); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + nodeSize = nodeIndexes.size; + var spectralResult = void 0; + if (nodeSize > 2) { + sampleSize = nodeSize < options3.sampleSize ? nodeSize : options3.sampleSize; + for (var _i14 = 0; _i14 < nodeSize; _i14++) { + C2[_i14] = []; + } + for (var _i15 = 0; _i15 < sampleSize; _i15++) { + INV[_i15] = []; + } + if (options3.quality == "draft" || options3.step == "all") { + allBFS(samplingType); + sample(); + powerIteration(); + spectralResult = { nodeIndexes, xCoords, yCoords }; + } else { + nodeIndexes.forEach(function(value2, key2) { + xCoords.push(cy.getElementById(key2).position("x")); + yCoords.push(cy.getElementById(key2).position("y")); + }); + spectralResult = { nodeIndexes, xCoords, yCoords }; + } + return spectralResult; + } else { + var iterator = nodeIndexes.keys(); + var firstNode = cy.getElementById(iterator.next().value); + var firstNodePos = firstNode.position(); + var firstNodeWidth = firstNode.outerWidth(); + xCoords.push(firstNodePos.x); + yCoords.push(firstNodePos.y); + if (nodeSize == 2) { + var secondNode = cy.getElementById(iterator.next().value); + var secondNodeWidth = secondNode.outerWidth(); + xCoords.push(firstNodePos.x + firstNodeWidth / 2 + secondNodeWidth / 2 + options3.idealEdgeLength); + yCoords.push(firstNodePos.y); + } + spectralResult = { nodeIndexes, xCoords, yCoords }; + return spectralResult; + } + }, "spectralLayout"); + module3.exports = { spectralLayout }; + } + ), + /***/ + 579: ( + /***/ + (module3, __unused_webpack_exports, __webpack_require__2) => { + var impl2 = __webpack_require__2(212); + var register = /* @__PURE__ */ __name(function register2(cytoscape4) { + if (!cytoscape4) { + return; + } + cytoscape4("layout", "fcose", impl2); + }, "register"); + if (typeof cytoscape !== "undefined") { + register(cytoscape); + } + module3.exports = register; + } + ), + /***/ + 140: ( + /***/ + (module3) => { + module3.exports = __WEBPACK_EXTERNAL_MODULE__140__; + } + ) + /******/ + }; + var __webpack_module_cache__ = {}; + function __webpack_require__(moduleId) { + var cachedModule = __webpack_module_cache__[moduleId]; + if (cachedModule !== void 0) { + return cachedModule.exports; + } + var module3 = __webpack_module_cache__[moduleId] = { + /******/ + // no module.id needed + /******/ + // no module.loaded needed + /******/ + exports: {} + /******/ + }; + __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__); + return module3.exports; + } + __name(__webpack_require__, "__webpack_require__"); + var __webpack_exports__ = __webpack_require__(579); + return __webpack_exports__; + })() + ); + }); + } + }); + + // src/diagrams/architecture/architectureIcons.ts + var wrapIcon, architectureIcons; + var init_architectureIcons = __esm({ + "src/diagrams/architecture/architectureIcons.ts"() { + "use strict"; + init_icons(); + wrapIcon = /* @__PURE__ */ __name((icon) => { + return `${icon}`; + }, "wrapIcon"); + architectureIcons = { + prefix: "mermaid-architecture", + height: 80, + width: 80, + icons: { + database: { + body: wrapIcon( + '' + ) + }, + server: { + body: wrapIcon( + '' + ) + }, + disk: { + body: wrapIcon( + '' + ) + }, + internet: { + body: wrapIcon( + '' + ) + }, + cloud: { + body: wrapIcon( + '' + ) + }, + unknown: unknownIcon, + blank: { + body: wrapIcon("") + } + } + }; + } + }); + + // src/diagrams/architecture/svgDraw.ts + var drawEdges2, drawGroups, drawServices, drawJunctions; + var init_svgDraw7 = __esm({ + "src/diagrams/architecture/svgDraw.ts"() { + "use strict"; + init_icons(); + init_diagramAPI(); + init_createText(); + init_architectureDb(); + init_architectureIcons(); + init_architectureTypes(); + drawEdges2 = /* @__PURE__ */ __name(async function(edgesEl, cy) { + const padding3 = getConfigField("padding"); + const iconSize = getConfigField("iconSize"); + const halfIconSize = iconSize / 2; + const arrowSize = iconSize / 6; + const halfArrowSize = arrowSize / 2; + await Promise.all( + cy.edges().map(async (edge) => { + const { + source, + sourceDir, + sourceArrow, + sourceGroup, + target, + targetDir, + targetArrow, + targetGroup, + label + } = edgeData(edge); + let { x: startX2, y: startY2 } = edge[0].sourceEndpoint(); + const { x: midX, y: midY } = edge[0].midpoint(); + let { x: endX, y: endY } = edge[0].targetEndpoint(); + const groupEdgeShift = padding3 + 4; + if (sourceGroup) { + if (isArchitectureDirectionX(sourceDir)) { + startX2 += sourceDir === "L" ? -groupEdgeShift : groupEdgeShift; + } else { + startY2 += sourceDir === "T" ? -groupEdgeShift : groupEdgeShift + 18; + } + } + if (targetGroup) { + if (isArchitectureDirectionX(targetDir)) { + endX += targetDir === "L" ? -groupEdgeShift : groupEdgeShift; + } else { + endY += targetDir === "T" ? -groupEdgeShift : groupEdgeShift + 18; + } + } + if (!sourceGroup && db7.getNode(source)?.type === "junction") { + if (isArchitectureDirectionX(sourceDir)) { + startX2 += sourceDir === "L" ? halfIconSize : -halfIconSize; + } else { + startY2 += sourceDir === "T" ? halfIconSize : -halfIconSize; + } + } + if (!targetGroup && db7.getNode(target)?.type === "junction") { + if (isArchitectureDirectionX(targetDir)) { + endX += targetDir === "L" ? halfIconSize : -halfIconSize; + } else { + endY += targetDir === "T" ? halfIconSize : -halfIconSize; + } + } + if (edge[0]._private.rscratch) { + const g2 = edgesEl.insert("g"); + g2.insert("path").attr("d", `M ${startX2},${startY2} L ${midX},${midY} L${endX},${endY} `).attr("class", "edge"); + if (sourceArrow) { + const xShift = isArchitectureDirectionX(sourceDir) ? ArchitectureDirectionArrowShift[sourceDir](startX2, arrowSize) : startX2 - halfArrowSize; + const yShift = isArchitectureDirectionY(sourceDir) ? ArchitectureDirectionArrowShift[sourceDir](startY2, arrowSize) : startY2 - halfArrowSize; + g2.insert("polygon").attr("points", ArchitectureDirectionArrow[sourceDir](arrowSize)).attr("transform", `translate(${xShift},${yShift})`).attr("class", "arrow"); + } + if (targetArrow) { + const xShift = isArchitectureDirectionX(targetDir) ? ArchitectureDirectionArrowShift[targetDir](endX, arrowSize) : endX - halfArrowSize; + const yShift = isArchitectureDirectionY(targetDir) ? ArchitectureDirectionArrowShift[targetDir](endY, arrowSize) : endY - halfArrowSize; + g2.insert("polygon").attr("points", ArchitectureDirectionArrow[targetDir](arrowSize)).attr("transform", `translate(${xShift},${yShift})`).attr("class", "arrow"); + } + if (label) { + const axis2 = !isArchitectureDirectionXY(sourceDir, targetDir) ? isArchitectureDirectionX(sourceDir) ? "X" : "Y" : "XY"; + let width3 = 0; + if (axis2 === "X") { + width3 = Math.abs(startX2 - endX); + } else if (axis2 === "Y") { + width3 = Math.abs(startY2 - endY) / 1.5; + } else { + width3 = Math.abs(startX2 - endX) / 2; + } + const textElem = g2.append("g"); + await createText( + textElem, + label, + { + useHtmlLabels: false, + width: width3, + classes: "architecture-service-label" + }, + getConfig2() + ); + textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"); + if (axis2 === "X") { + textElem.attr("transform", "translate(" + midX + ", " + midY + ")"); + } else if (axis2 === "Y") { + textElem.attr("transform", "translate(" + midX + ", " + midY + ") rotate(-90)"); + } else if (axis2 === "XY") { + const pair = getArchitectureDirectionPair(sourceDir, targetDir); + if (pair && isArchitecturePairXY(pair)) { + const bboxOrig = textElem.node().getBoundingClientRect(); + const [x5, y5] = getArchitectureDirectionXYFactors(pair); + textElem.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * x5 * y5 * 45})`); + const bboxNew = textElem.node().getBoundingClientRect(); + textElem.attr( + "transform", + ` + translate(${midX}, ${midY - bboxOrig.height / 2}) + translate(${x5 * bboxNew.width / 2}, ${y5 * bboxNew.height / 2}) + rotate(${-1 * x5 * y5 * 45}, 0, ${bboxOrig.height / 2}) + ` + ); + } + } + } + } + }) + ); + }, "drawEdges"); + drawGroups = /* @__PURE__ */ __name(async function(groupsEl, cy) { + const padding3 = getConfigField("padding"); + const groupIconSize = padding3 * 0.75; + const fontSize = getConfigField("fontSize"); + const iconSize = getConfigField("iconSize"); + const halfIconSize = iconSize / 2; + await Promise.all( + cy.nodes().map(async (node2) => { + const data5 = nodeData(node2); + if (data5.type === "group") { + const { h: h2, w: w3, x1, y1 } = node2.boundingBox(); + groupsEl.append("rect").attr("x", x1 + halfIconSize).attr("y", y1 + halfIconSize).attr("width", w3).attr("height", h2).attr("class", "node-bkg"); + const groupLabelContainer = groupsEl.append("g"); + let shiftedX1 = x1; + let shiftedY1 = y1; + if (data5.icon) { + const bkgElem = groupLabelContainer.append("g"); + bkgElem.html( + `${await getIconSVG(data5.icon, { height: groupIconSize, width: groupIconSize, fallbackPrefix: architectureIcons.prefix })}` + ); + bkgElem.attr( + "transform", + "translate(" + (shiftedX1 + halfIconSize + 1) + ", " + (shiftedY1 + halfIconSize + 1) + ")" + ); + shiftedX1 += groupIconSize; + shiftedY1 += fontSize / 2 - 1 - 2; + } + if (data5.label) { + const textElem = groupLabelContainer.append("g"); + await createText( + textElem, + data5.label, + { + useHtmlLabels: false, + width: w3, + classes: "architecture-service-label" + }, + getConfig2() + ); + textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"); + textElem.attr( + "transform", + "translate(" + (shiftedX1 + halfIconSize + 4) + ", " + (shiftedY1 + halfIconSize + 2) + ")" + ); + } + } + }) + ); + }, "drawGroups"); + drawServices = /* @__PURE__ */ __name(async function(db8, elem, services) { + for (const service of services) { + const serviceElem = elem.append("g"); + const iconSize = getConfigField("iconSize"); + if (service.title) { + const textElem = serviceElem.append("g"); + await createText( + textElem, + service.title, + { + useHtmlLabels: false, + width: iconSize * 1.5, + classes: "architecture-service-label" + }, + getConfig2() + ); + textElem.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"); + textElem.attr("transform", "translate(" + iconSize / 2 + ", " + iconSize + ")"); + } + const bkgElem = serviceElem.append("g"); + if (service.icon) { + bkgElem.html( + `${await getIconSVG(service.icon, { height: iconSize, width: iconSize, fallbackPrefix: architectureIcons.prefix })}` + ); + } else if (service.iconText) { + bkgElem.html( + `${await getIconSVG("blank", { height: iconSize, width: iconSize, fallbackPrefix: architectureIcons.prefix })}` + ); + const textElemContainer = bkgElem.append("g"); + const fo = textElemContainer.append("foreignObject").attr("width", iconSize).attr("height", iconSize); + const divElem = fo.append("div").attr("class", "node-icon-text").attr("style", `height: ${iconSize}px;`).append("div").html(service.iconText); + const fontSize = parseInt( + window.getComputedStyle(divElem.node(), null).getPropertyValue("font-size").replace(/\D/g, "") + ) ?? 16; + divElem.attr("style", `-webkit-line-clamp: ${Math.floor((iconSize - 2) / fontSize)};`); + } else { + bkgElem.append("path").attr("class", "node-bkg").attr("id", "node-" + service.id).attr( + "d", + `M0 ${iconSize} v${-iconSize} q0,-5 5,-5 h${iconSize} q5,0 5,5 v${iconSize} H0 Z` + ); + } + serviceElem.attr("class", "architecture-service"); + const { width: width3, height: height2 } = serviceElem._groups[0][0].getBBox(); + service.width = width3; + service.height = height2; + db8.setElementForId(service.id, serviceElem); + } + return 0; + }, "drawServices"); + drawJunctions = /* @__PURE__ */ __name(function(db8, elem, junctions) { + junctions.forEach((junction) => { + const junctionElem = elem.append("g"); + const iconSize = getConfigField("iconSize"); + const bkgElem = junctionElem.append("g"); + bkgElem.append("rect").attr("id", "node-" + junction.id).attr("fill-opacity", "0").attr("width", iconSize).attr("height", iconSize); + junctionElem.attr("class", "architecture-junction"); + const { width: width3, height: height2 } = junctionElem._groups[0][0].getBBox(); + junctionElem.width = width3; + junctionElem.height = height2; + db8.setElementForId(junction.id, junctionElem); + }); + }, "drawJunctions"); + } + }); + + // src/diagrams/architecture/architectureRenderer.ts + function addServices(services, cy) { + services.forEach((service) => { + cy.add({ + group: "nodes", + data: { + type: "service", + id: service.id, + icon: service.icon, + label: service.title, + parent: service.in, + width: getConfigField("iconSize"), + height: getConfigField("iconSize") + }, + classes: "node-service" + }); + }); + } + function addJunctions(junctions, cy) { + junctions.forEach((junction) => { + cy.add({ + group: "nodes", + data: { + type: "junction", + id: junction.id, + parent: junction.in, + width: getConfigField("iconSize"), + height: getConfigField("iconSize") + }, + classes: "node-junction" + }); + }); + } + function positionNodes2(db8, cy) { + cy.nodes().map((node2) => { + const data5 = nodeData(node2); + if (data5.type === "group") { + return; + } + data5.x = node2.position().x; + data5.y = node2.position().y; + const nodeElem = db8.getElementById(data5.id); + nodeElem.attr("transform", "translate(" + (data5.x || 0) + "," + (data5.y || 0) + ")"); + }); + } + function addGroups(groups, cy) { + groups.forEach((group2) => { + cy.add({ + group: "nodes", + data: { + type: "group", + id: group2.id, + icon: group2.icon, + label: group2.title, + parent: group2.in + }, + classes: "node-group" + }); + }); + } + function addEdges(edges5, cy) { + edges5.forEach((parsedEdge) => { + const { lhsId, rhsId, lhsInto, lhsGroup, rhsInto, lhsDir, rhsDir, rhsGroup, title: title2 } = parsedEdge; + const edgeType = isArchitectureDirectionXY(parsedEdge.lhsDir, parsedEdge.rhsDir) ? "segments" : "straight"; + const edge = { + id: `${lhsId}-${rhsId}`, + label: title2, + source: lhsId, + sourceDir: lhsDir, + sourceArrow: lhsInto, + sourceGroup: lhsGroup, + sourceEndpoint: lhsDir === "L" ? "0 50%" : lhsDir === "R" ? "100% 50%" : lhsDir === "T" ? "50% 0" : "50% 100%", + target: rhsId, + targetDir: rhsDir, + targetArrow: rhsInto, + targetGroup: rhsGroup, + targetEndpoint: rhsDir === "L" ? "0 50%" : rhsDir === "R" ? "100% 50%" : rhsDir === "T" ? "50% 0" : "50% 100%" + }; + cy.add({ + group: "edges", + data: edge, + classes: edgeType + }); + }); + } + function getAlignments(spatialMaps) { + const alignments = spatialMaps.map((spatialMap) => { + const horizontalAlignments = {}; + const verticalAlignments = {}; + Object.entries(spatialMap).forEach(([id27, [x5, y5]]) => { + if (!horizontalAlignments[y5]) { + horizontalAlignments[y5] = []; + } + if (!verticalAlignments[x5]) { + verticalAlignments[x5] = []; + } + horizontalAlignments[y5].push(id27); + verticalAlignments[x5].push(id27); + }); + return { + horiz: Object.values(horizontalAlignments).filter((arr) => arr.length > 1), + vert: Object.values(verticalAlignments).filter((arr) => arr.length > 1) + }; + }); + const [horizontal, vertical] = alignments.reduce( + ([prevHoriz, prevVert], { horiz, vert }) => { + return [ + [...prevHoriz, ...horiz], + [...prevVert, ...vert] + ]; + }, + [[], []] + ); + return { + horizontal, + vertical + }; + } + function getRelativeConstraints(spatialMaps) { + const relativeConstraints = []; + const posToStr = /* @__PURE__ */ __name((pos) => `${pos[0]},${pos[1]}`, "posToStr"); + const strToPos = /* @__PURE__ */ __name((pos) => pos.split(",").map((p3) => parseInt(p3)), "strToPos"); + spatialMaps.forEach((spatialMap) => { + const invSpatialMap = Object.fromEntries( + Object.entries(spatialMap).map(([id27, pos]) => [posToStr(pos), id27]) + ); + const queue = [posToStr([0, 0])]; + const visited = {}; + const directions = { + L: [-1, 0], + R: [1, 0], + T: [0, 1], + B: [0, -1] + }; + while (queue.length > 0) { + const curr = queue.shift(); + if (curr) { + visited[curr] = 1; + const currId = invSpatialMap[curr]; + if (currId) { + const currPos = strToPos(curr); + Object.entries(directions).forEach(([dir2, shift2]) => { + const newPos = posToStr([currPos[0] + shift2[0], currPos[1] + shift2[1]]); + const newId2 = invSpatialMap[newPos]; + if (newId2 && !visited[newPos]) { + queue.push(newPos); + relativeConstraints.push({ + [ArchitectureDirectionName[dir2]]: newId2, + [ArchitectureDirectionName[getOppositeArchitectureDirection(dir2)]]: currId, + gap: 1.5 * getConfigField("iconSize") + }); + } + }); + } + } + } + }); + return relativeConstraints; + } + function layoutArchitecture(services, junctions, groups, edges5, { spatialMaps }) { + return new Promise((resolve3) => { + const renderEl = select_default2("body").append("div").attr("id", "cy").attr("style", "display:none"); + const cy = cytoscape2({ + container: document.getElementById("cy"), + style: [ + { + selector: "edge", + style: { + "curve-style": "straight", + label: "data(label)", + "source-endpoint": "data(sourceEndpoint)", + "target-endpoint": "data(targetEndpoint)" + } + }, + { + selector: "edge.segments", + style: { + "curve-style": "segments", + "segment-weights": "0", + "segment-distances": [0.5], + // @ts-ignore Incorrect library types + "edge-distances": "endpoints", + "source-endpoint": "data(sourceEndpoint)", + "target-endpoint": "data(targetEndpoint)" + } + }, + { + selector: "node", + style: { + // @ts-ignore Incorrect library types + "compound-sizing-wrt-labels": "include" + } + }, + { + selector: "node[label]", + style: { + "text-valign": "bottom", + "text-halign": "center", + "font-size": `${getConfigField("fontSize")}px` + } + }, + { + selector: ".node-service", + style: { + label: "data(label)", + width: "data(width)", + height: "data(height)" + } + }, + { + selector: ".node-junction", + style: { + width: "data(width)", + height: "data(height)" + } + }, + { + selector: ".node-group", + style: { + // @ts-ignore Incorrect library types + padding: `${getConfigField("padding")}px` + } + } + ] + }); + renderEl.remove(); + addGroups(groups, cy); + addServices(services, cy); + addJunctions(junctions, cy); + addEdges(edges5, cy); + const alignmentConstraint = getAlignments(spatialMaps); + const relativePlacementConstraint = getRelativeConstraints(spatialMaps); + const layout6 = cy.layout({ + name: "fcose", + quality: "proof", + styleEnabled: false, + animate: false, + nodeDimensionsIncludeLabels: false, + // Adjust the edge parameters if it passes through the border of a group + // Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67 + idealEdgeLength(edge) { + const [nodeA, nodeB] = edge.connectedNodes(); + const { parent: parentA } = nodeData(nodeA); + const { parent: parentB } = nodeData(nodeB); + const elasticity = parentA === parentB ? 1.5 * getConfigField("iconSize") : 0.5 * getConfigField("iconSize"); + return elasticity; + }, + edgeElasticity(edge) { + const [nodeA, nodeB] = edge.connectedNodes(); + const { parent: parentA } = nodeData(nodeA); + const { parent: parentB } = nodeData(nodeB); + const elasticity = parentA === parentB ? 0.45 : 1e-3; + return elasticity; + }, + alignmentConstraint, + relativePlacementConstraint + }); + layout6.one("layoutstop", () => { + function getSegmentWeights(source, target, pointX, pointY) { + let W2, D3; + const { x: sX, y: sY } = source; + const { x: tX, y: tY } = target; + D3 = (pointY - sY + (sX - pointX) * (sY - tY) / (sX - tX)) / Math.sqrt(1 + Math.pow((sY - tY) / (sX - tX), 2)); + W2 = Math.sqrt(Math.pow(pointY - sY, 2) + Math.pow(pointX - sX, 2) - Math.pow(D3, 2)); + const distAB = Math.sqrt(Math.pow(tX - sX, 2) + Math.pow(tY - sY, 2)); + W2 = W2 / distAB; + let delta1 = (tX - sX) * (pointY - sY) - (tY - sY) * (pointX - sX); + switch (true) { + case delta1 >= 0: + delta1 = 1; + break; + case delta1 < 0: + delta1 = -1; + break; + } + let delta2 = (tX - sX) * (pointX - sX) + (tY - sY) * (pointY - sY); + switch (true) { + case delta2 >= 0: + delta2 = 1; + break; + case delta2 < 0: + delta2 = -1; + break; + } + D3 = Math.abs(D3) * delta1; + W2 = W2 * delta2; + return { + distances: D3, + weights: W2 + }; + } + __name(getSegmentWeights, "getSegmentWeights"); + cy.startBatch(); + for (const edge of Object.values(cy.edges())) { + if (edge.data?.()) { + const { x: sX, y: sY } = edge.source().position(); + const { x: tX, y: tY } = edge.target().position(); + if (sX !== tX && sY !== tY) { + const sEP = edge.sourceEndpoint(); + const tEP = edge.targetEndpoint(); + const { sourceDir } = edgeData(edge); + const [pointX, pointY] = isArchitectureDirectionY(sourceDir) ? [sEP.x, tEP.y] : [tEP.x, sEP.y]; + const { weights, distances: distances2 } = getSegmentWeights(sEP, tEP, pointX, pointY); + edge.style("segment-distances", distances2); + edge.style("segment-weights", weights); + } + } + } + cy.endBatch(); + layout6.run(); + }); + layout6.run(); + cy.ready((e3) => { + log.info("Ready", e3); + resolve3(cy); + }); + }); + } + var import_cytoscape_fcose, draw23, renderer7; + var init_architectureRenderer = __esm({ + "src/diagrams/architecture/architectureRenderer.ts"() { + "use strict"; + init_icons(); + init_cytoscape_esm(); + import_cytoscape_fcose = __toESM(require_cytoscape_fcose(), 1); + init_src32(); + init_logger(); + init_selectSvgElement(); + init_setupGraphViewbox(); + init_architectureDb(); + init_architectureIcons(); + init_architectureTypes(); + init_svgDraw7(); + registerIconPacks([ + { + name: architectureIcons.prefix, + icons: architectureIcons + } + ]); + cytoscape2.use(import_cytoscape_fcose.default); + __name(addServices, "addServices"); + __name(addJunctions, "addJunctions"); + __name(positionNodes2, "positionNodes"); + __name(addGroups, "addGroups"); + __name(addEdges, "addEdges"); + __name(getAlignments, "getAlignments"); + __name(getRelativeConstraints, "getRelativeConstraints"); + __name(layoutArchitecture, "layoutArchitecture"); + draw23 = /* @__PURE__ */ __name(async (text2, id27, _version, diagObj) => { + const db8 = diagObj.db; + const services = db8.getServices(); + const junctions = db8.getJunctions(); + const groups = db8.getGroups(); + const edges5 = db8.getEdges(); + const ds = db8.getDataStructures(); + const svg = selectSvgElement(id27); + const edgesElem = svg.append("g"); + edgesElem.attr("class", "architecture-edges"); + const servicesElem = svg.append("g"); + servicesElem.attr("class", "architecture-services"); + const groupElem = svg.append("g"); + groupElem.attr("class", "architecture-groups"); + await drawServices(db8, servicesElem, services); + drawJunctions(db8, servicesElem, junctions); + const cy = await layoutArchitecture(services, junctions, groups, edges5, ds); + await drawEdges2(edgesElem, cy); + await drawGroups(groupElem, cy); + positionNodes2(db8, cy); + setupGraphViewbox(void 0, svg, getConfigField("padding"), getConfigField("useMaxWidth")); + }, "draw"); + renderer7 = { draw: draw23 }; + } + }); + + // src/diagrams/architecture/architectureDiagram.ts + var architectureDiagram_exports = {}; + __export(architectureDiagram_exports, { + diagram: () => diagram23 + }); + var diagram23; + var init_architectureDiagram = __esm({ + "src/diagrams/architecture/architectureDiagram.ts"() { + "use strict"; + init_architectureParser(); + init_architectureDb(); + init_architectureStyles(); + init_architectureRenderer(); + diagram23 = { + parser: parser21, + db: db7, + renderer: renderer7, + styles: architectureStyles_default + }; + } + }); + + // src/mermaid.ts + var mermaid_exports = {}; + __export(mermaid_exports, { + default: () => mermaid_default + }); + init_icons(); + init_esm(); + init_detectType(); + + // src/diagrams/c4/c4Detector.ts + var id2 = "c4"; + var detector = /* @__PURE__ */ __name((txt) => { + return /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(txt); + }, "detector"); + var loader = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_c4Diagram2(), c4Diagram_exports)); + return { id: id2, diagram: diagram24 }; + }, "loader"); + var plugin = { + id: id2, + detector, + loader + }; + var c4Detector_default = plugin; + + // src/diagrams/flowchart/flowDetector.ts + var id3 = "flowchart"; + var detector2 = /* @__PURE__ */ __name((txt, config6) => { + if (config6?.flowchart?.defaultRenderer === "dagre-wrapper" || config6?.flowchart?.defaultRenderer === "elk") { + return false; + } + return /^\s*graph/.test(txt); + }, "detector"); + var loader2 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); + return { id: id3, diagram: diagram24 }; + }, "loader"); + var plugin2 = { + id: id3, + detector: detector2, + loader: loader2 + }; + var flowDetector_default = plugin2; + + // src/diagrams/flowchart/flowDetector-v2.ts + var id4 = "flowchart-v2"; + var detector3 = /* @__PURE__ */ __name((txt, config6) => { + if (config6?.flowchart?.defaultRenderer === "dagre-d3") { + return false; + } + if (config6?.flowchart?.defaultRenderer === "elk") { + config6.layout = "elk"; + } + if (/^\s*graph/.test(txt) && config6?.flowchart?.defaultRenderer === "dagre-wrapper") { + return true; + } + return /^\s*flowchart/.test(txt); + }, "detector"); + var loader3 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); + return { id: id4, diagram: diagram24 }; + }, "loader"); + var plugin3 = { + id: id4, + detector: detector3, + loader: loader3 + }; + var flowDetector_v2_default = plugin3; + + // src/diagrams/er/erDetector.ts + var id5 = "er"; + var detector4 = /* @__PURE__ */ __name((txt) => { + return /^\s*erDiagram/.test(txt); + }, "detector"); + var loader4 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_erDiagram2(), erDiagram_exports)); + return { id: id5, diagram: diagram24 }; + }, "loader"); + var plugin4 = { + id: id5, + detector: detector4, + loader: loader4 + }; + var erDetector_default = plugin4; + + // src/diagrams/git/gitGraphDetector.ts + var id6 = "gitGraph"; + var detector5 = /* @__PURE__ */ __name((txt) => { + return /^\s*gitGraph/.test(txt); + }, "detector"); + var loader5 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_gitGraphDiagram(), gitGraphDiagram_exports)); + return { id: id6, diagram: diagram24 }; + }, "loader"); + var plugin5 = { + id: id6, + detector: detector5, + loader: loader5 + }; + var gitGraphDetector_default = plugin5; + + // src/diagrams/gantt/ganttDetector.ts + var id7 = "gantt"; + var detector6 = /* @__PURE__ */ __name((txt) => { + return /^\s*gantt/.test(txt); + }, "detector"); + var loader6 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_ganttDiagram(), ganttDiagram_exports)); + return { id: id7, diagram: diagram24 }; + }, "loader"); + var plugin6 = { + id: id7, + detector: detector6, + loader: loader6 + }; + var ganttDetector_default = plugin6; + + // src/diagrams/info/infoDetector.ts + var id8 = "info"; + var detector7 = /* @__PURE__ */ __name((txt) => { + return /^\s*info/.test(txt); + }, "detector"); + var loader7 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_infoDiagram(), infoDiagram_exports)); + return { id: id8, diagram: diagram24 }; + }, "loader"); + var info = { + id: id8, + detector: detector7, + loader: loader7 + }; + + // src/diagrams/pie/pieDetector.ts + var id9 = "pie"; + var detector8 = /* @__PURE__ */ __name((txt) => { + return /^\s*pie/.test(txt); + }, "detector"); + var loader8 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_pieDiagram(), pieDiagram_exports)); + return { id: id9, diagram: diagram24 }; + }, "loader"); + var pie = { + id: id9, + detector: detector8, + loader: loader8 + }; + + // src/diagrams/quadrant-chart/quadrantDetector.ts + var id10 = "quadrantChart"; + var detector9 = /* @__PURE__ */ __name((txt) => { + return /^\s*quadrantChart/.test(txt); + }, "detector"); + var loader9 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_quadrantDiagram(), quadrantDiagram_exports)); + return { id: id10, diagram: diagram24 }; + }, "loader"); + var plugin7 = { + id: id10, + detector: detector9, + loader: loader9 + }; + var quadrantDetector_default = plugin7; + + // src/diagrams/xychart/xychartDetector.ts + var id11 = "xychart"; + var detector10 = /* @__PURE__ */ __name((txt) => { + return /^\s*xychart-beta/.test(txt); + }, "detector"); + var loader10 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_xychartDiagram(), xychartDiagram_exports)); + return { id: id11, diagram: diagram24 }; + }, "loader"); + var plugin8 = { + id: id11, + detector: detector10, + loader: loader10 + }; + var xychartDetector_default = plugin8; + + // src/diagrams/requirement/requirementDetector.ts + var id12 = "requirement"; + var detector11 = /* @__PURE__ */ __name((txt) => { + return /^\s*requirement(Diagram)?/.test(txt); + }, "detector"); + var loader11 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_requirementDiagram2(), requirementDiagram_exports)); + return { id: id12, diagram: diagram24 }; + }, "loader"); + var plugin9 = { + id: id12, + detector: detector11, + loader: loader11 + }; + var requirementDetector_default = plugin9; + + // src/diagrams/sequence/sequenceDetector.ts + var id13 = "sequence"; + var detector12 = /* @__PURE__ */ __name((txt) => { + return /^\s*sequenceDiagram/.test(txt); + }, "detector"); + var loader12 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_sequenceDiagram2(), sequenceDiagram_exports)); + return { id: id13, diagram: diagram24 }; + }, "loader"); + var plugin10 = { + id: id13, + detector: detector12, + loader: loader12 + }; + var sequenceDetector_default = plugin10; + + // src/diagrams/class/classDetector.ts + var id14 = "class"; + var detector13 = /* @__PURE__ */ __name((txt, config6) => { + if (config6?.class?.defaultRenderer === "dagre-wrapper") { + return false; + } + return /^\s*classDiagram/.test(txt); + }, "detector"); + var loader13 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_classDiagram2(), classDiagram_exports)); + return { id: id14, diagram: diagram24 }; + }, "loader"); + var plugin11 = { + id: id14, + detector: detector13, + loader: loader13 + }; + var classDetector_default = plugin11; + + // src/diagrams/class/classDetector-V2.ts + var id15 = "classDiagram"; + var detector14 = /* @__PURE__ */ __name((txt, config6) => { + if (/^\s*classDiagram/.test(txt) && config6?.class?.defaultRenderer === "dagre-wrapper") { + return true; + } + return /^\s*classDiagram-v2/.test(txt); + }, "detector"); + var loader14 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_classDiagram_v2(), classDiagram_v2_exports)); + return { id: id15, diagram: diagram24 }; + }, "loader"); + var plugin12 = { + id: id15, + detector: detector14, + loader: loader14 + }; + var classDetector_V2_default = plugin12; + + // src/diagrams/state/stateDetector.ts + var id16 = "state"; + var detector15 = /* @__PURE__ */ __name((txt, config6) => { + if (config6?.state?.defaultRenderer === "dagre-wrapper") { + return false; + } + return /^\s*stateDiagram/.test(txt); + }, "detector"); + var loader15 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_stateDiagram2(), stateDiagram_exports)); + return { id: id16, diagram: diagram24 }; + }, "loader"); + var plugin13 = { + id: id16, + detector: detector15, + loader: loader15 + }; + var stateDetector_default = plugin13; + + // src/diagrams/state/stateDetector-V2.ts + var id17 = "stateDiagram"; + var detector16 = /* @__PURE__ */ __name((txt, config6) => { + if (/^\s*stateDiagram-v2/.test(txt)) { + return true; + } + if (/^\s*stateDiagram/.test(txt) && config6?.state?.defaultRenderer === "dagre-wrapper") { + return true; + } + return false; + }, "detector"); + var loader16 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_stateDiagram_v2(), stateDiagram_v2_exports)); + return { id: id17, diagram: diagram24 }; + }, "loader"); + var plugin14 = { + id: id17, + detector: detector16, + loader: loader16 + }; + var stateDetector_V2_default = plugin14; + + // src/diagrams/user-journey/journeyDetector.ts + var id18 = "journey"; + var detector17 = /* @__PURE__ */ __name((txt) => { + return /^\s*journey/.test(txt); + }, "detector"); + var loader17 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_journeyDiagram(), journeyDiagram_exports)); + return { id: id18, diagram: diagram24 }; + }, "loader"); + var plugin15 = { + id: id18, + detector: detector17, + loader: loader17 + }; + var journeyDetector_default = plugin15; + + // src/diagrams/error/errorRenderer.ts + init_logger(); + init_selectSvgElement(); + init_setupGraphViewbox(); + var draw17 = /* @__PURE__ */ __name((_text, id27, version4) => { + log.debug("rendering svg for syntax error\n"); + const svg = selectSvgElement(id27); + const g2 = svg.append("g"); + svg.attr("viewBox", "0 0 2412 512"); + configureSvgSize(svg, 100, 512, true); + g2.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" + ); + g2.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" + ); + g2.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" + ); + g2.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" + ); + g2.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" + ); + g2.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" + ); + g2.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"); + g2.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${version4}`); + }, "draw"); + var renderer3 = { draw: draw17 }; + var errorRenderer_default = renderer3; + + // src/diagrams/error/errorDiagram.ts + var diagram17 = { + db: {}, + renderer: renderer3, + parser: { + parse: /* @__PURE__ */ __name(() => { + return; + }, "parse") + } + }; + var errorDiagram_default = diagram17; + + // src/diagrams/flowchart/elk/detector.ts + var id19 = "flowchart-elk"; + var detector18 = /* @__PURE__ */ __name((txt, config6 = {}) => { + if ( + // If diagram explicitly states flowchart-elk + /^\s*flowchart-elk/.test(txt) || // If a flowchart/graph diagram has their default renderer set to elk + /^\s*flowchart|graph/.test(txt) && config6?.flowchart?.defaultRenderer === "elk" + ) { + config6.layout = "elk"; + return true; + } + return false; + }, "detector"); + var loader18 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_flowDiagram(), flowDiagram_exports)); + return { id: id19, diagram: diagram24 }; + }, "loader"); + var plugin16 = { + id: id19, + detector: detector18, + loader: loader18 + }; + var detector_default = plugin16; + + // src/diagrams/timeline/detector.ts + var id20 = "timeline"; + var detector19 = /* @__PURE__ */ __name((txt) => { + return /^\s*timeline/.test(txt); + }, "detector"); + var loader19 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_timeline_definition(), timeline_definition_exports)); + return { id: id20, diagram: diagram24 }; + }, "loader"); + var plugin17 = { + id: id20, + detector: detector19, + loader: loader19 + }; + var detector_default2 = plugin17; + + // src/diagrams/mindmap/detector.ts + var id22 = "mindmap"; + var detector20 = /* @__PURE__ */ __name((txt) => { + return /^\s*mindmap/.test(txt); + }, "detector"); + var loader20 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_mindmap_definition(), mindmap_definition_exports)); + return { id: id22, diagram: diagram24 }; + }, "loader"); + var plugin18 = { + id: id22, + detector: detector20, + loader: loader20 + }; + var detector_default3 = plugin18; + + // src/diagrams/sankey/sankeyDetector.ts + var id23 = "sankey"; + var detector21 = /* @__PURE__ */ __name((txt) => { + return /^\s*sankey-beta/.test(txt); + }, "detector"); + var loader21 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_sankeyDiagram(), sankeyDiagram_exports)); + return { id: id23, diagram: diagram24 }; + }, "loader"); + var plugin19 = { + id: id23, + detector: detector21, + loader: loader21 + }; + var sankeyDetector_default = plugin19; + + // src/diagrams/packet/detector.ts + var id24 = "packet"; + var detector22 = /* @__PURE__ */ __name((txt) => { + return /^\s*packet-beta/.test(txt); + }, "detector"); + var loader22 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_diagram(), diagram_exports)); + return { id: id24, diagram: diagram24 }; + }, "loader"); + var packet = { + id: id24, + detector: detector22, + loader: loader22 + }; + + // src/diagrams/block/blockDetector.ts + var id25 = "block"; + var detector23 = /* @__PURE__ */ __name((txt) => { + return /^\s*block-beta/.test(txt); + }, "detector"); + var loader23 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_blockDiagram(), blockDiagram_exports)); + return { id: id25, diagram: diagram24 }; + }, "loader"); + var plugin20 = { + id: id25, + detector: detector23, + loader: loader23 + }; + var blockDetector_default = plugin20; + + // src/diagrams/architecture/architectureDetector.ts + var id26 = "architecture"; + var detector24 = /* @__PURE__ */ __name((txt) => { + return /^\s*architecture/.test(txt); + }, "detector"); + var loader24 = /* @__PURE__ */ __name(async () => { + const { diagram: diagram24 } = await Promise.resolve().then(() => (init_architectureDiagram(), architectureDiagram_exports)); + return { id: id26, diagram: diagram24 }; + }, "loader"); + var architecture = { + id: id26, + detector: detector24, + loader: loader24 + }; + var architectureDetector_default = architecture; + + // src/diagram-api/diagram-orchestration.ts + init_detectType(); + init_diagramAPI(); + var hasLoadedDiagrams = false; + var addDiagrams = /* @__PURE__ */ __name(() => { + if (hasLoadedDiagrams) { + return; + } + hasLoadedDiagrams = true; + registerDiagram("error", errorDiagram_default, (text2) => { + return text2.toLowerCase().trim() === "error"; + }); + registerDiagram( + "---", + // --- diagram type may appear if YAML front-matter is not parsed correctly + { + db: { + clear: /* @__PURE__ */ __name(() => { + }, "clear") + }, + styles: {}, + // should never be used + renderer: { + draw: /* @__PURE__ */ __name(() => { + }, "draw") + }, + parser: { + parse: /* @__PURE__ */ __name(() => { + 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" + ); + }, "parse") + }, + init: /* @__PURE__ */ __name(() => null, "init") + // no op + }, + (text2) => { + return text2.toLowerCase().trimStart().startsWith("---"); + } + ); + registerLazyLoadedDiagrams( + c4Detector_default, + classDetector_V2_default, + classDetector_default, + erDetector_default, + ganttDetector_default, + info, + pie, + requirementDetector_default, + sequenceDetector_default, + detector_default, + flowDetector_v2_default, + flowDetector_default, + detector_default3, + detector_default2, + gitGraphDetector_default, + stateDetector_V2_default, + stateDetector_default, + journeyDetector_default, + quadrantDetector_default, + sankeyDetector_default, + packet, + xychartDetector_default, + blockDetector_default, + architectureDetector_default + ); + }, "addDiagrams"); + + // src/diagram-api/loadDiagram.ts + init_logger(); + init_detectType(); + init_diagramAPI(); + var loadRegisteredDiagrams = /* @__PURE__ */ __name(async () => { + log.debug(`Loading registered diagrams`); + const results = await Promise.allSettled( + Object.entries(detectors).map(async ([key, { detector: detector25, loader: loader26 }]) => { + if (loader26) { + try { + getDiagram(key); + } catch { + try { + const { diagram: diagram24, id: id27 } = await loader26(); + registerDiagram(id27, diagram24, detector25); + } catch (err) { + log.error(`Failed to load external diagram with key ${key}. Removing from detectors.`); + delete detectors[key]; + throw err; + } + } + } + }) + ); + const failed = results.filter((result) => result.status === "rejected"); + if (failed.length > 0) { + log.error(`Failed to load ${failed.length} external diagrams`); + for (const res of failed) { + log.error(res); + } + throw new Error(`Failed to load ${failed.length} external diagrams`); + } + }, "loadRegisteredDiagrams"); + + // src/mermaid.ts + init_logger(); + + // src/mermaidAPI.ts + init_src32(); + + // ../../node_modules/.pnpm/stylis@4.3.4/node_modules/stylis/src/Enum.js + var COMMENT = "comm"; + var RULESET = "rule"; + var DECLARATION = "decl"; + var IMPORT = "@import"; + var KEYFRAMES = "@keyframes"; + var LAYER = "@layer"; + + // ../../node_modules/.pnpm/stylis@4.3.4/node_modules/stylis/src/Utility.js + var abs3 = Math.abs; + var from = String.fromCharCode; + function trim(value2) { + return value2.trim(); + } + __name(trim, "trim"); + function replace(value2, pattern, replacement) { + return value2.replace(pattern, replacement); + } + __name(replace, "replace"); + function indexof(value2, search, position5) { + return value2.indexOf(search, position5); + } + __name(indexof, "indexof"); + function charat(value2, index) { + return value2.charCodeAt(index) | 0; + } + __name(charat, "charat"); + function substr(value2, begin, end2) { + return value2.slice(begin, end2); + } + __name(substr, "substr"); + function strlen(value2) { + return value2.length; + } + __name(strlen, "strlen"); + function sizeof(value2) { + return value2.length; + } + __name(sizeof, "sizeof"); + function append2(value2, array4) { + return array4.push(value2), value2; + } + __name(append2, "append"); + + // ../../node_modules/.pnpm/stylis@4.3.4/node_modules/stylis/src/Tokenizer.js + var line = 1; + var column = 1; + var length = 0; + var position4 = 0; + var character = 0; + var characters = ""; + function node(value2, root4, parent4, type3, props, children2, length2, siblings2) { + return { value: value2, root: root4, parent: parent4, type: type3, props, children: children2, line, column, length: length2, return: "", siblings: siblings2 }; + } + __name(node, "node"); + function char() { + return character; + } + __name(char, "char"); + function prev() { + character = position4 > 0 ? charat(characters, --position4) : 0; + if (column--, character === 10) + column = 1, line--; + return character; + } + __name(prev, "prev"); + function next2() { + character = position4 < length ? charat(characters, position4++) : 0; + if (column++, character === 10) + column = 1, line++; + return character; + } + __name(next2, "next"); + function peek() { + return charat(characters, position4); + } + __name(peek, "peek"); + function caret2() { + return position4; + } + __name(caret2, "caret"); + function slice4(begin, end2) { + return substr(characters, begin, end2); + } + __name(slice4, "slice"); + function token(type3) { + switch (type3) { + 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; + } + __name(token, "token"); + function alloc(value2) { + return line = column = 1, length = strlen(characters = value2), position4 = 0, []; + } + __name(alloc, "alloc"); + function dealloc(value2) { + return characters = "", value2; + } + __name(dealloc, "dealloc"); + function delimit(type3) { + return trim(slice4(position4 - 1, delimiter2(type3 === 91 ? type3 + 2 : type3 === 40 ? type3 + 1 : type3))); + } + __name(delimit, "delimit"); + function whitespace(type3) { + while (character = peek()) + if (character < 33) + next2(); + else + break; + return token(type3) > 2 || token(character) > 3 ? "" : " "; + } + __name(whitespace, "whitespace"); + function escaping(index, count) { + while (--count && next2()) + if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) + break; + return slice4(index, caret2() + (count < 6 && peek() == 32 && next2() == 32)); + } + __name(escaping, "escaping"); + function delimiter2(type3) { + while (next2()) + switch (character) { + case type3: + return position4; + case 34: + case 39: + if (type3 !== 34 && type3 !== 39) + delimiter2(character); + break; + case 40: + if (type3 === 41) + delimiter2(type3); + break; + case 92: + next2(); + break; + } + return position4; + } + __name(delimiter2, "delimiter"); + function commenter(type3, index) { + while (next2()) + if (type3 + character === 47 + 10) + break; + else if (type3 + character === 42 + 42 && peek() === 47) + break; + return "/*" + slice4(index, position4 - 1) + "*" + from(type3 === 47 ? type3 : next2()); + } + __name(commenter, "commenter"); + function identifier(index) { + while (!token(peek())) + next2(); + return slice4(index, position4); + } + __name(identifier, "identifier"); + + // ../../node_modules/.pnpm/stylis@4.3.4/node_modules/stylis/src/Parser.js + function compile(value2) { + return dealloc(parse5("", null, null, null, [""], value2 = alloc(value2), 0, [0], value2)); + } + __name(compile, "compile"); + function parse5(value2, root4, parent4, rule, rules, rulesets, pseudo, points, declarations) { + var index = 0; + var offset = 0; + var length2 = pseudo; + var atrule = 0; + var property2 = 0; + var previous = 0; + var variable = 1; + var scanning = 1; + var ampersand = 1; + var character2 = 0; + var type3 = ""; + var props = rules; + var children2 = rulesets; + var reference = rule; + var characters2 = type3; + while (scanning) + switch (previous = character2, character2 = next2()) { + case 40: + if (previous != 108 && charat(characters2, length2 - 1) == 58) { + if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs3(index ? points[index - 1] : 0)) != -1) + ampersand = -1; + break; + } + case 34: + case 39: + case 91: + characters2 += delimit(character2); + break; + case 9: + case 10: + case 13: + case 32: + characters2 += whitespace(previous); + break; + case 92: + characters2 += escaping(caret2() - 1, 7); + continue; + case 47: + switch (peek()) { + case 42: + case 47: + append2(comment(commenter(next2(), caret2()), root4, parent4, declarations), declarations); + if ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters2) && substr(characters2, -1, void 0) !== " ") characters2 += " "; + break; + default: + characters2 += "/"; + } + break; + case 123 * variable: + points[index++] = strlen(characters2) * ampersand; + case 125 * variable: + case 59: + case 0: + switch (character2) { + case 0: + case 125: + scanning = 0; case 59 + offset: if (ampersand == -1) characters2 = replace(characters2, /\f/g, ""); - if (property2 > 0 && strlen(characters2) - length2) + if (property2 > 0 && (strlen(characters2) - length2 || variable === 0 && previous === 47)) append2(property2 > 32 ? declaration(characters2 + ";", rule, parent4, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent4, length2 - 2, declarations), declarations); break; case 59: @@ -130006,7 +140130,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } __name(declaration, "declaration"); - // ../../node_modules/.pnpm/stylis@4.3.2/node_modules/stylis/src/Serializer.js + // ../../node_modules/.pnpm/stylis@4.3.4/node_modules/stylis/src/Serializer.js function serialize(children2, callback) { var output2 = ""; for (var i2 = 0; i2 < children2.length; i2++) @@ -130033,7 +140157,38 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; __name(stringify, "stringify"); // src/mermaidAPI.ts + var import_dompurify2 = __toESM(require_purify(), 1); + init_isEmpty(); init_package(); + + // src/accessibility.ts + var SVG_ROLE = "graphics-document document"; + function setA11yDiagramInfo(svg, diagramType) { + svg.attr("role", SVG_ROLE); + if (diagramType !== "") { + svg.attr("aria-roledescription", diagramType); + } + } + __name(setA11yDiagramInfo, "setA11yDiagramInfo"); + function addSVGa11yTitleDescription(svg, a11yTitle, a11yDesc, baseId) { + if (svg.insert === void 0) { + return; + } + if (a11yDesc) { + const descId = `chart-desc-${baseId}`; + svg.attr("aria-describedby", descId); + svg.insert("desc", ":first-child").attr("id", descId).text(a11yDesc); + } + if (a11yTitle) { + const titleId = `chart-title-${baseId}`; + svg.attr("aria-labelledby", titleId); + svg.insert("title", ":first-child").attr("id", titleId).text(a11yTitle); + } + } + __name(addSVGa11yTitleDescription, "addSVGa11yTitleDescription"); + + // src/mermaidAPI.ts + init_assignWithDepth(); init_config(); // src/Diagram.ts @@ -130043,12 +140198,12 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; init_errors(); init_utils2(); var Diagram = class _Diagram { - constructor(type3, text2, db7, parser21, renderer7) { + constructor(type3, text2, db8, parser22, renderer8) { this.type = type3; this.text = text2; - this.db = db7; - this.parser = parser21; - this.renderer = renderer7; + this.db = db8; + this.parser = parser22; + this.renderer = renderer8; } static { __name(this, "Diagram"); @@ -130060,27 +140215,27 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; try { getDiagram(type3); } catch { - const loader25 = getDiagramLoader(type3); - if (!loader25) { + const loader26 = getDiagramLoader(type3); + if (!loader26) { throw new UnknownDiagramError(`Diagram ${type3} not found.`); } - const { id: id26, diagram: diagram23 } = await loader25(); - registerDiagram(id26, diagram23); + const { id: id27, diagram: diagram24 } = await loader26(); + registerDiagram(id27, diagram24); } - const { db: db7, parser: parser21, renderer: renderer7, init: init3 } = getDiagram(type3); - if (parser21.parser) { - parser21.parser.yy = db7; + const { db: db8, parser: parser22, renderer: renderer8, init: init3 } = getDiagram(type3); + if (parser22.parser) { + parser22.parser.yy = db8; } - db7.clear?.(); + db8.clear?.(); init3?.(config6); if (metadata.title) { - db7.setDiagramTitle?.(metadata.title); + db8.setDiagramTitle?.(metadata.title); } - await parser21.parse(text2); - return new _Diagram(type3, text2, db7, parser21, renderer7); + await parser22.parse(text2); + return new _Diagram(type3, text2, db8, parser22, renderer8); } - async render(id26, version4) { - await this.renderer.draw(this.text, id26, version4, this); + async render(id27, version4) { + await this.renderer.draw(this.text, id27, version4, this); } getParser() { return this.parser; @@ -130090,6 +140245,9 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } }; + // src/mermaidAPI.ts + init_common(); + // src/interactionDb.ts var interactionFunctions = []; var attachFunctions = /* @__PURE__ */ __name(() => { @@ -130101,37 +140259,6 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; // src/mermaidAPI.ts init_logger(); - init_styles(); - init_themes(); - var import_dompurify2 = __toESM(require_purify(), 1); - init_common(); - init_isEmpty(); - - // src/accessibility.ts - var SVG_ROLE = "graphics-document document"; - function setA11yDiagramInfo(svg, diagramType) { - svg.attr("role", SVG_ROLE); - if (diagramType !== "") { - svg.attr("aria-roledescription", diagramType); - } - } - __name(setA11yDiagramInfo, "setA11yDiagramInfo"); - function addSVGa11yTitleDescription(svg, a11yTitle, a11yDesc, baseId) { - if (svg.insert === void 0) { - return; - } - if (a11yDesc) { - const descId = `chart-desc-${baseId}`; - svg.attr("aria-describedby", descId); - svg.insert("desc", ":first-child").attr("id", descId).text(a11yDesc); - } - if (a11yTitle) { - const titleId = `chart-title-${baseId}`; - svg.attr("aria-labelledby", titleId); - svg.insert("title", ":first-child").attr("id", titleId).text(a11yTitle); - } - } - __name(addSVGa11yTitleDescription, "addSVGa11yTitleDescription"); // src/diagram-api/comments.ts var cleanupComments = /* @__PURE__ */ __name((text2) => { @@ -131088,99 +141215,99 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; this.documents = []; } __name(State$1, "State$1"); - function generateError(state4, message) { + function generateError(state5, message) { var mark = { - name: state4.filename, - buffer: state4.input.slice(0, -1), + name: state5.filename, + buffer: state5.input.slice(0, -1), // omit trailing \0 - position: state4.position, - line: state4.line, - column: state4.position - state4.lineStart + position: state5.position, + line: state5.line, + column: state5.position - state5.lineStart }; mark.snippet = snippet(mark); return new exception(message, mark); } __name(generateError, "generateError"); - function throwError(state4, message) { - throw generateError(state4, message); + function throwError(state5, message) { + throw generateError(state5, message); } __name(throwError, "throwError"); - function throwWarning(state4, message) { - if (state4.onWarning) { - state4.onWarning.call(null, generateError(state4, message)); + function throwWarning(state5, message) { + if (state5.onWarning) { + state5.onWarning.call(null, generateError(state5, message)); } } __name(throwWarning, "throwWarning"); var directiveHandlers = { - YAML: /* @__PURE__ */ __name(function handleYamlDirective(state4, name, args) { + YAML: /* @__PURE__ */ __name(function handleYamlDirective(state5, name, args) { var match2, major, minor; - if (state4.version !== null) { - throwError(state4, "duplication of %YAML directive"); + if (state5.version !== null) { + throwError(state5, "duplication of %YAML directive"); } if (args.length !== 1) { - throwError(state4, "YAML directive accepts exactly one argument"); + throwError(state5, "YAML directive accepts exactly one argument"); } match2 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); if (match2 === null) { - throwError(state4, "ill-formed argument of the YAML directive"); + throwError(state5, "ill-formed argument of the YAML directive"); } major = parseInt(match2[1], 10); minor = parseInt(match2[2], 10); if (major !== 1) { - throwError(state4, "unacceptable YAML version of the document"); + throwError(state5, "unacceptable YAML version of the document"); } - state4.version = args[0]; - state4.checkLineBreaks = minor < 2; + state5.version = args[0]; + state5.checkLineBreaks = minor < 2; if (minor !== 1 && minor !== 2) { - throwWarning(state4, "unsupported YAML version of the document"); + throwWarning(state5, "unsupported YAML version of the document"); } }, "handleYamlDirective"), - TAG: /* @__PURE__ */ __name(function handleTagDirective(state4, name, args) { + TAG: /* @__PURE__ */ __name(function handleTagDirective(state5, name, args) { var handle, prefix; if (args.length !== 2) { - throwError(state4, "TAG directive accepts exactly two arguments"); + throwError(state5, "TAG directive accepts exactly two arguments"); } handle = args[0]; prefix = args[1]; if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state4, "ill-formed tag handle (first argument) of the TAG directive"); + throwError(state5, "ill-formed tag handle (first argument) of the TAG directive"); } - if (_hasOwnProperty$1.call(state4.tagMap, handle)) { - throwError(state4, 'there is a previously declared suffix for "' + handle + '" tag handle'); + if (_hasOwnProperty$1.call(state5.tagMap, handle)) { + throwError(state5, 'there is a previously declared suffix for "' + handle + '" tag handle'); } if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state4, "ill-formed tag prefix (second argument) of the TAG directive"); + throwError(state5, "ill-formed tag prefix (second argument) of the TAG directive"); } try { prefix = decodeURIComponent(prefix); } catch (err) { - throwError(state4, "tag prefix is malformed: " + prefix); + throwError(state5, "tag prefix is malformed: " + prefix); } - state4.tagMap[handle] = prefix; + state5.tagMap[handle] = prefix; }, "handleTagDirective") }; - function captureSegment(state4, start3, end2, checkJson) { + function captureSegment(state5, start3, end2, checkJson) { var _position, _length, _character, _result; if (start3 < end2) { - _result = state4.input.slice(start3, end2); + _result = state5.input.slice(start3, end2); if (checkJson) { for (_position = 0, _length = _result.length; _position < _length; _position += 1) { _character = _result.charCodeAt(_position); if (!(_character === 9 || 32 <= _character && _character <= 1114111)) { - throwError(state4, "expected valid JSON character"); + throwError(state5, "expected valid JSON character"); } } } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state4, "the stream contains non-printable characters"); + throwError(state5, "the stream contains non-printable characters"); } - state4.result += _result; + state5.result += _result; } } __name(captureSegment, "captureSegment"); - function mergeMappings(state4, destination, source, overridableKeys) { + function mergeMappings(state5, destination, source, overridableKeys) { var sourceKeys, key, index, quantity; if (!common.isObject(source)) { - throwError(state4, "cannot merge mappings; the provided source object is unacceptable"); + throwError(state5, "cannot merge mappings; the provided source object is unacceptable"); } sourceKeys = Object.keys(source); for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { @@ -131192,13 +141319,13 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } } __name(mergeMappings, "mergeMappings"); - function storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) { + function storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) { var index, quantity; if (Array.isArray(keyNode)) { keyNode = Array.prototype.slice.call(keyNode); for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { if (Array.isArray(keyNode[index])) { - throwError(state4, "nested arrays are not supported inside keys"); + throwError(state5, "nested arrays are not supported inside keys"); } if (typeof keyNode === "object" && _class(keyNode[index]) === "[object Object]") { keyNode[index] = "[object Object]"; @@ -131215,17 +141342,17 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; if (keyTag === "tag:yaml.org,2002:merge") { if (Array.isArray(valueNode)) { for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state4, _result, valueNode[index], overridableKeys); + mergeMappings(state5, _result, valueNode[index], overridableKeys); } } else { - mergeMappings(state4, _result, valueNode, overridableKeys); + mergeMappings(state5, _result, valueNode, overridableKeys); } } else { - if (!state4.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) { - state4.line = startLine || state4.line; - state4.lineStart = startLineStart || state4.lineStart; - state4.position = startPos || state4.position; - throwError(state4, "duplicated mapping key"); + if (!state5.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) { + state5.line = startLine || state5.line; + state5.lineStart = startLineStart || state5.lineStart; + state5.position = startPos || state5.position; + throwError(state5, "duplicated mapping key"); } if (keyNode === "__proto__") { Object.defineProperty(_result, keyNode, { @@ -131242,63 +141369,63 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; return _result; } __name(storeMappingPair, "storeMappingPair"); - function readLineBreak(state4) { + function readLineBreak(state5) { var ch; - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); if (ch === 10) { - state4.position++; + state5.position++; } else if (ch === 13) { - state4.position++; - if (state4.input.charCodeAt(state4.position) === 10) { - state4.position++; + state5.position++; + if (state5.input.charCodeAt(state5.position) === 10) { + state5.position++; } } else { - throwError(state4, "a line break is expected"); + throwError(state5, "a line break is expected"); } - state4.line += 1; - state4.lineStart = state4.position; - state4.firstTabInLine = -1; + state5.line += 1; + state5.lineStart = state5.position; + state5.firstTabInLine = -1; } __name(readLineBreak, "readLineBreak"); - function skipSeparationSpace(state4, allowComments, checkIndent) { - var lineBreaks = 0, ch = state4.input.charCodeAt(state4.position); + function skipSeparationSpace(state5, allowComments, checkIndent) { + var lineBreaks = 0, ch = state5.input.charCodeAt(state5.position); while (ch !== 0) { while (is_WHITE_SPACE(ch)) { - if (ch === 9 && state4.firstTabInLine === -1) { - state4.firstTabInLine = state4.position; + if (ch === 9 && state5.firstTabInLine === -1) { + state5.firstTabInLine = state5.position; } - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } if (allowComments && ch === 35) { do { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } while (ch !== 10 && ch !== 13 && ch !== 0); } if (is_EOL(ch)) { - readLineBreak(state4); - ch = state4.input.charCodeAt(state4.position); + readLineBreak(state5); + ch = state5.input.charCodeAt(state5.position); lineBreaks++; - state4.lineIndent = 0; + state5.lineIndent = 0; while (ch === 32) { - state4.lineIndent++; - ch = state4.input.charCodeAt(++state4.position); + state5.lineIndent++; + ch = state5.input.charCodeAt(++state5.position); } } else { break; } } - if (checkIndent !== -1 && lineBreaks !== 0 && state4.lineIndent < checkIndent) { - throwWarning(state4, "deficient indentation"); + if (checkIndent !== -1 && lineBreaks !== 0 && state5.lineIndent < checkIndent) { + throwWarning(state5, "deficient indentation"); } return lineBreaks; } __name(skipSeparationSpace, "skipSeparationSpace"); - function testDocumentSeparator(state4) { - var _position = state4.position, ch; - ch = state4.input.charCodeAt(_position); - if ((ch === 45 || ch === 46) && ch === state4.input.charCodeAt(_position + 1) && ch === state4.input.charCodeAt(_position + 2)) { + function testDocumentSeparator(state5) { + var _position = state5.position, ch; + ch = state5.input.charCodeAt(_position); + if ((ch === 45 || ch === 46) && ch === state5.input.charCodeAt(_position + 1) && ch === state5.input.charCodeAt(_position + 2)) { _position += 3; - ch = state4.input.charCodeAt(_position); + ch = state5.input.charCodeAt(_position); if (ch === 0 || is_WS_OR_EOL(ch)) { return true; } @@ -131306,172 +141433,172 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; return false; } __name(testDocumentSeparator, "testDocumentSeparator"); - function writeFoldedLines(state4, count) { + function writeFoldedLines(state5, count) { if (count === 1) { - state4.result += " "; + state5.result += " "; } else if (count > 1) { - state4.result += common.repeat("\n", count - 1); + state5.result += common.repeat("\n", count - 1); } } __name(writeFoldedLines, "writeFoldedLines"); - function readPlainScalar(state4, nodeIndent, withinFlowCollection) { - var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state4.kind, _result = state4.result, ch; - ch = state4.input.charCodeAt(state4.position); + function readPlainScalar(state5, nodeIndent, withinFlowCollection) { + var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state5.kind, _result = state5.result, ch; + ch = state5.input.charCodeAt(state5.position); if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) { return false; } if (ch === 63 || ch === 45) { - following = state4.input.charCodeAt(state4.position + 1); + following = state5.input.charCodeAt(state5.position + 1); if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { return false; } } - state4.kind = "scalar"; - state4.result = ""; - captureStart = captureEnd = state4.position; + state5.kind = "scalar"; + state5.result = ""; + captureStart = captureEnd = state5.position; hasPendingContent = false; while (ch !== 0) { if (ch === 58) { - following = state4.input.charCodeAt(state4.position + 1); + following = state5.input.charCodeAt(state5.position + 1); if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { break; } } else if (ch === 35) { - preceding = state4.input.charCodeAt(state4.position - 1); + preceding = state5.input.charCodeAt(state5.position - 1); if (is_WS_OR_EOL(preceding)) { break; } - } else if (state4.position === state4.lineStart && testDocumentSeparator(state4) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { + } else if (state5.position === state5.lineStart && testDocumentSeparator(state5) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { break; } else if (is_EOL(ch)) { - _line = state4.line; - _lineStart = state4.lineStart; - _lineIndent = state4.lineIndent; - skipSeparationSpace(state4, false, -1); - if (state4.lineIndent >= nodeIndent) { + _line = state5.line; + _lineStart = state5.lineStart; + _lineIndent = state5.lineIndent; + skipSeparationSpace(state5, false, -1); + if (state5.lineIndent >= nodeIndent) { hasPendingContent = true; - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); continue; } else { - state4.position = captureEnd; - state4.line = _line; - state4.lineStart = _lineStart; - state4.lineIndent = _lineIndent; + state5.position = captureEnd; + state5.line = _line; + state5.lineStart = _lineStart; + state5.lineIndent = _lineIndent; break; } } if (hasPendingContent) { - captureSegment(state4, captureStart, captureEnd, false); - writeFoldedLines(state4, state4.line - _line); - captureStart = captureEnd = state4.position; + captureSegment(state5, captureStart, captureEnd, false); + writeFoldedLines(state5, state5.line - _line); + captureStart = captureEnd = state5.position; hasPendingContent = false; } if (!is_WHITE_SPACE(ch)) { - captureEnd = state4.position + 1; + captureEnd = state5.position + 1; } - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } - captureSegment(state4, captureStart, captureEnd, false); - if (state4.result) { + captureSegment(state5, captureStart, captureEnd, false); + if (state5.result) { return true; } - state4.kind = _kind; - state4.result = _result; + state5.kind = _kind; + state5.result = _result; return false; } __name(readPlainScalar, "readPlainScalar"); - function readSingleQuotedScalar(state4, nodeIndent) { + function readSingleQuotedScalar(state5, nodeIndent) { var ch, captureStart, captureEnd; - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); if (ch !== 39) { return false; } - state4.kind = "scalar"; - state4.result = ""; - state4.position++; - captureStart = captureEnd = state4.position; - while ((ch = state4.input.charCodeAt(state4.position)) !== 0) { + state5.kind = "scalar"; + state5.result = ""; + state5.position++; + captureStart = captureEnd = state5.position; + while ((ch = state5.input.charCodeAt(state5.position)) !== 0) { if (ch === 39) { - captureSegment(state4, captureStart, state4.position, true); - ch = state4.input.charCodeAt(++state4.position); + captureSegment(state5, captureStart, state5.position, true); + ch = state5.input.charCodeAt(++state5.position); if (ch === 39) { - captureStart = state4.position; - state4.position++; - captureEnd = state4.position; + captureStart = state5.position; + state5.position++; + captureEnd = state5.position; } else { return true; } } else if (is_EOL(ch)) { - captureSegment(state4, captureStart, captureEnd, true); - writeFoldedLines(state4, skipSeparationSpace(state4, false, nodeIndent)); - captureStart = captureEnd = state4.position; - } else if (state4.position === state4.lineStart && testDocumentSeparator(state4)) { - throwError(state4, "unexpected end of the document within a single quoted scalar"); + captureSegment(state5, captureStart, captureEnd, true); + writeFoldedLines(state5, skipSeparationSpace(state5, false, nodeIndent)); + captureStart = captureEnd = state5.position; + } else if (state5.position === state5.lineStart && testDocumentSeparator(state5)) { + throwError(state5, "unexpected end of the document within a single quoted scalar"); } else { - state4.position++; - captureEnd = state4.position; + state5.position++; + captureEnd = state5.position; } } - throwError(state4, "unexpected end of the stream within a single quoted scalar"); + throwError(state5, "unexpected end of the stream within a single quoted scalar"); } __name(readSingleQuotedScalar, "readSingleQuotedScalar"); - function readDoubleQuotedScalar(state4, nodeIndent) { + function readDoubleQuotedScalar(state5, nodeIndent) { var captureStart, captureEnd, hexLength, hexResult, tmp, ch; - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); if (ch !== 34) { return false; } - state4.kind = "scalar"; - state4.result = ""; - state4.position++; - captureStart = captureEnd = state4.position; - while ((ch = state4.input.charCodeAt(state4.position)) !== 0) { + state5.kind = "scalar"; + state5.result = ""; + state5.position++; + captureStart = captureEnd = state5.position; + while ((ch = state5.input.charCodeAt(state5.position)) !== 0) { if (ch === 34) { - captureSegment(state4, captureStart, state4.position, true); - state4.position++; + captureSegment(state5, captureStart, state5.position, true); + state5.position++; return true; } else if (ch === 92) { - captureSegment(state4, captureStart, state4.position, true); - ch = state4.input.charCodeAt(++state4.position); + captureSegment(state5, captureStart, state5.position, true); + ch = state5.input.charCodeAt(++state5.position); if (is_EOL(ch)) { - skipSeparationSpace(state4, false, nodeIndent); + skipSeparationSpace(state5, false, nodeIndent); } else if (ch < 256 && simpleEscapeCheck[ch]) { - state4.result += simpleEscapeMap[ch]; - state4.position++; + state5.result += simpleEscapeMap[ch]; + state5.position++; } else if ((tmp = escapedHexLen(ch)) > 0) { hexLength = tmp; hexResult = 0; for (; hexLength > 0; hexLength--) { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); if ((tmp = fromHexCode(ch)) >= 0) { hexResult = (hexResult << 4) + tmp; } else { - throwError(state4, "expected hexadecimal character"); + throwError(state5, "expected hexadecimal character"); } } - state4.result += charFromCodepoint(hexResult); - state4.position++; + state5.result += charFromCodepoint(hexResult); + state5.position++; } else { - throwError(state4, "unknown escape sequence"); + throwError(state5, "unknown escape sequence"); } - captureStart = captureEnd = state4.position; + captureStart = captureEnd = state5.position; } else if (is_EOL(ch)) { - captureSegment(state4, captureStart, captureEnd, true); - writeFoldedLines(state4, skipSeparationSpace(state4, false, nodeIndent)); - captureStart = captureEnd = state4.position; - } else if (state4.position === state4.lineStart && testDocumentSeparator(state4)) { - throwError(state4, "unexpected end of the document within a double quoted scalar"); + captureSegment(state5, captureStart, captureEnd, true); + writeFoldedLines(state5, skipSeparationSpace(state5, false, nodeIndent)); + captureStart = captureEnd = state5.position; + } else if (state5.position === state5.lineStart && testDocumentSeparator(state5)) { + throwError(state5, "unexpected end of the document within a double quoted scalar"); } else { - state4.position++; - captureEnd = state4.position; + state5.position++; + captureEnd = state5.position; } } - throwError(state4, "unexpected end of the stream within a double quoted scalar"); + throwError(state5, "unexpected end of the stream within a double quoted scalar"); } __name(readDoubleQuotedScalar, "readDoubleQuotedScalar"); - function readFlowCollection(state4, nodeIndent) { - var readNext = true, _line, _lineStart, _pos, _tag2 = state4.tag, _result, _anchor = state4.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch; - ch = state4.input.charCodeAt(state4.position); + function readFlowCollection(state5, nodeIndent) { + var readNext = true, _line, _lineStart, _pos, _tag2 = state5.tag, _result, _anchor = state5.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch; + ch = state5.input.charCodeAt(state5.position); if (ch === 91) { terminator = 93; isMapping = false; @@ -131483,72 +141610,72 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } else { return false; } - if (state4.anchor !== null) { - state4.anchorMap[state4.anchor] = _result; + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = _result; } - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); while (ch !== 0) { - skipSeparationSpace(state4, true, nodeIndent); - ch = state4.input.charCodeAt(state4.position); + skipSeparationSpace(state5, true, nodeIndent); + ch = state5.input.charCodeAt(state5.position); if (ch === terminator) { - state4.position++; - state4.tag = _tag2; - state4.anchor = _anchor; - state4.kind = isMapping ? "mapping" : "sequence"; - state4.result = _result; + state5.position++; + state5.tag = _tag2; + state5.anchor = _anchor; + state5.kind = isMapping ? "mapping" : "sequence"; + state5.result = _result; return true; } else if (!readNext) { - throwError(state4, "missed comma between flow collection entries"); + throwError(state5, "missed comma between flow collection entries"); } else if (ch === 44) { - throwError(state4, "expected the node content, but found ','"); + throwError(state5, "expected the node content, but found ','"); } keyTag = keyNode = valueNode = null; isPair = isExplicitPair = false; if (ch === 63) { - following = state4.input.charCodeAt(state4.position + 1); + following = state5.input.charCodeAt(state5.position + 1); if (is_WS_OR_EOL(following)) { isPair = isExplicitPair = true; - state4.position++; - skipSeparationSpace(state4, true, nodeIndent); - } - } - _line = state4.line; - _lineStart = state4.lineStart; - _pos = state4.position; - composeNode(state4, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state4.tag; - keyNode = state4.result; - skipSeparationSpace(state4, true, nodeIndent); - ch = state4.input.charCodeAt(state4.position); - if ((isExplicitPair || state4.line === _line) && ch === 58) { + state5.position++; + skipSeparationSpace(state5, true, nodeIndent); + } + } + _line = state5.line; + _lineStart = state5.lineStart; + _pos = state5.position; + composeNode(state5, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state5.tag; + keyNode = state5.result; + skipSeparationSpace(state5, true, nodeIndent); + ch = state5.input.charCodeAt(state5.position); + if ((isExplicitPair || state5.line === _line) && ch === 58) { isPair = true; - ch = state4.input.charCodeAt(++state4.position); - skipSeparationSpace(state4, true, nodeIndent); - composeNode(state4, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state4.result; + ch = state5.input.charCodeAt(++state5.position); + skipSeparationSpace(state5, true, nodeIndent); + composeNode(state5, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state5.result; } if (isMapping) { - storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); } else if (isPair) { - _result.push(storeMappingPair(state4, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + _result.push(storeMappingPair(state5, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); } else { _result.push(keyNode); } - skipSeparationSpace(state4, true, nodeIndent); - ch = state4.input.charCodeAt(state4.position); + skipSeparationSpace(state5, true, nodeIndent); + ch = state5.input.charCodeAt(state5.position); if (ch === 44) { readNext = true; - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } else { readNext = false; } } - throwError(state4, "unexpected end of the stream within a flow collection"); + throwError(state5, "unexpected end of the stream within a flow collection"); } __name(readFlowCollection, "readFlowCollection"); - function readBlockScalar(state4, nodeIndent) { + function readBlockScalar(state5, nodeIndent) { var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); if (ch === 124) { folding = false; } else if (ch === 62) { @@ -131556,24 +141683,24 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } else { return false; } - state4.kind = "scalar"; - state4.result = ""; + state5.kind = "scalar"; + state5.result = ""; while (ch !== 0) { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); if (ch === 43 || ch === 45) { if (CHOMPING_CLIP === chomping) { chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP; } else { - throwError(state4, "repeat of a chomping mode identifier"); + throwError(state5, "repeat of a chomping mode identifier"); } } else if ((tmp = fromDecimalCode(ch)) >= 0) { if (tmp === 0) { - throwError(state4, "bad explicit indentation width of a block scalar; it cannot be less than one"); + throwError(state5, "bad explicit indentation width of a block scalar; it cannot be less than one"); } else if (!detectedIndent) { textIndent = nodeIndent + tmp - 1; detectedIndent = true; } else { - throwError(state4, "repeat of an indentation width identifier"); + throwError(state5, "repeat of an indentation width identifier"); } } else { break; @@ -131581,35 +141708,35 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } if (is_WHITE_SPACE(ch)) { do { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } while (is_WHITE_SPACE(ch)); if (ch === 35) { do { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } while (!is_EOL(ch) && ch !== 0); } } while (ch !== 0) { - readLineBreak(state4); - state4.lineIndent = 0; - ch = state4.input.charCodeAt(state4.position); - while ((!detectedIndent || state4.lineIndent < textIndent) && ch === 32) { - state4.lineIndent++; - ch = state4.input.charCodeAt(++state4.position); + readLineBreak(state5); + state5.lineIndent = 0; + ch = state5.input.charCodeAt(state5.position); + while ((!detectedIndent || state5.lineIndent < textIndent) && ch === 32) { + state5.lineIndent++; + ch = state5.input.charCodeAt(++state5.position); } - if (!detectedIndent && state4.lineIndent > textIndent) { - textIndent = state4.lineIndent; + if (!detectedIndent && state5.lineIndent > textIndent) { + textIndent = state5.lineIndent; } if (is_EOL(ch)) { emptyLines++; continue; } - if (state4.lineIndent < textIndent) { + if (state5.lineIndent < textIndent) { if (chomping === CHOMPING_KEEP) { - state4.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + state5.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); } else if (chomping === CHOMPING_CLIP) { if (didReadContent) { - state4.result += "\n"; + state5.result += "\n"; } } break; @@ -131617,99 +141744,99 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; if (folding) { if (is_WHITE_SPACE(ch)) { atMoreIndented = true; - state4.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + state5.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); } else if (atMoreIndented) { atMoreIndented = false; - state4.result += common.repeat("\n", emptyLines + 1); + state5.result += common.repeat("\n", emptyLines + 1); } else if (emptyLines === 0) { if (didReadContent) { - state4.result += " "; + state5.result += " "; } } else { - state4.result += common.repeat("\n", emptyLines); + state5.result += common.repeat("\n", emptyLines); } } else { - state4.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + state5.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); } didReadContent = true; detectedIndent = true; emptyLines = 0; - captureStart = state4.position; + captureStart = state5.position; while (!is_EOL(ch) && ch !== 0) { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } - captureSegment(state4, captureStart, state4.position, false); + captureSegment(state5, captureStart, state5.position, false); } return true; } __name(readBlockScalar, "readBlockScalar"); - function readBlockSequence(state4, nodeIndent) { - var _line, _tag2 = state4.tag, _anchor = state4.anchor, _result = [], following, detected = false, ch; - if (state4.firstTabInLine !== -1) return false; - if (state4.anchor !== null) { - state4.anchorMap[state4.anchor] = _result; + function readBlockSequence(state5, nodeIndent) { + var _line, _tag2 = state5.tag, _anchor = state5.anchor, _result = [], following, detected = false, ch; + if (state5.firstTabInLine !== -1) return false; + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = _result; } - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); while (ch !== 0) { - if (state4.firstTabInLine !== -1) { - state4.position = state4.firstTabInLine; - throwError(state4, "tab characters must not be used in indentation"); + if (state5.firstTabInLine !== -1) { + state5.position = state5.firstTabInLine; + throwError(state5, "tab characters must not be used in indentation"); } if (ch !== 45) { break; } - following = state4.input.charCodeAt(state4.position + 1); + following = state5.input.charCodeAt(state5.position + 1); if (!is_WS_OR_EOL(following)) { break; } detected = true; - state4.position++; - if (skipSeparationSpace(state4, true, -1)) { - if (state4.lineIndent <= nodeIndent) { + state5.position++; + if (skipSeparationSpace(state5, true, -1)) { + if (state5.lineIndent <= nodeIndent) { _result.push(null); - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); continue; } } - _line = state4.line; - composeNode(state4, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state4.result); - skipSeparationSpace(state4, true, -1); - ch = state4.input.charCodeAt(state4.position); - if ((state4.line === _line || state4.lineIndent > nodeIndent) && ch !== 0) { - throwError(state4, "bad indentation of a sequence entry"); - } else if (state4.lineIndent < nodeIndent) { + _line = state5.line; + composeNode(state5, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state5.result); + skipSeparationSpace(state5, true, -1); + ch = state5.input.charCodeAt(state5.position); + if ((state5.line === _line || state5.lineIndent > nodeIndent) && ch !== 0) { + throwError(state5, "bad indentation of a sequence entry"); + } else if (state5.lineIndent < nodeIndent) { break; } } if (detected) { - state4.tag = _tag2; - state4.anchor = _anchor; - state4.kind = "sequence"; - state4.result = _result; + state5.tag = _tag2; + state5.anchor = _anchor; + state5.kind = "sequence"; + state5.result = _result; return true; } return false; } __name(readBlockSequence, "readBlockSequence"); - function readBlockMapping(state4, nodeIndent, flowIndent) { - var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag2 = state4.tag, _anchor = state4.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; - if (state4.firstTabInLine !== -1) return false; - if (state4.anchor !== null) { - state4.anchorMap[state4.anchor] = _result; + function readBlockMapping(state5, nodeIndent, flowIndent) { + var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag2 = state5.tag, _anchor = state5.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; + if (state5.firstTabInLine !== -1) return false; + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = _result; } - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); while (ch !== 0) { - if (!atExplicitKey && state4.firstTabInLine !== -1) { - state4.position = state4.firstTabInLine; - throwError(state4, "tab characters must not be used in indentation"); + if (!atExplicitKey && state5.firstTabInLine !== -1) { + state5.position = state5.firstTabInLine; + throwError(state5, "tab characters must not be used in indentation"); } - following = state4.input.charCodeAt(state4.position + 1); - _line = state4.line; + following = state5.input.charCodeAt(state5.position + 1); + _line = state5.line; if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) { if (ch === 63) { if (atExplicitKey) { - storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); keyTag = keyNode = valueNode = null; } detected = true; @@ -131719,233 +141846,233 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; atExplicitKey = false; allowCompact = true; } else { - throwError(state4, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); + throwError(state5, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); } - state4.position += 1; + state5.position += 1; ch = following; } else { - _keyLine = state4.line; - _keyLineStart = state4.lineStart; - _keyPos = state4.position; - if (!composeNode(state4, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + _keyLine = state5.line; + _keyLineStart = state5.lineStart; + _keyPos = state5.position; + if (!composeNode(state5, flowIndent, CONTEXT_FLOW_OUT, false, true)) { break; } - if (state4.line === _line) { - ch = state4.input.charCodeAt(state4.position); + if (state5.line === _line) { + ch = state5.input.charCodeAt(state5.position); while (is_WHITE_SPACE(ch)) { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } if (ch === 58) { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); if (!is_WS_OR_EOL(ch)) { - throwError(state4, "a whitespace character is expected after the key-value separator within a block mapping"); + throwError(state5, "a whitespace character is expected after the key-value separator within a block mapping"); } if (atExplicitKey) { - storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); keyTag = keyNode = valueNode = null; } detected = true; atExplicitKey = false; allowCompact = false; - keyTag = state4.tag; - keyNode = state4.result; + keyTag = state5.tag; + keyNode = state5.result; } else if (detected) { - throwError(state4, "can not read an implicit mapping pair; a colon is missed"); + throwError(state5, "can not read an implicit mapping pair; a colon is missed"); } else { - state4.tag = _tag2; - state4.anchor = _anchor; + state5.tag = _tag2; + state5.anchor = _anchor; return true; } } else if (detected) { - throwError(state4, "can not read a block mapping entry; a multiline key may not be an implicit key"); + throwError(state5, "can not read a block mapping entry; a multiline key may not be an implicit key"); } else { - state4.tag = _tag2; - state4.anchor = _anchor; + state5.tag = _tag2; + state5.anchor = _anchor; return true; } } - if (state4.line === _line || state4.lineIndent > nodeIndent) { + if (state5.line === _line || state5.lineIndent > nodeIndent) { if (atExplicitKey) { - _keyLine = state4.line; - _keyLineStart = state4.lineStart; - _keyPos = state4.position; + _keyLine = state5.line; + _keyLineStart = state5.lineStart; + _keyPos = state5.position; } - if (composeNode(state4, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (composeNode(state5, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { if (atExplicitKey) { - keyNode = state4.result; + keyNode = state5.result; } else { - valueNode = state4.result; + valueNode = state5.result; } } if (!atExplicitKey) { - storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); keyTag = keyNode = valueNode = null; } - skipSeparationSpace(state4, true, -1); - ch = state4.input.charCodeAt(state4.position); + skipSeparationSpace(state5, true, -1); + ch = state5.input.charCodeAt(state5.position); } - if ((state4.line === _line || state4.lineIndent > nodeIndent) && ch !== 0) { - throwError(state4, "bad indentation of a mapping entry"); - } else if (state4.lineIndent < nodeIndent) { + if ((state5.line === _line || state5.lineIndent > nodeIndent) && ch !== 0) { + throwError(state5, "bad indentation of a mapping entry"); + } else if (state5.lineIndent < nodeIndent) { break; } } if (atExplicitKey) { - storeMappingPair(state4, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + storeMappingPair(state5, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); } if (detected) { - state4.tag = _tag2; - state4.anchor = _anchor; - state4.kind = "mapping"; - state4.result = _result; + state5.tag = _tag2; + state5.anchor = _anchor; + state5.kind = "mapping"; + state5.result = _result; } return detected; } __name(readBlockMapping, "readBlockMapping"); - function readTagProperty(state4) { + function readTagProperty(state5) { var _position, isVerbatim = false, isNamed2 = false, tagHandle, tagName, ch; - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); if (ch !== 33) return false; - if (state4.tag !== null) { - throwError(state4, "duplication of a tag property"); + if (state5.tag !== null) { + throwError(state5, "duplication of a tag property"); } - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); if (ch === 60) { isVerbatim = true; - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } else if (ch === 33) { isNamed2 = true; tagHandle = "!!"; - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } else { tagHandle = "!"; } - _position = state4.position; + _position = state5.position; if (isVerbatim) { do { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } while (ch !== 0 && ch !== 62); - if (state4.position < state4.length) { - tagName = state4.input.slice(_position, state4.position); - ch = state4.input.charCodeAt(++state4.position); + if (state5.position < state5.length) { + tagName = state5.input.slice(_position, state5.position); + ch = state5.input.charCodeAt(++state5.position); } else { - throwError(state4, "unexpected end of the stream within a verbatim tag"); + throwError(state5, "unexpected end of the stream within a verbatim tag"); } } else { while (ch !== 0 && !is_WS_OR_EOL(ch)) { if (ch === 33) { if (!isNamed2) { - tagHandle = state4.input.slice(_position - 1, state4.position + 1); + tagHandle = state5.input.slice(_position - 1, state5.position + 1); if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state4, "named tag handle cannot contain such characters"); + throwError(state5, "named tag handle cannot contain such characters"); } isNamed2 = true; - _position = state4.position + 1; + _position = state5.position + 1; } else { - throwError(state4, "tag suffix cannot contain exclamation marks"); + throwError(state5, "tag suffix cannot contain exclamation marks"); } } - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } - tagName = state4.input.slice(_position, state4.position); + tagName = state5.input.slice(_position, state5.position); if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state4, "tag suffix cannot contain flow indicator characters"); + throwError(state5, "tag suffix cannot contain flow indicator characters"); } } if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state4, "tag name cannot contain such characters: " + tagName); + throwError(state5, "tag name cannot contain such characters: " + tagName); } try { tagName = decodeURIComponent(tagName); } catch (err) { - throwError(state4, "tag name is malformed: " + tagName); + throwError(state5, "tag name is malformed: " + tagName); } if (isVerbatim) { - state4.tag = tagName; - } else if (_hasOwnProperty$1.call(state4.tagMap, tagHandle)) { - state4.tag = state4.tagMap[tagHandle] + tagName; + state5.tag = tagName; + } else if (_hasOwnProperty$1.call(state5.tagMap, tagHandle)) { + state5.tag = state5.tagMap[tagHandle] + tagName; } else if (tagHandle === "!") { - state4.tag = "!" + tagName; + state5.tag = "!" + tagName; } else if (tagHandle === "!!") { - state4.tag = "tag:yaml.org,2002:" + tagName; + state5.tag = "tag:yaml.org,2002:" + tagName; } else { - throwError(state4, 'undeclared tag handle "' + tagHandle + '"'); + throwError(state5, 'undeclared tag handle "' + tagHandle + '"'); } return true; } __name(readTagProperty, "readTagProperty"); - function readAnchorProperty(state4) { + function readAnchorProperty(state5) { var _position, ch; - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); if (ch !== 38) return false; - if (state4.anchor !== null) { - throwError(state4, "duplication of an anchor property"); + if (state5.anchor !== null) { + throwError(state5, "duplication of an anchor property"); } - ch = state4.input.charCodeAt(++state4.position); - _position = state4.position; + ch = state5.input.charCodeAt(++state5.position); + _position = state5.position; while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } - if (state4.position === _position) { - throwError(state4, "name of an anchor node must contain at least one character"); + if (state5.position === _position) { + throwError(state5, "name of an anchor node must contain at least one character"); } - state4.anchor = state4.input.slice(_position, state4.position); + state5.anchor = state5.input.slice(_position, state5.position); return true; } __name(readAnchorProperty, "readAnchorProperty"); - function readAlias(state4) { + function readAlias(state5) { var _position, alias, ch; - ch = state4.input.charCodeAt(state4.position); + ch = state5.input.charCodeAt(state5.position); if (ch !== 42) return false; - ch = state4.input.charCodeAt(++state4.position); - _position = state4.position; + ch = state5.input.charCodeAt(++state5.position); + _position = state5.position; while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } - if (state4.position === _position) { - throwError(state4, "name of an alias node must contain at least one character"); + if (state5.position === _position) { + throwError(state5, "name of an alias node must contain at least one character"); } - alias = state4.input.slice(_position, state4.position); - if (!_hasOwnProperty$1.call(state4.anchorMap, alias)) { - throwError(state4, 'unidentified alias "' + alias + '"'); + alias = state5.input.slice(_position, state5.position); + if (!_hasOwnProperty$1.call(state5.anchorMap, alias)) { + throwError(state5, 'unidentified alias "' + alias + '"'); } - state4.result = state4.anchorMap[alias]; - skipSeparationSpace(state4, true, -1); + state5.result = state5.anchorMap[alias]; + skipSeparationSpace(state5, true, -1); return true; } __name(readAlias, "readAlias"); - function composeNode(state4, parentIndent, nodeContext, allowToSeek, allowCompact) { + function composeNode(state5, parentIndent, nodeContext, allowToSeek, allowCompact) { var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type3, flowIndent, blockIndent; - if (state4.listener !== null) { - state4.listener("open", state4); + if (state5.listener !== null) { + state5.listener("open", state5); } - state4.tag = null; - state4.anchor = null; - state4.kind = null; - state4.result = null; + state5.tag = null; + state5.anchor = null; + state5.kind = null; + state5.result = null; allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext; if (allowToSeek) { - if (skipSeparationSpace(state4, true, -1)) { + if (skipSeparationSpace(state5, true, -1)) { atNewLine = true; - if (state4.lineIndent > parentIndent) { + if (state5.lineIndent > parentIndent) { indentStatus = 1; - } else if (state4.lineIndent === parentIndent) { + } else if (state5.lineIndent === parentIndent) { indentStatus = 0; - } else if (state4.lineIndent < parentIndent) { + } else if (state5.lineIndent < parentIndent) { indentStatus = -1; } } } if (indentStatus === 1) { - while (readTagProperty(state4) || readAnchorProperty(state4)) { - if (skipSeparationSpace(state4, true, -1)) { + while (readTagProperty(state5) || readAnchorProperty(state5)) { + if (skipSeparationSpace(state5, true, -1)) { atNewLine = true; allowBlockCollections = allowBlockStyles; - if (state4.lineIndent > parentIndent) { + if (state5.lineIndent > parentIndent) { indentStatus = 1; - } else if (state4.lineIndent === parentIndent) { + } else if (state5.lineIndent === parentIndent) { indentStatus = 0; - } else if (state4.lineIndent < parentIndent) { + } else if (state5.lineIndent < parentIndent) { indentStatus = -1; } } else { @@ -131962,154 +142089,154 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } else { flowIndent = parentIndent + 1; } - blockIndent = state4.position - state4.lineStart; + blockIndent = state5.position - state5.lineStart; if (indentStatus === 1) { - if (allowBlockCollections && (readBlockSequence(state4, blockIndent) || readBlockMapping(state4, blockIndent, flowIndent)) || readFlowCollection(state4, flowIndent)) { + if (allowBlockCollections && (readBlockSequence(state5, blockIndent) || readBlockMapping(state5, blockIndent, flowIndent)) || readFlowCollection(state5, flowIndent)) { hasContent = true; } else { - if (allowBlockScalars && readBlockScalar(state4, flowIndent) || readSingleQuotedScalar(state4, flowIndent) || readDoubleQuotedScalar(state4, flowIndent)) { + if (allowBlockScalars && readBlockScalar(state5, flowIndent) || readSingleQuotedScalar(state5, flowIndent) || readDoubleQuotedScalar(state5, flowIndent)) { hasContent = true; - } else if (readAlias(state4)) { + } else if (readAlias(state5)) { hasContent = true; - if (state4.tag !== null || state4.anchor !== null) { - throwError(state4, "alias node should not have any properties"); + if (state5.tag !== null || state5.anchor !== null) { + throwError(state5, "alias node should not have any properties"); } - } else if (readPlainScalar(state4, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + } else if (readPlainScalar(state5, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { hasContent = true; - if (state4.tag === null) { - state4.tag = "?"; + if (state5.tag === null) { + state5.tag = "?"; } } - if (state4.anchor !== null) { - state4.anchorMap[state4.anchor] = state4.result; + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = state5.result; } } } else if (indentStatus === 0) { - hasContent = allowBlockCollections && readBlockSequence(state4, blockIndent); + hasContent = allowBlockCollections && readBlockSequence(state5, blockIndent); } } - if (state4.tag === null) { - if (state4.anchor !== null) { - state4.anchorMap[state4.anchor] = state4.result; + if (state5.tag === null) { + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = state5.result; } - } else if (state4.tag === "?") { - if (state4.result !== null && state4.kind !== "scalar") { - throwError(state4, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state4.kind + '"'); + } else if (state5.tag === "?") { + if (state5.result !== null && state5.kind !== "scalar") { + throwError(state5, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state5.kind + '"'); } - for (typeIndex = 0, typeQuantity = state4.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type3 = state4.implicitTypes[typeIndex]; - if (type3.resolve(state4.result)) { - state4.result = type3.construct(state4.result); - state4.tag = type3.tag; - if (state4.anchor !== null) { - state4.anchorMap[state4.anchor] = state4.result; + for (typeIndex = 0, typeQuantity = state5.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type3 = state5.implicitTypes[typeIndex]; + if (type3.resolve(state5.result)) { + state5.result = type3.construct(state5.result); + state5.tag = type3.tag; + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = state5.result; } break; } } - } else if (state4.tag !== "!") { - if (_hasOwnProperty$1.call(state4.typeMap[state4.kind || "fallback"], state4.tag)) { - type3 = state4.typeMap[state4.kind || "fallback"][state4.tag]; + } else if (state5.tag !== "!") { + if (_hasOwnProperty$1.call(state5.typeMap[state5.kind || "fallback"], state5.tag)) { + type3 = state5.typeMap[state5.kind || "fallback"][state5.tag]; } else { type3 = null; - typeList = state4.typeMap.multi[state4.kind || "fallback"]; + typeList = state5.typeMap.multi[state5.kind || "fallback"]; for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { - if (state4.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + if (state5.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { type3 = typeList[typeIndex]; break; } } } if (!type3) { - throwError(state4, "unknown tag !<" + state4.tag + ">"); + throwError(state5, "unknown tag !<" + state5.tag + ">"); } - if (state4.result !== null && type3.kind !== state4.kind) { - throwError(state4, "unacceptable node kind for !<" + state4.tag + '> tag; it should be "' + type3.kind + '", not "' + state4.kind + '"'); + if (state5.result !== null && type3.kind !== state5.kind) { + throwError(state5, "unacceptable node kind for !<" + state5.tag + '> tag; it should be "' + type3.kind + '", not "' + state5.kind + '"'); } - if (!type3.resolve(state4.result, state4.tag)) { - throwError(state4, "cannot resolve a node with !<" + state4.tag + "> explicit tag"); + if (!type3.resolve(state5.result, state5.tag)) { + throwError(state5, "cannot resolve a node with !<" + state5.tag + "> explicit tag"); } else { - state4.result = type3.construct(state4.result, state4.tag); - if (state4.anchor !== null) { - state4.anchorMap[state4.anchor] = state4.result; + state5.result = type3.construct(state5.result, state5.tag); + if (state5.anchor !== null) { + state5.anchorMap[state5.anchor] = state5.result; } } } - if (state4.listener !== null) { - state4.listener("close", state4); + if (state5.listener !== null) { + state5.listener("close", state5); } - return state4.tag !== null || state4.anchor !== null || hasContent; + return state5.tag !== null || state5.anchor !== null || hasContent; } __name(composeNode, "composeNode"); - function readDocument(state4) { - var documentStart = state4.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; - state4.version = null; - state4.checkLineBreaks = state4.legacy; - state4.tagMap = /* @__PURE__ */ Object.create(null); - state4.anchorMap = /* @__PURE__ */ Object.create(null); - while ((ch = state4.input.charCodeAt(state4.position)) !== 0) { - skipSeparationSpace(state4, true, -1); - ch = state4.input.charCodeAt(state4.position); - if (state4.lineIndent > 0 || ch !== 37) { + function readDocument(state5) { + var documentStart = state5.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; + state5.version = null; + state5.checkLineBreaks = state5.legacy; + state5.tagMap = /* @__PURE__ */ Object.create(null); + state5.anchorMap = /* @__PURE__ */ Object.create(null); + while ((ch = state5.input.charCodeAt(state5.position)) !== 0) { + skipSeparationSpace(state5, true, -1); + ch = state5.input.charCodeAt(state5.position); + if (state5.lineIndent > 0 || ch !== 37) { break; } hasDirectives = true; - ch = state4.input.charCodeAt(++state4.position); - _position = state4.position; + ch = state5.input.charCodeAt(++state5.position); + _position = state5.position; while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } - directiveName = state4.input.slice(_position, state4.position); + directiveName = state5.input.slice(_position, state5.position); directiveArgs = []; if (directiveName.length < 1) { - throwError(state4, "directive name must not be less than one character in length"); + throwError(state5, "directive name must not be less than one character in length"); } while (ch !== 0) { while (is_WHITE_SPACE(ch)) { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } if (ch === 35) { do { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } while (ch !== 0 && !is_EOL(ch)); break; } if (is_EOL(ch)) break; - _position = state4.position; + _position = state5.position; while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state4.input.charCodeAt(++state4.position); + ch = state5.input.charCodeAt(++state5.position); } - directiveArgs.push(state4.input.slice(_position, state4.position)); + directiveArgs.push(state5.input.slice(_position, state5.position)); } - if (ch !== 0) readLineBreak(state4); + if (ch !== 0) readLineBreak(state5); if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state4, directiveName, directiveArgs); + directiveHandlers[directiveName](state5, directiveName, directiveArgs); } else { - throwWarning(state4, 'unknown document directive "' + directiveName + '"'); + throwWarning(state5, 'unknown document directive "' + directiveName + '"'); } } - skipSeparationSpace(state4, true, -1); - if (state4.lineIndent === 0 && state4.input.charCodeAt(state4.position) === 45 && state4.input.charCodeAt(state4.position + 1) === 45 && state4.input.charCodeAt(state4.position + 2) === 45) { - state4.position += 3; - skipSeparationSpace(state4, true, -1); + skipSeparationSpace(state5, true, -1); + if (state5.lineIndent === 0 && state5.input.charCodeAt(state5.position) === 45 && state5.input.charCodeAt(state5.position + 1) === 45 && state5.input.charCodeAt(state5.position + 2) === 45) { + state5.position += 3; + skipSeparationSpace(state5, true, -1); } else if (hasDirectives) { - throwError(state4, "directives end mark is expected"); + throwError(state5, "directives end mark is expected"); } - composeNode(state4, state4.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state4, true, -1); - if (state4.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state4.input.slice(documentStart, state4.position))) { - throwWarning(state4, "non-ASCII line breaks are interpreted as content"); + composeNode(state5, state5.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state5, true, -1); + if (state5.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state5.input.slice(documentStart, state5.position))) { + throwWarning(state5, "non-ASCII line breaks are interpreted as content"); } - state4.documents.push(state4.result); - if (state4.position === state4.lineStart && testDocumentSeparator(state4)) { - if (state4.input.charCodeAt(state4.position) === 46) { - state4.position += 3; - skipSeparationSpace(state4, true, -1); + state5.documents.push(state5.result); + if (state5.position === state5.lineStart && testDocumentSeparator(state5)) { + if (state5.input.charCodeAt(state5.position) === 46) { + state5.position += 3; + skipSeparationSpace(state5, true, -1); } return; } - if (state4.position < state4.length - 1) { - throwError(state4, "end of the stream or a document separator is expected"); + if (state5.position < state5.length - 1) { + throwError(state5, "end of the stream or a document separator is expected"); } else { return; } @@ -132126,21 +142253,21 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; input = input.slice(1); } } - var state4 = new State$1(input, options3); + var state5 = new State$1(input, options3); var nullpos = input.indexOf("\0"); if (nullpos !== -1) { - state4.position = nullpos; - throwError(state4, "null byte is not allowed in input"); + state5.position = nullpos; + throwError(state5, "null byte is not allowed in input"); } - state4.input += "\0"; - while (state4.input.charCodeAt(state4.position) === 32) { - state4.lineIndent += 1; - state4.position += 1; + state5.input += "\0"; + while (state5.input.charCodeAt(state5.position) === 32) { + state5.lineIndent += 1; + state5.position += 1; } - while (state4.position < state4.length - 1) { - readDocument(state4); + while (state5.position < state5.length - 1) { + readDocument(state5); } - return state4.documents; + return state5.documents; } __name(loadDocuments, "loadDocuments"); function loadAll$1(input, iterator, options3) { @@ -132169,7 +142296,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; __name(load$1, "load$1"); var loadAll_1 = loadAll$1; var load_1 = load$1; - var loader24 = { + var loader25 = { loadAll: loadAll_1, load: load_1 }; @@ -132315,14 +142442,14 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; return result; } __name(indentString, "indentString"); - function generateNextLine(state4, level) { - return "\n" + common.repeat(" ", state4.indent * level); + function generateNextLine(state5, level) { + return "\n" + common.repeat(" ", state5.indent * level); } __name(generateNextLine, "generateNextLine"); - function testImplicitResolving(state4, str2) { + function testImplicitResolving(state5, str2) { var index, length2, type3; - for (index = 0, length2 = state4.implicitTypes.length; index < length2; index += 1) { - type3 = state4.implicitTypes[index]; + for (index = 0, length2 = state5.implicitTypes.length; index < length2; index += 1) { + type3 = state5.implicitTypes[index]; if (type3.resolve(str2)) { return true; } @@ -132434,31 +142561,31 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; } __name(chooseScalarStyle, "chooseScalarStyle"); - function writeScalar(state4, string3, level, iskey, inblock) { - state4.dump = function() { + function writeScalar(state5, string3, level, iskey, inblock) { + state5.dump = function() { if (string3.length === 0) { - return state4.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + return state5.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; } - if (!state4.noCompatMode) { + if (!state5.noCompatMode) { if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string3) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string3)) { - return state4.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string3 + '"' : "'" + string3 + "'"; + return state5.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string3 + '"' : "'" + string3 + "'"; } } - var indent = state4.indent * Math.max(1, level); - var lineWidth = state4.lineWidth === -1 ? -1 : Math.max(Math.min(state4.lineWidth, 40), state4.lineWidth - indent); - var singleLineOnly = iskey || state4.flowLevel > -1 && level >= state4.flowLevel; + var indent = state5.indent * Math.max(1, level); + var lineWidth = state5.lineWidth === -1 ? -1 : Math.max(Math.min(state5.lineWidth, 40), state5.lineWidth - indent); + var singleLineOnly = iskey || state5.flowLevel > -1 && level >= state5.flowLevel; function testAmbiguity(string4) { - return testImplicitResolving(state4, string4); + return testImplicitResolving(state5, string4); } __name(testAmbiguity, "testAmbiguity"); switch (chooseScalarStyle( string3, singleLineOnly, - state4.indent, + state5.indent, lineWidth, testAmbiguity, - state4.quotingType, - state4.forceQuotes && !iskey, + state5.quotingType, + state5.forceQuotes && !iskey, inblock )) { case STYLE_PLAIN: @@ -132466,9 +142593,9 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; case STYLE_SINGLE: return "'" + string3.replace(/'/g, "''") + "'"; case STYLE_LITERAL: - return "|" + blockHeader(string3, state4.indent) + dropEndingNewline(indentString(string3, indent)); + return "|" + blockHeader(string3, state5.indent) + dropEndingNewline(indentString(string3, indent)); case STYLE_FOLDED: - return ">" + blockHeader(string3, state4.indent) + dropEndingNewline(indentString(foldString(string3, lineWidth), indent)); + return ">" + blockHeader(string3, state5.indent) + dropEndingNewline(indentString(foldString(string3, lineWidth), indent)); case STYLE_DOUBLE: return '"' + escapeString(string3) + '"'; default: @@ -132550,137 +142677,137 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; return result; } __name(escapeString, "escapeString"); - function writeFlowSequence(state4, level, object3) { - var _result = "", _tag2 = state4.tag, index, length2, value2; + function writeFlowSequence(state5, level, object3) { + var _result = "", _tag2 = state5.tag, index, length2, value2; for (index = 0, length2 = object3.length; index < length2; index += 1) { value2 = object3[index]; - if (state4.replacer) { - value2 = state4.replacer.call(object3, String(index), value2); + if (state5.replacer) { + value2 = state5.replacer.call(object3, String(index), value2); } - if (writeNode(state4, level, value2, false, false) || typeof value2 === "undefined" && writeNode(state4, level, null, false, false)) { - if (_result !== "") _result += "," + (!state4.condenseFlow ? " " : ""); - _result += state4.dump; + if (writeNode(state5, level, value2, false, false) || typeof value2 === "undefined" && writeNode(state5, level, null, false, false)) { + if (_result !== "") _result += "," + (!state5.condenseFlow ? " " : ""); + _result += state5.dump; } } - state4.tag = _tag2; - state4.dump = "[" + _result + "]"; + state5.tag = _tag2; + state5.dump = "[" + _result + "]"; } __name(writeFlowSequence, "writeFlowSequence"); - function writeBlockSequence(state4, level, object3, compact2) { - var _result = "", _tag2 = state4.tag, index, length2, value2; + function writeBlockSequence(state5, level, object3, compact2) { + var _result = "", _tag2 = state5.tag, index, length2, value2; for (index = 0, length2 = object3.length; index < length2; index += 1) { value2 = object3[index]; - if (state4.replacer) { - value2 = state4.replacer.call(object3, String(index), value2); + if (state5.replacer) { + value2 = state5.replacer.call(object3, String(index), value2); } - if (writeNode(state4, level + 1, value2, true, true, false, true) || typeof value2 === "undefined" && writeNode(state4, level + 1, null, true, true, false, true)) { + if (writeNode(state5, level + 1, value2, true, true, false, true) || typeof value2 === "undefined" && writeNode(state5, level + 1, null, true, true, false, true)) { if (!compact2 || _result !== "") { - _result += generateNextLine(state4, level); + _result += generateNextLine(state5, level); } - if (state4.dump && CHAR_LINE_FEED === state4.dump.charCodeAt(0)) { + if (state5.dump && CHAR_LINE_FEED === state5.dump.charCodeAt(0)) { _result += "-"; } else { _result += "- "; } - _result += state4.dump; + _result += state5.dump; } } - state4.tag = _tag2; - state4.dump = _result || "[]"; + state5.tag = _tag2; + state5.dump = _result || "[]"; } __name(writeBlockSequence, "writeBlockSequence"); - function writeFlowMapping(state4, level, object3) { - var _result = "", _tag2 = state4.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, pairBuffer; + function writeFlowMapping(state5, level, object3) { + var _result = "", _tag2 = state5.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, pairBuffer; for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) { pairBuffer = ""; if (_result !== "") pairBuffer += ", "; - if (state4.condenseFlow) pairBuffer += '"'; + if (state5.condenseFlow) pairBuffer += '"'; objectKey = objectKeyList[index]; objectValue = object3[objectKey]; - if (state4.replacer) { - objectValue = state4.replacer.call(object3, objectKey, objectValue); + if (state5.replacer) { + objectValue = state5.replacer.call(object3, objectKey, objectValue); } - if (!writeNode(state4, level, objectKey, false, false)) { + if (!writeNode(state5, level, objectKey, false, false)) { continue; } - if (state4.dump.length > 1024) pairBuffer += "? "; - pairBuffer += state4.dump + (state4.condenseFlow ? '"' : "") + ":" + (state4.condenseFlow ? "" : " "); - if (!writeNode(state4, level, objectValue, false, false)) { + if (state5.dump.length > 1024) pairBuffer += "? "; + pairBuffer += state5.dump + (state5.condenseFlow ? '"' : "") + ":" + (state5.condenseFlow ? "" : " "); + if (!writeNode(state5, level, objectValue, false, false)) { continue; } - pairBuffer += state4.dump; + pairBuffer += state5.dump; _result += pairBuffer; } - state4.tag = _tag2; - state4.dump = "{" + _result + "}"; + state5.tag = _tag2; + state5.dump = "{" + _result + "}"; } __name(writeFlowMapping, "writeFlowMapping"); - function writeBlockMapping(state4, level, object3, compact2) { - var _result = "", _tag2 = state4.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, explicitPair, pairBuffer; - if (state4.sortKeys === true) { + function writeBlockMapping(state5, level, object3, compact2) { + var _result = "", _tag2 = state5.tag, objectKeyList = Object.keys(object3), index, length2, objectKey, objectValue, explicitPair, pairBuffer; + if (state5.sortKeys === true) { objectKeyList.sort(); - } else if (typeof state4.sortKeys === "function") { - objectKeyList.sort(state4.sortKeys); - } else if (state4.sortKeys) { + } else if (typeof state5.sortKeys === "function") { + objectKeyList.sort(state5.sortKeys); + } else if (state5.sortKeys) { throw new exception("sortKeys must be a boolean or a function"); } for (index = 0, length2 = objectKeyList.length; index < length2; index += 1) { pairBuffer = ""; if (!compact2 || _result !== "") { - pairBuffer += generateNextLine(state4, level); + pairBuffer += generateNextLine(state5, level); } objectKey = objectKeyList[index]; objectValue = object3[objectKey]; - if (state4.replacer) { - objectValue = state4.replacer.call(object3, objectKey, objectValue); + if (state5.replacer) { + objectValue = state5.replacer.call(object3, objectKey, objectValue); } - if (!writeNode(state4, level + 1, objectKey, true, true, true)) { + if (!writeNode(state5, level + 1, objectKey, true, true, true)) { continue; } - explicitPair = state4.tag !== null && state4.tag !== "?" || state4.dump && state4.dump.length > 1024; + explicitPair = state5.tag !== null && state5.tag !== "?" || state5.dump && state5.dump.length > 1024; if (explicitPair) { - if (state4.dump && CHAR_LINE_FEED === state4.dump.charCodeAt(0)) { + if (state5.dump && CHAR_LINE_FEED === state5.dump.charCodeAt(0)) { pairBuffer += "?"; } else { pairBuffer += "? "; } } - pairBuffer += state4.dump; + pairBuffer += state5.dump; if (explicitPair) { - pairBuffer += generateNextLine(state4, level); + pairBuffer += generateNextLine(state5, level); } - if (!writeNode(state4, level + 1, objectValue, true, explicitPair)) { + if (!writeNode(state5, level + 1, objectValue, true, explicitPair)) { continue; } - if (state4.dump && CHAR_LINE_FEED === state4.dump.charCodeAt(0)) { + if (state5.dump && CHAR_LINE_FEED === state5.dump.charCodeAt(0)) { pairBuffer += ":"; } else { pairBuffer += ": "; } - pairBuffer += state4.dump; + pairBuffer += state5.dump; _result += pairBuffer; } - state4.tag = _tag2; - state4.dump = _result || "{}"; + state5.tag = _tag2; + state5.dump = _result || "{}"; } __name(writeBlockMapping, "writeBlockMapping"); - function detectType2(state4, object3, explicit) { + function detectType2(state5, object3, explicit) { var _result, typeList, index, length2, type3, style3; - typeList = explicit ? state4.explicitTypes : state4.implicitTypes; + typeList = explicit ? state5.explicitTypes : state5.implicitTypes; for (index = 0, length2 = typeList.length; index < length2; index += 1) { type3 = typeList[index]; if ((type3.instanceOf || type3.predicate) && (!type3.instanceOf || typeof object3 === "object" && object3 instanceof type3.instanceOf) && (!type3.predicate || type3.predicate(object3))) { if (explicit) { if (type3.multi && type3.representName) { - state4.tag = type3.representName(object3); + state5.tag = type3.representName(object3); } else { - state4.tag = type3.tag; + state5.tag = type3.tag; } } else { - state4.tag = "?"; + state5.tag = "?"; } if (type3.represent) { - style3 = state4.styleMap[type3.tag] || type3.defaultStyle; + style3 = state5.styleMap[type3.tag] || type3.defaultStyle; if (_toString.call(type3.represent) === "[object Function]") { _result = type3.represent(object3, style3); } else if (_hasOwnProperty.call(type3.represent, style3)) { @@ -132688,7 +142815,7 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } else { throw new exception("!<" + type3.tag + '> tag resolver accepts not "' + style3 + '" style'); } - state4.dump = _result; + state5.dump = _result; } return true; } @@ -132696,94 +142823,94 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; return false; } __name(detectType2, "detectType"); - function writeNode(state4, level, object3, block3, compact2, iskey, isblockseq) { - state4.tag = null; - state4.dump = object3; - if (!detectType2(state4, object3, false)) { - detectType2(state4, object3, true); + function writeNode(state5, level, object3, block3, compact2, iskey, isblockseq) { + state5.tag = null; + state5.dump = object3; + if (!detectType2(state5, object3, false)) { + detectType2(state5, object3, true); } - var type3 = _toString.call(state4.dump); + var type3 = _toString.call(state5.dump); var inblock = block3; var tagStr; if (block3) { - block3 = state4.flowLevel < 0 || state4.flowLevel > level; + block3 = state5.flowLevel < 0 || state5.flowLevel > level; } var objectOrArray = type3 === "[object Object]" || type3 === "[object Array]", duplicateIndex, duplicate; if (objectOrArray) { - duplicateIndex = state4.duplicates.indexOf(object3); + duplicateIndex = state5.duplicates.indexOf(object3); duplicate = duplicateIndex !== -1; } - if (state4.tag !== null && state4.tag !== "?" || duplicate || state4.indent !== 2 && level > 0) { + if (state5.tag !== null && state5.tag !== "?" || duplicate || state5.indent !== 2 && level > 0) { compact2 = false; } - if (duplicate && state4.usedDuplicates[duplicateIndex]) { - state4.dump = "*ref_" + duplicateIndex; + if (duplicate && state5.usedDuplicates[duplicateIndex]) { + state5.dump = "*ref_" + duplicateIndex; } else { - if (objectOrArray && duplicate && !state4.usedDuplicates[duplicateIndex]) { - state4.usedDuplicates[duplicateIndex] = true; + if (objectOrArray && duplicate && !state5.usedDuplicates[duplicateIndex]) { + state5.usedDuplicates[duplicateIndex] = true; } if (type3 === "[object Object]") { - if (block3 && Object.keys(state4.dump).length !== 0) { - writeBlockMapping(state4, level, state4.dump, compact2); + if (block3 && Object.keys(state5.dump).length !== 0) { + writeBlockMapping(state5, level, state5.dump, compact2); if (duplicate) { - state4.dump = "&ref_" + duplicateIndex + state4.dump; + state5.dump = "&ref_" + duplicateIndex + state5.dump; } } else { - writeFlowMapping(state4, level, state4.dump); + writeFlowMapping(state5, level, state5.dump); if (duplicate) { - state4.dump = "&ref_" + duplicateIndex + " " + state4.dump; + state5.dump = "&ref_" + duplicateIndex + " " + state5.dump; } } } else if (type3 === "[object Array]") { - if (block3 && state4.dump.length !== 0) { - if (state4.noArrayIndent && !isblockseq && level > 0) { - writeBlockSequence(state4, level - 1, state4.dump, compact2); + if (block3 && state5.dump.length !== 0) { + if (state5.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state5, level - 1, state5.dump, compact2); } else { - writeBlockSequence(state4, level, state4.dump, compact2); + writeBlockSequence(state5, level, state5.dump, compact2); } if (duplicate) { - state4.dump = "&ref_" + duplicateIndex + state4.dump; + state5.dump = "&ref_" + duplicateIndex + state5.dump; } } else { - writeFlowSequence(state4, level, state4.dump); + writeFlowSequence(state5, level, state5.dump); if (duplicate) { - state4.dump = "&ref_" + duplicateIndex + " " + state4.dump; + state5.dump = "&ref_" + duplicateIndex + " " + state5.dump; } } } else if (type3 === "[object String]") { - if (state4.tag !== "?") { - writeScalar(state4, state4.dump, level, iskey, inblock); + if (state5.tag !== "?") { + writeScalar(state5, state5.dump, level, iskey, inblock); } } else if (type3 === "[object Undefined]") { return false; } else { - if (state4.skipInvalid) return false; + if (state5.skipInvalid) return false; throw new exception("unacceptable kind of an object to dump " + type3); } - if (state4.tag !== null && state4.tag !== "?") { + if (state5.tag !== null && state5.tag !== "?") { tagStr = encodeURI( - state4.tag[0] === "!" ? state4.tag.slice(1) : state4.tag + state5.tag[0] === "!" ? state5.tag.slice(1) : state5.tag ).replace(/!/g, "%21"); - if (state4.tag[0] === "!") { + if (state5.tag[0] === "!") { tagStr = "!" + tagStr; } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") { tagStr = "!!" + tagStr.slice(18); } else { tagStr = "!<" + tagStr + ">"; } - state4.dump = tagStr + " " + state4.dump; + state5.dump = tagStr + " " + state5.dump; } } return true; } __name(writeNode, "writeNode"); - function getDuplicateReferences(object3, state4) { + function getDuplicateReferences(object3, state5) { var objects = [], duplicatesIndexes = [], index, length2; inspectNode(object3, objects, duplicatesIndexes); for (index = 0, length2 = duplicatesIndexes.length; index < length2; index += 1) { - state4.duplicates.push(objects[duplicatesIndexes[index]]); + state5.duplicates.push(objects[duplicatesIndexes[index]]); } - state4.usedDuplicates = new Array(length2); + state5.usedDuplicates = new Array(length2); } __name(getDuplicateReferences, "getDuplicateReferences"); function inspectNode(object3, objects, duplicatesIndexes) { @@ -132812,13 +142939,13 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; __name(inspectNode, "inspectNode"); function dump$1(input, options3) { options3 = options3 || {}; - var state4 = new State(options3); - if (!state4.noRefs) getDuplicateReferences(input, state4); + var state5 = new State(options3); + if (!state5.noRefs) getDuplicateReferences(input, state5); var value2 = input; - if (state4.replacer) { - value2 = state4.replacer.call({ "": value2 }, "", value2); + if (state5.replacer) { + value2 = state5.replacer.call({ "": value2 }, "", value2); } - if (writeNode(state4, 0, value2, true, true)) return state4.dump + "\n"; + if (writeNode(state5, 0, value2, true, true)) return state5.dump + "\n"; return ""; } __name(dump$1, "dump$1"); @@ -132833,8 +142960,8 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; } __name(renamed, "renamed"); var JSON_SCHEMA = json2; - var load = loader24.load; - var loadAll = loader24.loadAll; + var load = loader25.load; + var loadAll = loader25.loadAll; var dump = dumper.dump; var safeLoad = renamed("safeLoad", "load"); var safeLoadAll = renamed("safeLoadAll", "loadAll"); @@ -132919,6 +143046,8 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; __name(preprocessDiagram, "preprocessDiagram"); // src/mermaidAPI.ts + init_styles(); + init_themes(); init_utils2(); // src/utils/base64.ts @@ -132930,7 +143059,6 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; __name(toBase64, "toBase64"); // src/mermaidAPI.ts - init_assignWithDepth(); var MAX_TEXTLENGTH = 5e4; var MAX_TEXTLENGTH_EXCEEDED_MSG = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa"; var SECURITY_LVL_SANDBOX = "sandbox"; @@ -132957,8 +143085,8 @@ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`; addDiagrams(); try { const { code } = processAndSetConfigs(text2); - const diagram23 = await getDiagramFromText(code); - return { diagramType: diagram23.type }; + const diagram24 = await getDiagramFromText(code); + return { diagramType: diagram24.type }; } catch (error3) { if (parseOptions?.suppressErrors) { return false; @@ -133031,13 +143159,13 @@ ${config6.themeCSS}`; ${IFRAME_NOT_SUPPORTED_MSG} `; }, "putIntoIFrame"); - var appendDivSvgG = /* @__PURE__ */ __name((parentRoot, id26, enclosingDivId, divStyle, svgXlink) => { + var appendDivSvgG = /* @__PURE__ */ __name((parentRoot, id27, enclosingDivId, divStyle, svgXlink) => { const enclosingDiv = parentRoot.append("div"); enclosingDiv.attr("id", enclosingDivId); if (divStyle) { enclosingDiv.attr("style", divStyle); } - const svgNode2 = enclosingDiv.append("svg").attr("id", id26).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD); + const svgNode2 = enclosingDiv.append("svg").attr("id", id27).attr("width", "100%").attr("xmlns", XMLNS_SVG_STD); if (svgXlink) { svgNode2.attr("xmlns:xlink", svgXlink); } @@ -133048,12 +143176,12 @@ ${config6.themeCSS}`; return parentNode.append("iframe").attr("id", iFrameId).attr("style", "width: 100%; height: 100%;").attr("sandbox", ""); } __name(sandboxedIframe, "sandboxedIframe"); - var removeExistingElements = /* @__PURE__ */ __name((doc, id26, divId, iFrameId) => { - doc.getElementById(id26)?.remove(); + var removeExistingElements = /* @__PURE__ */ __name((doc, id27, divId, iFrameId) => { + doc.getElementById(id27)?.remove(); doc.getElementById(divId)?.remove(); doc.getElementById(iFrameId)?.remove(); }, "removeExistingElements"); - var render6 = /* @__PURE__ */ __name(async function(id26, text2, svgContainingElement) { + var render6 = /* @__PURE__ */ __name(async function(id27, text2, svgContainingElement) { addDiagrams(); const processed2 = processAndSetConfigs(text2); text2 = processed2.code; @@ -133062,10 +143190,10 @@ ${config6.themeCSS}`; if (text2.length > (config6?.maxTextSize ?? MAX_TEXTLENGTH)) { text2 = MAX_TEXTLENGTH_EXCEEDED_MSG; } - const idSelector = "#" + id26; - const iFrameID = "i" + id26; + const idSelector = "#" + id27; + const iFrameID = "i" + id27; const iFrameID_selector = "#" + iFrameID; - const enclosingDivID = "d" + id26; + const enclosingDivID = "d" + id27; const enclosingDivID_selector = "#" + enclosingDivID; const removeTempElements = /* @__PURE__ */ __name(() => { const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector; @@ -133089,9 +143217,9 @@ ${config6.themeCSS}`; } else { root4 = select_default2(svgContainingElement); } - appendDivSvgG(root4, id26, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD); + appendDivSvgG(root4, id27, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD); } else { - removeExistingElements(document, id26, enclosingDivID, iFrameID); + removeExistingElements(document, id27, enclosingDivID, iFrameID); if (isSandboxed) { const iframe = sandboxedIframe(select_default2("body"), iFrameID); root4 = select_default2(iframe.nodes()[0].contentDocument.body); @@ -133099,7 +143227,7 @@ ${config6.themeCSS}`; } else { root4 = select_default2("body"); } - appendDivSvgG(root4, id26, enclosingDivID); + appendDivSvgG(root4, id27, enclosingDivID); } let diag; let parseEncounteredException; @@ -133123,12 +143251,12 @@ ${config6.themeCSS}`; style1.innerHTML = rules; svg.insertBefore(style1, firstChild); try { - await diag.renderer.draw(text2, id26, version2, diag); + await diag.renderer.draw(text2, id27, version2, diag); } catch (e3) { if (config6.suppressErrorRendering) { removeTempElements(); } else { - errorRenderer_default.draw(text2, id26, version2); + errorRenderer_default.draw(text2, id27, version2); } throw e3; } @@ -133136,7 +143264,7 @@ ${config6.themeCSS}`; const a11yTitle = diag.db.getAccTitle?.(); const a11yDescr = diag.db.getAccDescription?.(); addA11yInfo(diagramType, svgNode2, a11yTitle, a11yDescr); - root4.select(`[id="${id26}"]`).selectAll("foreignobject > *").attr("xmlns", XMLNS_XHTML_STD); + root4.select(`[id="${id27}"]`).selectAll("foreignobject > *").attr("xmlns", XMLNS_XHTML_STD); let svgCode = root4.select(enclosingDivID_selector).node().innerHTML; log.debug("config.arrowMarkerAbsolute", config6.arrowMarkerAbsolute); svgCode = cleanUpSvgCode(svgCode, isSandboxed, evaluate(config6.arrowMarkerAbsolute)); @@ -133279,7 +143407,7 @@ ${config6.themeCSS}`; continue; } element3.setAttribute("data-processed", "true"); - const id26 = `mermaid-${idGenerator.next()}`; + const id27 = `mermaid-${idGenerator.next()}`; txt = element3.innerHTML; txt = dedent(utils_default2.entityDecode(txt)).trim().replace(//gi, "
"); const init3 = utils_default2.detectInit(txt); @@ -133287,10 +143415,10 @@ ${config6.themeCSS}`; log.debug("Detected early reinit: ", init3); } try { - const { svg, bindFunctions: bindFunctions4 } = await render7(id26, txt, element3); + const { svg, bindFunctions: bindFunctions4 } = await render7(id27, txt, element3); element3.innerHTML = svg; if (postRenderCallback) { - await postRenderCallback(id26); + await postRenderCallback(id27); } if (bindFunctions4) { bindFunctions4(element3); @@ -133385,10 +143513,10 @@ ${config6.themeCSS}`; executeQueue().catch(reject3); }); }, "parse"); - var render7 = /* @__PURE__ */ __name((id26, text2, container2) => { + var render7 = /* @__PURE__ */ __name((id27, text2, container2) => { return new Promise((resolve3, reject3) => { const performCall = /* @__PURE__ */ __name(() => new Promise((res, rej) => { - mermaidAPI.render(id26, text2, container2).then( + mermaidAPI.render(id27, text2, container2).then( (r2) => { res(r2); resolve3(r2); @@ -133418,7 +143546,8 @@ ${config6.themeCSS}`; parseError: void 0, contentLoaded, setParseErrorHandler, - detectType + detectType, + registerIconPacks }; var mermaid_default = mermaid; return __toCommonJS(mermaid_exports); diff --git a/package-lock.json b/package-lock.json index 38ea833..5750ef0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gethinode/mod-mermaid", - "version": "1.1.16", + "version": "1.1.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gethinode/mod-mermaid", - "version": "1.1.16", + "version": "1.1.17", "hasInstallScript": true, "license": "MIT", "devDependencies": { diff --git a/package.json b/package.json index 97d45ce..e539aef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gethinode/mod-mermaid", - "version": "1.1.16", + "version": "1.1.17", "description": "A Hugo module to add diagrams and charts powered by Mermaid to your Hinode site (work in progress)", "keywords": [ "hugo",