import { C as e, D as t, E as n, G as r, N as i, P as a, V as o, j as s, k as c, n as l, p as u, v as d, w as f, z as p } from "./isArrayLikeObject-uEhZQuCW.js";
import { C as m, E as ee, M as h, N as te, S as ne, a as g, c as re, d as ie, f as _, i as v, m as ae, n as y, p as oe, r as b, s as x, y as se } from "./_baseUniq-CO35kH5B.js";
import { a as ce, c as le, d as ue, f as S, i as de, l as C, m as w, n as T, o as fe, r as pe, s as E, t as me, u as D } from "./_basePickBy-BlpD3CIQ.js";
import { i as he, n as ge } from "./isEmpty-SB7gHWzg.js";
import { k as O } from "./chunk-GEFDOKGD-bXEkwPrJ.js";
import { t as k } from "./graphlib-DmFENmkJ.js";
//#region node_modules/lodash-es/_flatRest.js
function _e(e) {
	return i(t(e, void 0, S), e + "");
}
//#endregion
//#region node_modules/lodash-es/_hasUnicode.js
var ve = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");
function ye(e) {
	return ve.test(e);
}
//#endregion
//#region node_modules/lodash-es/cloneDeep.js
var be = 1, xe = 4;
function Se(e) {
	return se(e, be | xe);
}
//#endregion
//#region node_modules/lodash-es/now.js
var Ce = function() {
	return r.Date.now();
};
//#endregion
//#region node_modules/lodash-es/forIn.js
function we(e, t) {
	return e == null ? e : l(e, re(t), u);
}
//#endregion
//#region node_modules/lodash-es/forOwn.js
function Te(e, t) {
	return e && ie(e, re(t));
}
//#endregion
//#region node_modules/lodash-es/_baseGt.js
function Ee(e, t) {
	return e > t;
}
//#endregion
//#region node_modules/lodash-es/mapValues.js
function A(e, t) {
	var n = {};
	return t = _(t, 3), ie(e, function(e, r, i) {
		s(n, r, t(e, r, i));
	}), n;
}
//#endregion
//#region node_modules/lodash-es/max.js
function j(e) {
	return e && e.length ? pe(e, p, Ee) : void 0;
}
//#endregion
//#region node_modules/lodash-es/minBy.js
function M(e, t) {
	return e && e.length ? pe(e, _(t, 2), de) : void 0;
}
//#endregion
//#region node_modules/lodash-es/_baseSortBy.js
function De(e, t) {
	var n = e.length;
	for (e.sort(t); n--;) e[n] = e[n].value;
	return e;
}
//#endregion
//#region node_modules/lodash-es/_compareAscending.js
function Oe(e, t) {
	if (e !== t) {
		var n = e !== void 0, r = e === null, i = e === e, a = te(e), o = t !== void 0, s = t === null, c = t === t, l = te(t);
		if (!s && !l && !a && e > t || a && o && c && !s && !l || r && o && c || !n && c || !i) return 1;
		if (!r && !a && !l && e < t || l && n && i && !r && !a || s && n && i || !o && i || !c) return -1;
	}
	return 0;
}
//#endregion
//#region node_modules/lodash-es/_compareMultiple.js
function ke(e, t, n) {
	for (var r = -1, i = e.criteria, a = t.criteria, o = i.length, s = n.length; ++r < o;) {
		var c = Oe(i[r], a[r]);
		if (c) return r >= s ? c : c * (n[r] == "desc" ? -1 : 1);
	}
	return e.index - t.index;
}
//#endregion
//#region node_modules/lodash-es/_baseOrderBy.js
function Ae(e, t, n) {
	t = t.length ? h(t, function(e) {
		return o(e) ? function(t) {
			return m(t, e.length === 1 ? e[0] : e);
		} : e;
	}) : [p];
	var r = -1;
	return t = h(t, d(_)), De(le(e, function(e, n, i) {
		return {
			criteria: h(t, function(t) {
				return t(e);
			}),
			index: ++r,
			value: e
		};
	}), function(e, t) {
		return ke(e, t, n);
	});
}
//#endregion
//#region node_modules/lodash-es/_asciiSize.js
var je = oe("length"), Me = "\\ud800-\\udfff", Ne = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", Pe = "\\ufe0e\\ufe0f", Fe = "[" + Me + "]", N = "[" + Ne + "]", P = "\\ud83c[\\udffb-\\udfff]", Ie = "(?:" + N + "|" + P + ")", Le = "[^" + Me + "]", Re = "(?:\\ud83c[\\udde6-\\uddff]){2}", ze = "[\\ud800-\\udbff][\\udc00-\\udfff]", Be = "\\u200d", Ve = Ie + "?", He = "[" + Pe + "]?", Ue = "(?:" + Be + "(?:" + [
	Le,
	Re,
	ze
].join("|") + ")" + He + Ve + ")*", We = He + Ve + Ue, Ge = "(?:" + [
	Le + N + "?",
	N,
	Re,
	ze,
	Fe
].join("|") + ")", Ke = RegExp(P + "(?=" + P + ")|" + Ge + We, "g");
function qe(e) {
	for (var t = Ke.lastIndex = 0; Ke.test(e);) ++t;
	return t;
}
//#endregion
//#region node_modules/lodash-es/_stringSize.js
function Je(e) {
	return ye(e) ? qe(e) : je(e);
}
//#endregion
//#region node_modules/lodash-es/_basePick.js
function Ye(e, t) {
	return me(e, t, function(t, n) {
		return ae(e, n);
	});
}
//#endregion
//#region node_modules/lodash-es/pick.js
var F = _e(function(e, t) {
	return e == null ? {} : Ye(e, t);
}), Xe = Math.ceil, Ze = Math.max;
function Qe(e, t, n, r) {
	for (var i = -1, a = Ze(Xe((t - e) / (n || 1)), 0), o = Array(a); a--;) o[r ? a : ++i] = e, e += n;
	return o;
}
//#endregion
//#region node_modules/lodash-es/_createRange.js
function $e(t) {
	return function(n, r, i) {
		return i && typeof i != "number" && e(n, r, i) && (r = i = void 0), n = w(n), r === void 0 ? (r = n, n = 0) : r = w(r), i = i === void 0 ? n < r ? 1 : -1 : w(i), Qe(n, r, i, t);
	};
}
//#endregion
//#region node_modules/lodash-es/range.js
var I = $e(), et = "[object Map]", tt = "[object Set]";
function nt(e) {
	if (e == null) return 0;
	if (f(e)) return ce(e) ? Je(e) : e.length;
	var t = ge(e);
	return t == et || t == tt ? e.size : he(e).length;
}
//#endregion
//#region node_modules/lodash-es/sortBy.js
var L = n(function(t, n) {
	if (t == null) return [];
	var r = n.length;
	return r > 1 && e(t, n[0], n[1]) ? n = [] : r > 2 && e(n[0], n[1], n[2]) && (n = [n[0]]), Ae(t, ne(n, 1), []);
}), rt = 0;
function R(e) {
	var t = ++rt;
	return ee(e) + t;
}
//#endregion
//#region node_modules/lodash-es/_baseZipObject.js
function it(e, t, n) {
	for (var r = -1, i = e.length, a = t.length, o = {}; ++r < i;) {
		var s = r < a ? t[r] : void 0;
		n(o, e[r], s);
	}
	return o;
}
//#endregion
//#region node_modules/lodash-es/zipObject.js
function at(e, t) {
	return it(e || [], t || [], c);
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/data/list.js
var ot = class {
	constructor() {
		var e = {};
		e._next = e._prev = e, this._sentinel = e;
	}
	dequeue() {
		var e = this._sentinel, t = e._prev;
		if (t !== e) return st(t), t;
	}
	enqueue(e) {
		var t = this._sentinel;
		e._prev && e._next && st(e), e._next = t._next, t._next._prev = e, t._next = e, e._prev = t;
	}
	toString() {
		for (var e = [], t = this._sentinel, n = t._prev; n !== t;) e.push(JSON.stringify(n, ct)), n = n._prev;
		return "[" + e.join(", ") + "]";
	}
};
function st(e) {
	e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
}
function ct(e, t) {
	if (e !== "_next" && e !== "_prev") return t;
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/greedy-fas.js
var lt = a(1);
function ut(e, t) {
	if (e.nodeCount() <= 1) return [];
	var n = ft(e, t || lt);
	return S(E(dt(n.graph, n.buckets, n.zeroIdx), function(t) {
		return e.outEdges(t.v, t.w);
	}));
}
function dt(e, t, n) {
	for (var r = [], i = t[t.length - 1], a = t[0], o; e.nodeCount();) {
		for (; o = a.dequeue();) z(e, t, n, o);
		for (; o = i.dequeue();) z(e, t, n, o);
		if (e.nodeCount()) {
			for (var s = t.length - 2; s > 0; --s) if (o = t[s].dequeue(), o) {
				r = r.concat(z(e, t, n, o, !0));
				break;
			}
		}
	}
	return r;
}
function z(e, t, n, r, i) {
	var a = i ? [] : void 0;
	return x(e.inEdges(r.v), function(r) {
		var o = e.edge(r), s = e.node(r.v);
		i && a.push({
			v: r.v,
			w: r.w
		}), s.out -= o, B(t, n, s);
	}), x(e.outEdges(r.v), function(r) {
		var i = e.edge(r), a = r.w, o = e.node(a);
		o.in -= i, B(t, n, o);
	}), e.removeNode(r.v), a;
}
function ft(e, t) {
	var n = new k(), r = 0, i = 0;
	x(e.nodes(), function(e) {
		n.setNode(e, {
			v: e,
			in: 0,
			out: 0
		});
	}), x(e.edges(), function(e) {
		var a = n.edge(e.v, e.w) || 0, o = t(e), s = a + o;
		n.setEdge(e.v, e.w, s), i = Math.max(i, n.node(e.v).out += o), r = Math.max(r, n.node(e.w).in += o);
	});
	var a = I(i + r + 3).map(function() {
		return new ot();
	}), o = r + 1;
	return x(n.nodes(), function(e) {
		B(a, o, n.node(e));
	}), {
		graph: n,
		buckets: a,
		zeroIdx: o
	};
}
function B(e, t, n) {
	n.out ? n.in ? e[n.out - n.in + t].enqueue(n) : e[e.length - 1].enqueue(n) : e[0].enqueue(n);
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/acyclic.js
function pt(e) {
	x(e.graph().acyclicer === "greedy" ? ut(e, t(e)) : mt(e), function(t) {
		var n = e.edge(t);
		e.removeEdge(t), n.forwardName = t.name, n.reversed = !0, e.setEdge(t.w, t.v, n, R("rev"));
	});
	function t(e) {
		return function(t) {
			return e.edge(t).weight;
		};
	}
}
function mt(e) {
	var t = [], n = {}, r = {};
	function i(a) {
		Object.prototype.hasOwnProperty.call(r, a) || (r[a] = !0, n[a] = !0, x(e.outEdges(a), function(e) {
			Object.prototype.hasOwnProperty.call(n, e.w) ? t.push(e) : i(e.w);
		}), delete n[a]);
	}
	return x(e.nodes(), i), t;
}
function ht(e) {
	x(e.edges(), function(t) {
		var n = e.edge(t);
		if (n.reversed) {
			e.removeEdge(t);
			var r = n.forwardName;
			delete n.reversed, delete n.forwardName, e.setEdge(t.w, t.v, n, r);
		}
	});
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/util.js
function V(e, t, n, r) {
	var i;
	do
		i = R(r);
	while (e.hasNode(i));
	return n.dummy = t, e.setNode(i, n), i;
}
function gt(e) {
	var t = new k().setGraph(e.graph());
	return x(e.nodes(), function(n) {
		t.setNode(n, e.node(n));
	}), x(e.edges(), function(n) {
		var r = t.edge(n.v, n.w) || {
			weight: 0,
			minlen: 1
		}, i = e.edge(n);
		t.setEdge(n.v, n.w, {
			weight: r.weight + i.weight,
			minlen: Math.max(r.minlen, i.minlen)
		});
	}), t;
}
function _t(e) {
	var t = new k({ multigraph: e.isMultigraph() }).setGraph(e.graph());
	return x(e.nodes(), function(n) {
		e.children(n).length || t.setNode(n, e.node(n));
	}), x(e.edges(), function(n) {
		t.setEdge(n, e.edge(n));
	}), t;
}
function vt(e, t) {
	var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2;
	if (!i && !a) throw Error("Not possible to find intersection inside of the rectangle");
	var c, l;
	return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = o * a / i), {
		x: n + c,
		y: r + l
	};
}
function H(e) {
	var t = E(I(St(e) + 1), function() {
		return [];
	});
	return x(e.nodes(), function(n) {
		var r = e.node(n), i = r.rank;
		b(i) || (t[i][r.order] = n);
	}), t;
}
function yt(e) {
	var t = T(E(e.nodes(), function(t) {
		return e.node(t).rank;
	}));
	x(e.nodes(), function(n) {
		var r = e.node(n);
		fe(r, "rank") && (r.rank -= t);
	});
}
function bt(e) {
	var t = T(E(e.nodes(), function(t) {
		return e.node(t).rank;
	})), n = [];
	x(e.nodes(), function(r) {
		var i = e.node(r).rank - t;
		n[i] || (n[i] = []), n[i].push(r);
	});
	var r = 0, i = e.graph().nodeRankFactor;
	x(n, function(t, n) {
		b(t) && n % i !== 0 ? --r : r && x(t, function(t) {
			e.node(t).rank += r;
		});
	});
}
function xt(e, t, n, r) {
	var i = {
		width: 0,
		height: 0
	};
	return arguments.length >= 4 && (i.rank = n, i.order = r), V(e, "border", i, t);
}
function St(e) {
	return j(E(e.nodes(), function(t) {
		var n = e.node(t).rank;
		if (!b(n)) return n;
	}));
}
function Ct(e, t) {
	var n = {
		lhs: [],
		rhs: []
	};
	return x(e, function(e) {
		t(e) ? n.lhs.push(e) : n.rhs.push(e);
	}), n;
}
function wt(e, t) {
	var n = Ce();
	try {
		return t();
	} finally {
		console.log(e + " time: " + (Ce() - n) + "ms");
	}
}
function Tt(e, t) {
	return t();
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/add-border-segments.js
function Et(e) {
	function t(n) {
		var r = e.children(n), i = e.node(n);
		if (r.length && x(r, t), Object.prototype.hasOwnProperty.call(i, "minRank")) {
			i.borderLeft = [], i.borderRight = [];
			for (var a = i.minRank, o = i.maxRank + 1; a < o; ++a) Dt(e, "borderLeft", "_bl", n, i, a), Dt(e, "borderRight", "_br", n, i, a);
		}
	}
	x(e.children(), t);
}
function Dt(e, t, n, r, i, a) {
	var o = {
		width: 0,
		height: 0,
		rank: a,
		borderType: t
	}, s = i[t][a - 1], c = V(e, "border", o, n);
	i[t][a] = c, e.setParent(c, r), s && e.setEdge(s, c, { weight: 1 });
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/coordinate-system.js
function Ot(e) {
	var t = e.graph().rankdir.toLowerCase();
	(t === "lr" || t === "rl") && At(e);
}
function kt(e) {
	var t = e.graph().rankdir.toLowerCase();
	(t === "bt" || t === "rl") && jt(e), (t === "lr" || t === "rl") && (Mt(e), At(e));
}
function At(e) {
	x(e.nodes(), function(t) {
		U(e.node(t));
	}), x(e.edges(), function(t) {
		U(e.edge(t));
	});
}
function U(e) {
	var t = e.width;
	e.width = e.height, e.height = t;
}
function jt(e) {
	x(e.nodes(), function(t) {
		W(e.node(t));
	}), x(e.edges(), function(t) {
		var n = e.edge(t);
		x(n.points, W), Object.prototype.hasOwnProperty.call(n, "y") && W(n);
	});
}
function W(e) {
	e.y = -e.y;
}
function Mt(e) {
	x(e.nodes(), function(t) {
		G(e.node(t));
	}), x(e.edges(), function(t) {
		var n = e.edge(t);
		x(n.points, G), Object.prototype.hasOwnProperty.call(n, "x") && G(n);
	});
}
function G(e) {
	var t = e.x;
	e.x = e.y, e.y = t;
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/normalize.js
function Nt(e) {
	e.graph().dummyChains = [], x(e.edges(), function(t) {
		Pt(e, t);
	});
}
function Pt(e, t) {
	var n = t.v, r = e.node(n).rank, i = t.w, a = e.node(i).rank, o = t.name, s = e.edge(t), c = s.labelRank;
	if (a !== r + 1) {
		e.removeEdge(t);
		var l = void 0, u, d;
		for (d = 0, ++r; r < a; ++d, ++r) s.points = [], l = {
			width: 0,
			height: 0,
			edgeLabel: s,
			edgeObj: t,
			rank: r
		}, u = V(e, "edge", l, "_d"), r === c && (l.width = s.width, l.height = s.height, l.dummy = "edge-label", l.labelpos = s.labelpos), e.setEdge(n, u, { weight: s.weight }, o), d === 0 && e.graph().dummyChains.push(u), n = u;
		e.setEdge(n, i, { weight: s.weight }, o);
	}
}
function Ft(e) {
	x(e.graph().dummyChains, function(t) {
		var n = e.node(t), r = n.edgeLabel, i;
		for (e.setEdge(n.edgeObj, r); n.dummy;) i = e.successors(t)[0], e.removeNode(t), r.points.push({
			x: n.x,
			y: n.y
		}), n.dummy === "edge-label" && (r.x = n.x, r.y = n.y, r.width = n.width, r.height = n.height), t = i, n = e.node(t);
	});
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/rank/util.js
function K(e) {
	var t = {};
	function n(r) {
		var i = e.node(r);
		if (Object.prototype.hasOwnProperty.call(t, r)) return i.rank;
		t[r] = !0;
		var a = T(E(e.outEdges(r), function(t) {
			return n(t.w) - e.edge(t).minlen;
		}));
		return (a === Infinity || a == null) && (a = 0), i.rank = a;
	}
	x(e.sources(), n);
}
function q(e, t) {
	return e.node(t.w).rank - e.node(t.v).rank - e.edge(t).minlen;
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.js
function It(e) {
	var t = new k({ directed: !1 }), n = e.nodes()[0], r = e.nodeCount();
	t.setNode(n, {});
	for (var i, a; Lt(t, e) < r;) i = Rt(t, e), a = t.hasNode(i.v) ? q(e, i) : -q(e, i), zt(t, e, a);
	return t;
}
function Lt(e, t) {
	function n(r) {
		x(t.nodeEdges(r), function(i) {
			var a = i.v, o = r === a ? i.w : a;
			!e.hasNode(o) && !q(t, i) && (e.setNode(o, {}), e.setEdge(r, o, {}), n(o));
		});
	}
	return x(e.nodes(), n), e.nodeCount();
}
function Rt(e, t) {
	return M(t.edges(), function(n) {
		if (e.hasNode(n.v) !== e.hasNode(n.w)) return q(t, n);
	});
}
function zt(e, t, n) {
	x(e.nodes(), function(e) {
		t.node(e).rank += n;
	});
}
//#endregion
//#region node_modules/dagre-d3-es/src/graphlib/alg/topsort.js
a(1), a(1), Bt.CycleException = J;
function Bt(e) {
	var t = {}, n = {}, r = [];
	function i(a) {
		if (Object.prototype.hasOwnProperty.call(n, a)) throw new J();
		Object.prototype.hasOwnProperty.call(t, a) || (n[a] = !0, t[a] = !0, x(e.predecessors(a), i), delete n[a], r.push(a));
	}
	if (x(e.sinks(), i), nt(t) !== e.nodeCount()) throw new J();
	return r;
}
function J() {}
J.prototype = /* @__PURE__ */ Error();
//#endregion
//#region node_modules/dagre-d3-es/src/graphlib/alg/dfs.js
function Vt(e, t, n) {
	o(t) || (t = [t]);
	var r = (e.isDirected() ? e.successors : e.neighbors).bind(e), i = [], a = {};
	return x(t, function(t) {
		if (!e.hasNode(t)) throw Error("Graph does not have node: " + t);
		Ht(e, t, n === "post", a, r, i);
	}), i;
}
function Ht(e, t, n, r, i, a) {
	Object.prototype.hasOwnProperty.call(r, t) || (r[t] = !0, n || a.push(t), x(i(t), function(t) {
		Ht(e, t, n, r, i, a);
	}), n && a.push(t));
}
//#endregion
//#region node_modules/dagre-d3-es/src/graphlib/alg/postorder.js
function Ut(e, t) {
	return Vt(e, t, "post");
}
//#endregion
//#region node_modules/dagre-d3-es/src/graphlib/alg/preorder.js
function Wt(e, t) {
	return Vt(e, t, "pre");
}
Y.initLowLimValues = Z, Y.initCutValues = X, Y.calcCutValue = Kt, Y.leaveEdge = Jt, Y.enterEdge = Yt, Y.exchangeEdges = Xt;
function Y(e) {
	e = gt(e), K(e);
	var t = It(e);
	Z(t), X(t, e);
	for (var n, r; n = Jt(t);) r = Yt(t, e, n), Xt(t, e, n, r);
}
function X(e, t) {
	var n = Ut(e, e.nodes());
	n = n.slice(0, n.length - 1), x(n, function(n) {
		Gt(e, t, n);
	});
}
function Gt(e, t, n) {
	var r = e.node(n).parent;
	e.edge(n, r).cutvalue = Kt(e, t, n);
}
function Kt(e, t, n) {
	var r = e.node(n).parent, i = !0, a = t.edge(n, r), o = 0;
	return a ||= (i = !1, t.edge(r, n)), o = a.weight, x(t.nodeEdges(n), function(a) {
		var s = a.v === n, c = s ? a.w : a.v;
		if (c !== r) {
			var l = s === i, u = t.edge(a).weight;
			if (o += l ? u : -u, Qt(e, n, c)) {
				var d = e.edge(n, c).cutvalue;
				o += l ? -d : d;
			}
		}
	}), o;
}
function Z(e, t) {
	arguments.length < 2 && (t = e.nodes()[0]), qt(e, {}, 1, t);
}
function qt(e, t, n, r, i) {
	var a = n, o = e.node(r);
	return t[r] = !0, x(e.neighbors(r), function(i) {
		Object.prototype.hasOwnProperty.call(t, i) || (n = qt(e, t, n, i, r));
	}), o.low = a, o.lim = n++, i ? o.parent = i : delete o.parent, n;
}
function Jt(e) {
	return C(e.edges(), function(t) {
		return e.edge(t).cutvalue < 0;
	});
}
function Yt(e, t, n) {
	var r = n.v, i = n.w;
	t.hasEdge(r, i) || (r = n.w, i = n.v);
	var a = e.node(r), o = e.node(i), s = a, c = !1;
	return a.lim > o.lim && (s = o, c = !0), M(g(t.edges(), function(t) {
		return c === $t(e, e.node(t.v), s) && c !== $t(e, e.node(t.w), s);
	}), function(e) {
		return q(t, e);
	});
}
function Xt(e, t, n, r) {
	var i = n.v, a = n.w;
	e.removeEdge(i, a), e.setEdge(r.v, r.w, {}), Z(e), X(e, t), Zt(e, t);
}
function Zt(e, t) {
	var n = Wt(e, C(e.nodes(), function(e) {
		return !t.node(e).parent;
	}));
	n = n.slice(1), x(n, function(n) {
		var r = e.node(n).parent, i = t.edge(n, r), a = !1;
		i || (i = t.edge(r, n), a = !0), t.node(n).rank = t.node(r).rank + (a ? i.minlen : -i.minlen);
	});
}
function Qt(e, t, n) {
	return e.hasEdge(t, n);
}
function $t(e, t, n) {
	return n.low <= t.lim && t.lim <= n.lim;
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/rank/index.js
function en(e) {
	switch (e.graph().ranker) {
		case "network-simplex":
			rn(e);
			break;
		case "tight-tree":
			nn(e);
			break;
		case "longest-path":
			tn(e);
			break;
		default: rn(e);
	}
}
var tn = K;
function nn(e) {
	K(e), It(e);
}
function rn(e) {
	Y(e);
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/nesting-graph.js
function an(e) {
	var t = V(e, "root", {}, "_root"), n = sn(e), r = j(v(n)) - 1, i = 2 * r + 1;
	e.graph().nestingRoot = t, x(e.edges(), function(t) {
		e.edge(t).minlen *= i;
	});
	var a = cn(e) + 1;
	x(e.children(), function(o) {
		on(e, t, i, a, r, n, o);
	}), e.graph().nodeRankFactor = i;
}
function on(e, t, n, r, i, a, o) {
	var s = e.children(o);
	if (!s.length) {
		o !== t && e.setEdge(t, o, {
			weight: 0,
			minlen: n
		});
		return;
	}
	var c = xt(e, "_bt"), l = xt(e, "_bb"), u = e.node(o);
	e.setParent(c, o), u.borderTop = c, e.setParent(l, o), u.borderBottom = l, x(s, function(s) {
		on(e, t, n, r, i, a, s);
		var u = e.node(s), d = u.borderTop ? u.borderTop : s, f = u.borderBottom ? u.borderBottom : s, p = u.borderTop ? r : 2 * r, m = d === f ? i - a[o] + 1 : 1;
		e.setEdge(c, d, {
			weight: p,
			minlen: m,
			nestingEdge: !0
		}), e.setEdge(f, l, {
			weight: p,
			minlen: m,
			nestingEdge: !0
		});
	}), e.parent(o) || e.setEdge(t, c, {
		weight: 0,
		minlen: i + a[o]
	});
}
function sn(e) {
	var t = {};
	function n(r, i) {
		var a = e.children(r);
		a && a.length && x(a, function(e) {
			n(e, i + 1);
		}), t[r] = i;
	}
	return x(e.children(), function(e) {
		n(e, 1);
	}), t;
}
function cn(e) {
	return y(e.edges(), function(t, n) {
		return t + e.edge(n).weight;
	}, 0);
}
function ln(e) {
	var t = e.graph();
	e.removeNode(t.nestingRoot), delete t.nestingRoot, x(e.edges(), function(t) {
		e.edge(t).nestingEdge && e.removeEdge(t);
	});
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.js
function un(e, t, n) {
	var r = {}, i;
	x(n, function(n) {
		for (var a = e.parent(n), o, s; a;) {
			if (o = e.parent(a), o ? (s = r[o], r[o] = a) : (s = i, i = a), s && s !== a) {
				t.setEdge(s, a);
				return;
			}
			a = o;
		}
	});
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.js
function dn(e, t, n) {
	var r = fn(e), i = new k({ compound: !0 }).setGraph({ root: r }).setDefaultNodeLabel(function(t) {
		return e.node(t);
	});
	return x(e.nodes(), function(a) {
		var o = e.node(a), s = e.parent(a);
		(o.rank === t || o.minRank <= t && t <= o.maxRank) && (i.setNode(a), i.setParent(a, s || r), x(e[n](a), function(t) {
			var n = t.v === a ? t.w : t.v, r = i.edge(n, a), o = b(r) ? 0 : r.weight;
			i.setEdge(n, a, { weight: e.edge(t).weight + o });
		}), Object.prototype.hasOwnProperty.call(o, "minRank") && i.setNode(a, {
			borderLeft: o.borderLeft[t],
			borderRight: o.borderRight[t]
		}));
	}), i;
}
function fn(e) {
	for (var t; e.hasNode(t = R("_root")););
	return t;
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/order/cross-count.js
function pn(e, t) {
	for (var n = 0, r = 1; r < t.length; ++r) n += mn(e, t[r - 1], t[r]);
	return n;
}
function mn(e, t, n) {
	for (var r = at(n, E(n, function(e, t) {
		return t;
	})), i = S(E(t, function(t) {
		return L(E(e.outEdges(t), function(t) {
			return {
				pos: r[t.w],
				weight: e.edge(t).weight
			};
		}), "pos");
	})), a = 1; a < n.length;) a <<= 1;
	var o = 2 * a - 1;
	--a;
	var s = E(Array(o), function() {
		return 0;
	}), c = 0;
	return x(i.forEach(function(e) {
		var t = e.pos + a;
		s[t] += e.weight;
		for (var n = 0; t > 0;) t % 2 && (n += s[t + 1]), t = t - 1 >> 1, s[t] += e.weight;
		c += e.weight * n;
	})), c;
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/order/init-order.js
function hn(e) {
	var t = {}, n = g(e.nodes(), function(t) {
		return !e.children(t).length;
	}), r = E(I(j(E(n, function(t) {
		return e.node(t).rank;
	})) + 1), function() {
		return [];
	});
	function i(n) {
		fe(t, n) || (t[n] = !0, r[e.node(n).rank].push(n), x(e.successors(n), i));
	}
	return x(L(n, function(t) {
		return e.node(t).rank;
	}), i), r;
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/order/barycenter.js
function gn(e, t) {
	return E(t, function(t) {
		var n = e.inEdges(t);
		if (n.length) {
			var r = y(n, function(t, n) {
				var r = e.edge(n), i = e.node(n.v);
				return {
					sum: t.sum + r.weight * i.order,
					weight: t.weight + r.weight
				};
			}, {
				sum: 0,
				weight: 0
			});
			return {
				v: t,
				barycenter: r.sum / r.weight,
				weight: r.weight
			};
		} else return { v: t };
	});
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js
function _n(e, t) {
	var n = {};
	return x(e, function(e, t) {
		var r = n[e.v] = {
			indegree: 0,
			in: [],
			out: [],
			vs: [e.v],
			i: t
		};
		b(e.barycenter) || (r.barycenter = e.barycenter, r.weight = e.weight);
	}), x(t.edges(), function(e) {
		var t = n[e.v], r = n[e.w];
		!b(t) && !b(r) && (r.indegree++, t.out.push(n[e.w]));
	}), vn(g(n, function(e) {
		return !e.indegree;
	}));
}
function vn(e) {
	var t = [];
	function n(e) {
		return function(t) {
			t.merged || (b(t.barycenter) || b(e.barycenter) || t.barycenter >= e.barycenter) && yn(e, t);
		};
	}
	function r(t) {
		return function(n) {
			n.in.push(t), --n.indegree === 0 && e.push(n);
		};
	}
	for (; e.length;) {
		var i = e.pop();
		t.push(i), x(i.in.reverse(), n(i)), x(i.out, r(i));
	}
	return E(g(t, function(e) {
		return !e.merged;
	}), function(e) {
		return F(e, [
			"vs",
			"i",
			"barycenter",
			"weight"
		]);
	});
}
function yn(e, t) {
	var n = 0, r = 0;
	e.weight && (n += e.barycenter * e.weight, r += e.weight), t.weight && (n += t.barycenter * t.weight, r += t.weight), e.vs = t.vs.concat(e.vs), e.barycenter = n / r, e.weight = r, e.i = Math.min(t.i, e.i), t.merged = !0;
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/order/sort.js
function bn(e, t) {
	var n = Ct(e, function(e) {
		return Object.prototype.hasOwnProperty.call(e, "barycenter");
	}), r = n.lhs, i = L(n.rhs, function(e) {
		return -e.i;
	}), a = [], o = 0, s = 0, c = 0;
	r.sort(Sn(!!t)), c = xn(a, i, c), x(r, function(e) {
		c += e.vs.length, a.push(e.vs), o += e.barycenter * e.weight, s += e.weight, c = xn(a, i, c);
	});
	var l = { vs: S(a) };
	return s && (l.barycenter = o / s, l.weight = s), l;
}
function xn(e, t, n) {
	for (var r; t.length && (r = D(t)).i <= n;) t.pop(), e.push(r.vs), n++;
	return n;
}
function Sn(e) {
	return function(t, n) {
		return t.barycenter < n.barycenter ? -1 : t.barycenter > n.barycenter ? 1 : e ? n.i - t.i : t.i - n.i;
	};
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js
function Cn(e, t, n, r) {
	var i = e.children(t), a = e.node(t), o = a ? a.borderLeft : void 0, s = a ? a.borderRight : void 0, c = {};
	o && (i = g(i, function(e) {
		return e !== o && e !== s;
	}));
	var l = gn(e, i);
	x(l, function(t) {
		if (e.children(t.v).length) {
			var i = Cn(e, t.v, n, r);
			c[t.v] = i, Object.prototype.hasOwnProperty.call(i, "barycenter") && Tn(t, i);
		}
	});
	var u = _n(l, n);
	wn(u, c);
	var d = bn(u, r);
	if (o && (d.vs = S([
		o,
		d.vs,
		s
	]), e.predecessors(o).length)) {
		var f = e.node(e.predecessors(o)[0]), p = e.node(e.predecessors(s)[0]);
		Object.prototype.hasOwnProperty.call(d, "barycenter") || (d.barycenter = 0, d.weight = 0), d.barycenter = (d.barycenter * d.weight + f.order + p.order) / (d.weight + 2), d.weight += 2;
	}
	return d;
}
function wn(e, t) {
	x(e, function(e) {
		e.vs = S(e.vs.map(function(e) {
			return t[e] ? t[e].vs : e;
		}));
	});
}
function Tn(e, t) {
	b(e.barycenter) ? (e.barycenter = t.barycenter, e.weight = t.weight) : (e.barycenter = (e.barycenter * e.weight + t.barycenter * t.weight) / (e.weight + t.weight), e.weight += t.weight);
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/order/index.js
function En(e) {
	var t = St(e), n = Dn(e, I(1, t + 1), "inEdges"), r = Dn(e, I(t - 1, -1, -1), "outEdges"), i = hn(e);
	kn(e, i);
	for (var a = Infinity, o, s = 0, c = 0; c < 4; ++s, ++c) {
		On(s % 2 ? n : r, s % 4 >= 2), i = H(e);
		var l = pn(e, i);
		l < a && (c = 0, o = Se(i), a = l);
	}
	kn(e, o);
}
function Dn(e, t, n) {
	return E(t, function(t) {
		return dn(e, t, n);
	});
}
function On(e, t) {
	var n = new k();
	x(e, function(e) {
		var r = e.graph().root, i = Cn(e, r, n, t);
		x(i.vs, function(t, n) {
			e.node(t).order = n;
		}), un(e, n, i.vs);
	});
}
function kn(e, t) {
	x(t, function(t) {
		x(t, function(t, n) {
			e.node(t).order = n;
		});
	});
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.js
function An(e) {
	var t = Mn(e);
	x(e.graph().dummyChains, function(n) {
		for (var r = e.node(n), i = r.edgeObj, a = jn(e, t, i.v, i.w), o = a.path, s = a.lca, c = 0, l = o[c], u = !0; n !== i.w;) {
			if (r = e.node(n), u) {
				for (; (l = o[c]) !== s && e.node(l).maxRank < r.rank;) c++;
				l === s && (u = !1);
			}
			if (!u) {
				for (; c < o.length - 1 && e.node(l = o[c + 1]).minRank <= r.rank;) c++;
				l = o[c];
			}
			e.setParent(n, l), n = e.successors(n)[0];
		}
	});
}
function jn(e, t, n, r) {
	var i = [], a = [], o = Math.min(t[n].low, t[r].low), s = Math.max(t[n].lim, t[r].lim), c = n, l;
	do
		c = e.parent(c), i.push(c);
	while (c && (t[c].low > o || s > t[c].lim));
	for (l = c, c = r; (c = e.parent(c)) !== l;) a.push(c);
	return {
		path: i.concat(a.reverse()),
		lca: l
	};
}
function Mn(e) {
	var t = {}, n = 0;
	function r(i) {
		var a = n;
		x(e.children(i), r), t[i] = {
			low: a,
			lim: n++
		};
	}
	return x(e.children(), r), t;
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/position/bk.js
function Nn(e, t) {
	var n = {};
	function r(t, r) {
		var i = 0, a = 0, o = t.length, s = D(r);
		return x(r, function(t, c) {
			var l = Fn(e, t), u = l ? e.node(l).order : o;
			(l || t === s) && (x(r.slice(a, c + 1), function(t) {
				x(e.predecessors(t), function(r) {
					var a = e.node(r), o = a.order;
					(o < i || u < o) && !(a.dummy && e.node(t).dummy) && In(n, r, t);
				});
			}), a = c + 1, i = u);
		}), r;
	}
	return y(t, r), n;
}
function Pn(e, t) {
	var n = {};
	function r(t, r, i, a, o) {
		var s;
		x(I(r, i), function(r) {
			s = t[r], e.node(s).dummy && x(e.predecessors(s), function(t) {
				var r = e.node(t);
				r.dummy && (r.order < a || r.order > o) && In(n, t, s);
			});
		});
	}
	function i(t, n) {
		var i = -1, a, o = 0;
		return x(n, function(s, c) {
			if (e.node(s).dummy === "border") {
				var l = e.predecessors(s);
				l.length && (a = e.node(l[0]).order, r(n, o, c, i, a), o = c, i = a);
			}
			r(n, o, n.length, a, t.length);
		}), n;
	}
	return y(t, i), n;
}
function Fn(e, t) {
	if (e.node(t).dummy) return C(e.predecessors(t), function(t) {
		return e.node(t).dummy;
	});
}
function In(e, t, n) {
	if (t > n) {
		var r = t;
		t = n, n = r;
	}
	Object.prototype.hasOwnProperty.call(e, t) || Object.defineProperty(e, t, {
		enumerable: !0,
		configurable: !0,
		value: {},
		writable: !0
	});
	var i = e[t];
	Object.defineProperty(i, n, {
		enumerable: !0,
		configurable: !0,
		value: !0,
		writable: !0
	});
}
function Ln(e, t, n) {
	if (t > n) {
		var r = t;
		t = n, n = r;
	}
	return !!e[t] && Object.prototype.hasOwnProperty.call(e[t], n);
}
function Rn(e, t, n, r) {
	var i = {}, a = {}, o = {};
	return x(t, function(e) {
		x(e, function(e, t) {
			i[e] = e, a[e] = e, o[e] = t;
		});
	}), x(t, function(e) {
		var t = -1;
		x(e, function(e) {
			var s = r(e);
			if (s.length) {
				s = L(s, function(e) {
					return o[e];
				});
				for (var c = (s.length - 1) / 2, l = Math.floor(c), u = Math.ceil(c); l <= u; ++l) {
					var d = s[l];
					a[e] === e && t < o[d] && !Ln(n, e, d) && (a[d] = e, a[e] = i[e] = i[d], t = o[d]);
				}
			}
		});
	}), {
		root: i,
		align: a
	};
}
function zn(e, t, n, r, i) {
	var a = {}, o = Bn(e, t, n, i), s = i ? "borderLeft" : "borderRight";
	function c(e, t) {
		for (var n = o.nodes(), r = n.pop(), i = {}; r;) i[r] ? e(r) : (i[r] = !0, n.push(r), n = n.concat(t(r))), r = n.pop();
	}
	function l(e) {
		a[e] = o.inEdges(e).reduce(function(e, t) {
			return Math.max(e, a[t.v] + o.edge(t));
		}, 0);
	}
	function u(t) {
		var n = o.outEdges(t).reduce(function(e, t) {
			return Math.min(e, a[t.w] - o.edge(t));
		}, Infinity), r = e.node(t);
		n !== Infinity && r.borderType !== s && (a[t] = Math.max(a[t], n));
	}
	return c(l, o.predecessors.bind(o)), c(u, o.successors.bind(o)), x(r, function(e) {
		a[e] = a[n[e]];
	}), a;
}
function Bn(e, t, n, r) {
	var i = new k(), a = e.graph(), o = Gn(a.nodesep, a.edgesep, r);
	return x(t, function(t) {
		var r;
		x(t, function(t) {
			var a = n[t];
			if (i.setNode(a), r) {
				var s = n[r], c = i.edge(s, a);
				i.setEdge(s, a, Math.max(o(e, t, r), c || 0));
			}
			r = t;
		});
	}), i;
}
function Vn(e, t) {
	return M(v(t), function(t) {
		var n = -Infinity, r = Infinity;
		return we(t, function(t, i) {
			var a = Kn(e, i) / 2;
			n = Math.max(t + a, n), r = Math.min(t - a, r);
		}), n - r;
	});
}
function Hn(e, t) {
	var n = v(t), r = T(n), i = j(n);
	x(["u", "d"], function(n) {
		x(["l", "r"], function(a) {
			var o = n + a, s = e[o], c;
			if (s !== t) {
				var l = v(s);
				c = a === "l" ? r - T(l) : i - j(l), c && (e[o] = A(s, function(e) {
					return e + c;
				}));
			}
		});
	});
}
function Un(e, t) {
	return A(e.ul, function(n, r) {
		if (t) return e[t.toLowerCase()][r];
		var i = L(E(e, r));
		return (i[1] + i[2]) / 2;
	});
}
function Wn(e) {
	var t = H(e), n = O(Nn(e, t), Pn(e, t)), r = {}, i;
	return x(["u", "d"], function(a) {
		i = a === "u" ? t : v(t).reverse(), x(["l", "r"], function(t) {
			t === "r" && (i = E(i, function(e) {
				return v(e).reverse();
			}));
			var o = (a === "u" ? e.predecessors : e.successors).bind(e), s = Rn(e, i, n, o), c = zn(e, i, s.root, s.align, t === "r");
			t === "r" && (c = A(c, function(e) {
				return -e;
			})), r[a + t] = c;
		});
	}), Hn(r, Vn(e, r)), Un(r, e.graph().align);
}
function Gn(e, t, n) {
	return function(r, i, a) {
		var o = r.node(i), s = r.node(a), c = 0, l;
		if (c += o.width / 2, Object.prototype.hasOwnProperty.call(o, "labelpos")) switch (o.labelpos.toLowerCase()) {
			case "l":
				l = -o.width / 2;
				break;
			case "r":
				l = o.width / 2;
				break;
		}
		if (l && (c += n ? l : -l), l = 0, c += (o.dummy ? t : e) / 2, c += (s.dummy ? t : e) / 2, c += s.width / 2, Object.prototype.hasOwnProperty.call(s, "labelpos")) switch (s.labelpos.toLowerCase()) {
			case "l":
				l = s.width / 2;
				break;
			case "r":
				l = -s.width / 2;
				break;
		}
		return l && (c += n ? l : -l), l = 0, c;
	};
}
function Kn(e, t) {
	return e.node(t).width;
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/position/index.js
function qn(e) {
	e = _t(e), Jn(e), Te(Wn(e), function(t, n) {
		e.node(n).x = t;
	});
}
function Jn(e) {
	var t = H(e), n = e.graph().ranksep, r = 0;
	x(t, function(t) {
		var i = j(E(t, function(t) {
			return e.node(t).height;
		}));
		x(t, function(t) {
			e.node(t).y = r + i / 2;
		}), r += i + n;
	});
}
//#endregion
//#region node_modules/dagre-d3-es/src/dagre/layout.js
function Yn(e, t) {
	var n = t && t.debugTiming ? wt : Tt;
	n("layout", () => {
		var t = n("  buildLayoutGraph", () => or(e));
		n("  runLayout", () => Xn(t, n)), n("  updateInputGraph", () => Zn(e, t));
	});
}
function Xn(e, t) {
	t("    makeSpaceForEdgeLabels", () => sr(e)), t("    removeSelfEdges", () => gr(e)), t("    acyclic", () => pt(e)), t("    nestingGraph.run", () => an(e)), t("    rank", () => en(_t(e))), t("    injectEdgeLabelProxies", () => cr(e)), t("    removeEmptyRanks", () => bt(e)), t("    nestingGraph.cleanup", () => ln(e)), t("    normalizeRanks", () => yt(e)), t("    assignRankMinMax", () => lr(e)), t("    removeEdgeLabelProxies", () => ur(e)), t("    normalize.run", () => Nt(e)), t("    parentDummyChains", () => An(e)), t("    addBorderSegments", () => Et(e)), t("    order", () => En(e)), t("    insertSelfEdges", () => _r(e)), t("    adjustCoordinateSystem", () => Ot(e)), t("    position", () => qn(e)), t("    positionSelfEdges", () => vr(e)), t("    removeBorderNodes", () => hr(e)), t("    normalize.undo", () => Ft(e)), t("    fixupEdgeLabelCoords", () => pr(e)), t("    undoCoordinateSystem", () => kt(e)), t("    translateGraph", () => dr(e)), t("    assignNodeIntersects", () => fr(e)), t("    reversePoints", () => mr(e)), t("    acyclic.undo", () => ht(e));
}
function Zn(e, t) {
	x(e.nodes(), function(n) {
		var r = e.node(n), i = t.node(n);
		r && (r.x = i.x, r.y = i.y, t.children(n).length && (r.width = i.width, r.height = i.height));
	}), x(e.edges(), function(n) {
		var r = e.edge(n), i = t.edge(n);
		r.points = i.points, Object.prototype.hasOwnProperty.call(i, "x") && (r.x = i.x, r.y = i.y);
	}), e.graph().width = t.graph().width, e.graph().height = t.graph().height;
}
var Qn = [
	"nodesep",
	"edgesep",
	"ranksep",
	"marginx",
	"marginy"
], $n = {
	ranksep: 50,
	edgesep: 20,
	nodesep: 50,
	rankdir: "tb"
}, er = [
	"acyclicer",
	"ranker",
	"rankdir",
	"align"
], tr = ["width", "height"], nr = {
	width: 0,
	height: 0
}, rr = [
	"minlen",
	"weight",
	"width",
	"height",
	"labeloffset"
], ir = {
	minlen: 1,
	weight: 1,
	width: 0,
	height: 0,
	labeloffset: 10,
	labelpos: "r"
}, ar = ["labelpos"];
function or(e) {
	var t = new k({
		multigraph: !0,
		compound: !0
	}), n = $(e.graph());
	return t.setGraph(O({}, $n, Q(n, Qn), F(n, er))), x(e.nodes(), function(n) {
		var r = $(e.node(n));
		t.setNode(n, ue(Q(r, tr), nr)), t.setParent(n, e.parent(n));
	}), x(e.edges(), function(n) {
		var r = $(e.edge(n));
		t.setEdge(n, O({}, ir, Q(r, rr), F(r, ar)));
	}), t;
}
function sr(e) {
	var t = e.graph();
	t.ranksep /= 2, x(e.edges(), function(n) {
		var r = e.edge(n);
		r.minlen *= 2, r.labelpos.toLowerCase() !== "c" && (t.rankdir === "TB" || t.rankdir === "BT" ? r.width += r.labeloffset : r.height += r.labeloffset);
	});
}
function cr(e) {
	x(e.edges(), function(t) {
		var n = e.edge(t);
		if (n.width && n.height) {
			var r = e.node(t.v);
			V(e, "edge-proxy", {
				rank: (e.node(t.w).rank - r.rank) / 2 + r.rank,
				e: t
			}, "_ep");
		}
	});
}
function lr(e) {
	var t = 0;
	x(e.nodes(), function(n) {
		var r = e.node(n);
		r.borderTop && (r.minRank = e.node(r.borderTop).rank, r.maxRank = e.node(r.borderBottom).rank, t = j(t, r.maxRank));
	}), e.graph().maxRank = t;
}
function ur(e) {
	x(e.nodes(), function(t) {
		var n = e.node(t);
		n.dummy === "edge-proxy" && (e.edge(n.e).labelRank = n.rank, e.removeNode(t));
	});
}
function dr(e) {
	var t = Infinity, n = 0, r = Infinity, i = 0, a = e.graph(), o = a.marginx || 0, s = a.marginy || 0;
	function c(e) {
		var a = e.x, o = e.y, s = e.width, c = e.height;
		t = Math.min(t, a - s / 2), n = Math.max(n, a + s / 2), r = Math.min(r, o - c / 2), i = Math.max(i, o + c / 2);
	}
	x(e.nodes(), function(t) {
		c(e.node(t));
	}), x(e.edges(), function(t) {
		var n = e.edge(t);
		Object.prototype.hasOwnProperty.call(n, "x") && c(n);
	}), t -= o, r -= s, x(e.nodes(), function(n) {
		var i = e.node(n);
		i.x -= t, i.y -= r;
	}), x(e.edges(), function(n) {
		var i = e.edge(n);
		x(i.points, function(e) {
			e.x -= t, e.y -= r;
		}), Object.prototype.hasOwnProperty.call(i, "x") && (i.x -= t), Object.prototype.hasOwnProperty.call(i, "y") && (i.y -= r);
	}), a.width = n - t + o, a.height = i - r + s;
}
function fr(e) {
	x(e.edges(), function(t) {
		var n = e.edge(t), r = e.node(t.v), i = e.node(t.w), a, o;
		n.points ? (a = n.points[0], o = n.points[n.points.length - 1]) : (n.points = [], a = i, o = r), n.points.unshift(vt(r, a)), n.points.push(vt(i, o));
	});
}
function pr(e) {
	x(e.edges(), function(t) {
		var n = e.edge(t);
		if (Object.prototype.hasOwnProperty.call(n, "x")) switch ((n.labelpos === "l" || n.labelpos === "r") && (n.width -= n.labeloffset), n.labelpos) {
			case "l":
				n.x -= n.width / 2 + n.labeloffset;
				break;
			case "r":
				n.x += n.width / 2 + n.labeloffset;
				break;
		}
	});
}
function mr(e) {
	x(e.edges(), function(t) {
		var n = e.edge(t);
		n.reversed && n.points.reverse();
	});
}
function hr(e) {
	x(e.nodes(), function(t) {
		if (e.children(t).length) {
			var n = e.node(t), r = e.node(n.borderTop), i = e.node(n.borderBottom), a = e.node(D(n.borderLeft)), o = e.node(D(n.borderRight));
			n.width = Math.abs(o.x - a.x), n.height = Math.abs(i.y - r.y), n.x = a.x + n.width / 2, n.y = r.y + n.height / 2;
		}
	}), x(e.nodes(), function(t) {
		e.node(t).dummy === "border" && e.removeNode(t);
	});
}
function gr(e) {
	x(e.edges(), function(t) {
		if (t.v === t.w) {
			var n = e.node(t.v);
			n.selfEdges ||= [], n.selfEdges.push({
				e: t,
				label: e.edge(t)
			}), e.removeEdge(t);
		}
	});
}
function _r(e) {
	x(H(e), function(t) {
		var n = 0;
		x(t, function(t, r) {
			var i = e.node(t);
			i.order = r + n, x(i.selfEdges, function(t) {
				V(e, "selfedge", {
					width: t.label.width,
					height: t.label.height,
					rank: i.rank,
					order: r + ++n,
					e: t.e,
					label: t.label
				}, "_se");
			}), delete i.selfEdges;
		});
	});
}
function vr(e) {
	x(e.nodes(), function(t) {
		var n = e.node(t);
		if (n.dummy === "selfedge") {
			var r = e.node(n.e.v), i = r.x + r.width / 2, a = r.y, o = n.x - i, s = r.height / 2;
			e.setEdge(n.e, n.label), e.removeNode(t), n.label.points = [
				{
					x: i + 2 * o / 3,
					y: a - s
				},
				{
					x: i + 5 * o / 6,
					y: a - s
				},
				{
					x: i + o,
					y: a
				},
				{
					x: i + 5 * o / 6,
					y: a + s
				},
				{
					x: i + 2 * o / 3,
					y: a + s
				}
			], n.label.x = n.x, n.label.y = n.y;
		}
	});
}
function Q(e, t) {
	return A(F(e, t), Number);
}
function $(e) {
	var t = {};
	return x(e, function(e, n) {
		t[n.toLowerCase()] = e;
	}), t;
}
//#endregion
export { Yn as t };

//# sourceMappingURL=dagre-Bm7BZZKB.js.map