import { a as e, d as t, h as n, i as r, m as i, r as a } from "./chunk-5PVQY5BW-De02jDY6.js";
import { a as o, i as s, r as c, t as l } from "./src-CiYEh6Gu.js";
import { t as u } from "./isEmpty-KjELx5uD.js";
import { F as d, G as f, H as p, J as m, M as h, N as g, S as _, T as v, X as y, Y as b, Z as x, c as S, f as C, g as w, h as ee, l as te, n as ne, p as T, r as re, t as ie, w as ae, x as E, y as D, z as oe } from "./chunk-ICPOFSXX-BGDNDwyb.js";
import { t as se } from "./chunk-426QAEUC-Bz08yDpF.js";
import "./dist-6KEP7Sv7.js";
import { i as ce, o as le } from "./chunk-U2HBQHQK-zQDW-w6z.js";
import "./chunk-BSJP7CBP-B_RLxeu-.js";
import "./chunk-ZZ45TVLE-DR9n48w9.js";
import "./chunk-X2U36JSP-vovBAHWP.js";
import "./chunk-5FUZZQ4R-CJuRfR98.js";
import "./chunk-ENJZ2VHE-DJN4zRqT.js";
import { n as ue } from "./chunk-336JU56O-C3Hg1JN3.js";
import { n as de, t as fe } from "./chunk-XPW4576I-DFs62wV-.js";
//#region ../../node_modules/.pnpm/stylis@4.4.0/node_modules/stylis/src/Enum.js
var pe = "comm", me = "rule", he = "decl", ge = "@import", _e = "@namespace", ve = "@keyframes", ye = "@layer", be = Math.abs, O = String.fromCharCode;
function xe(e) {
	return e.trim();
}
function Se(e, t, n) {
	return e.replace(t, n);
}
function k(e, t) {
	return e.charCodeAt(t) | 0;
}
function A(e, t, n) {
	return e.slice(t, n);
}
function j(e) {
	return e.length;
}
function Ce(e) {
	return e.length;
}
function M(e, t) {
	return t.push(e), e;
}
//#endregion
//#region ../../node_modules/.pnpm/stylis@4.4.0/node_modules/stylis/src/Tokenizer.js
var N = 1, P = 1, we = 0, F = 0, I = 0, L = "";
function R(e, t, n, r, i, a, o, s) {
	return {
		value: e,
		root: t,
		parent: n,
		type: r,
		props: i,
		children: a,
		line: N,
		column: P,
		length: o,
		return: "",
		siblings: s
	};
}
function Te() {
	return I;
}
function Ee() {
	return I = F > 0 ? k(L, --F) : 0, P--, I === 10 && (P = 1, N--), I;
}
function z() {
	return I = F < we ? k(L, F++) : 0, P++, I === 10 && (P = 1, N++), I;
}
function B() {
	return k(L, F);
}
function V() {
	return F;
}
function H(e, t) {
	return A(L, e, t);
}
function U(e) {
	switch (e) {
		case 0:
		case 9:
		case 10:
		case 13:
		case 32: return 5;
		case 33:
		case 43:
		case 44:
		case 47:
		case 62:
		case 64:
		case 126:
		case 59:
		case 123:
		case 125: return 4;
		case 58: return 3;
		case 34:
		case 39:
		case 40:
		case 91: return 2;
		case 41:
		case 93: return 1;
	}
	return 0;
}
function De(e) {
	return N = P = 1, we = j(L = e), F = 0, [];
}
function Oe(e) {
	return L = "", e;
}
function W(e) {
	return xe(H(F - 1, G(e === 91 ? e + 2 : e === 40 ? e + 1 : e)));
}
function ke(e) {
	for (; (I = B()) && I < 33;) z();
	return U(e) > 2 || U(I) > 3 ? "" : " ";
}
function Ae(e, t) {
	for (; --t && z() && !(I < 48 || I > 102 || I > 57 && I < 65 || I > 70 && I < 97););
	return H(e, V() + (t < 6 && B() == 32 && z() == 32));
}
function G(e) {
	for (; z();) switch (I) {
		case e: return F;
		case 34:
		case 39:
			e !== 34 && e !== 39 && G(I);
			break;
		case 40:
			e === 41 && G(e);
			break;
		case 92:
			z();
			break;
	}
	return F;
}
function je(e, t) {
	for (; z() && e + I !== 57 && !(e + I === 84 && B() === 47););
	return "/*" + H(t, F - 1) + "*" + O(e === 47 ? e : z());
}
function Me(e) {
	for (; !U(B());) z();
	return H(e, F);
}
//#endregion
//#region ../../node_modules/.pnpm/stylis@4.4.0/node_modules/stylis/src/Parser.js
function Ne(e) {
	return Oe(K("", null, null, null, [""], e = De(e), 0, [0], e));
}
function K(e, t, n, r, i, a, o, s, c) {
	for (var l = 0, u = 0, d = o, f = 0, p = 0, m = 0, h = 1, g = 1, _ = 1, v = 0, y = 0, b = "", x = i, S = a, C = r, w = b; g;) switch (m = y, y = z()) {
		case 40:
			m != 108 && k(w, d - 1) == 58 ? (v++, w += "(") : w += W(y);
			break;
		case 41:
			v--, w += ")";
			break;
		case 34:
		case 39:
		case 91:
			w += W(y);
			break;
		case 9:
		case 10:
		case 13:
		case 32:
			if (v > 0) {
				w += O(y);
				break;
			}
			w += ke(m);
			break;
		case 92:
			w += Ae(V() - 1, 7);
			continue;
		case 47:
			switch (B()) {
				case 42:
				case 47:
					M(Fe(je(z(), V()), t, n, c), c), (U(m || 1) == 5 || U(B() || 1) == 5) && j(w) && A(w, -1, void 0) !== " " && (w += " ");
					break;
				default: w += "/";
			}
			break;
		case 123 * h: s[l++] = j(w) * _;
		case 125 * h:
		case 59:
		case 0:
			if (v > 0 && y) {
				w += O(y);
				break;
			}
			switch (y) {
				case 0:
				case 125: g = 0;
				case 59 + u:
					_ == -1 && (w = Se(w, /\f/g, "")), p > 0 && (j(w) - d || h === 0) && M(p > 32 ? Ie(w + ";", r, n, d - 1, c) : Ie(Se(w, " ", "") + ";", r, n, d - 2, c), c);
					break;
				case 59: w += ";";
				default: if (M(C = Pe(w, t, n, l, u, i, s, b, x = [], S = [], d, a), a), y === 123) if (u === 0) K(w, t, C, C, x, a, d, s, S);
				else {
					switch (f) {
						case 99: if (k(w, 3) === 110) break;
						case 108: if (k(w, 2) === 97) break;
						default: u = 0;
						case 100:
						case 109:
						case 115:
					}
					u ? K(e, C, C, r && M(Pe(e, C, C, 0, 0, i, s, b, i, x = [], d, S), S), i, S, d, s, r ? x : S) : K(w, C, C, C, [""], S, 0, s, S);
				}
			}
			l = u = p = 0, h = _ = 1, b = w = "", d = o;
			break;
		case 58: d = 1 + j(w), p = m;
		default:
			if (h < 1) {
				if (y == 123) --h;
				else if (y == 125 && h++ == 0 && Ee() == 125) continue;
			}
			switch (w += O(y), y * h) {
				case 38:
					_ = u > 0 ? 1 : (w += "\f", -1);
					break;
				case 44:
					if (v > 0) break;
					s[l++] = (j(w) - 1) * _, _ = 1;
					break;
				case 64:
					B() === 45 && (w += W(z())), f = B(), u = d = j(b = w += Me(V())), y++;
					break;
				case 45: m === 45 && j(w) == 2 && (h = 0);
			}
	}
	return a;
}
function Pe(e, t, n, r, i, a, o, s, c, l, u, d) {
	for (var f = i - 1, p = i === 0 ? a : [""], m = Ce(p), h = 0, g = 0, _ = 0; h < r; ++h) for (var v = 0, y = A(e, f + 1, f = be(g = o[h])), b = e; v < m; ++v) (b = xe(g > 0 ? p[v] + " " + y : Se(y, /&\f/g, p[v]))) && (c[_++] = b);
	return R(e, t, n, i === 0 ? me : s, c, l, u, d);
}
function Fe(e, t, n, r) {
	return R(e, t, n, pe, O(Te()), A(e, 2, -2), 0, r);
}
function Ie(e, t, n, r, i) {
	return R(e, t, n, he, A(e, 0, r), A(e, r + 1, -1), r, i);
}
//#endregion
//#region ../../node_modules/.pnpm/stylis@4.4.0/node_modules/stylis/src/Serializer.js
function q(e, t) {
	for (var n = "", r = 0; r < e.length; r++) n += t(e[r], r, e, t) || "";
	return n;
}
function Le(e, t, n, r) {
	switch (e.type) {
		case ye: if (e.children.length) break;
		case ge:
		case _e:
		case he: return e.return = e.return || e.value;
		case pe: return "";
		case ve: return e.return = e.value + "{" + q(e.children, r) + "}";
		case me: if (!j(e.value = e.props.join(","))) return "";
	}
	return j(n = q(e.children, r)) ? e.return = e.value + "{" + n + "}" : "";
}
//#endregion
//#region ../../node_modules/.pnpm/mermaid@11.14.0/node_modules/mermaid/dist/mermaid.core.mjs
var Re = "c4", ze = {
	id: Re,
	detector: /* @__PURE__ */ c((e) => /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./c4Diagram-AHTNJAMY-bRk2T1M4.js");
		return {
			id: Re,
			diagram: e
		};
	}, "loader")
}, Be = "flowchart", Ve = {
	id: Be,
	detector: /* @__PURE__ */ c((e, t) => t?.flowchart?.defaultRenderer === "dagre-wrapper" || t?.flowchart?.defaultRenderer === "elk" ? !1 : /^\s*graph/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./flowDiagram-DWJPFMVM-BQTi4LbC.js");
		return {
			id: Be,
			diagram: e
		};
	}, "loader")
}, He = "flowchart-v2", Ue = {
	id: He,
	detector: /* @__PURE__ */ c((e, t) => t?.flowchart?.defaultRenderer === "dagre-d3" ? !1 : (t?.flowchart?.defaultRenderer === "elk" && (t.layout = "elk"), /^\s*graph/.test(e) && t?.flowchart?.defaultRenderer === "dagre-wrapper" ? !0 : /^\s*flowchart/.test(e)), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./flowDiagram-DWJPFMVM-BQTi4LbC.js");
		return {
			id: He,
			diagram: e
		};
	}, "loader")
}, We = "er", Ge = {
	id: We,
	detector: /* @__PURE__ */ c((e) => /^\s*erDiagram/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./erDiagram-SMLLAGMA-sjEfql1A.js");
		return {
			id: We,
			diagram: e
		};
	}, "loader")
}, Ke = "gitGraph", qe = {
	id: Ke,
	detector: /* @__PURE__ */ c((e) => /^\s*gitGraph/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./gitGraphDiagram-UUTBAWPF-DAgnz1dA.js");
		return {
			id: Ke,
			diagram: e
		};
	}, "loader")
}, Je = "gantt", Ye = {
	id: Je,
	detector: /* @__PURE__ */ c((e) => /^\s*gantt/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./ganttDiagram-T4ZO3ILL-D9poSPrH.js");
		return {
			id: Je,
			diagram: e
		};
	}, "loader")
}, Xe = "info", Ze = {
	id: Xe,
	detector: /* @__PURE__ */ c((e) => /^\s*info/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./infoDiagram-42DDH7IO-CVPCG-S8.js");
		return {
			id: Xe,
			diagram: e
		};
	}, "loader")
}, Qe = "pie", $e = {
	id: Qe,
	detector: /* @__PURE__ */ c((e) => /^\s*pie/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./pieDiagram-DEJITSTG-D4_7YOc_.js");
		return {
			id: Qe,
			diagram: e
		};
	}, "loader")
}, et = "quadrantChart", tt = {
	id: et,
	detector: /* @__PURE__ */ c((e) => /^\s*quadrantChart/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./quadrantDiagram-34T5L4WZ-BOmkdKHG.js");
		return {
			id: et,
			diagram: e
		};
	}, "loader")
}, nt = "xychart", rt = {
	id: nt,
	detector: /* @__PURE__ */ c((e) => /^\s*xychart(-beta)?/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./xychartDiagram-5P7HB3ND-FvOeoJ08.js");
		return {
			id: nt,
			diagram: e
		};
	}, "loader")
}, it = "requirement", at = {
	id: it,
	detector: /* @__PURE__ */ c((e) => /^\s*requirement(Diagram)?/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./requirementDiagram-MS252O5E-D8OmWqfy.js");
		return {
			id: it,
			diagram: e
		};
	}, "loader")
}, ot = "sequence", st = {
	id: ot,
	detector: /* @__PURE__ */ c((e) => /^\s*sequenceDiagram/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./sequenceDiagram-FGHM5R23-BLkehVb3.js");
		return {
			id: ot,
			diagram: e
		};
	}, "loader")
}, ct = "class", lt = {
	id: ct,
	detector: /* @__PURE__ */ c((e, t) => t?.class?.defaultRenderer === "dagre-wrapper" ? !1 : /^\s*classDiagram/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./classDiagram-6PBFFD2Q-BDn1FXcn.js");
		return {
			id: ct,
			diagram: e
		};
	}, "loader")
}, ut = "classDiagram", dt = {
	id: ut,
	detector: /* @__PURE__ */ c((e, t) => /^\s*classDiagram/.test(e) && t?.class?.defaultRenderer === "dagre-wrapper" ? !0 : /^\s*classDiagram-v2/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./classDiagram-v2-HSJHXN6E-CRJbBWOR.js");
		return {
			id: ut,
			diagram: e
		};
	}, "loader")
}, ft = "state", pt = {
	id: ft,
	detector: /* @__PURE__ */ c((e, t) => t?.state?.defaultRenderer === "dagre-wrapper" ? !1 : /^\s*stateDiagram/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./stateDiagram-FHFEXIEX-B2N-7xbP.js");
		return {
			id: ft,
			diagram: e
		};
	}, "loader")
}, mt = "stateDiagram", ht = {
	id: mt,
	detector: /* @__PURE__ */ c((e, t) => !!(/^\s*stateDiagram-v2/.test(e) || /^\s*stateDiagram/.test(e) && t?.state?.defaultRenderer === "dagre-wrapper"), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./stateDiagram-v2-QKLJ7IA2-DOVvZ_BB.js");
		return {
			id: mt,
			diagram: e
		};
	}, "loader")
}, gt = "journey", _t = {
	id: gt,
	detector: /* @__PURE__ */ c((e) => /^\s*journey/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./journeyDiagram-VCZTEJTY-DmTORJ_u.js");
		return {
			id: gt,
			diagram: e
		};
	}, "loader")
}, vt = { draw: /* @__PURE__ */ c((e, t, n) => {
	s.debug("rendering svg for syntax error\n");
	let r = se(t), i = r.append("g");
	r.attr("viewBox", "0 0 2412 512"), S(r, 100, 512, !0), i.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"), i.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"), i.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"), i.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"), i.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"), i.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"), i.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"), i.append("text").attr("class", "error-text").attr("x", 1250).attr("y", 400).attr("font-size", "100px").style("text-anchor", "middle").text(`mermaid version ${n}`);
}, "draw") }, yt = vt, bt = {
	db: {},
	renderer: vt,
	parser: { parse: /* @__PURE__ */ c(() => {}, "parse") }
}, xt = "flowchart-elk", St = {
	id: xt,
	detector: /* @__PURE__ */ c((e, t = {}) => /^\s*flowchart-elk/.test(e) || /^\s*(flowchart|graph)/.test(e) && t?.flowchart?.defaultRenderer === "elk" ? (t.layout = "elk", !0) : !1, "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./flowDiagram-DWJPFMVM-BQTi4LbC.js");
		return {
			id: xt,
			diagram: e
		};
	}, "loader")
}, Ct = "timeline", wt = {
	id: Ct,
	detector: /* @__PURE__ */ c((e) => /^\s*timeline/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./timeline-definition-GMOUNBTQ-BWMQ3wuq.js");
		return {
			id: Ct,
			diagram: e
		};
	}, "loader")
}, Tt = "mindmap", Et = {
	id: Tt,
	detector: /* @__PURE__ */ c((e) => /^\s*mindmap/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./mindmap-definition-QFDTVHPH-Ca2moJAs.js");
		return {
			id: Tt,
			diagram: e
		};
	}, "loader")
}, Dt = "kanban", Ot = {
	id: Dt,
	detector: /* @__PURE__ */ c((e) => /^\s*kanban/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./kanban-definition-6JOO6SKY-BnOTz0ck.js");
		return {
			id: Dt,
			diagram: e
		};
	}, "loader")
}, kt = "sankey", At = {
	id: kt,
	detector: /* @__PURE__ */ c((e) => /^\s*sankey(-beta)?/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./sankeyDiagram-XADWPNL6-CgMMtmHj.js");
		return {
			id: kt,
			diagram: e
		};
	}, "loader")
}, jt = "packet", Mt = {
	id: jt,
	detector: /* @__PURE__ */ c((e) => /^\s*packet(-beta)?/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./diagram-TYMM5635-DJFL9N6o.js");
		return {
			id: jt,
			diagram: e
		};
	}, "loader")
}, Nt = "radar", Pt = {
	id: Nt,
	detector: /* @__PURE__ */ c((e) => /^\s*radar-beta/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./diagram-MMDJMWI5-RA1e6II2.js");
		return {
			id: Nt,
			diagram: e
		};
	}, "loader")
}, Ft = "block", It = {
	id: Ft,
	detector: /* @__PURE__ */ c((e) => /^\s*block(-beta)?/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./blockDiagram-DXYQGD6D-BAHeT5M1.js");
		return {
			id: Ft,
			diagram: e
		};
	}, "loader")
}, Lt = "treeView", Rt = {
	id: Lt,
	detector: /* @__PURE__ */ c((e) => /^\s*treeView-beta/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./diagram-5BDNPKRD-BughzzUm.js");
		return {
			id: Lt,
			diagram: e
		};
	}, "loader")
}, zt = "architecture", Bt = {
	id: zt,
	detector: /* @__PURE__ */ c((e) => /^\s*architecture/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./architectureDiagram-Q4EWVU46-DwcU1djs.js");
		return {
			id: zt,
			diagram: e
		};
	}, "loader")
}, Vt = "ishikawa", Ht = {
	id: Vt,
	detector: /* @__PURE__ */ c((e) => /^\s*ishikawa(-beta)?\b/i.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./ishikawaDiagram-UXIWVN3A-DWPfST8T.js");
		return {
			id: Vt,
			diagram: e
		};
	}, "loader")
}, Ut = "venn", Wt = {
	id: Ut,
	detector: /* @__PURE__ */ c((e) => /^\s*venn-beta/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./vennDiagram-DHZGUBPP-9QLoIUJJ.js");
		return {
			id: Ut,
			diagram: e
		};
	}, "loader")
}, Gt = "treemap", Kt = {
	id: Gt,
	detector: /* @__PURE__ */ c((e) => /^\s*treemap/.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./diagram-G4DWMVQ6-DwW2ViEc.js");
		return {
			id: Gt,
			diagram: e
		};
	}, "loader")
}, qt = "wardley-beta", Jt = {
	id: qt,
	detector: /* @__PURE__ */ c((e) => /^\s*wardley-beta/i.test(e), "detector"),
	loader: /* @__PURE__ */ c(async () => {
		let { diagram: e } = await import("./wardleyDiagram-NUSXRM2D-CG1Fc1hg.js");
		return {
			id: qt,
			diagram: e
		};
	}, "loader")
}, Yt = !1, J = /* @__PURE__ */ c(() => {
	Yt || (Yt = !0, h("error", bt, (e) => e.toLowerCase().trim() === "error"), h("---", {
		db: { clear: /* @__PURE__ */ c(() => {}, "clear") },
		styles: {},
		renderer: { draw: /* @__PURE__ */ c(() => {}, "draw") },
		parser: { parse: /* @__PURE__ */ c(() => {
			throw 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__ */ c(() => null, "init")
	}, (e) => e.toLowerCase().trimStart().startsWith("---")), g(St, Et, Bt), g(ze, Ot, dt, lt, Ge, Ye, Ze, $e, at, st, Ue, Ve, wt, qe, ht, pt, _t, tt, At, Mt, rt, It, Rt, Pt, Ht, Kt, Wt, Jt));
}, "addDiagrams"), Xt = /* @__PURE__ */ c(async () => {
	s.debug("Loading registered diagrams");
	let e = (await Promise.allSettled(Object.entries(T).map(async ([e, { detector: t, loader: n }]) => {
		if (n) try {
			E(e);
		} catch {
			try {
				let { diagram: e, id: r } = await n();
				h(r, e, t);
			} catch (t) {
				throw s.error(`Failed to load external diagram with key ${e}. Removing from detectors.`), delete T[e], t;
			}
		}
	}))).filter((e) => e.status === "rejected");
	if (e.length > 0) {
		s.error(`Failed to load ${e.length} external diagrams`);
		for (let t of e) s.error(t);
		throw Error(`Failed to load ${e.length} external diagrams`);
	}
}, "loadRegisteredDiagrams"), Zt = "graphics-document document";
function Qt(e, t) {
	e.attr("role", Zt), t !== "" && e.attr("aria-roledescription", t);
}
c(Qt, "setA11yDiagramInfo");
function $t(e, t, n, r) {
	if (e.insert !== void 0) {
		if (n) {
			let t = `chart-desc-${r}`;
			e.attr("aria-describedby", t), e.insert("desc", ":first-child").attr("id", t).text(n);
		}
		if (t) {
			let n = `chart-title-${r}`;
			e.attr("aria-labelledby", n), e.insert("title", ":first-child").attr("id", n).text(t);
		}
	}
}
c($t, "addSVGa11yTitleDescription");
var Y = class t {
	constructor(e, t, n, r, i) {
		this.type = e, this.text = t, this.db = n, this.parser = r, this.renderer = i;
	}
	static {
		c(this, "Diagram");
	}
	static async fromText(n, r = {}) {
		let i = D(), a = C(n, i);
		n = e(n) + "\n";
		try {
			E(a);
		} catch {
			let e = _(a);
			if (!e) throw new ie(`Diagram ${a} not found.`);
			let { id: t, diagram: n } = await e();
			h(t, n);
		}
		let { db: o, parser: s, renderer: c, init: l } = E(a);
		return s.parser && (s.parser.yy = o), o.clear?.(), l?.(i), r.title && o.setDiagramTitle?.(r.title), await s.parse(n), new t(a, n, o, s, c);
	}
	async render(e, t) {
		await this.renderer.draw(this.text, e, t, this);
	}
	getParser() {
		return this.parser;
	}
	getType() {
		return this.type;
	}
}, en = [], tn = /* @__PURE__ */ c(() => {
	en.forEach((e) => {
		e();
	}), en = [];
}, "attachFunctions"), nn = /* @__PURE__ */ c((e) => e.replace(/^\s*%%(?!{)[^\n]+\n?/gm, "").trimStart(), "cleanupComments");
function rn(e) {
	let t = e.match(w);
	if (!t) return {
		text: e,
		metadata: {}
	};
	let n = de(t[1], { schema: fe }) ?? {};
	n = typeof n == "object" && !Array.isArray(n) ? n : {};
	let r = {};
	return n.displayMode && (r.displayMode = n.displayMode.toString()), n.title && (r.title = n.title.toString()), n.config && (r.config = n.config), {
		text: e.slice(t[0].length),
		metadata: r
	};
}
c(rn, "extractFrontMatter");
var an = /* @__PURE__ */ c((e) => e.replace(/\r\n?/g, "\n").replace(/<(\w+)([^>]*)>/g, (e, t, n) => "<" + t + n.replace(/="([^"]*)"/g, "='$1'") + ">"), "cleanupText"), on = /* @__PURE__ */ c((e) => {
	let { text: t, metadata: n } = rn(e), { displayMode: r, title: i, config: a = {} } = n;
	return r && (a.gantt ||= {}, a.gantt.displayMode = r), {
		title: i,
		config: a,
		text: t
	};
}, "processFrontmatter"), sn = /* @__PURE__ */ c((e) => {
	let t = n.detectInit(e) ?? {}, r = n.detectDirective(e, "wrap");
	return Array.isArray(r) ? t.wrap = r.some(({ type: e }) => e === "wrap") : r?.type === "wrap" && (t.wrap = !0), {
		text: i(e),
		directive: t
	};
}, "processDirectives");
function X(e) {
	let t = on(an(e)), n = sn(t.text), r = a(t.config, n.directive);
	return e = nn(n.text), {
		code: e,
		title: t.title,
		config: r
	};
}
c(X, "preprocessDiagram");
function cn(e) {
	let t = new TextEncoder().encode(e), n = Array.from(t, (e) => String.fromCodePoint(e)).join("");
	return btoa(n);
}
c(cn, "toBase64");
var ln = 5e4, un = "graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa", dn = "sandbox", fn = "loose", pn = "http://www.w3.org/2000/svg", mn = "http://www.w3.org/1999/xlink", hn = "http://www.w3.org/1999/xhtml", gn = "100%", _n = "100%", vn = "border:0;margin:0;", yn = "margin:0", bn = "allow-top-navigation-by-user-activation allow-popups", xn = "The \"iframe\" tag is not supported by your browser.", Sn = ["foreignobject"], Cn = ["dominant-baseline"];
function wn(e) {
	let t = X(e);
	return d(), ne(t.config ?? {}), t;
}
c(wn, "processAndSetConfigs");
async function Tn(e, t) {
	J();
	try {
		let { code: t, config: n } = wn(e);
		return {
			diagramType: (await In(t)).type,
			config: n
		};
	} catch (e) {
		if (t?.suppressErrors) return !1;
		throw e;
	}
}
c(Tn, "parse");
var En = /* @__PURE__ */ c((e, t, n = []) => `
.${e} ${t} { ${n.join(" !important; ")} !important; }`, "cssImportantStyles"), Dn = /* @__PURE__ */ c((e, t = /* @__PURE__ */ new Map()) => {
	let n = "";
	if (e.themeCSS !== void 0 && (n += `
${e.themeCSS}`), e.fontFamily !== void 0 && (n += `
:root { --mermaid-font-family: ${e.fontFamily}}`), e.altFontFamily !== void 0 && (n += `
:root { --mermaid-alt-font-family: ${e.altFontFamily}}`), t instanceof Map) {
		let r = ae(e) ? ["> *", "span"] : [
			"rect",
			"polygon",
			"ellipse",
			"circle",
			"path"
		];
		t.forEach((e) => {
			u(e.styles) || r.forEach((t) => {
				n += En(e.id, t, e.styles);
			}), u(e.textStyles) || (n += En(e.id, "tspan", (e?.textStyles || []).map((e) => e.replace("color", "fill"))));
		});
	}
	return n;
}, "createCssStyles"), On = /* @__PURE__ */ c((e, t, n, r) => q(Ne(`${r}{${m(t, Dn(e, n), {
	...e.themeVariables,
	theme: e.theme,
	look: e.look
}, r)}}`), Le), "createUserStyles"), kn = /* @__PURE__ */ c((e = "", t, n) => {
	let i = e;
	return !n && !t && (i = i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g, "marker-end=\"url(#")), i = r(i), i = i.replace(/<br>/g, "<br/>"), i;
}, "cleanUpSvgCode"), An = /* @__PURE__ */ c((e = "", t) => `<iframe style="width:${gn};height:${t?.viewBox?.baseVal?.height ? t.viewBox.baseVal.height + "px" : _n};${vn}" src="data:text/html;charset=UTF-8;base64,${cn(`<body style="${yn}">${e}</body>`)}" sandbox="${bn}">
  ${xn}
</iframe>`, "putIntoIFrame"), jn = /* @__PURE__ */ c((e, t, n, r, i) => {
	let a = e.append("div");
	a.attr("id", n), r && a.attr("style", r);
	let o = a.append("svg").attr("id", t).attr("width", "100%").attr("xmlns", pn);
	return i && o.attr("xmlns:xlink", i), o.append("g"), e;
}, "appendDivSvgG");
function Mn(e, t) {
	return e.append("iframe").attr("id", t).attr("style", "width: 100%; height: 100%;").attr("sandbox", "");
}
c(Mn, "sandboxedIframe");
var Nn = /* @__PURE__ */ c((e, t, n, r) => {
	e.getElementById(t)?.remove(), e.getElementById(n)?.remove(), e.getElementById(r)?.remove();
}, "removeExistingElements"), Pn = /* @__PURE__ */ c(async function(e, t, n) {
	J();
	let r = wn(t);
	t = r.code;
	let i = D();
	s.debug(i), t.length > (i?.maxTextSize ?? ln) && (t = un);
	let a = "#" + e, o = "i" + e, u = "#" + o, d = "d" + e, f = "#" + d, p = /* @__PURE__ */ c(() => {
		let e = l(h ? u : f).node();
		e && "remove" in e && e.remove();
	}, "removeTempElements"), m = l("body"), h = i.securityLevel === dn, g = i.securityLevel === fn, _ = i.fontFamily;
	n === void 0 ? (Nn(document, e, d, o), h ? (m = l(Mn(l("body"), o).nodes()[0].contentDocument.body), m.node().style.margin = 0) : m = l("body"), jn(m, e, d)) : (n && (n.innerHTML = ""), h ? (m = l(Mn(l(n), o).nodes()[0].contentDocument.body), m.node().style.margin = 0) : m = l(n), jn(m, e, d, `font-family: ${_}`, mn));
	let v, y;
	try {
		v = await Y.fromText(t, { title: r.title });
	} catch (e) {
		if (i.suppressErrorRendering) throw p(), e;
		v = await Y.fromText("error"), y = e;
	}
	let b = m.select(f).node(), S = v.type, C = b.firstChild, w = C.firstChild, te = v.renderer.getClasses?.(t, v), ne = On(i, S, te, a), T = document.createElement("style");
	T.innerHTML = ne, C.insertBefore(T, w);
	try {
		await v.renderer.draw(t, e, "11.14.0", v);
	} catch (n) {
		throw i.suppressErrorRendering ? p() : yt.draw(t, e, "11.14.0"), n;
	}
	let re = m.select(`${f} svg`), ie = v.db.getAccTitle?.(), ae = v.db.getAccDescription?.();
	Ln(S, re, ie, ae), m.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns", hn);
	let E = m.select(f).node().innerHTML;
	if (s.debug("config.arrowMarkerAbsolute", i.arrowMarkerAbsolute), E = kn(E, h, ee(i.arrowMarkerAbsolute)), h) {
		let e = m.select(f + " svg").node();
		E = An(E, e);
	} else g || (E = x.sanitize(E, {
		ADD_TAGS: Sn,
		ADD_ATTR: Cn,
		HTML_INTEGRATION_POINTS: { foreignobject: !0 }
	}));
	if (tn(), y) throw y;
	return p(), {
		diagramType: S,
		svg: E,
		bindFunctions: v.db.bindFunctions
	};
}, "render");
function Fn(e = {}) {
	let t = re({}, e);
	t?.fontFamily && !t.themeVariables?.fontFamily && (t.themeVariables ||= {}, t.themeVariables.fontFamily = t.fontFamily), oe(t), t?.theme && t.theme in b ? t.themeVariables = b[t.theme].getThemeVariables(t.themeVariables) : t && (t.themeVariables = b.default.getThemeVariables(t.themeVariables)), o((typeof t == "object" ? f(t) : v()).logLevel), J();
}
c(Fn, "initialize");
var In = /* @__PURE__ */ c((e, t = {}) => {
	let { code: n } = X(e);
	return Y.fromText(n, t);
}, "getDiagramFromText");
function Ln(e, t, n, r) {
	Qt(t, e), $t(t, n, r, t.attr("id"));
}
c(Ln, "addA11yInfo");
var Z = Object.freeze({
	render: Pn,
	parse: Tn,
	getDiagramFromText: In,
	initialize: Fn,
	getConfig: D,
	setConfig: p,
	getSiteConfig: v,
	updateSiteConfig: y,
	reset: /* @__PURE__ */ c(() => {
		d();
	}, "reset"),
	globalReset: /* @__PURE__ */ c(() => {
		d(te);
	}, "globalReset"),
	defaultConfig: te
});
o(D().logLevel), d(D());
var Rn = /* @__PURE__ */ c((e, n, r) => {
	s.warn(e), t(e) ? (r && r(e.str, e.hash), n.push({
		...e,
		message: e.str,
		error: e
	})) : (r && r(e), e instanceof Error && n.push({
		str: e.message,
		message: e.message,
		hash: e.name,
		error: e
	}));
}, "handleError"), zn = /* @__PURE__ */ c(async function(e = { querySelector: ".mermaid" }) {
	try {
		await Bn(e);
	} catch (n) {
		if (t(n) && s.error(n.str), $.parseError && $.parseError(n), !e.suppressErrors) throw s.error("Use the suppressErrors option to suppress these errors"), n;
	}
}, "run"), Bn = /* @__PURE__ */ c(async function({ postRenderCallback: e, querySelector: t, nodes: r } = { querySelector: ".mermaid" }) {
	let i = Z.getConfig();
	s.debug(`${e ? "" : "No "}Callback function found`);
	let a;
	if (r) a = r;
	else if (t) a = document.querySelectorAll(t);
	else throw Error("Nodes and querySelector are both undefined");
	s.debug(`Found ${a.length} diagrams`), i?.startOnLoad !== void 0 && (s.debug("Start On Load: " + i?.startOnLoad), Z.updateSiteConfig({ startOnLoad: i?.startOnLoad }));
	let o = new n.InitIDGenerator(i.deterministicIds, i.deterministicIDSeed), c, l = [];
	for (let t of Array.from(a)) {
		if (s.info("Rendering diagram: " + t.id), t.getAttribute("data-processed")) continue;
		t.setAttribute("data-processed", "true");
		let r = `mermaid-${o.next()}`;
		c = t.innerHTML, c = le(n.entityDecode(c)).trim().replace(/<br\s*\/?>/gi, "<br/>");
		let i = n.detectInit(c);
		i && s.debug("Detected early reinit: ", i);
		try {
			let { svg: n, bindFunctions: i } = await Yn(r, c, t);
			t.innerHTML = n, e && await e(r), i && i(t);
		} catch (e) {
			Rn(e, l, $.parseError);
		}
	}
	if (l.length > 0) throw l[0];
}, "runThrowsErrors"), Vn = /* @__PURE__ */ c(function(e) {
	Z.initialize(e);
}, "initialize"), Hn = /* @__PURE__ */ c(async function(e, t, n) {
	s.warn("mermaid.init is deprecated. Please use run instead."), e && Vn(e);
	let r = {
		postRenderCallback: n,
		querySelector: ".mermaid"
	};
	typeof t == "string" ? r.querySelector = t : t && (t instanceof HTMLElement ? r.nodes = [t] : r.nodes = t), await zn(r);
}, "init"), Un = /* @__PURE__ */ c(async (e, { lazyLoad: t = !0 } = {}) => {
	J(), g(...e), t === !1 && await Xt();
}, "registerExternalDiagrams"), Wn = /* @__PURE__ */ c(function() {
	if ($.startOnLoad) {
		let { startOnLoad: e } = Z.getConfig();
		e && $.run().catch((e) => s.error("Mermaid failed to initialize", e));
	}
}, "contentLoaded");
typeof document < "u" && window.addEventListener("load", Wn, !1);
var Gn = /* @__PURE__ */ c(function(e) {
	$.parseError = e;
}, "setParseErrorHandler"), Q = [], Kn = !1, qn = /* @__PURE__ */ c(async () => {
	if (!Kn) {
		for (Kn = !0; Q.length > 0;) {
			let e = Q.shift();
			if (e) try {
				await e();
			} catch (e) {
				s.error("Error executing queue", e);
			}
		}
		Kn = !1;
	}
}, "executeQueue"), Jn = /* @__PURE__ */ c(async (e, t) => new Promise((n, r) => {
	let i = /* @__PURE__ */ c(() => new Promise((i, a) => {
		Z.parse(e, t).then((e) => {
			i(e), n(e);
		}, (e) => {
			s.error("Error parsing", e), $.parseError?.(e), a(e), r(e);
		});
	}), "performCall");
	Q.push(i), qn().catch(r);
}), "parse"), Yn = /* @__PURE__ */ c((e, t, n) => new Promise((r, i) => {
	let a = /* @__PURE__ */ c(() => new Promise((a, o) => {
		Z.render(e, t, n).then((e) => {
			a(e), r(e);
		}, (e) => {
			s.error("Error parsing", e), $.parseError?.(e), o(e), i(e);
		});
	}), "performCall");
	Q.push(a), qn().catch(i);
}), "render"), $ = {
	startOnLoad: !0,
	mermaidAPI: Z,
	parse: Jn,
	render: Yn,
	init: Hn,
	run: zn,
	registerExternalDiagrams: Un,
	registerLayoutLoaders: ue,
	initialize: Vn,
	parseError: void 0,
	contentLoaded: Wn,
	setParseErrorHandler: Gn,
	detectType: C,
	registerIconPacks: ce,
	getRegisteredDiagramsMetadata: /* @__PURE__ */ c(() => Object.keys(T).map((e) => ({ id: e })), "getRegisteredDiagramsMetadata")
}, Xn = $;
//#endregion
export { Xn as default };
