UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

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