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