import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.js";
import { require_layout_base as t } from "../layout-base/layout-base.js";
//#region ../../node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.js
var n = /* @__PURE__ */ e(((e, n) => {
	(function(r, i) {
		typeof e == "object" && typeof n == "object" ? n.exports = i(t()) : typeof define == "function" && define.amd ? define(["layout-base"], i) : typeof e == "object" ? e.coseBase = i(t()) : r.coseBase = i(r.layoutBase);
	})(e, function(e) {
		return (() => {
			var t = {
				45: ((e, t, n) => {
					var r = {};
					r.layoutBase = n(551), r.CoSEConstants = n(806), r.CoSEEdge = n(767), r.CoSEGraph = n(880), r.CoSEGraphManager = n(578), r.CoSELayout = n(765), r.CoSENode = n(991), r.ConstraintHandler = n(902), e.exports = r;
				}),
				806: ((e, t, n) => {
					var r = n(551).FDLayoutConstants;
					function i() {}
					for (var a in r) i[a] = r[a];
					i.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, i.DEFAULT_RADIAL_SEPARATION = r.DEFAULT_EDGE_LENGTH, i.DEFAULT_COMPONENT_SEPERATION = 60, i.TILE = !0, i.TILING_PADDING_VERTICAL = 10, i.TILING_PADDING_HORIZONTAL = 10, i.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, i.ENFORCE_CONSTRAINTS = !0, i.APPLY_LAYOUT = !0, i.RELAX_MOVEMENT_ON_CONSTRAINTS = !0, i.TREE_REDUCTION_ON_INCREMENTAL = !0, i.PURE_INCREMENTAL = i.DEFAULT_INCREMENTAL, e.exports = i;
				}),
				767: ((e, t, n) => {
					var r = n(551).FDLayoutEdge;
					function i(e, t, n) {
						r.call(this, e, t, n);
					}
					for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
					e.exports = i;
				}),
				880: ((e, t, n) => {
					var r = n(551).LGraph;
					function i(e, t, n) {
						r.call(this, e, t, n);
					}
					for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
					e.exports = i;
				}),
				578: ((e, t, n) => {
					var r = n(551).LGraphManager;
					function i(e) {
						r.call(this, e);
					}
					for (var a in i.prototype = Object.create(r.prototype), r) i[a] = r[a];
					e.exports = i;
				}),
				765: ((e, t, n) => {
					var r = n(551).FDLayout, i = n(578), a = n(880), o = n(991), s = n(767), c = n(806), l = n(902), u = n(551).FDLayoutConstants, d = n(551).LayoutConstants, f = n(551).Point, p = n(551).PointD, m = n(551).DimensionD, h = n(551).Layout, g = n(551).Integer, _ = n(551).IGeometry, v = n(551).LGraph, y = n(551).Transform, b = n(551).LinkedList;
					function x() {
						r.call(this), this.toBeTiled = {}, this.constraints = {};
					}
					for (var S in x.prototype = Object.create(r.prototype), r) x[S] = r[S];
					x.prototype.newGraphManager = function() {
						var e = new i(this);
						return this.graphManager = e, e;
					}, x.prototype.newGraph = function(e) {
						return new a(null, this.graphManager, e);
					}, x.prototype.newNode = function(e) {
						return new o(this.graphManager, e);
					}, x.prototype.newEdge = function(e) {
						return new s(null, null, e);
					}, x.prototype.initParameters = function() {
						r.prototype.initParameters.call(this, arguments), this.isSubLayout || (c.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = c.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = u.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = u.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = u.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1);
					}, x.prototype.initSpringEmbedder = function() {
						r.prototype.initSpringEmbedder.call(this), this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / u.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = .04, this.coolingAdjuster = 1;
					}, x.prototype.layout = function() {
						return d.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
					}, x.prototype.classicLayout = function() {
						if (this.nodesWithGravity = this.calculateNodesToApplyGravitationTo(), this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity), this.calcNoOfChildrenForAllNodes(), this.graphManager.calcLowestCommonAncestors(), this.graphManager.calcInclusionTreeDepths(), this.graphManager.getRoot().calcEstimatedSize(), this.calcIdealEdgeLengths(), !this.incremental) {
							var e = this.getFlatForest();
							if (e.length > 0) this.positionNodesRadially(e);
							else {
								this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
								var t = new Set(this.getAllNodes()), n = this.nodesWithGravity.filter(function(e) {
									return t.has(e);
								});
								this.graphManager.setAllNodesToApplyGravitation(n), this.positionNodesRandomly();
							}
						} else if (c.TREE_REDUCTION_ON_INCREMENTAL) {
							this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
							var t = new Set(this.getAllNodes()), n = this.nodesWithGravity.filter(function(e) {
								return t.has(e);
							});
							this.graphManager.setAllNodesToApplyGravitation(n);
						}
						return Object.keys(this.constraints).length > 0 && (l.handleConstraints(this), this.initConstraintVariables()), this.initSpringEmbedder(), c.APPLY_LAYOUT && this.runSpringEmbedder(), !0;
					}, x.prototype.tick = function() {
						if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
						else return !0;
						if (this.totalIterations % u.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
							if (this.isConverged()) if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
							else return !0;
							this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - this.coolingCycle ** +(Math.log(100 * (this.initialCoolingFactor - this.finalTemperature)) / Math.log(this.maxCoolingCycle)) / 100 * this.coolingAdjuster, this.finalTemperature), this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));
						}
						if (this.isTreeGrowing) {
							if (this.growTreeIterations % 10 == 0) if (this.prunedNodesAll.length > 0) {
								this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
								var e = new Set(this.getAllNodes()), t = this.nodesWithGravity.filter(function(t) {
									return e.has(t);
								});
								this.graphManager.setAllNodesToApplyGravitation(t), this.graphManager.updateBounds(), this.updateGrid(), c.PURE_INCREMENTAL ? this.coolingFactor = u.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 : this.coolingFactor = u.DEFAULT_COOLING_FACTOR_INCREMENTAL;
							} else this.isTreeGrowing = !1, this.isGrowthFinished = !0;
							this.growTreeIterations++;
						}
						if (this.isGrowthFinished) {
							if (this.isConverged()) return !0;
							this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), c.PURE_INCREMENTAL ? this.coolingFactor = u.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100) : this.coolingFactor = u.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
						}
						var n = !this.isTreeGrowing && !this.isGrowthFinished, r = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
						return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(n, r), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
					}, x.prototype.getPositionsData = function() {
						for (var e = this.graphManager.getAllNodes(), t = {}, n = 0; n < e.length; n++) {
							var r = e[n].rect, i = e[n].id;
							t[i] = {
								id: i,
								x: r.getCenterX(),
								y: r.getCenterY(),
								w: r.width,
								h: r.height
							};
						}
						return t;
					}, x.prototype.runSpringEmbedder = function() {
						this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
						var e = !1;
						if (u.ANIMATE === "during") this.emit("layoutstarted");
						else {
							for (; !e;) e = this.tick();
							this.graphManager.updateBounds();
						}
					}, x.prototype.moveNodes = function() {
						for (var e = this.getAllNodes(), t, n = 0; n < e.length; n++) t = e[n], t.calculateDisplacement();
						Object.keys(this.constraints).length > 0 && this.updateDisplacements();
						for (var n = 0; n < e.length; n++) t = e[n], t.move();
					}, x.prototype.initConstraintVariables = function() {
						var e = this;
						this.idToNodeMap = /* @__PURE__ */ new Map(), this.fixedNodeSet = /* @__PURE__ */ new Set();
						for (var t = this.graphManager.getAllNodes(), n = 0; n < t.length; n++) {
							var r = t[n];
							this.idToNodeMap.set(r.id, r);
						}
						var i = function t(n) {
							for (var r = n.getChild().getNodes(), i, a = 0, o = 0; o < r.length; o++) i = r[o], i.getChild() == null ? e.fixedNodeSet.has(i.id) && (a += 100) : a += t(i);
							return a;
						};
						if (this.constraints.fixedNodeConstraint) {
							this.constraints.fixedNodeConstraint.forEach(function(t) {
								e.fixedNodeSet.add(t.nodeId);
							});
							for (var t = this.graphManager.getAllNodes(), r, n = 0; n < t.length; n++) if (r = t[n], r.getChild() != null) {
								var a = i(r);
								a > 0 && (r.fixedNodeWeight = a);
							}
						}
						if (this.constraints.relativePlacementConstraint) {
							var o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
							if (this.dummyToNodeForVerticalAlignment = /* @__PURE__ */ new Map(), this.dummyToNodeForHorizontalAlignment = /* @__PURE__ */ new Map(), this.fixedNodesOnHorizontal = /* @__PURE__ */ new Set(), this.fixedNodesOnVertical = /* @__PURE__ */ new Set(), this.fixedNodeSet.forEach(function(t) {
								e.fixedNodesOnHorizontal.add(t), e.fixedNodesOnVertical.add(t);
							}), this.constraints.alignmentConstraint) {
								if (this.constraints.alignmentConstraint.vertical) for (var l = this.constraints.alignmentConstraint.vertical, n = 0; n < l.length; n++) this.dummyToNodeForVerticalAlignment.set("dummy" + n, []), l[n].forEach(function(t) {
									o.set(t, "dummy" + n), e.dummyToNodeForVerticalAlignment.get("dummy" + n).push(t), e.fixedNodeSet.has(t) && e.fixedNodesOnHorizontal.add("dummy" + n);
								});
								if (this.constraints.alignmentConstraint.horizontal) for (var u = this.constraints.alignmentConstraint.horizontal, n = 0; n < u.length; n++) this.dummyToNodeForHorizontalAlignment.set("dummy" + n, []), u[n].forEach(function(t) {
									s.set(t, "dummy" + n), e.dummyToNodeForHorizontalAlignment.get("dummy" + n).push(t), e.fixedNodeSet.has(t) && e.fixedNodesOnVertical.add("dummy" + n);
								});
							}
							if (c.RELAX_MOVEMENT_ON_CONSTRAINTS) this.shuffle = function(e) {
								var t, n, r;
								for (r = e.length - 1; r >= 2 * e.length / 3; r--) t = Math.floor(Math.random() * (r + 1)), n = e[r], e[r] = e[t], e[t] = n;
								return e;
							}, this.nodesInRelativeHorizontal = [], this.nodesInRelativeVertical = [], this.nodeToRelativeConstraintMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToRelativeConstraintMapVertical = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapHorizontal = /* @__PURE__ */ new Map(), this.nodeToTempPositionMapVertical = /* @__PURE__ */ new Map(), this.constraints.relativePlacementConstraint.forEach(function(t) {
								if (t.left) {
									var n = o.has(t.left) ? o.get(t.left) : t.left, r = o.has(t.right) ? o.get(t.right) : t.right;
									e.nodesInRelativeHorizontal.includes(n) || (e.nodesInRelativeHorizontal.push(n), e.nodeToRelativeConstraintMapHorizontal.set(n, []), e.dummyToNodeForVerticalAlignment.has(n) ? e.nodeToTempPositionMapHorizontal.set(n, e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()) : e.nodeToTempPositionMapHorizontal.set(n, e.idToNodeMap.get(n).getCenterX())), e.nodesInRelativeHorizontal.includes(r) || (e.nodesInRelativeHorizontal.push(r), e.nodeToRelativeConstraintMapHorizontal.set(r, []), e.dummyToNodeForVerticalAlignment.has(r) ? e.nodeToTempPositionMapHorizontal.set(r, e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()) : e.nodeToTempPositionMapHorizontal.set(r, e.idToNodeMap.get(r).getCenterX())), e.nodeToRelativeConstraintMapHorizontal.get(n).push({
										right: r,
										gap: t.gap
									}), e.nodeToRelativeConstraintMapHorizontal.get(r).push({
										left: n,
										gap: t.gap
									});
								} else {
									var i = s.has(t.top) ? s.get(t.top) : t.top, a = s.has(t.bottom) ? s.get(t.bottom) : t.bottom;
									e.nodesInRelativeVertical.includes(i) || (e.nodesInRelativeVertical.push(i), e.nodeToRelativeConstraintMapVertical.set(i, []), e.dummyToNodeForHorizontalAlignment.has(i) ? e.nodeToTempPositionMapVertical.set(i, e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()) : e.nodeToTempPositionMapVertical.set(i, e.idToNodeMap.get(i).getCenterY())), e.nodesInRelativeVertical.includes(a) || (e.nodesInRelativeVertical.push(a), e.nodeToRelativeConstraintMapVertical.set(a, []), e.dummyToNodeForHorizontalAlignment.has(a) ? e.nodeToTempPositionMapVertical.set(a, e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()) : e.nodeToTempPositionMapVertical.set(a, e.idToNodeMap.get(a).getCenterY())), e.nodeToRelativeConstraintMapVertical.get(i).push({
										bottom: a,
										gap: t.gap
									}), e.nodeToRelativeConstraintMapVertical.get(a).push({
										top: i,
										gap: t.gap
									});
								}
							});
							else {
								var d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
								this.constraints.relativePlacementConstraint.forEach(function(e) {
									if (e.left) {
										var t = o.has(e.left) ? o.get(e.left) : e.left, n = o.has(e.right) ? o.get(e.right) : e.right;
										d.has(t) ? d.get(t).push(n) : d.set(t, [n]), d.has(n) ? d.get(n).push(t) : d.set(n, [t]);
									} else {
										var r = s.has(e.top) ? s.get(e.top) : e.top, i = s.has(e.bottom) ? s.get(e.bottom) : e.bottom;
										f.has(r) ? f.get(r).push(i) : f.set(r, [i]), f.has(i) ? f.get(i).push(r) : f.set(i, [r]);
									}
								});
								var p = function(e, t) {
									var n = [], r = [], i = new b(), a = /* @__PURE__ */ new Set(), o = 0;
									return e.forEach(function(s, c) {
										if (!a.has(c)) {
											n[o] = [], r[o] = !1;
											var l = c;
											for (i.push(l), a.add(l), n[o].push(l); i.length != 0;) l = i.shift(), t.has(l) && (r[o] = !0), e.get(l).forEach(function(e) {
												a.has(e) || (i.push(e), a.add(e), n[o].push(e));
											});
											o++;
										}
									}), {
										components: n,
										isFixed: r
									};
								}, m = p(d, e.fixedNodesOnHorizontal);
								this.componentsOnHorizontal = m.components, this.fixedComponentsOnHorizontal = m.isFixed;
								var h = p(f, e.fixedNodesOnVertical);
								this.componentsOnVertical = h.components, this.fixedComponentsOnVertical = h.isFixed;
							}
						}
					}, x.prototype.updateDisplacements = function() {
						var e = this;
						if (this.constraints.fixedNodeConstraint && this.constraints.fixedNodeConstraint.forEach(function(t) {
							var n = e.idToNodeMap.get(t.nodeId);
							n.displacementX = 0, n.displacementY = 0;
						}), this.constraints.alignmentConstraint) {
							if (this.constraints.alignmentConstraint.vertical) for (var t = this.constraints.alignmentConstraint.vertical, n = 0; n < t.length; n++) {
								for (var r = 0, i = 0; i < t[n].length; i++) {
									if (this.fixedNodeSet.has(t[n][i])) {
										r = 0;
										break;
									}
									r += this.idToNodeMap.get(t[n][i]).displacementX;
								}
								for (var a = r / t[n].length, i = 0; i < t[n].length; i++) this.idToNodeMap.get(t[n][i]).displacementX = a;
							}
							if (this.constraints.alignmentConstraint.horizontal) for (var o = this.constraints.alignmentConstraint.horizontal, n = 0; n < o.length; n++) {
								for (var s = 0, i = 0; i < o[n].length; i++) {
									if (this.fixedNodeSet.has(o[n][i])) {
										s = 0;
										break;
									}
									s += this.idToNodeMap.get(o[n][i]).displacementY;
								}
								for (var l = s / o[n].length, i = 0; i < o[n].length; i++) this.idToNodeMap.get(o[n][i]).displacementY = l;
							}
						}
						if (this.constraints.relativePlacementConstraint) if (c.RELAX_MOVEMENT_ON_CONSTRAINTS) this.totalIterations % 10 == 0 && (this.shuffle(this.nodesInRelativeHorizontal), this.shuffle(this.nodesInRelativeVertical)), this.nodesInRelativeHorizontal.forEach(function(t) {
							if (!e.fixedNodesOnHorizontal.has(t)) {
								var n = 0;
								n = e.dummyToNodeForVerticalAlignment.has(t) ? e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(t)[0]).displacementX : e.idToNodeMap.get(t).displacementX, e.nodeToRelativeConstraintMapHorizontal.get(t).forEach(function(r) {
									if (r.right) {
										var i = e.nodeToTempPositionMapHorizontal.get(r.right) - e.nodeToTempPositionMapHorizontal.get(t) - n;
										i < r.gap && (n -= r.gap - i);
									} else {
										var i = e.nodeToTempPositionMapHorizontal.get(t) - e.nodeToTempPositionMapHorizontal.get(r.left) + n;
										i < r.gap && (n += r.gap - i);
									}
								}), e.nodeToTempPositionMapHorizontal.set(t, e.nodeToTempPositionMapHorizontal.get(t) + n), e.dummyToNodeForVerticalAlignment.has(t) ? e.dummyToNodeForVerticalAlignment.get(t).forEach(function(t) {
									e.idToNodeMap.get(t).displacementX = n;
								}) : e.idToNodeMap.get(t).displacementX = n;
							}
						}), this.nodesInRelativeVertical.forEach(function(t) {
							if (!e.fixedNodesOnHorizontal.has(t)) {
								var n = 0;
								n = e.dummyToNodeForHorizontalAlignment.has(t) ? e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(t)[0]).displacementY : e.idToNodeMap.get(t).displacementY, e.nodeToRelativeConstraintMapVertical.get(t).forEach(function(r) {
									if (r.bottom) {
										var i = e.nodeToTempPositionMapVertical.get(r.bottom) - e.nodeToTempPositionMapVertical.get(t) - n;
										i < r.gap && (n -= r.gap - i);
									} else {
										var i = e.nodeToTempPositionMapVertical.get(t) - e.nodeToTempPositionMapVertical.get(r.top) + n;
										i < r.gap && (n += r.gap - i);
									}
								}), e.nodeToTempPositionMapVertical.set(t, e.nodeToTempPositionMapVertical.get(t) + n), e.dummyToNodeForHorizontalAlignment.has(t) ? e.dummyToNodeForHorizontalAlignment.get(t).forEach(function(t) {
									e.idToNodeMap.get(t).displacementY = n;
								}) : e.idToNodeMap.get(t).displacementY = n;
							}
						});
						else {
							for (var n = 0; n < this.componentsOnHorizontal.length; n++) {
								var u = this.componentsOnHorizontal[n];
								if (this.fixedComponentsOnHorizontal[n]) for (var i = 0; i < u.length; i++) this.dummyToNodeForVerticalAlignment.has(u[i]) ? this.dummyToNodeForVerticalAlignment.get(u[i]).forEach(function(t) {
									e.idToNodeMap.get(t).displacementX = 0;
								}) : this.idToNodeMap.get(u[i]).displacementX = 0;
								else {
									for (var d = 0, f = 0, i = 0; i < u.length; i++) if (this.dummyToNodeForVerticalAlignment.has(u[i])) {
										var p = this.dummyToNodeForVerticalAlignment.get(u[i]);
										d += p.length * this.idToNodeMap.get(p[0]).displacementX, f += p.length;
									} else d += this.idToNodeMap.get(u[i]).displacementX, f++;
									for (var m = d / f, i = 0; i < u.length; i++) this.dummyToNodeForVerticalAlignment.has(u[i]) ? this.dummyToNodeForVerticalAlignment.get(u[i]).forEach(function(t) {
										e.idToNodeMap.get(t).displacementX = m;
									}) : this.idToNodeMap.get(u[i]).displacementX = m;
								}
							}
							for (var n = 0; n < this.componentsOnVertical.length; n++) {
								var u = this.componentsOnVertical[n];
								if (this.fixedComponentsOnVertical[n]) for (var i = 0; i < u.length; i++) this.dummyToNodeForHorizontalAlignment.has(u[i]) ? this.dummyToNodeForHorizontalAlignment.get(u[i]).forEach(function(t) {
									e.idToNodeMap.get(t).displacementY = 0;
								}) : this.idToNodeMap.get(u[i]).displacementY = 0;
								else {
									for (var d = 0, f = 0, i = 0; i < u.length; i++) if (this.dummyToNodeForHorizontalAlignment.has(u[i])) {
										var p = this.dummyToNodeForHorizontalAlignment.get(u[i]);
										d += p.length * this.idToNodeMap.get(p[0]).displacementY, f += p.length;
									} else d += this.idToNodeMap.get(u[i]).displacementY, f++;
									for (var m = d / f, i = 0; i < u.length; i++) this.dummyToNodeForHorizontalAlignment.has(u[i]) ? this.dummyToNodeForHorizontalAlignment.get(u[i]).forEach(function(t) {
										e.idToNodeMap.get(t).displacementY = m;
									}) : this.idToNodeMap.get(u[i]).displacementY = m;
								}
							}
						}
					}, x.prototype.calculateNodesToApplyGravitationTo = function() {
						var e = [], t, n = this.graphManager.getGraphs(), r = n.length, i;
						for (i = 0; i < r; i++) t = n[i], t.updateConnected(), t.isConnected || (e = e.concat(t.getNodes()));
						return e;
					}, x.prototype.createBendpoints = function() {
						var e = [];
						e = e.concat(this.graphManager.getAllEdges());
						var t = /* @__PURE__ */ new Set(), n;
						for (n = 0; n < e.length; n++) {
							var r = e[n];
							if (!t.has(r)) {
								var i = r.getSource(), a = r.getTarget();
								if (i == a) r.getBendpoints().push(new p()), r.getBendpoints().push(new p()), this.createDummyNodesForBendpoints(r), t.add(r);
								else {
									var o = [];
									if (o = o.concat(i.getEdgeListToNode(a)), o = o.concat(a.getEdgeListToNode(i)), !t.has(o[0])) {
										if (o.length > 1) {
											var s;
											for (s = 0; s < o.length; s++) {
												var c = o[s];
												c.getBendpoints().push(new p()), this.createDummyNodesForBendpoints(c);
											}
										}
										o.forEach(function(e) {
											t.add(e);
										});
									}
								}
							}
							if (t.size == e.length) break;
						}
					}, x.prototype.positionNodesRadially = function(e) {
						for (var t = new f(0, 0), n = Math.ceil(Math.sqrt(e.length)), r = 0, i = 0, a = 0, o = new p(0, 0), s = 0; s < e.length; s++) {
							s % n == 0 && (a = 0, i = r, s != 0 && (i += c.DEFAULT_COMPONENT_SEPERATION), r = 0);
							var l = e[s], u = h.findCenterOfTree(l);
							t.x = a, t.y = i, o = x.radialLayout(l, u, t), o.y > r && (r = Math.floor(o.y)), a = Math.floor(o.x + c.DEFAULT_COMPONENT_SEPERATION);
						}
						this.transform(new p(d.WORLD_CENTER_X - o.x / 2, d.WORLD_CENTER_Y - o.y / 2));
					}, x.radialLayout = function(e, t, n) {
						var r = Math.max(this.maxDiagonalInTree(e), c.DEFAULT_RADIAL_SEPARATION);
						x.branchRadialLayout(t, null, 0, 359, 0, r);
						var i = v.calculateBounds(e), a = new y();
						a.setDeviceOrgX(i.getMinX()), a.setDeviceOrgY(i.getMinY()), a.setWorldOrgX(n.x), a.setWorldOrgY(n.y);
						for (var o = 0; o < e.length; o++) e[o].transform(a);
						var s = new p(i.getMaxX(), i.getMaxY());
						return a.inverseTransformPoint(s);
					}, x.branchRadialLayout = function(e, t, n, r, i, a) {
						var o = (r - n + 1) / 2;
						o < 0 && (o += 180);
						var s = (o + n) % 360 * _.TWO_PI / 360, c = i * Math.cos(s), l = i * Math.sin(s);
						e.setCenter(c, l);
						var u = [];
						u = u.concat(e.getEdges());
						var d = u.length;
						t != null && d--;
						for (var f = 0, p = u.length, m, h = e.getEdgesBetween(t); h.length > 1;) {
							var g = h[0];
							h.splice(0, 1);
							var v = u.indexOf(g);
							v >= 0 && u.splice(v, 1), p--, d--;
						}
						m = t == null ? 0 : (u.indexOf(h[0]) + 1) % p;
						for (var y = Math.abs(r - n) / d, b = m; f != d; b = ++b % p) {
							var S = u[b].getOtherEnd(e);
							if (S != t) {
								var C = (n + f * y) % 360, w = (C + y) % 360;
								x.branchRadialLayout(S, e, C, w, i + a, a), f++;
							}
						}
					}, x.maxDiagonalInTree = function(e) {
						for (var t = g.MIN_VALUE, n = 0; n < e.length; n++) {
							var r = e[n].getDiagonal();
							r > t && (t = r);
						}
						return t;
					}, x.prototype.calcRepulsionRange = function() {
						return 2 * (this.level + 1) * this.idealEdgeLength;
					}, x.prototype.groupZeroDegreeMembers = function() {
						var e = this, t = {};
						this.memberGroups = {}, this.idToDummyNode = {};
						for (var n = [], r = this.graphManager.getAllNodes(), i = 0; i < r.length; i++) {
							var a = r[i], s = a.getParent();
							this.getNodeDegreeWithChildren(a) === 0 && (s.id == null || !this.getToBeTiled(s)) && n.push(a);
						}
						for (var i = 0; i < n.length; i++) {
							var a = n[i], c = a.getParent().id;
							t[c] === void 0 && (t[c] = []), t[c] = t[c].concat(a);
						}
						Object.keys(t).forEach(function(n) {
							if (t[n].length > 1) {
								var r = "DummyCompound_" + n;
								e.memberGroups[r] = t[n];
								var i = t[n][0].getParent(), a = new o(e.graphManager);
								a.id = r, a.paddingLeft = i.paddingLeft || 0, a.paddingRight = i.paddingRight || 0, a.paddingBottom = i.paddingBottom || 0, a.paddingTop = i.paddingTop || 0, e.idToDummyNode[r] = a;
								var s = e.getGraphManager().add(e.newGraph(), a), c = i.getChild();
								c.add(a);
								for (var l = 0; l < t[n].length; l++) {
									var u = t[n][l];
									c.remove(u), s.add(u);
								}
							}
						});
					}, x.prototype.clearCompounds = function() {
						var e = {}, t = {};
						this.performDFSOnCompounds();
						for (var n = 0; n < this.compoundOrder.length; n++) t[this.compoundOrder[n].id] = this.compoundOrder[n], e[this.compoundOrder[n].id] = [].concat(this.compoundOrder[n].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[n].getChild()), this.compoundOrder[n].child = null;
						this.graphManager.resetAllNodes(), this.tileCompoundMembers(e, t);
					}, x.prototype.clearZeroDegreeMembers = function() {
						var e = this, t = this.tiledZeroDegreePack = [];
						Object.keys(this.memberGroups).forEach(function(n) {
							var r = e.idToDummyNode[n];
							if (t[n] = e.tileNodes(e.memberGroups[n], r.paddingLeft + r.paddingRight), r.rect.width = t[n].width, r.rect.height = t[n].height, r.setCenter(t[n].centerX, t[n].centerY), r.labelMarginLeft = 0, r.labelMarginTop = 0, c.NODE_DIMENSIONS_INCLUDE_LABELS) {
								var i = r.rect.width, a = r.rect.height;
								r.labelWidth && (r.labelPosHorizontal == "left" ? (r.rect.x -= r.labelWidth, r.setWidth(i + r.labelWidth), r.labelMarginLeft = r.labelWidth) : r.labelPosHorizontal == "center" && r.labelWidth > i ? (r.rect.x -= (r.labelWidth - i) / 2, r.setWidth(r.labelWidth), r.labelMarginLeft = (r.labelWidth - i) / 2) : r.labelPosHorizontal == "right" && r.setWidth(i + r.labelWidth)), r.labelHeight && (r.labelPosVertical == "top" ? (r.rect.y -= r.labelHeight, r.setHeight(a + r.labelHeight), r.labelMarginTop = r.labelHeight) : r.labelPosVertical == "center" && r.labelHeight > a ? (r.rect.y -= (r.labelHeight - a) / 2, r.setHeight(r.labelHeight), r.labelMarginTop = (r.labelHeight - a) / 2) : r.labelPosVertical == "bottom" && r.setHeight(a + r.labelHeight));
							}
						});
					}, x.prototype.repopulateCompounds = function() {
						for (var e = this.compoundOrder.length - 1; e >= 0; e--) {
							var t = this.compoundOrder[e], n = t.id, r = t.paddingLeft, i = t.paddingTop, a = t.labelMarginLeft, o = t.labelMarginTop;
							this.adjustLocations(this.tiledMemberPack[n], t.rect.x, t.rect.y, r, i, a, o);
						}
					}, x.prototype.repopulateZeroDegreeMembers = function() {
						var e = this, t = this.tiledZeroDegreePack;
						Object.keys(t).forEach(function(n) {
							var r = e.idToDummyNode[n], i = r.paddingLeft, a = r.paddingTop, o = r.labelMarginLeft, s = r.labelMarginTop;
							e.adjustLocations(t[n], r.rect.x, r.rect.y, i, a, o, s);
						});
					}, x.prototype.getToBeTiled = function(e) {
						var t = e.id;
						if (this.toBeTiled[t] != null) return this.toBeTiled[t];
						var n = e.getChild();
						if (n == null) return this.toBeTiled[t] = !1, !1;
						for (var r = n.getNodes(), i = 0; i < r.length; i++) {
							var a = r[i];
							if (this.getNodeDegree(a) > 0) return this.toBeTiled[t] = !1, !1;
							if (a.getChild() == null) {
								this.toBeTiled[a.id] = !1;
								continue;
							}
							if (!this.getToBeTiled(a)) return this.toBeTiled[t] = !1, !1;
						}
						return this.toBeTiled[t] = !0, !0;
					}, x.prototype.getNodeDegree = function(e) {
						e.id;
						for (var t = e.getEdges(), n = 0, r = 0; r < t.length; r++) {
							var i = t[r];
							i.getSource().id !== i.getTarget().id && (n += 1);
						}
						return n;
					}, x.prototype.getNodeDegreeWithChildren = function(e) {
						var t = this.getNodeDegree(e);
						if (e.getChild() == null) return t;
						for (var n = e.getChild().getNodes(), r = 0; r < n.length; r++) {
							var i = n[r];
							t += this.getNodeDegreeWithChildren(i);
						}
						return t;
					}, x.prototype.performDFSOnCompounds = function() {
						this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
					}, x.prototype.fillCompexOrderByDFS = function(e) {
						for (var t = 0; t < e.length; t++) {
							var n = e[t];
							n.getChild() != null && this.fillCompexOrderByDFS(n.getChild().getNodes()), this.getToBeTiled(n) && this.compoundOrder.push(n);
						}
					}, x.prototype.adjustLocations = function(e, t, n, r, i, a, o) {
						t += r + a, n += i + o;
						for (var s = t, c = 0; c < e.rows.length; c++) {
							var l = e.rows[c];
							t = s;
							for (var u = 0, d = 0; d < l.length; d++) {
								var f = l[d];
								f.rect.x = t, f.rect.y = n, t += f.rect.width + e.horizontalPadding, f.rect.height > u && (u = f.rect.height);
							}
							n += u + e.verticalPadding;
						}
					}, x.prototype.tileCompoundMembers = function(e, t) {
						var n = this;
						this.tiledMemberPack = [], Object.keys(e).forEach(function(r) {
							var i = t[r];
							if (n.tiledMemberPack[r] = n.tileNodes(e[r], i.paddingLeft + i.paddingRight), i.rect.width = n.tiledMemberPack[r].width, i.rect.height = n.tiledMemberPack[r].height, i.setCenter(n.tiledMemberPack[r].centerX, n.tiledMemberPack[r].centerY), i.labelMarginLeft = 0, i.labelMarginTop = 0, c.NODE_DIMENSIONS_INCLUDE_LABELS) {
								var a = i.rect.width, o = i.rect.height;
								i.labelWidth && (i.labelPosHorizontal == "left" ? (i.rect.x -= i.labelWidth, i.setWidth(a + i.labelWidth), i.labelMarginLeft = i.labelWidth) : i.labelPosHorizontal == "center" && i.labelWidth > a ? (i.rect.x -= (i.labelWidth - a) / 2, i.setWidth(i.labelWidth), i.labelMarginLeft = (i.labelWidth - a) / 2) : i.labelPosHorizontal == "right" && i.setWidth(a + i.labelWidth)), i.labelHeight && (i.labelPosVertical == "top" ? (i.rect.y -= i.labelHeight, i.setHeight(o + i.labelHeight), i.labelMarginTop = i.labelHeight) : i.labelPosVertical == "center" && i.labelHeight > o ? (i.rect.y -= (i.labelHeight - o) / 2, i.setHeight(i.labelHeight), i.labelMarginTop = (i.labelHeight - o) / 2) : i.labelPosVertical == "bottom" && i.setHeight(o + i.labelHeight));
							}
						});
					}, x.prototype.tileNodes = function(e, t) {
						var n = this.tileNodesByFavoringDim(e, t, !0), r = this.tileNodesByFavoringDim(e, t, !1), i = this.getOrgRatio(n);
						return this.getOrgRatio(r) < i ? r : n;
					}, x.prototype.getOrgRatio = function(e) {
						var t = e.width / e.height;
						return t < 1 && (t = 1 / t), t;
					}, x.prototype.calcIdealRowWidth = function(e, t) {
						var n = c.TILING_PADDING_VERTICAL, r = c.TILING_PADDING_HORIZONTAL, i = e.length, a = 0, o = 0, s = 0;
						e.forEach(function(e) {
							a += e.getWidth(), o += e.getHeight(), e.getWidth() > s && (s = e.getWidth());
						});
						var l = a / i, u = o / i, d = (n - r) ** 2 + 4 * (l + r) * (u + n) * i, f = (r - n + Math.sqrt(d)) / (2 * (l + r)), p;
						t ? (p = Math.ceil(f), p == f && p++) : p = Math.floor(f);
						var m = p * (l + r) - r;
						return s > m && (m = s), m += r * 2, m;
					}, x.prototype.tileNodesByFavoringDim = function(e, t, n) {
						var r = c.TILING_PADDING_VERTICAL, i = c.TILING_PADDING_HORIZONTAL, a = c.TILING_COMPARE_BY, o = {
							rows: [],
							rowWidth: [],
							rowHeight: [],
							width: 0,
							height: t,
							verticalPadding: r,
							horizontalPadding: i,
							centerX: 0,
							centerY: 0
						};
						a && (o.idealRowWidth = this.calcIdealRowWidth(e, n));
						var s = function(e) {
							return e.rect.width * e.rect.height;
						}, l = function(e, t) {
							return s(t) - s(e);
						};
						e.sort(function(e, t) {
							var n = l;
							return o.idealRowWidth ? (n = a, n(e.id, t.id)) : n(e, t);
						});
						for (var u = 0, d = 0, f = 0; f < e.length; f++) {
							var p = e[f];
							u += p.getCenterX(), d += p.getCenterY();
						}
						o.centerX = u / e.length, o.centerY = d / e.length;
						for (var f = 0; f < e.length; f++) {
							var p = e[f];
							if (o.rows.length == 0) this.insertNodeToRow(o, p, 0, t);
							else if (this.canAddHorizontal(o, p.rect.width, p.rect.height)) {
								var m = o.rows.length - 1;
								o.idealRowWidth || (m = this.getShortestRowIndex(o)), this.insertNodeToRow(o, p, m, t);
							} else this.insertNodeToRow(o, p, o.rows.length, t);
							this.shiftToLastRow(o);
						}
						return o;
					}, x.prototype.insertNodeToRow = function(e, t, n, r) {
						var i = r;
						n == e.rows.length && (e.rows.push([]), e.rowWidth.push(i), e.rowHeight.push(0));
						var a = e.rowWidth[n] + t.rect.width;
						e.rows[n].length > 0 && (a += e.horizontalPadding), e.rowWidth[n] = a, e.width < a && (e.width = a);
						var o = t.rect.height;
						n > 0 && (o += e.verticalPadding);
						var s = 0;
						o > e.rowHeight[n] && (s = e.rowHeight[n], e.rowHeight[n] = o, s = e.rowHeight[n] - s), e.height += s, e.rows[n].push(t);
					}, x.prototype.getShortestRowIndex = function(e) {
						for (var t = -1, n = Number.MAX_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] < n && (t = r, n = e.rowWidth[r]);
						return t;
					}, x.prototype.getLongestRowIndex = function(e) {
						for (var t = -1, n = Number.MIN_VALUE, r = 0; r < e.rows.length; r++) e.rowWidth[r] > n && (t = r, n = e.rowWidth[r]);
						return t;
					}, x.prototype.canAddHorizontal = function(e, t, n) {
						if (e.idealRowWidth) {
							var r = e.rows.length - 1;
							return e.rowWidth[r] + t + e.horizontalPadding <= e.idealRowWidth;
						}
						var i = this.getShortestRowIndex(e);
						if (i < 0) return !0;
						var a = e.rowWidth[i];
						if (a + e.horizontalPadding + t <= e.width) return !0;
						var o = 0;
						e.rowHeight[i] < n && i > 0 && (o = n + e.verticalPadding - e.rowHeight[i]);
						var s = e.width - a >= t + e.horizontalPadding ? (e.height + o) / (a + t + e.horizontalPadding) : (e.height + o) / e.width;
						o = n + e.verticalPadding;
						var c = e.width < t ? (e.height + o) / t : (e.height + o) / e.width;
						return c < 1 && (c = 1 / c), s < 1 && (s = 1 / s), s < c;
					}, x.prototype.shiftToLastRow = function(e) {
						var t = this.getLongestRowIndex(e), n = e.rowWidth.length - 1, r = e.rows[t], i = r[r.length - 1], a = i.width + e.horizontalPadding;
						if (e.width - e.rowWidth[n] > a && t != n) {
							r.splice(-1, 1), e.rows[n].push(i), e.rowWidth[t] = e.rowWidth[t] - a, e.rowWidth[n] = e.rowWidth[n] + a, e.width = e.rowWidth[instance.getLongestRowIndex(e)];
							for (var o = Number.MIN_VALUE, s = 0; s < r.length; s++) r[s].height > o && (o = r[s].height);
							t > 0 && (o += e.verticalPadding);
							var c = e.rowHeight[t] + e.rowHeight[n];
							e.rowHeight[t] = o, e.rowHeight[n] < i.height + e.verticalPadding && (e.rowHeight[n] = i.height + e.verticalPadding);
							var l = e.rowHeight[t] + e.rowHeight[n];
							e.height += l - c, this.shiftToLastRow(e);
						}
					}, x.prototype.tilingPreLayout = function() {
						c.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
					}, x.prototype.tilingPostLayout = function() {
						c.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
					}, x.prototype.reduceTrees = function() {
						for (var e = [], t = !0, n; t;) {
							var r = this.graphManager.getAllNodes(), i = [];
							t = !1;
							for (var a = 0; a < r.length; a++) if (n = r[a], n.getEdges().length == 1 && !n.getEdges()[0].isInterGraph && n.getChild() == null) {
								if (c.PURE_INCREMENTAL) {
									var o = n.getEdges()[0].getOtherEnd(n), s = new m(n.getCenterX() - o.getCenterX(), n.getCenterY() - o.getCenterY());
									i.push([
										n,
										n.getEdges()[0],
										n.getOwner(),
										s
									]);
								} else i.push([
									n,
									n.getEdges()[0],
									n.getOwner()
								]);
								t = !0;
							}
							if (t == 1) {
								for (var l = [], u = 0; u < i.length; u++) i[u][0].getEdges().length == 1 && (l.push(i[u]), i[u][0].getOwner().remove(i[u][0]));
								e.push(l), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
							}
						}
						this.prunedNodesAll = e;
					}, x.prototype.growTree = function(e) {
						for (var t = e[e.length - 1], n, r = 0; r < t.length; r++) n = t[r], this.findPlaceforPrunedNode(n), n[2].add(n[0]), n[2].add(n[1], n[1].source, n[1].target);
						e.splice(e.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
					}, x.prototype.findPlaceforPrunedNode = function(e) {
						var t, n, r = e[0];
						if (n = r == e[1].source ? e[1].target : e[1].source, c.PURE_INCREMENTAL) r.setCenter(n.getCenterX() + e[3].getWidth(), n.getCenterY() + e[3].getHeight());
						else {
							var i = n.startX, a = n.finishX, o = n.startY, s = n.finishY, l = [
								0,
								0,
								0,
								0
							];
							if (o > 0) for (var d = i; d <= a; d++) l[0] += this.grid[d][o - 1].length + this.grid[d][o].length - 1;
							if (a < this.grid.length - 1) for (var d = o; d <= s; d++) l[1] += this.grid[a + 1][d].length + this.grid[a][d].length - 1;
							if (s < this.grid[0].length - 1) for (var d = i; d <= a; d++) l[2] += this.grid[d][s + 1].length + this.grid[d][s].length - 1;
							if (i > 0) for (var d = o; d <= s; d++) l[3] += this.grid[i - 1][d].length + this.grid[i][d].length - 1;
							for (var f = g.MAX_VALUE, p, m, h = 0; h < l.length; h++) l[h] < f ? (f = l[h], p = 1, m = h) : l[h] == f && p++;
							if (p == 3 && f == 0) l[0] == 0 && l[1] == 0 && l[2] == 0 ? t = 1 : l[0] == 0 && l[1] == 0 && l[3] == 0 ? t = 0 : l[0] == 0 && l[2] == 0 && l[3] == 0 ? t = 3 : l[1] == 0 && l[2] == 0 && l[3] == 0 && (t = 2);
							else if (p == 2 && f == 0) {
								var _ = Math.floor(Math.random() * 2);
								t = l[0] == 0 && l[1] == 0 ? _ == 0 ? 0 : 1 : l[0] == 0 && l[2] == 0 ? _ == 0 ? 0 : 2 : l[0] == 0 && l[3] == 0 ? _ == 0 ? 0 : 3 : l[1] == 0 && l[2] == 0 ? _ == 0 ? 1 : 2 : l[1] == 0 && l[3] == 0 ? _ == 0 ? 1 : 3 : _ == 0 ? 2 : 3;
							} else if (p == 4 && f == 0) {
								var _ = Math.floor(Math.random() * 4);
								t = _;
							} else t = m;
							t == 0 ? r.setCenter(n.getCenterX(), n.getCenterY() - n.getHeight() / 2 - u.DEFAULT_EDGE_LENGTH - r.getHeight() / 2) : t == 1 ? r.setCenter(n.getCenterX() + n.getWidth() / 2 + u.DEFAULT_EDGE_LENGTH + r.getWidth() / 2, n.getCenterY()) : t == 2 ? r.setCenter(n.getCenterX(), n.getCenterY() + n.getHeight() / 2 + u.DEFAULT_EDGE_LENGTH + r.getHeight() / 2) : r.setCenter(n.getCenterX() - n.getWidth() / 2 - u.DEFAULT_EDGE_LENGTH - r.getWidth() / 2, n.getCenterY());
						}
					}, e.exports = x;
				}),
				991: ((e, t, n) => {
					var r = n(551).FDLayoutNode, i = n(551).IMath;
					function a(e, t, n, i) {
						r.call(this, e, t, n, i);
					}
					for (var o in a.prototype = Object.create(r.prototype), r) a[o] = r[o];
					a.prototype.calculateDisplacement = function() {
						var e = this.graphManager.getLayout();
						this.getChild() != null && this.fixedNodeWeight ? (this.displacementX += e.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight, this.displacementY += e.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight) : (this.displacementX += e.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY += e.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren), Math.abs(this.displacementX) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementX = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementX)), Math.abs(this.displacementY) > e.coolingFactor * e.maxNodeDisplacement && (this.displacementY = e.coolingFactor * e.maxNodeDisplacement * i.sign(this.displacementY)), this.child && this.child.getNodes().length > 0 && this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
					}, a.prototype.propogateDisplacementToChildren = function(e, t) {
						for (var n = this.getChild().getNodes(), r, i = 0; i < n.length; i++) r = n[i], r.getChild() == null ? (r.displacementX += e, r.displacementY += t) : r.propogateDisplacementToChildren(e, t);
					}, a.prototype.move = function() {
						var e = this.graphManager.getLayout();
						(this.child == null || this.child.getNodes().length == 0) && (this.moveBy(this.displacementX, this.displacementY), e.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY)), this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0;
					}, a.prototype.setPred1 = function(e) {
						this.pred1 = e;
					}, a.prototype.getPred1 = function() {
						return pred1;
					}, a.prototype.getPred2 = function() {
						return pred2;
					}, a.prototype.setNext = function(e) {
						this.next = e;
					}, a.prototype.getNext = function() {
						return next;
					}, a.prototype.setProcessed = function(e) {
						this.processed = e;
					}, a.prototype.isProcessed = function() {
						return processed;
					}, e.exports = a;
				}),
				902: ((e, t, n) => {
					function r(e) {
						if (Array.isArray(e)) {
							for (var t = 0, n = Array(e.length); t < e.length; t++) n[t] = e[t];
							return n;
						} else return Array.from(e);
					}
					var i = n(806), a = n(551).LinkedList, o = n(551).Matrix, s = n(551).SVD;
					function c() {}
					c.handleConstraints = function(e) {
						var t = {};
						t.fixedNodeConstraint = e.constraints.fixedNodeConstraint, t.alignmentConstraint = e.constraints.alignmentConstraint, t.relativePlacementConstraint = e.constraints.relativePlacementConstraint;
						for (var n = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = [], u = [], d = e.getAllNodes(), f = 0, p = 0; p < d.length; p++) {
							var m = d[p];
							m.getChild() ?? (c.set(m.id, f++), l.push(m.getCenterX()), u.push(m.getCenterY()), n.set(m.id, m));
						}
						t.relativePlacementConstraint && t.relativePlacementConstraint.forEach(function(e) {
							!e.gap && e.gap != 0 && (e.left ? e.gap = i.DEFAULT_EDGE_LENGTH + n.get(e.left).getWidth() / 2 + n.get(e.right).getWidth() / 2 : e.gap = i.DEFAULT_EDGE_LENGTH + n.get(e.top).getHeight() / 2 + n.get(e.bottom).getHeight() / 2);
						});
						var h = function(e, t) {
							return {
								x: e.x - t.x,
								y: e.y - t.y
							};
						}, g = function(e) {
							var t = 0, n = 0;
							return e.forEach(function(e) {
								t += l[c.get(e)], n += u[c.get(e)];
							}), {
								x: t / e.size,
								y: n / e.size
							};
						}, _ = function(e, t, n, i, o) {
							function s(e, t) {
								var n = new Set(e), r = !0, i = !1, a = void 0;
								try {
									for (var o = t[Symbol.iterator](), s; !(r = (s = o.next()).done); r = !0) {
										var c = s.value;
										n.add(c);
									}
								} catch (e) {
									i = !0, a = e;
								} finally {
									try {
										!r && o.return && o.return();
									} finally {
										if (i) throw a;
									}
								}
								return n;
							}
							var d = /* @__PURE__ */ new Map();
							e.forEach(function(e, t) {
								d.set(t, 0);
							}), e.forEach(function(e, t) {
								e.forEach(function(e) {
									d.set(e.id, d.get(e.id) + 1);
								});
							});
							var f = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = new a();
							d.forEach(function(e, r) {
								e == 0 ? (m.push(r), n || (t == "horizontal" ? f.set(r, c.has(r) ? l[c.get(r)] : i.get(r)) : f.set(r, c.has(r) ? u[c.get(r)] : i.get(r)))) : f.set(r, -Infinity), n && p.set(r, new Set([r]));
							}), n && o.forEach(function(e) {
								var r = [];
								if (e.forEach(function(e) {
									n.has(e) && r.push(e);
								}), r.length > 0) {
									var a = 0;
									r.forEach(function(e) {
										t == "horizontal" ? (f.set(e, c.has(e) ? l[c.get(e)] : i.get(e)), a += f.get(e)) : (f.set(e, c.has(e) ? u[c.get(e)] : i.get(e)), a += f.get(e));
									}), a /= r.length, e.forEach(function(e) {
										n.has(e) || f.set(e, a);
									});
								} else {
									var o = 0;
									e.forEach(function(e) {
										t == "horizontal" ? o += c.has(e) ? l[c.get(e)] : i.get(e) : o += c.has(e) ? u[c.get(e)] : i.get(e);
									}), o /= e.length, e.forEach(function(e) {
										f.set(e, o);
									});
								}
							});
							for (var h = function() {
								var r = m.shift();
								e.get(r).forEach(function(e) {
									if (f.get(e.id) < f.get(r) + e.gap) if (n && n.has(e.id)) {
										var a = void 0;
										if (a = t == "horizontal" ? c.has(e.id) ? l[c.get(e.id)] : i.get(e.id) : c.has(e.id) ? u[c.get(e.id)] : i.get(e.id), f.set(e.id, a), a < f.get(r) + e.gap) {
											var o = f.get(r) + e.gap - a;
											p.get(r).forEach(function(e) {
												f.set(e, f.get(e) - o);
											});
										}
									} else f.set(e.id, f.get(r) + e.gap);
									d.set(e.id, d.get(e.id) - 1), d.get(e.id) == 0 && m.push(e.id), n && p.set(e.id, s(p.get(r), p.get(e.id)));
								});
							}; m.length != 0;) h();
							if (n) {
								var g = /* @__PURE__ */ new Set();
								e.forEach(function(e, t) {
									e.length == 0 && g.add(t);
								});
								var _ = [];
								p.forEach(function(e, t) {
									if (g.has(t)) {
										var i = !1, a = !0, o = !1, s = void 0;
										try {
											for (var c = e[Symbol.iterator](), l; !(a = (l = c.next()).done); a = !0) {
												var u = l.value;
												n.has(u) && (i = !0);
											}
										} catch (e) {
											o = !0, s = e;
										} finally {
											try {
												!a && c.return && c.return();
											} finally {
												if (o) throw s;
											}
										}
										if (!i) {
											var d = !1, f = void 0;
											_.forEach(function(t, n) {
												t.has([].concat(r(e))[0]) && (d = !0, f = n);
											}), d ? e.forEach(function(e) {
												_[f].add(e);
											}) : _.push(new Set(e));
										}
									}
								}), _.forEach(function(e, n) {
									var r = Infinity, a = Infinity, o = -Infinity, s = -Infinity, d = !0, p = !1, m = void 0;
									try {
										for (var h = e[Symbol.iterator](), g; !(d = (g = h.next()).done); d = !0) {
											var _ = g.value, v = void 0;
											v = t == "horizontal" ? c.has(_) ? l[c.get(_)] : i.get(_) : c.has(_) ? u[c.get(_)] : i.get(_);
											var y = f.get(_);
											v < r && (r = v), v > o && (o = v), y < a && (a = y), y > s && (s = y);
										}
									} catch (e) {
										p = !0, m = e;
									} finally {
										try {
											!d && h.return && h.return();
										} finally {
											if (p) throw m;
										}
									}
									var b = (r + o) / 2 - (a + s) / 2, x = !0, S = !1, C = void 0;
									try {
										for (var w = e[Symbol.iterator](), T; !(x = (T = w.next()).done); x = !0) {
											var E = T.value;
											f.set(E, f.get(E) + b);
										}
									} catch (e) {
										S = !0, C = e;
									} finally {
										try {
											!x && w.return && w.return();
										} finally {
											if (S) throw C;
										}
									}
								});
							}
							return f;
						}, v = function(e) {
							var t = 0, n = 0, r = 0, i = 0;
							if (e.forEach(function(e) {
								e.left ? l[c.get(e.left)] - l[c.get(e.right)] >= 0 ? t++ : n++ : u[c.get(e.top)] - u[c.get(e.bottom)] >= 0 ? r++ : i++;
							}), t > n && r > i) for (var a = 0; a < c.size; a++) l[a] = -1 * l[a], u[a] = -1 * u[a];
							else if (t > n) for (var o = 0; o < c.size; o++) l[o] = -1 * l[o];
							else if (r > i) for (var s = 0; s < c.size; s++) u[s] = -1 * u[s];
						}, y = function(e) {
							var t = [], n = new a(), r = /* @__PURE__ */ new Set(), i = 0;
							return e.forEach(function(a, o) {
								if (!r.has(o)) {
									t[i] = [];
									var s = o;
									for (n.push(s), r.add(s), t[i].push(s); n.length != 0;) s = n.shift(), e.get(s).forEach(function(e) {
										r.has(e.id) || (n.push(e.id), r.add(e.id), t[i].push(e.id));
									});
									i++;
								}
							}), t;
						}, b = function(e) {
							var t = /* @__PURE__ */ new Map();
							return e.forEach(function(e, n) {
								t.set(n, []);
							}), e.forEach(function(e, n) {
								e.forEach(function(e) {
									t.get(n).push(e), t.get(e.id).push({
										id: n,
										gap: e.gap,
										direction: e.direction
									});
								});
							}), t;
						}, x = function(e) {
							var t = /* @__PURE__ */ new Map();
							return e.forEach(function(e, n) {
								t.set(n, []);
							}), e.forEach(function(e, n) {
								e.forEach(function(e) {
									t.get(e.id).push({
										id: n,
										gap: e.gap,
										direction: e.direction
									});
								});
							}), t;
						}, S = [], C = [], w = !1, T = !1, E = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), k = [];
						if (t.fixedNodeConstraint && t.fixedNodeConstraint.forEach(function(e) {
							E.add(e.nodeId);
						}), t.relativePlacementConstraint && (t.relativePlacementConstraint.forEach(function(e) {
							e.left ? (D.has(e.left) ? D.get(e.left).push({
								id: e.right,
								gap: e.gap,
								direction: "horizontal"
							}) : D.set(e.left, [{
								id: e.right,
								gap: e.gap,
								direction: "horizontal"
							}]), D.has(e.right) || D.set(e.right, [])) : (D.has(e.top) ? D.get(e.top).push({
								id: e.bottom,
								gap: e.gap,
								direction: "vertical"
							}) : D.set(e.top, [{
								id: e.bottom,
								gap: e.gap,
								direction: "vertical"
							}]), D.has(e.bottom) || D.set(e.bottom, []));
						}), O = b(D), k = y(O)), i.TRANSFORM_ON_CONSTRAINT_HANDLING) {
							if (t.fixedNodeConstraint && t.fixedNodeConstraint.length > 1) t.fixedNodeConstraint.forEach(function(e, t) {
								S[t] = [e.position.x, e.position.y], C[t] = [l[c.get(e.nodeId)], u[c.get(e.nodeId)]];
							}), w = !0;
							else if (t.alignmentConstraint) (function() {
								var e = 0;
								if (t.alignmentConstraint.vertical) {
									for (var n = t.alignmentConstraint.vertical, i = function(t) {
										var i = /* @__PURE__ */ new Set();
										n[t].forEach(function(e) {
											i.add(e);
										});
										var a = new Set([].concat(r(i)).filter(function(e) {
											return E.has(e);
										})), o = void 0;
										o = a.size > 0 ? l[c.get(a.values().next().value)] : g(i).x, n[t].forEach(function(t) {
											S[e] = [o, u[c.get(t)]], C[e] = [l[c.get(t)], u[c.get(t)]], e++;
										});
									}, a = 0; a < n.length; a++) i(a);
									w = !0;
								}
								if (t.alignmentConstraint.horizontal) {
									for (var o = t.alignmentConstraint.horizontal, s = function(t) {
										var n = /* @__PURE__ */ new Set();
										o[t].forEach(function(e) {
											n.add(e);
										});
										var i = new Set([].concat(r(n)).filter(function(e) {
											return E.has(e);
										})), a = void 0;
										a = i.size > 0 ? l[c.get(i.values().next().value)] : g(n).y, o[t].forEach(function(t) {
											S[e] = [l[c.get(t)], a], C[e] = [l[c.get(t)], u[c.get(t)]], e++;
										});
									}, d = 0; d < o.length; d++) s(d);
									w = !0;
								}
								t.relativePlacementConstraint && (T = !0);
							})();
							else if (t.relativePlacementConstraint) {
								for (var A = 0, j = 0, M = 0; M < k.length; M++) k[M].length > A && (A = k[M].length, j = M);
								if (A < O.size / 2) v(t.relativePlacementConstraint), w = !1, T = !1;
								else {
									var N = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), F = [];
									k[j].forEach(function(e) {
										D.get(e).forEach(function(t) {
											t.direction == "horizontal" ? (N.has(e) ? N.get(e).push(t) : N.set(e, [t]), N.has(t.id) || N.set(t.id, []), F.push({
												left: e,
												right: t.id
											})) : (P.has(e) ? P.get(e).push(t) : P.set(e, [t]), P.has(t.id) || P.set(t.id, []), F.push({
												top: e,
												bottom: t.id
											}));
										});
									}), v(F), T = !1;
									var I = _(N, "horizontal"), ee = _(P, "vertical");
									k[j].forEach(function(e, t) {
										C[t] = [l[c.get(e)], u[c.get(e)]], S[t] = [], I.has(e) ? S[t][0] = I.get(e) : S[t][0] = l[c.get(e)], ee.has(e) ? S[t][1] = ee.get(e) : S[t][1] = u[c.get(e)];
									}), w = !0;
								}
							}
							if (w) {
								for (var L = void 0, R = o.transpose(S), z = o.transpose(C), B = 0; B < R.length; B++) R[B] = o.multGamma(R[B]), z[B] = o.multGamma(z[B]);
								var V = o.multMat(R, o.transpose(z)), H = s.svd(V);
								L = o.multMat(H.V, o.transpose(H.U));
								for (var U = 0; U < c.size; U++) {
									var W = [l[U], u[U]], G = [L[0][0], L[1][0]], K = [L[0][1], L[1][1]];
									l[U] = o.dotProduct(W, G), u[U] = o.dotProduct(W, K);
								}
								T && v(t.relativePlacementConstraint);
							}
						}
						if (i.ENFORCE_CONSTRAINTS) {
							if (t.fixedNodeConstraint && t.fixedNodeConstraint.length > 0) {
								var q = {
									x: 0,
									y: 0
								};
								t.fixedNodeConstraint.forEach(function(e, t) {
									var n = {
										x: l[c.get(e.nodeId)],
										y: u[c.get(e.nodeId)]
									}, r = e.position, i = h(r, n);
									q.x += i.x, q.y += i.y;
								}), q.x /= t.fixedNodeConstraint.length, q.y /= t.fixedNodeConstraint.length, l.forEach(function(e, t) {
									l[t] += q.x;
								}), u.forEach(function(e, t) {
									u[t] += q.y;
								}), t.fixedNodeConstraint.forEach(function(e) {
									l[c.get(e.nodeId)] = e.position.x, u[c.get(e.nodeId)] = e.position.y;
								});
							}
							if (t.alignmentConstraint) {
								if (t.alignmentConstraint.vertical) for (var J = t.alignmentConstraint.vertical, te = function(e) {
									var t = /* @__PURE__ */ new Set();
									J[e].forEach(function(e) {
										t.add(e);
									});
									var n = new Set([].concat(r(t)).filter(function(e) {
										return E.has(e);
									})), i = void 0;
									i = n.size > 0 ? l[c.get(n.values().next().value)] : g(t).x, t.forEach(function(e) {
										E.has(e) || (l[c.get(e)] = i);
									});
								}, Y = 0; Y < J.length; Y++) te(Y);
								if (t.alignmentConstraint.horizontal) for (var X = t.alignmentConstraint.horizontal, ne = function(e) {
									var t = /* @__PURE__ */ new Set();
									X[e].forEach(function(e) {
										t.add(e);
									});
									var n = new Set([].concat(r(t)).filter(function(e) {
										return E.has(e);
									})), i = void 0;
									i = n.size > 0 ? u[c.get(n.values().next().value)] : g(t).y, t.forEach(function(e) {
										E.has(e) || (u[c.get(e)] = i);
									});
								}, Z = 0; Z < X.length; Z++) ne(Z);
							}
							t.relativePlacementConstraint && (function() {
								var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
								if (E.forEach(function(e) {
									s.add(e), d.add(e);
								}), t.alignmentConstraint) {
									if (t.alignmentConstraint.vertical) for (var f = t.alignmentConstraint.vertical, p = function(t) {
										r.set("dummy" + t, []), f[t].forEach(function(n) {
											e.set(n, "dummy" + t), r.get("dummy" + t).push(n), E.has(n) && s.add("dummy" + t);
										}), a.set("dummy" + t, l[c.get(f[t][0])]);
									}, m = 0; m < f.length; m++) p(m);
									if (t.alignmentConstraint.horizontal) for (var h = t.alignmentConstraint.horizontal, g = function(e) {
										i.set("dummy" + e, []), h[e].forEach(function(t) {
											n.set(t, "dummy" + e), i.get("dummy" + e).push(t), E.has(t) && d.add("dummy" + e);
										}), o.set("dummy" + e, u[c.get(h[e][0])]);
									}, v = 0; v < h.length; v++) g(v);
								}
								var S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), w = function(t) {
									D.get(t).forEach(function(r) {
										var i = void 0, a = void 0;
										r.direction == "horizontal" ? (i = e.get(t) ? e.get(t) : t, a = e.get(r.id) ? {
											id: e.get(r.id),
											gap: r.gap,
											direction: r.direction
										} : r, S.has(i) ? S.get(i).push(a) : S.set(i, [a]), S.has(a.id) || S.set(a.id, [])) : (i = n.get(t) ? n.get(t) : t, a = n.get(r.id) ? {
											id: n.get(r.id),
											gap: r.gap,
											direction: r.direction
										} : r, C.has(i) ? C.get(i).push(a) : C.set(i, [a]), C.has(a.id) || C.set(a.id, []));
									});
								}, T = !0, O = !1, k = void 0;
								try {
									for (var A = D.keys()[Symbol.iterator](), j; !(T = (j = A.next()).done); T = !0) {
										var M = j.value;
										w(M);
									}
								} catch (e) {
									O = !0, k = e;
								} finally {
									try {
										!T && A.return && A.return();
									} finally {
										if (O) throw k;
									}
								}
								var N = b(S), P = b(C), F = y(N), I = y(P), ee = x(S), L = x(C), R = [], z = [];
								F.forEach(function(e, t) {
									R[t] = [], e.forEach(function(e) {
										ee.get(e).length == 0 && R[t].push(e);
									});
								}), I.forEach(function(e, t) {
									z[t] = [], e.forEach(function(e) {
										L.get(e).length == 0 && z[t].push(e);
									});
								});
								var B = _(S, "horizontal", s, a, R), V = _(C, "vertical", d, o, z), H = function(e) {
									r.get(e) ? r.get(e).forEach(function(t) {
										l[c.get(t)] = B.get(e);
									}) : l[c.get(e)] = B.get(e);
								}, U = !0, W = !1, G = void 0;
								try {
									for (var K = B.keys()[Symbol.iterator](), q; !(U = (q = K.next()).done); U = !0) {
										var J = q.value;
										H(J);
									}
								} catch (e) {
									W = !0, G = e;
								} finally {
									try {
										!U && K.return && K.return();
									} finally {
										if (W) throw G;
									}
								}
								var te = function(e) {
									i.get(e) ? i.get(e).forEach(function(t) {
										u[c.get(t)] = V.get(e);
									}) : u[c.get(e)] = V.get(e);
								}, Y = !0, X = !1, ne = void 0;
								try {
									for (var Z = V.keys()[Symbol.iterator](), Q; !(Y = (Q = Z.next()).done); Y = !0) {
										var J = Q.value;
										te(J);
									}
								} catch (e) {
									X = !0, ne = e;
								} finally {
									try {
										!Y && Z.return && Z.return();
									} finally {
										if (X) throw ne;
									}
								}
							})();
						}
						for (var Q = 0; Q < d.length; Q++) {
							var $ = d[Q];
							$.getChild() ?? $.setCenter(l[c.get($.id)], u[c.get($.id)]);
						}
					}, e.exports = c;
				}),
				551: ((t) => {
					t.exports = e;
				})
			}, n = {};
			function r(e) {
				var i = n[e];
				if (i !== void 0) return i.exports;
				var a = n[e] = { exports: {} };
				return t[e](a, a.exports, r), a.exports;
			}
			return r(45);
		})();
	});
}));
//#endregion
export default n();
export { n as require_cose_base };
