markdown-flow-ui
Version:
A React UI library for rendering markdown with interactive flow components, typewriter effects, and plugin support
966 lines • 163 kB
JavaScript
import { aH as Et, _, l as Q, c as st, H as Lt, V as Tt, F as it, i as J, W as Nt, X as mt, Y as Dt, d as Ot, ak as At, N as It } from "./index-pooOtYuy.mjs";
import { c as ft } from "./cytoscape.esm-DfdJODL8.mjs";
var tt = { exports: {} }, et = { exports: {} }, rt = { exports: {} }, Ct = rt.exports, ct;
function Rt() {
return ct || (ct = 1, (function(C, M) {
(function(D, y) {
C.exports = y();
})(Ct, function() {
return (
/******/
(function(u) {
var D = {};
function y(r) {
if (D[r])
return D[r].exports;
var t = D[r] = {
/******/
i: r,
/******/
l: !1,
/******/
exports: {}
/******/
};
return u[r].call(t.exports, t, t.exports, y), t.l = !0, t.exports;
}
return y.m = u, y.c = D, y.i = function(r) {
return r;
}, y.d = function(r, t, e) {
y.o(r, t) || Object.defineProperty(r, t, {
/******/
configurable: !1,
/******/
enumerable: !0,
/******/
get: e
/******/
});
}, y.n = function(r) {
var t = r && r.__esModule ? (
/******/
function() {
return r.default;
}
) : (
/******/
function() {
return r;
}
);
return y.d(t, "a", t), t;
}, y.o = function(r, t) {
return Object.prototype.hasOwnProperty.call(r, t);
}, y.p = "", y(y.s = 26);
})([
/* 0 */
/***/
(function(u, D, y) {
function r() {
}
r.QUALITY = 1, r.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, r.DEFAULT_INCREMENTAL = !1, r.DEFAULT_ANIMATION_ON_LAYOUT = !0, r.DEFAULT_ANIMATION_DURING_LAYOUT = !1, r.DEFAULT_ANIMATION_PERIOD = 50, r.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, r.DEFAULT_GRAPH_MARGIN = 15, r.NODE_DIMENSIONS_INCLUDE_LABELS = !1, r.SIMPLE_NODE_SIZE = 40, r.SIMPLE_NODE_HALF_SIZE = r.SIMPLE_NODE_SIZE / 2, r.EMPTY_COMPOUND_NODE_SIZE = 40, r.MIN_EDGE_LENGTH = 1, r.WORLD_BOUNDARY = 1e6, r.INITIAL_WORLD_BOUNDARY = r.WORLD_BOUNDARY / 1e3, r.WORLD_CENTER_X = 1200, r.WORLD_CENTER_Y = 900, u.exports = r;
}),
/* 1 */
/***/
(function(u, D, y) {
var r = y(2), t = y(8), e = y(9);
function i(g, a, v) {
r.call(this, v), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = v, this.bendpoints = [], this.source = g, this.target = a;
}
i.prototype = Object.create(r.prototype);
for (var o in r)
i[o] = r[o];
i.prototype.getSource = function() {
return this.source;
}, i.prototype.getTarget = function() {
return this.target;
}, i.prototype.isInterGraph = function() {
return this.isInterGraph;
}, i.prototype.getLength = function() {
return this.length;
}, i.prototype.isOverlapingSourceAndTarget = function() {
return this.isOverlapingSourceAndTarget;
}, i.prototype.getBendpoints = function() {
return this.bendpoints;
}, i.prototype.getLca = function() {
return this.lca;
}, i.prototype.getSourceInLca = function() {
return this.sourceInLca;
}, i.prototype.getTargetInLca = function() {
return this.targetInLca;
}, i.prototype.getOtherEnd = function(g) {
if (this.source === g)
return this.target;
if (this.target === g)
return this.source;
throw "Node is not incident with this edge";
}, i.prototype.getOtherEndInGraph = function(g, a) {
for (var v = this.getOtherEnd(g), n = a.getGraphManager().getRoot(); ; ) {
if (v.getOwner() == a)
return v;
if (v.getOwner() == n)
break;
v = v.getOwner().getParent();
}
return null;
}, i.prototype.updateLength = function() {
var g = new Array(4);
this.isOverlapingSourceAndTarget = t.getIntersection(this.target.getRect(), this.source.getRect(), g), this.isOverlapingSourceAndTarget || (this.lengthX = g[0] - g[2], this.lengthY = g[1] - g[3], Math.abs(this.lengthX) < 1 && (this.lengthX = e.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = e.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
}, i.prototype.updateLengthSimple = function() {
this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = e.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = e.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
}, u.exports = i;
}),
/* 2 */
/***/
(function(u, D, y) {
function r(t) {
this.vGraphObject = t;
}
u.exports = r;
}),
/* 3 */
/***/
(function(u, D, y) {
var r = y(2), t = y(10), e = y(13), i = y(0), o = y(16), g = y(4);
function a(n, c, l, E) {
l == null && E == null && (E = c), r.call(this, E), n.graphManager != null && (n = n.graphManager), this.estimatedSize = t.MIN_VALUE, this.inclusionTreeDepth = t.MAX_VALUE, this.vGraphObject = E, this.edges = [], this.graphManager = n, l != null && c != null ? this.rect = new e(c.x, c.y, l.width, l.height) : this.rect = new e();
}
a.prototype = Object.create(r.prototype);
for (var v in r)
a[v] = r[v];
a.prototype.getEdges = function() {
return this.edges;
}, a.prototype.getChild = function() {
return this.child;
}, a.prototype.getOwner = function() {
return this.owner;
}, a.prototype.getWidth = function() {
return this.rect.width;
}, a.prototype.setWidth = function(n) {
this.rect.width = n;
}, a.prototype.getHeight = function() {
return this.rect.height;
}, a.prototype.setHeight = function(n) {
this.rect.height = n;
}, a.prototype.getCenterX = function() {
return this.rect.x + this.rect.width / 2;
}, a.prototype.getCenterY = function() {
return this.rect.y + this.rect.height / 2;
}, a.prototype.getCenter = function() {
return new g(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
}, a.prototype.getLocation = function() {
return new g(this.rect.x, this.rect.y);
}, a.prototype.getRect = function() {
return this.rect;
}, a.prototype.getDiagonal = function() {
return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
}, a.prototype.getHalfTheDiagonal = function() {
return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
}, a.prototype.setRect = function(n, c) {
this.rect.x = n.x, this.rect.y = n.y, this.rect.width = c.width, this.rect.height = c.height;
}, a.prototype.setCenter = function(n, c) {
this.rect.x = n - this.rect.width / 2, this.rect.y = c - this.rect.height / 2;
}, a.prototype.setLocation = function(n, c) {
this.rect.x = n, this.rect.y = c;
}, a.prototype.moveBy = function(n, c) {
this.rect.x += n, this.rect.y += c;
}, a.prototype.getEdgeListToNode = function(n) {
var c = [], l = this;
return l.edges.forEach(function(E) {
if (E.target == n) {
if (E.source != l) throw "Incorrect edge source!";
c.push(E);
}
}), c;
}, a.prototype.getEdgesBetween = function(n) {
var c = [], l = this;
return l.edges.forEach(function(E) {
if (!(E.source == l || E.target == l)) throw "Incorrect edge source and/or target";
(E.target == n || E.source == n) && c.push(E);
}), c;
}, a.prototype.getNeighborsList = function() {
var n = /* @__PURE__ */ new Set(), c = this;
return c.edges.forEach(function(l) {
if (l.source == c)
n.add(l.target);
else {
if (l.target != c)
throw "Incorrect incidency!";
n.add(l.source);
}
}), n;
}, a.prototype.withChildren = function() {
var n = /* @__PURE__ */ new Set(), c, l;
if (n.add(this), this.child != null)
for (var E = this.child.getNodes(), T = 0; T < E.length; T++)
c = E[T], l = c.withChildren(), l.forEach(function(m) {
n.add(m);
});
return n;
}, a.prototype.getNoOfChildren = function() {
var n = 0, c;
if (this.child == null)
n = 1;
else
for (var l = this.child.getNodes(), E = 0; E < l.length; E++)
c = l[E], n += c.getNoOfChildren();
return n == 0 && (n = 1), n;
}, a.prototype.getEstimatedSize = function() {
if (this.estimatedSize == t.MIN_VALUE)
throw "assert failed";
return this.estimatedSize;
}, a.prototype.calcEstimatedSize = function() {
return this.child == null ? this.estimatedSize = (this.rect.width + this.rect.height) / 2 : (this.estimatedSize = this.child.calcEstimatedSize(), this.rect.width = this.estimatedSize, this.rect.height = this.estimatedSize, this.estimatedSize);
}, a.prototype.scatter = function() {
var n, c, l = -i.INITIAL_WORLD_BOUNDARY, E = i.INITIAL_WORLD_BOUNDARY;
n = i.WORLD_CENTER_X + o.nextDouble() * (E - l) + l;
var T = -i.INITIAL_WORLD_BOUNDARY, m = i.INITIAL_WORLD_BOUNDARY;
c = i.WORLD_CENTER_Y + o.nextDouble() * (m - T) + T, this.rect.x = n, this.rect.y = c;
}, a.prototype.updateBounds = function() {
if (this.getChild() == null)
throw "assert failed";
if (this.getChild().getNodes().length != 0) {
var n = this.getChild();
if (n.updateBounds(!0), this.rect.x = n.getLeft(), this.rect.y = n.getTop(), this.setWidth(n.getRight() - n.getLeft()), this.setHeight(n.getBottom() - n.getTop()), i.NODE_DIMENSIONS_INCLUDE_LABELS) {
var c = n.getRight() - n.getLeft(), l = n.getBottom() - n.getTop();
this.labelWidth > c && (this.rect.x -= (this.labelWidth - c) / 2, this.setWidth(this.labelWidth)), this.labelHeight > l && (this.labelPos == "center" ? this.rect.y -= (this.labelHeight - l) / 2 : this.labelPos == "top" && (this.rect.y -= this.labelHeight - l), this.setHeight(this.labelHeight));
}
}
}, a.prototype.getInclusionTreeDepth = function() {
if (this.inclusionTreeDepth == t.MAX_VALUE)
throw "assert failed";
return this.inclusionTreeDepth;
}, a.prototype.transform = function(n) {
var c = this.rect.x;
c > i.WORLD_BOUNDARY ? c = i.WORLD_BOUNDARY : c < -i.WORLD_BOUNDARY && (c = -i.WORLD_BOUNDARY);
var l = this.rect.y;
l > i.WORLD_BOUNDARY ? l = i.WORLD_BOUNDARY : l < -i.WORLD_BOUNDARY && (l = -i.WORLD_BOUNDARY);
var E = new g(c, l), T = n.inverseTransformPoint(E);
this.setLocation(T.x, T.y);
}, a.prototype.getLeft = function() {
return this.rect.x;
}, a.prototype.getRight = function() {
return this.rect.x + this.rect.width;
}, a.prototype.getTop = function() {
return this.rect.y;
}, a.prototype.getBottom = function() {
return this.rect.y + this.rect.height;
}, a.prototype.getParent = function() {
return this.owner == null ? null : this.owner.getParent();
}, u.exports = a;
}),
/* 4 */
/***/
(function(u, D, y) {
function r(t, e) {
t == null && e == null ? (this.x = 0, this.y = 0) : (this.x = t, this.y = e);
}
r.prototype.getX = function() {
return this.x;
}, r.prototype.getY = function() {
return this.y;
}, r.prototype.setX = function(t) {
this.x = t;
}, r.prototype.setY = function(t) {
this.y = t;
}, r.prototype.getDifference = function(t) {
return new DimensionD(this.x - t.x, this.y - t.y);
}, r.prototype.getCopy = function() {
return new r(this.x, this.y);
}, r.prototype.translate = function(t) {
return this.x += t.width, this.y += t.height, this;
}, u.exports = r;
}),
/* 5 */
/***/
(function(u, D, y) {
var r = y(2), t = y(10), e = y(0), i = y(6), o = y(3), g = y(1), a = y(13), v = y(12), n = y(11);
function c(E, T, m) {
r.call(this, m), this.estimatedSize = t.MIN_VALUE, this.margin = e.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = E, T != null && T instanceof i ? this.graphManager = T : T != null && T instanceof Layout && (this.graphManager = T.graphManager);
}
c.prototype = Object.create(r.prototype);
for (var l in r)
c[l] = r[l];
c.prototype.getNodes = function() {
return this.nodes;
}, c.prototype.getEdges = function() {
return this.edges;
}, c.prototype.getGraphManager = function() {
return this.graphManager;
}, c.prototype.getParent = function() {
return this.parent;
}, c.prototype.getLeft = function() {
return this.left;
}, c.prototype.getRight = function() {
return this.right;
}, c.prototype.getTop = function() {
return this.top;
}, c.prototype.getBottom = function() {
return this.bottom;
}, c.prototype.isConnected = function() {
return this.isConnected;
}, c.prototype.add = function(E, T, m) {
if (T == null && m == null) {
var L = E;
if (this.graphManager == null)
throw "Graph has no graph mgr!";
if (this.getNodes().indexOf(L) > -1)
throw "Node already in graph!";
return L.owner = this, this.getNodes().push(L), L;
} else {
var O = E;
if (!(this.getNodes().indexOf(T) > -1 && this.getNodes().indexOf(m) > -1))
throw "Source or target not in graph!";
if (!(T.owner == m.owner && T.owner == this))
throw "Both owners must be this graph!";
return T.owner != m.owner ? null : (O.source = T, O.target = m, O.isInterGraph = !1, this.getEdges().push(O), T.edges.push(O), m != T && m.edges.push(O), O);
}
}, c.prototype.remove = function(E) {
var T = E;
if (E instanceof o) {
if (T == null)
throw "Node is null!";
if (!(T.owner != null && T.owner == this))
throw "Owner graph is invalid!";
if (this.graphManager == null)
throw "Owner graph manager is invalid!";
for (var m = T.edges.slice(), L, O = m.length, d = 0; d < O; d++)
L = m[d], L.isInterGraph ? this.graphManager.remove(L) : L.source.owner.remove(L);
var N = this.nodes.indexOf(T);
if (N == -1)
throw "Node not in owner node list!";
this.nodes.splice(N, 1);
} else if (E instanceof g) {
var L = E;
if (L == null)
throw "Edge is null!";
if (!(L.source != null && L.target != null))
throw "Source and/or target is null!";
if (!(L.source.owner != null && L.target.owner != null && L.source.owner == this && L.target.owner == this))
throw "Source and/or target owner is invalid!";
var s = L.source.edges.indexOf(L), h = L.target.edges.indexOf(L);
if (!(s > -1 && h > -1))
throw "Source and/or target doesn't know this edge!";
L.source.edges.splice(s, 1), L.target != L.source && L.target.edges.splice(h, 1);
var N = L.source.owner.getEdges().indexOf(L);
if (N == -1)
throw "Not in owner's edge list!";
L.source.owner.getEdges().splice(N, 1);
}
}, c.prototype.updateLeftTop = function() {
for (var E = t.MAX_VALUE, T = t.MAX_VALUE, m, L, O, d = this.getNodes(), N = d.length, s = 0; s < N; s++) {
var h = d[s];
m = h.getTop(), L = h.getLeft(), E > m && (E = m), T > L && (T = L);
}
return E == t.MAX_VALUE ? null : (d[0].getParent().paddingLeft != null ? O = d[0].getParent().paddingLeft : O = this.margin, this.left = T - O, this.top = E - O, new v(this.left, this.top));
}, c.prototype.updateBounds = function(E) {
for (var T = t.MAX_VALUE, m = -t.MAX_VALUE, L = t.MAX_VALUE, O = -t.MAX_VALUE, d, N, s, h, f, p = this.nodes, A = p.length, I = 0; I < A; I++) {
var R = p[I];
E && R.child != null && R.updateBounds(), d = R.getLeft(), N = R.getRight(), s = R.getTop(), h = R.getBottom(), T > d && (T = d), m < N && (m = N), L > s && (L = s), O < h && (O = h);
}
var x = new a(T, L, m - T, O - L);
T == t.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), p[0].getParent().paddingLeft != null ? f = p[0].getParent().paddingLeft : f = this.margin, this.left = x.x - f, this.right = x.x + x.width + f, this.top = x.y - f, this.bottom = x.y + x.height + f;
}, c.calculateBounds = function(E) {
for (var T = t.MAX_VALUE, m = -t.MAX_VALUE, L = t.MAX_VALUE, O = -t.MAX_VALUE, d, N, s, h, f = E.length, p = 0; p < f; p++) {
var A = E[p];
d = A.getLeft(), N = A.getRight(), s = A.getTop(), h = A.getBottom(), T > d && (T = d), m < N && (m = N), L > s && (L = s), O < h && (O = h);
}
var I = new a(T, L, m - T, O - L);
return I;
}, c.prototype.getInclusionTreeDepth = function() {
return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
}, c.prototype.getEstimatedSize = function() {
if (this.estimatedSize == t.MIN_VALUE)
throw "assert failed";
return this.estimatedSize;
}, c.prototype.calcEstimatedSize = function() {
for (var E = 0, T = this.nodes, m = T.length, L = 0; L < m; L++) {
var O = T[L];
E += O.calcEstimatedSize();
}
return E == 0 ? this.estimatedSize = e.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = E / Math.sqrt(this.nodes.length), this.estimatedSize;
}, c.prototype.updateConnected = function() {
var E = this;
if (this.nodes.length == 0) {
this.isConnected = !0;
return;
}
var T = new n(), m = /* @__PURE__ */ new Set(), L = this.nodes[0], O, d, N = L.withChildren();
for (N.forEach(function(I) {
T.push(I), m.add(I);
}); T.length !== 0; ) {
L = T.shift(), O = L.getEdges();
for (var s = O.length, h = 0; h < s; h++) {
var f = O[h];
if (d = f.getOtherEndInGraph(L, this), d != null && !m.has(d)) {
var p = d.withChildren();
p.forEach(function(I) {
T.push(I), m.add(I);
});
}
}
}
if (this.isConnected = !1, m.size >= this.nodes.length) {
var A = 0;
m.forEach(function(I) {
I.owner == E && A++;
}), A == this.nodes.length && (this.isConnected = !0);
}
}, u.exports = c;
}),
/* 6 */
/***/
(function(u, D, y) {
var r, t = y(1);
function e(i) {
r = y(5), this.layout = i, this.graphs = [], this.edges = [];
}
e.prototype.addRoot = function() {
var i = this.layout.newGraph(), o = this.layout.newNode(null), g = this.add(i, o);
return this.setRootGraph(g), this.rootGraph;
}, e.prototype.add = function(i, o, g, a, v) {
if (g == null && a == null && v == null) {
if (i == null)
throw "Graph is null!";
if (o == null)
throw "Parent node is null!";
if (this.graphs.indexOf(i) > -1)
throw "Graph already in this graph mgr!";
if (this.graphs.push(i), i.parent != null)
throw "Already has a parent!";
if (o.child != null)
throw "Already has a child!";
return i.parent = o, o.child = i, i;
} else {
v = g, a = o, g = i;
var n = a.getOwner(), c = v.getOwner();
if (!(n != null && n.getGraphManager() == this))
throw "Source not in this graph mgr!";
if (!(c != null && c.getGraphManager() == this))
throw "Target not in this graph mgr!";
if (n == c)
return g.isInterGraph = !1, n.add(g, a, v);
if (g.isInterGraph = !0, g.source = a, g.target = v, this.edges.indexOf(g) > -1)
throw "Edge already in inter-graph edge list!";
if (this.edges.push(g), !(g.source != null && g.target != null))
throw "Edge source and/or target is null!";
if (!(g.source.edges.indexOf(g) == -1 && g.target.edges.indexOf(g) == -1))
throw "Edge already in source and/or target incidency list!";
return g.source.edges.push(g), g.target.edges.push(g), g;
}
}, e.prototype.remove = function(i) {
if (i instanceof r) {
var o = i;
if (o.getGraphManager() != this)
throw "Graph not in this graph mgr";
if (!(o == this.rootGraph || o.parent != null && o.parent.graphManager == this))
throw "Invalid parent node!";
var g = [];
g = g.concat(o.getEdges());
for (var a, v = g.length, n = 0; n < v; n++)
a = g[n], o.remove(a);
var c = [];
c = c.concat(o.getNodes());
var l;
v = c.length;
for (var n = 0; n < v; n++)
l = c[n], o.remove(l);
o == this.rootGraph && this.setRootGraph(null);
var E = this.graphs.indexOf(o);
this.graphs.splice(E, 1), o.parent = null;
} else if (i instanceof t) {
if (a = i, a == null)
throw "Edge is null!";
if (!a.isInterGraph)
throw "Not an inter-graph edge!";
if (!(a.source != null && a.target != null))
throw "Source and/or target is null!";
if (!(a.source.edges.indexOf(a) != -1 && a.target.edges.indexOf(a) != -1))
throw "Source and/or target doesn't know this edge!";
var E = a.source.edges.indexOf(a);
if (a.source.edges.splice(E, 1), E = a.target.edges.indexOf(a), a.target.edges.splice(E, 1), !(a.source.owner != null && a.source.owner.getGraphManager() != null))
throw "Edge owner graph or owner graph manager is null!";
if (a.source.owner.getGraphManager().edges.indexOf(a) == -1)
throw "Not in owner graph manager's edge list!";
var E = a.source.owner.getGraphManager().edges.indexOf(a);
a.source.owner.getGraphManager().edges.splice(E, 1);
}
}, e.prototype.updateBounds = function() {
this.rootGraph.updateBounds(!0);
}, e.prototype.getGraphs = function() {
return this.graphs;
}, e.prototype.getAllNodes = function() {
if (this.allNodes == null) {
for (var i = [], o = this.getGraphs(), g = o.length, a = 0; a < g; a++)
i = i.concat(o[a].getNodes());
this.allNodes = i;
}
return this.allNodes;
}, e.prototype.resetAllNodes = function() {
this.allNodes = null;
}, e.prototype.resetAllEdges = function() {
this.allEdges = null;
}, e.prototype.resetAllNodesToApplyGravitation = function() {
this.allNodesToApplyGravitation = null;
}, e.prototype.getAllEdges = function() {
if (this.allEdges == null) {
var i = [], o = this.getGraphs();
o.length;
for (var g = 0; g < o.length; g++)
i = i.concat(o[g].getEdges());
i = i.concat(this.edges), this.allEdges = i;
}
return this.allEdges;
}, e.prototype.getAllNodesToApplyGravitation = function() {
return this.allNodesToApplyGravitation;
}, e.prototype.setAllNodesToApplyGravitation = function(i) {
if (this.allNodesToApplyGravitation != null)
throw "assert failed";
this.allNodesToApplyGravitation = i;
}, e.prototype.getRoot = function() {
return this.rootGraph;
}, e.prototype.setRootGraph = function(i) {
if (i.getGraphManager() != this)
throw "Root not in this graph mgr!";
this.rootGraph = i, i.parent == null && (i.parent = this.layout.newNode("Root node"));
}, e.prototype.getLayout = function() {
return this.layout;
}, e.prototype.isOneAncestorOfOther = function(i, o) {
if (!(i != null && o != null))
throw "assert failed";
if (i == o)
return !0;
var g = i.getOwner(), a;
do {
if (a = g.getParent(), a == null)
break;
if (a == o)
return !0;
if (g = a.getOwner(), g == null)
break;
} while (!0);
g = o.getOwner();
do {
if (a = g.getParent(), a == null)
break;
if (a == i)
return !0;
if (g = a.getOwner(), g == null)
break;
} while (!0);
return !1;
}, e.prototype.calcLowestCommonAncestors = function() {
for (var i, o, g, a, v, n = this.getAllEdges(), c = n.length, l = 0; l < c; l++) {
if (i = n[l], o = i.source, g = i.target, i.lca = null, i.sourceInLca = o, i.targetInLca = g, o == g) {
i.lca = o.getOwner();
continue;
}
for (a = o.getOwner(); i.lca == null; ) {
for (i.targetInLca = g, v = g.getOwner(); i.lca == null; ) {
if (v == a) {
i.lca = v;
break;
}
if (v == this.rootGraph)
break;
if (i.lca != null)
throw "assert failed";
i.targetInLca = v.getParent(), v = i.targetInLca.getOwner();
}
if (a == this.rootGraph)
break;
i.lca == null && (i.sourceInLca = a.getParent(), a = i.sourceInLca.getOwner());
}
if (i.lca == null)
throw "assert failed";
}
}, e.prototype.calcLowestCommonAncestor = function(i, o) {
if (i == o)
return i.getOwner();
var g = i.getOwner();
do {
if (g == null)
break;
var a = o.getOwner();
do {
if (a == null)
break;
if (a == g)
return a;
a = a.getParent().getOwner();
} while (!0);
g = g.getParent().getOwner();
} while (!0);
return g;
}, e.prototype.calcInclusionTreeDepths = function(i, o) {
i == null && o == null && (i = this.rootGraph, o = 1);
for (var g, a = i.getNodes(), v = a.length, n = 0; n < v; n++)
g = a[n], g.inclusionTreeDepth = o, g.child != null && this.calcInclusionTreeDepths(g.child, o + 1);
}, e.prototype.includesInvalidEdge = function() {
for (var i, o = this.edges.length, g = 0; g < o; g++)
if (i = this.edges[g], this.isOneAncestorOfOther(i.source, i.target))
return !0;
return !1;
}, u.exports = e;
}),
/* 7 */
/***/
(function(u, D, y) {
var r = y(0);
function t() {
}
for (var e in r)
t[e] = r[e];
t.MAX_ITERATIONS = 2500, t.DEFAULT_EDGE_LENGTH = 50, t.DEFAULT_SPRING_STRENGTH = 0.45, t.DEFAULT_REPULSION_STRENGTH = 4500, t.DEFAULT_GRAVITY_STRENGTH = 0.4, t.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, t.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, t.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, t.COOLING_ADAPTATION_FACTOR = 0.33, t.ADAPTATION_LOWER_NODE_LIMIT = 1e3, t.ADAPTATION_UPPER_NODE_LIMIT = 5e3, t.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, t.MAX_NODE_DISPLACEMENT = t.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, t.MIN_REPULSION_DIST = t.DEFAULT_EDGE_LENGTH / 10, t.CONVERGENCE_CHECK_PERIOD = 100, t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, t.MIN_EDGE_LENGTH = 1, t.GRID_CALCULATION_CHECK_PERIOD = 10, u.exports = t;
}),
/* 8 */
/***/
(function(u, D, y) {
var r = y(12);
function t() {
}
t.calcSeparationAmount = function(e, i, o, g) {
if (!e.intersects(i))
throw "assert failed";
var a = new Array(2);
this.decideDirectionsForOverlappingNodes(e, i, a), o[0] = Math.min(e.getRight(), i.getRight()) - Math.max(e.x, i.x), o[1] = Math.min(e.getBottom(), i.getBottom()) - Math.max(e.y, i.y), e.getX() <= i.getX() && e.getRight() >= i.getRight() ? o[0] += Math.min(i.getX() - e.getX(), e.getRight() - i.getRight()) : i.getX() <= e.getX() && i.getRight() >= e.getRight() && (o[0] += Math.min(e.getX() - i.getX(), i.getRight() - e.getRight())), e.getY() <= i.getY() && e.getBottom() >= i.getBottom() ? o[1] += Math.min(i.getY() - e.getY(), e.getBottom() - i.getBottom()) : i.getY() <= e.getY() && i.getBottom() >= e.getBottom() && (o[1] += Math.min(e.getY() - i.getY(), i.getBottom() - e.getBottom()));
var v = Math.abs((i.getCenterY() - e.getCenterY()) / (i.getCenterX() - e.getCenterX()));
i.getCenterY() === e.getCenterY() && i.getCenterX() === e.getCenterX() && (v = 1);
var n = v * o[0], c = o[1] / v;
o[0] < c ? c = o[0] : n = o[1], o[0] = -1 * a[0] * (c / 2 + g), o[1] = -1 * a[1] * (n / 2 + g);
}, t.decideDirectionsForOverlappingNodes = function(e, i, o) {
e.getCenterX() < i.getCenterX() ? o[0] = -1 : o[0] = 1, e.getCenterY() < i.getCenterY() ? o[1] = -1 : o[1] = 1;
}, t.getIntersection2 = function(e, i, o) {
var g = e.getCenterX(), a = e.getCenterY(), v = i.getCenterX(), n = i.getCenterY();
if (e.intersects(i))
return o[0] = g, o[1] = a, o[2] = v, o[3] = n, !0;
var c = e.getX(), l = e.getY(), E = e.getRight(), T = e.getX(), m = e.getBottom(), L = e.getRight(), O = e.getWidthHalf(), d = e.getHeightHalf(), N = i.getX(), s = i.getY(), h = i.getRight(), f = i.getX(), p = i.getBottom(), A = i.getRight(), I = i.getWidthHalf(), R = i.getHeightHalf(), x = !1, G = !1;
if (g === v) {
if (a > n)
return o[0] = g, o[1] = l, o[2] = v, o[3] = p, !1;
if (a < n)
return o[0] = g, o[1] = m, o[2] = v, o[3] = s, !1;
} else if (a === n) {
if (g > v)
return o[0] = c, o[1] = a, o[2] = h, o[3] = n, !1;
if (g < v)
return o[0] = E, o[1] = a, o[2] = N, o[3] = n, !1;
} else {
var U = e.height / e.width, X = i.height / i.width, w = (n - a) / (v - g), S = void 0, F = void 0, b = void 0, Y = void 0, k = void 0, H = void 0;
if (-U === w ? g > v ? (o[0] = T, o[1] = m, x = !0) : (o[0] = E, o[1] = l, x = !0) : U === w && (g > v ? (o[0] = c, o[1] = l, x = !0) : (o[0] = L, o[1] = m, x = !0)), -X === w ? v > g ? (o[2] = f, o[3] = p, G = !0) : (o[2] = h, o[3] = s, G = !0) : X === w && (v > g ? (o[2] = N, o[3] = s, G = !0) : (o[2] = A, o[3] = p, G = !0)), x && G)
return !1;
if (g > v ? a > n ? (S = this.getCardinalDirection(U, w, 4), F = this.getCardinalDirection(X, w, 2)) : (S = this.getCardinalDirection(-U, w, 3), F = this.getCardinalDirection(-X, w, 1)) : a > n ? (S = this.getCardinalDirection(-U, w, 1), F = this.getCardinalDirection(-X, w, 3)) : (S = this.getCardinalDirection(U, w, 2), F = this.getCardinalDirection(X, w, 4)), !x)
switch (S) {
case 1:
Y = l, b = g + -d / w, o[0] = b, o[1] = Y;
break;
case 2:
b = L, Y = a + O * w, o[0] = b, o[1] = Y;
break;
case 3:
Y = m, b = g + d / w, o[0] = b, o[1] = Y;
break;
case 4:
b = T, Y = a + -O * w, o[0] = b, o[1] = Y;
break;
}
if (!G)
switch (F) {
case 1:
H = s, k = v + -R / w, o[2] = k, o[3] = H;
break;
case 2:
k = A, H = n + I * w, o[2] = k, o[3] = H;
break;
case 3:
H = p, k = v + R / w, o[2] = k, o[3] = H;
break;
case 4:
k = f, H = n + -I * w, o[2] = k, o[3] = H;
break;
}
}
return !1;
}, t.getCardinalDirection = function(e, i, o) {
return e > i ? o : 1 + o % 4;
}, t.getIntersection = function(e, i, o, g) {
if (g == null)
return this.getIntersection2(e, i, o);
var a = e.x, v = e.y, n = i.x, c = i.y, l = o.x, E = o.y, T = g.x, m = g.y, L = void 0, O = void 0, d = void 0, N = void 0, s = void 0, h = void 0, f = void 0, p = void 0, A = void 0;
return d = c - v, s = a - n, f = n * v - a * c, N = m - E, h = l - T, p = T * E - l * m, A = d * h - N * s, A === 0 ? null : (L = (s * p - h * f) / A, O = (N * f - d * p) / A, new r(L, O));
}, t.angleOfVector = function(e, i, o, g) {
var a = void 0;
return e !== o ? (a = Math.atan((g - i) / (o - e)), o < e ? a += Math.PI : g < i && (a += this.TWO_PI)) : g < i ? a = this.ONE_AND_HALF_PI : a = this.HALF_PI, a;
}, t.doIntersect = function(e, i, o, g) {
var a = e.x, v = e.y, n = i.x, c = i.y, l = o.x, E = o.y, T = g.x, m = g.y, L = (n - a) * (m - E) - (T - l) * (c - v);
if (L === 0)
return !1;
var O = ((m - E) * (T - a) + (l - T) * (m - v)) / L, d = ((v - c) * (T - a) + (n - a) * (m - v)) / L;
return 0 < O && O < 1 && 0 < d && d < 1;
}, t.HALF_PI = 0.5 * Math.PI, t.ONE_AND_HALF_PI = 1.5 * Math.PI, t.TWO_PI = 2 * Math.PI, t.THREE_PI = 3 * Math.PI, u.exports = t;
}),
/* 9 */
/***/
(function(u, D, y) {
function r() {
}
r.sign = function(t) {
return t > 0 ? 1 : t < 0 ? -1 : 0;
}, r.floor = function(t) {
return t < 0 ? Math.ceil(t) : Math.floor(t);
}, r.ceil = function(t) {
return t < 0 ? Math.floor(t) : Math.ceil(t);
}, u.exports = r;
}),
/* 10 */
/***/
(function(u, D, y) {
function r() {
}
r.MAX_VALUE = 2147483647, r.MIN_VALUE = -2147483648, u.exports = r;
}),
/* 11 */
/***/
(function(u, D, y) {
var r = /* @__PURE__ */ (function() {
function a(v, n) {
for (var c = 0; c < n.length; c++) {
var l = n[c];
l.enumerable = l.enumerable || !1, l.configurable = !0, "value" in l && (l.writable = !0), Object.defineProperty(v, l.key, l);
}
}
return function(v, n, c) {
return n && a(v.prototype, n), c && a(v, c), v;
};
})();
function t(a, v) {
if (!(a instanceof v))
throw new TypeError("Cannot call a class as a function");
}
var e = function(v) {
return { value: v, next: null, prev: null };
}, i = function(v, n, c, l) {
return v !== null ? v.next = n : l.head = n, c !== null ? c.prev = n : l.tail = n, n.prev = v, n.next = c, l.length++, n;
}, o = function(v, n) {
var c = v.prev, l = v.next;
return c !== null ? c.next = l : n.head = l, l !== null ? l.prev = c : n.tail = c, v.prev = v.next = null, n.length--, v;
}, g = (function() {
function a(v) {
var n = this;
t(this, a), this.length = 0, this.head = null, this.tail = null, v?.forEach(function(c) {
return n.push(c);
});
}
return r(a, [{
key: "size",
value: function() {
return this.length;
}
}, {
key: "insertBefore",
value: function(n, c) {
return i(c.prev, e(n), c, this);
}
}, {
key: "insertAfter",
value: function(n, c) {
return i(c, e(n), c.next, this);
}
}, {
key: "insertNodeBefore",
value: function(n, c) {
return i(c.prev, n, c, this);
}
}, {
key: "insertNodeAfter",
value: function(n, c) {
return i(c, n, c.next, this);
}
}, {
key: "push",
value: function(n) {
return i(this.tail, e(n), null, this);
}
}, {
key: "unshift",
value: function(n) {
return i(null, e(n), this.head, this);
}
}, {
key: "remove",
value: function(n) {
return o(n, this);
}
}, {
key: "pop",
value: function() {
return o(this.tail, this).value;
}
}, {
key: "popNode",
value: function() {
return o(this.tail, this);
}
}, {
key: "shift",
value: function() {
return o(this.head, this).value;
}
}, {
key: "shiftNode",
value: function() {
return o(this.head, this);
}
}, {
key: "get_object_at",
value: function(n) {
if (n <= this.length()) {
for (var c = 1, l = this.head; c < n; )
l = l.next, c++;
return l.value;
}
}
}, {
key: "set_object_at",
value: function(n, c) {
if (n <= this.length()) {
for (var l = 1, E = this.head; l < n; )
E = E.next, l++;
E.value = c;
}
}
}]), a;
})();
u.exports = g;
}),
/* 12 */
/***/
(function(u, D, y) {
function r(t, e, i) {
this.x = null, this.y = null, t == null && e == null && i == null ? (this.x = 0, this.y = 0) : typeof t == "number" && typeof e == "number" && i == null ? (this.x = t, this.y = e) : t.constructor.name == "Point" && e == null && i == null && (i = t, this.x = i.x, this.y = i.y);
}
r.prototype.getX = function() {
return this.x;
}, r.prototype.getY = function() {
return this.y;
}, r.prototype.getLocation = function() {
return new r(this.x, this.y);
}, r.prototype.setLocation = function(t, e, i) {
t.constructor.name == "Point" && e == null && i == null ? (i = t, this.setLocation(i.x, i.y)) : typeof t == "number" && typeof e == "number" && i == null && (parseInt(t) == t && parseInt(e) == e ? this.move(t, e) : (this.x = Math.floor(t + 0.5), this.y = Math.floor(e + 0.5)));
}, r.prototype.move = function(t, e) {
this.x = t, this.y = e;
}, r.prototype.translate = function(t, e) {
this.x += t, this.y += e;
}, r.prototype.equals = function(t) {
if (t.constructor.name == "Point") {
var e = t;
return this.x == e.x && this.y == e.y;
}
return this == t;
}, r.prototype.toString = function() {
return new r().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
}, u.exports = r;
}),
/* 13 */
/***/
(function(u, D, y) {
function r(t, e, i, o) {
this.x = 0, this.y = 0, this.width = 0, this.height = 0, t != null && e != null && i != null && o != null && (this.x = t, this.y = e, this.width = i, this.height = o);
}
r.prototype.getX = function() {
return this.x;
}, r.prototype.setX = function(t) {
this.x = t;
}, r.prototype.getY = function() {
return this.y;
}, r.prototype.setY = function(t) {
this.y = t;
}, r.prototype.getWidth = function() {
return this.width;
}, r.prototype.setWidth = function(t) {
this.width = t;
}, r.prototype.getHeight = function() {
return this.height;
}, r.prototype.setHeight = function(t) {
this.height = t;
}, r.prototype.getRight = function() {
return this.x + this.width;
}, r.prototype.getBottom = function() {
return this.y + this.height;
}, r.prototype.intersects = function(t) {
return !(this.getRight() < t.x || this.getBottom() < t.y || t.getRight() < this.x || t.getBottom() < this.y);
}, r.prototype.getCenterX = function() {
return this.x + this.width / 2;
}, r.prototype.getMinX = function() {
return this.getX();
}, r.prototype.getMaxX = function() {
return this.getX() + this.width;
}, r.prototype.getCenterY = function() {
return this.y + this.height / 2;
}, r.prototype.getMinY = function() {
return this.getY();
}, r.prototype.getMaxY = function() {
return this.getY() + this.height;
}, r.prototype.getWidthHalf = function() {
return this.width / 2;
}, r.prototype.getHeightHalf = function() {
return this.height / 2;
}, u.exports = r;
}),
/* 14 */
/***/
(function(u, D, y) {
var r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
return typeof e;
} : function(e) {
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
};
function t() {
}
t.lastID = 0, t.createID = function(e) {
return t.isPrimitive(e) ? e : (e.uniqueID != null || (e.uniqueID = t.getString(), t.lastID++), e.uniqueID);
}, t.getString = function(e) {
return e == null && (e = t.lastID), "Object#" + e;
}, t.isPrimitive = function(e) {
var i = typeof e > "u" ? "undefined" : r(e);
return e == null || i != "object" && i != "function";
}, u.exports = t;
}),
/* 15 */
/***/
(function(u, D, y) {
function r(l) {
if (Array.isArray(l)) {
for (var E = 0, T = Array(l.length); E < l.length; E++)
T[E] = l[E];
return T;
} else
return Array.from(l);
}
var t = y(0), e = y(6), i = y(3), o = y(1), g = y(5), a = y(4), v = y(17), n = y(27);
function c(l) {
n.call(this), this.layoutQuality = t.QUALITY, this.createBendsAsNeeded = t.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = t.DEFAULT_INCREMENTAL, this.animationOnLayout = t.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = t.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = t.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = t.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new e(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, l != null && (this.isRemoteUse = l);
}
c.RANDOM_SEED = 1, c.prototype = Object.create(n.prototype), c.prototype.getGraphManager = function() {
return this.graphManager;
}, c.prototype.getAllNodes = function() {
return this.graphManager.getAllNodes();
}, c.prototype.getAllEdges = function() {
return this.graphManager.getAllEdges();
}, c.prototype.getAllNodesToApplyGravitation = function() {
return this.graphManager.getAllNodesToApplyGravitation();
}, c.prototype.newGraphManager = function() {
var l = new e(this);
return this.graphManager = l, l;
}, c.prototype.newGraph = function(l) {
return new g(null, this.graphManager, l);
}, c.prototype.newNode = function(l) {
return new i(this.graphManager, l);
}, c.prototype.newEdge = function(l) {
return new o(null, null, l);
}, c.prototype.checkLayoutSuccess = function() {
return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
}, c.prototype.runLayout = function() {
this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
var l;
return this.checkLayoutSuccess() ? l = !1 : l = this.layout(), t.ANIMATE === "during" ? !1 :