mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
893 lines (885 loc) • 5.46 MB
JavaScript
"use strict";
var __esbuild_esm_mermaid = (() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value2) => __defProp(target, "name", { value: value2, configurable: true });
var __esm = (fn3, res) => function __init() {
return fn3 && (res = (0, fn3[__getOwnPropNames(fn3)[0]])(fn3 = 0)), res;
};
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from2, except, desc) => {
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
for (let key of __getOwnPropNames(from2))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
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
var require_dayjs_min = __commonJS({
"../../node_modules/.pnpm/dayjs@1.11.12/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();
}(exports2, function() {
"use strict";
var t4 = 1e3, e3 = 6e4, n2 = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c3 = "month", f3 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $3 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y5 = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: /* @__PURE__ */ __name(function(t5) {
var e4 = ["th", "st", "nd", "rd"], n3 = t5 % 100;
return "[" + t5 + (e4[(n3 - 20) % 10] || e4[n3] || e4[0]) + "]";
}, "ordinal") }, m2 = /* @__PURE__ */ __name(function(t5, e4, n3) {
var r3 = String(t5);
return !r3 || r3.length >= e4 ? t5 : "" + Array(e4 + 1 - r3.length).join(n3) + t5;
}, "m"), v3 = { s: m2, z: /* @__PURE__ */ __name(function(t5) {
var e4 = -t5.utcOffset(), n3 = Math.abs(e4), r3 = Math.floor(n3 / 60), i3 = n3 % 60;
return (e4 <= 0 ? "+" : "-") + m2(r3, 2, "0") + ":" + m2(i3, 2, "0");
}, "z"), m: /* @__PURE__ */ __name(function t5(e4, n3) {
if (e4.date() < n3.date()) return -t5(n3, e4);
var r3 = 12 * (n3.year() - e4.year()) + (n3.month() - e4.month()), i3 = e4.clone().add(r3, c3), s3 = n3 - i3 < 0, u3 = e4.clone().add(r3 + (s3 ? -1 : 1), c3);
return +(-(r3 + (n3 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
}, "t"), a: /* @__PURE__ */ __name(function(t5) {
return t5 < 0 ? Math.ceil(t5) || 0 : Math.floor(t5);
}, "a"), p: /* @__PURE__ */ __name(function(t5) {
return { M: c3, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r2, Q: f3 }[t5] || String(t5 || "").toLowerCase().replace(/s$/, "");
}, "p"), u: /* @__PURE__ */ __name(function(t5) {
return void 0 === t5;
}, "u") }, g2 = "en", D3 = {};
D3[g2] = M2;
var p3 = "$isDayjsObject", S3 = /* @__PURE__ */ __name(function(t5) {
return t5 instanceof _2 || !(!t5 || !t5[p3]);
}, "S"), w3 = /* @__PURE__ */ __name(function t5(e4, n3, r3) {
var i3;
if (!e4) return g2;
if ("string" == typeof e4) {
var s3 = e4.toLowerCase();
D3[s3] && (i3 = s3), n3 && (D3[s3] = n3, i3 = s3);
var u3 = e4.split("-");
if (!i3 && u3.length > 1) return t5(u3[0]);
} else {
var a3 = e4.name;
D3[a3] = e4, i3 = a3;
}
return !r3 && i3 && (g2 = i3), i3 || !r3 && g2;
}, "t"), O2 = /* @__PURE__ */ __name(function(t5, e4) {
if (S3(t5)) return t5.clone();
var n3 = "object" == typeof e4 ? e4 : {};
return n3.date = t5, n3.args = arguments, new _2(n3);
}, "O"), b2 = v3;
b2.l = w3, b2.i = S3, b2.w = function(t5, e4) {
return O2(t5, { locale: e4.$L, utc: e4.$u, x: e4.$x, $offset: e4.$offset });
};
var _2 = function() {
function M3(t5) {
this.$L = w3(t5.locale, null, true), this.parse(t5), this.$x = this.$x || t5.x || {}, this[p3] = true;
}
__name(M3, "M");
var m3 = M3.prototype;
return m3.parse = function(t5) {
this.$d = function(t6) {
var e4 = t6.date, n3 = t6.utc;
if (null === e4) return /* @__PURE__ */ new Date(NaN);
if (b2.u(e4)) return /* @__PURE__ */ new Date();
if (e4 instanceof Date) return new Date(e4);
if ("string" == typeof e4 && !/Z$/i.test(e4)) {
var r3 = e4.match($3);
if (r3) {
var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
return n3 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3);
}
}
return new Date(e4);
}(t5), this.init();
}, m3.init = function() {
var t5 = this.$d;
this.$y = t5.getFullYear(), this.$M = t5.getMonth(), this.$D = t5.getDate(), this.$W = t5.getDay(), this.$H = t5.getHours(), this.$m = t5.getMinutes(), this.$s = t5.getSeconds(), this.$ms = t5.getMilliseconds();
}, m3.$utils = function() {
return b2;
}, m3.isValid = function() {
return !(this.$d.toString() === l2);
}, m3.isSame = function(t5, e4) {
var n3 = O2(t5);
return this.startOf(e4) <= n3 && n3 <= this.endOf(e4);
}, m3.isAfter = function(t5, e4) {
return O2(t5) < this.startOf(e4);
}, m3.isBefore = function(t5, e4) {
return this.endOf(e4) < O2(t5);
}, m3.$g = function(t5, e4, n3) {
return b2.u(t5) ? this[e4] : this.set(n3, t5);
}, m3.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, m3.valueOf = function() {
return this.$d.getTime();
}, m3.startOf = function(t5, e4) {
var n3 = this, r3 = !!b2.u(e4) || e4, f4 = b2.p(t5), l3 = /* @__PURE__ */ __name(function(t6, e6) {
var i3 = b2.w(n3.$u ? Date.UTC(n3.$y, e6, t6) : new Date(n3.$y, e6, t6), n3);
return r3 ? i3 : i3.endOf(a2);
}, "l"), $4 = /* @__PURE__ */ __name(function(t6, e6) {
return b2.w(n3.toDate()[t6].apply(n3.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e6)), n3);
}, "$"), y6 = this.$W, M4 = this.$M, m4 = this.$D, v4 = "set" + (this.$u ? "UTC" : "");
switch (f4) {
case h2:
return r3 ? l3(1, 0) : l3(31, 11);
case c3:
return r3 ? l3(1, M4) : l3(0, M4 + 1);
case o2:
var g3 = this.$locale().weekStart || 0, D4 = (y6 < g3 ? y6 + 7 : y6) - g3;
return l3(r3 ? m4 - D4 : m4 + (6 - D4), M4);
case a2:
case d2:
return $4(v4 + "Hours", 0);
case u2:
return $4(v4 + "Minutes", 1);
case s2:
return $4(v4 + "Seconds", 2);
case i2:
return $4(v4 + "Milliseconds", 3);
default:
return this.clone();
}
}, m3.endOf = function(t5) {
return this.startOf(t5, false);
}, m3.$set = function(t5, e4) {
var n3, o3 = b2.p(t5), f4 = "set" + (this.$u ? "UTC" : ""), l3 = (n3 = {}, n3[a2] = f4 + "Date", n3[d2] = f4 + "Date", n3[c3] = f4 + "Month", n3[h2] = f4 + "FullYear", n3[u2] = f4 + "Hours", n3[s2] = f4 + "Minutes", n3[i2] = f4 + "Seconds", n3[r2] = f4 + "Milliseconds", n3)[o3], $4 = o3 === a2 ? this.$D + (e4 - this.$W) : e4;
if (o3 === c3 || o3 === h2) {
var y6 = this.clone().set(d2, 1);
y6.$d[l3]($4), y6.init(), this.$d = y6.set(d2, Math.min(this.$D, y6.daysInMonth())).$d;
} else l3 && this.$d[l3]($4);
return this.init(), this;
}, m3.set = function(t5, e4) {
return this.clone().$set(t5, e4);
}, m3.get = function(t5) {
return this[b2.p(t5)]();
}, m3.add = function(r3, f4) {
var d3, l3 = this;
r3 = Number(r3);
var $4 = b2.p(f4), y6 = /* @__PURE__ */ __name(function(t5) {
var e4 = O2(l3);
return b2.w(e4.date(e4.date() + Math.round(t5 * r3)), l3);
}, "y");
if ($4 === c3) return this.set(c3, this.$M + r3);
if ($4 === h2) return this.set(h2, this.$y + r3);
if ($4 === a2) return y6(1);
if ($4 === o2) return y6(7);
var M4 = (d3 = {}, d3[s2] = e3, d3[u2] = n2, d3[i2] = t4, d3)[$4] || 1, m4 = this.$d.getTime() + r3 * M4;
return b2.w(m4, this);
}, m3.subtract = function(t5, e4) {
return this.add(-1 * t5, e4);
}, m3.format = function(t5) {
var e4 = this, n3 = this.$locale();
if (!this.isValid()) return n3.invalidDate || l2;
var r3 = t5 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n3.weekdays, c4 = n3.months, f4 = n3.meridiem, h3 = /* @__PURE__ */ __name(function(t6, n4, i4, s4) {
return t6 && (t6[n4] || t6(e4, r3)) || i4[n4].slice(0, s4);
}, "h"), d3 = /* @__PURE__ */ __name(function(t6) {
return b2.s(s3 % 12 || 12, t6, "0");
}, "d"), $4 = f4 || function(t6, e6, n4) {
var r4 = t6 < 12 ? "AM" : "PM";
return n4 ? r4.toLowerCase() : r4;
};
return r3.replace(y5, function(t6, r4) {
return r4 || function(t7) {
switch (t7) {
case "YY":
return String(e4.$y).slice(-2);
case "YYYY":
return b2.s(e4.$y, 4, "0");
case "M":
return a3 + 1;
case "MM":
return b2.s(a3 + 1, 2, "0");
case "MMM":
return h3(n3.monthsShort, a3, c4, 3);
case "MMMM":
return h3(c4, a3);
case "D":
return e4.$D;
case "DD":
return b2.s(e4.$D, 2, "0");
case "d":
return String(e4.$W);
case "dd":
return h3(n3.weekdaysMin, e4.$W, o3, 2);
case "ddd":
return h3(n3.weekdaysShort, e4.$W, o3, 3);
case "dddd":
return o3[e4.$W];
case "H":
return String(s3);
case "HH":
return b2.s(s3, 2, "0");
case "h":
return d3(1);
case "hh":
return d3(2);
case "a":
return $4(s3, u3, true);
case "A":
return $4(s3, u3, false);
case "m":
return String(u3);
case "mm":
return b2.s(u3, 2, "0");
case "s":
return String(e4.$s);
case "ss":
return b2.s(e4.$s, 2, "0");
case "SSS":
return b2.s(e4.$ms, 3, "0");
case "Z":
return i3;
}
return null;
}(t6) || i3.replace(":", "");
});
}, m3.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, m3.diff = function(r3, d3, l3) {
var $4, y6 = this, M4 = b2.p(d3), m4 = O2(r3), v4 = (m4.utcOffset() - this.utcOffset()) * e3, g3 = this - m4, D4 = /* @__PURE__ */ __name(function() {
return b2.m(y6, m4);
}, "D");
switch (M4) {
case h2:
$4 = D4() / 12;
break;
case c3:
$4 = D4();
break;
case f3:
$4 = D4() / 3;
break;
case o2:
$4 = (g3 - v4) / 6048e5;
break;
case a2:
$4 = (g3 - v4) / 864e5;
break;
case u2:
$4 = g3 / n2;
break;
case s2:
$4 = g3 / e3;
break;
case i2:
$4 = g3 / t4;
break;
default:
$4 = g3;
}
return l3 ? $4 : b2.a($4);
}, m3.daysInMonth = function() {
return this.endOf(c3).$D;
}, m3.$locale = function() {
return D3[this.$L];
}, m3.locale = function(t5, e4) {
if (!t5) return this.$L;
var n3 = this.clone(), r3 = w3(t5, e4, true);
return r3 && (n3.$L = r3), n3;
}, m3.clone = function() {
return b2.w(this.$d, this);
}, m3.toDate = function() {
return new Date(this.valueOf());
}, m3.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, m3.toISOString = function() {
return this.$d.toISOString();
}, m3.toString = function() {
return this.$d.toUTCString();
}, M3;
}(), k2 = _2.prototype;
return O2.prototype = k2, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c3], ["$y", h2], ["$D", d2]].forEach(function(t5) {
k2[t5[1]] = function(e4) {
return this.$g(e4, t5[0], t5[1]);
};
}), O2.extend = function(t5, e4) {
return t5.$i || (t5(e4, _2, O2), t5.$i = true), O2;
}, O2.locale = w3, O2.isDayjs = S3, O2.unix = function(t5) {
return O2(1e3 * t5);
}, O2.en = D3[g2], O2.Ls = D3, O2.p = {}, O2;
});
}
});
// src/logger.ts
var import_dayjs, LEVELS, log, setLogLevel, format;
var init_logger = __esm({
"src/logger.ts"() {
"use strict";
import_dayjs = __toESM(require_dayjs_min(), 1);
LEVELS = {
trace: 0,
debug: 1,
info: 2,
warn: 3,
error: 4,
fatal: 5
};
log = {
trace: /* @__PURE__ */ __name((..._args) => {
}, "trace"),
debug: /* @__PURE__ */ __name((..._args) => {
}, "debug"),
info: /* @__PURE__ */ __name((..._args) => {
}, "info"),
warn: /* @__PURE__ */ __name((..._args) => {
}, "warn"),
error: /* @__PURE__ */ __name((..._args) => {
}, "error"),
fatal: /* @__PURE__ */ __name((..._args) => {
}, "fatal")
};
setLogLevel = /* @__PURE__ */ __name(function(level = "fatal") {
let numericLevel = LEVELS.fatal;
if (typeof level === "string") {
if (level.toLowerCase() in LEVELS) {
numericLevel = LEVELS[level];
}
} else if (typeof level === "number") {
numericLevel = level;
}
log.trace = () => {
};
log.debug = () => {
};
log.info = () => {
};
log.warn = () => {
};
log.error = () => {
};
log.fatal = () => {
};
if (numericLevel <= LEVELS.fatal) {
log.fatal = console.error ? console.error.bind(console, format("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", format("FATAL"));
}
if (numericLevel <= LEVELS.error) {
log.error = console.error ? console.error.bind(console, format("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", format("ERROR"));
}
if (numericLevel <= LEVELS.warn) {
log.warn = console.warn ? console.warn.bind(console, format("WARN"), "color: orange") : console.log.bind(console, `\x1B[33m`, format("WARN"));
}
if (numericLevel <= LEVELS.info) {
log.info = console.info ? console.info.bind(console, format("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", format("INFO"));
}
if (numericLevel <= LEVELS.debug) {
log.debug = console.debug ? console.debug.bind(console, format("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("DEBUG"));
}
if (numericLevel <= LEVELS.trace) {
log.trace = console.debug ? console.debug.bind(console, format("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", format("TRACE"));
}
}, "setLogLevel");
format = /* @__PURE__ */ __name((level) => {
const time4 = (0, import_dayjs.default)().format("ss.SSS");
return `%c${time4} : ${level} : `;
}, "format");
}
});
// src/diagram-api/regexes.ts
var frontMatterRegex, directiveRegex, anyCommentRegex;
var init_regexes = __esm({
"src/diagram-api/regexes.ts"() {
"use strict";
frontMatterRegex = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s;
directiveRegex = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
anyCommentRegex = /\s*%%.*\n/gm;
}
});
// src/errors.ts
var UnknownDiagramError;
var init_errors = __esm({
"src/errors.ts"() {
"use strict";
UnknownDiagramError = class extends Error {
static {
__name(this, "UnknownDiagramError");
}
constructor(message) {
super(message);
this.name = "UnknownDiagramError";
}
};
}
});
// src/diagram-api/detectType.ts
var detectors, detectType, registerLazyLoadedDiagrams, addDetector, getDiagramLoader;
var init_detectType = __esm({
"src/diagram-api/detectType.ts"() {
"use strict";
init_logger();
init_regexes();
init_errors();
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) {
return key;
}
}
throw new UnknownDiagramError(
`No diagram type detected matching given configuration for text: ${text2}`
);
}, "detectType");
registerLazyLoadedDiagrams = /* @__PURE__ */ __name((...diagrams2) => {
for (const { id: id26, detector: detector24, loader: loader25 } of diagrams2) {
addDetector(id26, detector24, loader25);
}
}, "registerLazyLoadedDiagrams");
addDetector = /* @__PURE__ */ __name((key, detector24, loader25) => {
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" : ""}`);
}, "addDetector");
getDiagramLoader = /* @__PURE__ */ __name((key) => {
return detectors[key].loader;
}, "getDiagramLoader");
}
});
// src/diagrams/c4/parser/c4Diagram.jison
var parser, c4Diagram_default;
var init_c4Diagram = __esm({
"src/diagrams/c4/parser/c4Diagram.jison"() {
"use strict";
parser = function() {
var o2 = /* @__PURE__ */ __name(function(k2, v3, o3, l2) {
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 = {
trace: /* @__PURE__ */ __name(function trace() {
}, "trace"),
yy: {},
symbols_: { "error": 2, "start": 3, "mermaidDoc": 4, "direction": 5, "direction_tb": 6, "direction_bt": 7, "direction_rl": 8, "direction_lr": 9, "graphConfig": 10, "C4_CONTEXT": 11, "NEWLINE": 12, "statements": 13, "EOF": 14, "C4_CONTAINER": 15, "C4_COMPONENT": 16, "C4_DYNAMIC": 17, "C4_DEPLOYMENT": 18, "otherStatements": 19, "diagramStatements": 20, "otherStatement": 21, "title": 22, "accDescription": 23, "acc_title": 24, "acc_title_value": 25, "acc_descr": 26, "acc_descr_value": 27, "acc_descr_multiline_value": 28, "boundaryStatement": 29, "boundaryStartStatement": 30, "boundaryStopStatement": 31, "boundaryStart": 32, "LBRACE": 33, "ENTERPRISE_BOUNDARY": 34, "attributes": 35, "SYSTEM_BOUNDARY": 36, "BOUNDARY": 37, "CONTAINER_BOUNDARY": 38, "NODE": 39, "NODE_L": 40, "NODE_R": 41, "RBRACE": 42, "diagramStatement": 43, "PERSON": 44, "PERSON_EXT": 45, "SYSTEM": 46, "SYSTEM_DB": 47, "SYSTEM_QUEUE": 48, "SYSTEM_EXT": 49, "SYSTEM_EXT_DB": 50, "SYSTEM_EXT_QUEUE": 51, "CONTAINER": 52, "CONTAINER_DB": 53, "CONTAINER_QUEUE": 54, "CONTAINER_EXT": 55, "CONTAINER_EXT_DB": 56, "CONTAINER_EXT_QUEUE": 57, "COMPONENT": 58, "COMPONENT_DB": 59, "COMPONENT_QUEUE": 60, "COMPONENT_EXT": 61, "COMPONENT_EXT_DB": 62, "COMPONENT_EXT_QUEUE": 63, "REL": 64, "BIREL": 65, "REL_U": 66, "REL_D": 67, "REL_L": 68, "REL_R": 69, "REL_B": 70, "REL_INDEX": 71, "UPDATE_EL_STYLE": 72, "UPDATE_REL_STYLE": 73, "UPDATE_LAYOUT_CONFIG": 74, "attribute": 75, "STR": 76, "STR_KEY": 77, "STR_VALUE": 78, "ATTRIBUTE": 79, "ATTRIBUTE_EMPTY": 80, "$accept": 0, "$end": 1 },
terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" },
productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]],
performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
var $0 = $$.length - 1;
switch (yystate) {
case 3:
yy.setDirection("TB");
break;
case 4:
yy.setDirection("BT");
break;
case 5:
yy.setDirection("RL");
break;
case 6:
yy.setDirection("LR");
break;
case 8:
case 9:
case 10:
case 11:
case 12:
yy.setC4Type($$[$0 - 3]);
break;
case 19:
yy.setTitle($$[$0].substring(6));
this.$ = $$[$0].substring(6);
break;
case 20:
yy.setAccDescription($$[$0].substring(15));
this.$ = $$[$0].substring(15);
break;
case 21:
this.$ = $$[$0].trim();
yy.setTitle(this.$);
break;
case 22:
case 23:
this.$ = $$[$0].trim();
yy.setAccDescription(this.$);
break;
case 28:
$$[$0].splice(2, 0, "ENTERPRISE");
yy.addPersonOrSystemBoundary(...$$[$0]);
this.$ = $$[$0];
break;
case 29:
$$[$0].splice(2, 0, "SYSTEM");
yy.addPersonOrSystemBoundary(...$$[$0]);
this.$ = $$[$0];
break;
case 30:
yy.addPersonOrSystemBoundary(...$$[$0]);
this.$ = $$[$0];
break;
case 31:
$$[$0].splice(2, 0, "CONTAINER");
yy.addContainerBoundary(...$$[$0]);
this.$ = $$[$0];
break;
case 32:
yy.addDeploymentNode("node", ...$$[$0]);
this.$ = $$[$0];
break;
case 33:
yy.addDeploymentNode("nodeL", ...$$[$0]);
this.$ = $$[$0];
break;
case 34:
yy.addDeploymentNode("nodeR", ...$$[$0]);
this.$ = $$[$0];
break;
case 35:
yy.popBoundaryParseStack();
break;
case 39:
yy.addPersonOrSystem("person", ...$$[$0]);
this.$ = $$[$0];
break;
case 40:
yy.addPersonOrSystem("external_person", ...$$[$0]);
this.$ = $$[$0];
break;
case 41:
yy.addPersonOrSystem("system", ...$$[$0]);
this.$ = $$[$0];
break;
case 42:
yy.addPersonOrSystem("system_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 43:
yy.addPersonOrSystem("system_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 44:
yy.addPersonOrSystem("external_system", ...$$[$0]);
this.$ = $$[$0];
break;
case 45:
yy.addPersonOrSystem("external_system_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 46:
yy.addPersonOrSystem("external_system_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 47:
yy.addContainer("container", ...$$[$0]);
this.$ = $$[$0];
break;
case 48:
yy.addContainer("container_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 49:
yy.addContainer("container_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 50:
yy.addContainer("external_container", ...$$[$0]);
this.$ = $$[$0];
break;
case 51:
yy.addContainer("external_container_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 52:
yy.addContainer("external_container_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 53:
yy.addComponent("component", ...$$[$0]);
this.$ = $$[$0];
break;
case 54:
yy.addComponent("component_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 55:
yy.addComponent("component_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 56:
yy.addComponent("external_component", ...$$[$0]);
this.$ = $$[$0];
break;
case 57:
yy.addComponent("external_component_db", ...$$[$0]);
this.$ = $$[$0];
break;
case 58:
yy.addComponent("external_component_queue", ...$$[$0]);
this.$ = $$[$0];
break;
case 60:
yy.addRel("rel", ...$$[$0]);
this.$ = $$[$0];
break;
case 61:
yy.addRel("birel", ...$$[$0]);
this.$ = $$[$0];
break;
case 62:
yy.addRel("rel_u", ...$$[$0]);
this.$ = $$[$0];
break;
case 63:
yy.addRel("rel_d", ...$$[$0]);
this.$ = $$[$0];
break;
case 64:
yy.addRel("rel_l", ...$$[$0]);
this.$ = $$[$0];
break;
case 65:
yy.addRel("rel_r", ...$$[$0]);
this.$ = $$[$0];
break;
case 66:
yy.addRel("rel_b", ...$$[$0]);
this.$ = $$[$0];
break;
case 67:
$$[$0].splice(0, 1);
yy.addRel("rel", ...$$[$0]);
this.$ = $$[$0];
break;
case 68:
yy.updateElStyle("update_el_style", ...$$[$0]);
this.$ = $$[$0];
break;
case 69:
yy.updateRelStyle("update_rel_style", ...$$[$0]);
this.$ = $$[$0];
break;
case 70:
yy.updateLayoutConfig("update_layout_config", ...$$[$0]);
this.$ = $$[$0];
break;
case 71:
this.$ = [$$[$0]];
break;
case 72:
$$[$0].unshift($$[$0 - 1]);
this.$ = $$[$0];
break;
case 73:
case 75:
this.$ = $$[$0].trim();
break;
case 74:
let kv = {};
kv[$$[$0 - 1].trim()] = $$[$0].trim();
this.$ = kv;
break;
case 76:
this.$ = "";
break;
}
}, "anonymous"),
table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 14: [1, 74] }, o2($VH, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o2($VH, [2, 14]), o2($VI, [2, 16], { 12: [1, 76] }), o2($VH, [2, 36], { 12: [1, 77] }), o2($VJ, [2, 19]), o2($VJ, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, o2($VJ, [2, 23]), { 35: 80, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 86, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 87, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 88, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 89, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 90, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 91, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 92, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 93, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 94, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 95, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 96, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 97, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 98, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 99, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 100, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 101, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 102, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 103, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 104, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, o2($VO, [2, 59]), { 35: 105, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 106, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 107, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 108, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 109, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 110, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 111, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 112, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 113, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 114, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 115, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 43: 23, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 120, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 121, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 122, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 123, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 124, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 35: 125, 75: 81, 76: $VK, 77: $VL, 79: $VM, 80: $VN }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, o2($VH, [2, 15]), o2($VI, [2, 17], { 21: 22, 19: 130, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4 }), o2($VH, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: $V0, 23: $V1, 24: $V2, 26: $V3, 28: $V4, 34: $V5, 36: $V6, 37: $V7, 38: $V8, 39: $V9, 40: $Va, 41: $Vb, 44: $Vc, 45: $Vd, 46: $Ve, 47: $Vf, 48: $Vg, 49: $Vh, 50: $Vi, 51: $Vj, 52: $Vk, 53: $Vl, 54: $Vm, 55: $Vn, 56: $Vo, 57: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 61: $Vt, 62: $Vu, 63: $Vv, 64: $Vw, 65: $Vx, 66: $Vy, 67: $Vz, 68: $VA, 69: $VB, 70: $VC, 71: $VD, 72: $VE, 73: $VF, 74: $VG }), o2($VJ, [2, 21]), o2($VJ, [2, 22]), o2($VO, [2, 39]), o2($VP, [2, 71], { 75: 81, 35: 132, 76: $VK, 77: $VL, 79: $VM, 80: $VN }), o2($VQ, [2, 73]), { 78: [1, 133] }, o2($VQ, [2, 75]), o2($VQ, [2, 76]), o2($VO, [2, 40]), o2($VO, [2, 41]), o2($VO, [2, 42]), o2($VO, [2, 43]), o2($VO, [2, 44]), o2($VO, [2, 45]), o2($VO, [2, 46]), o2($VO, [2, 47]), o2($VO, [2, 48]), o2($VO, [2, 49]), o2($VO, [2, 50]), o2($VO, [2, 51]), o2($VO, [2, 52]), o2($VO, [2, 53]), o2($VO, [2, 54]), o2($VO, [2, 55]), o2($VO, [2, 56]), o2($VO, [2, 57]), o2($VO, [2, 58]), o2($VO, [2, 60]), o2($VO, [2, 61]), o2($VO, [2, 62]), o2($VO, [2, 63]), o2($VO, [2, 64]), o2($VO, [2, 65]), o2($VO, [2, 66]), o2($VO, [2, 67]), o2($VO, [2, 68]), o2($VO, [2, 69]), o2($VO, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, o2($VR, [2, 28]), o2($VR, [2, 29]), o2($VR, [2, 30]), o2($VR, [2, 31]), o2($VR, [2, 32]), o2($VR, [2, 33]), o2($VR, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, o2($VI, [2, 18]), o2($VH, [2, 38]), o2($VP, [2, 72]), o2($VQ, [2, 74]), o2($VO, [2, 24]), o2($VO, [2, 35]), o2($VS, [2, 25]), o2($VS, [2, 26], { 12: [1, 138] }), o2($VS, [2, 27])],
defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] },
parseError: /* @__PURE__ */ __name(function parseError(str2, hash) {
if (hash.recoverable) {
this.trace(str2);
} else {
var error3 = new Error(str2);
error3.hash = hash;
throw error3;
}
}, "parseError"),
parse: /* @__PURE__ */ __name(function parse8(input) {
var self2 = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF2 = 1;
var args = lstack.slice.call(arguments, 1);
var lexer3 = Object.create(this.lexer);
var sharedState = { yy: {} };
for (var k2 in this.yy) {
if (Object.prototype.hasOwnProperty.call(this.yy, k2)) {
sharedState.yy[k2] = this.yy[k2];
}
}
lexer3.setInput(input, sharedState.yy);
sharedState.yy.lexer = lexer3;
sharedState.yy.parser = this;
if (typeof lexer3.yylloc == "undefined") {
lexer3.yylloc = {};
}
var yyloc = lexer3.yylloc;
lstack.push(yyloc);
var ranges = lexer3.options && lexer3.options.ranges;
if (typeof sharedState.yy.parseError === "function") {
this.parseError = sharedState.yy.parseError;
} else {
this.parseError = Object.getPrototypeOf(this).parseError;
}
function popStack(n2) {
stack.length = stack.length - 2 * n2;
vstack.length = vstack.length - n2;
lstack.length = lstack.length - n2;
}
__name(popStack, "popStack");
function lex2() {
var token2;
token2 = tstack.pop() || lexer3.lex() || EOF2;
if (typeof token2 !== "number") {
if (token2 instanceof Array) {
tstack = token2;
token2 = tstack.pop();
}
token2 = self2.symbols_[token2] || token2;
}
return token2;
}
__name(lex2, "lex");
var symbol, preErrorSymbol, state4, action, a2, r2, yyval = {}, p3, len, newState2, expected;
while (true) {
state4 = stack[stack.length - 1];
if (this.defaultActions[state4]) {
action = this.defaultActions[state4];
} else {
if (symbol === null || typeof symbol == "undefined") {
symbol = lex2();
}
action = table[state4] && table[state4][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
expected = [];
for (p3 in table[state4]) {
if (this.terminals_[p3] && p3 > TERROR) {
expected.push("'" + this.terminals_[p3] + "'");
}
}
if (lexer3.showPosition) {
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer3.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
} else {
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF2 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
}
this.parseError(errStr, {
text: lexer3.match,
token: this.terminals_[symbol] || symbol,
line: lexer3.yylineno,
loc: yyloc,
expected
});
}
if (action[0] instanceof Array && action.length > 1) {
throw new Error("Parse Error: multiple actions possible at state: " + state4 + ", token: " + symbol);
}
switch (action[0]) {
case 1:
stack.push(symbol);
vstack.push(lexer3.yytext);
lstack.push(lexer3.yylloc);
stack.push(action[1]);
symbol = null;
if (!preErrorSymbol) {
yyleng = lexer3.yyleng;
yytext = lexer3.yytext;
yylineno = lexer3.yylineno;
yyloc = lexer3.yylloc;
if (recovering > 0) {
recovering--;
}
} else {
symbol = preErrorSymbol;
preErrorSymbol = null;
}
break;
case 2:
len = this.productions_[action[1]][1];
yyval.$ = vstack[vstack.length - len];
yyval._$ = {
first_line: lstack[lstack.length - (len || 1)].first_line,
last_line: lstack[lstack.length - 1].last_line,
first_column: lstack[lstack.length - (len || 1)].first_column,
last_column: lstack[lstack.length - 1].last_column
};
if (ranges) {
yyval._$.range = [
lstack[lstack.length - (len || 1)].range[0],
lstack[lstack.length - 1].range[1]
];
}
r2 = this.performAction.apply(yyval, [
yytext,
yyleng,
yylineno,
sharedState.yy,
action[1],
vstack,
lstack
].concat(args));
if (typeof r2 !== "undefined") {
return r2;
}
if (len) {
stack = stack.slice(0, -1 * len * 2);
vstack = vstack.slice(0, -1 * len);
lstack = lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]);
vstack.push(yyval.$);
lstack.push(yyval._$);
newState2 = table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState2);
break;
case 3: