@ucap-llm/ai-ui 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/_basePickBy-7d00d05e.mjs +153 -0
  2. package/_baseUniq-1876be04.mjs +440 -0
  3. package/ai-ui.es.js +11 -78207
  4. package/ai-ui.umd.js +2701 -143
  5. package/arc-bb1e7b28.mjs +85 -0
  6. package/architecture-4AB2E3PP-26f07d27.mjs +10 -0
  7. package/architectureDiagram-IEHRJDOE-535e4958.mjs +4640 -0
  8. package/blockDiagram-JOT3LUYC-e5536854.mjs +2251 -0
  9. package/c4Diagram-VJAJSXHY-311741c3.mjs +1583 -0
  10. package/channel-5d097975.mjs +5 -0
  11. package/chunk-4BMEZGHF-55420838.mjs +9 -0
  12. package/chunk-A2AXSNBT-5f9de039.mjs +1373 -0
  13. package/chunk-AEK57VVT-bd6e836f.mjs +1416 -0
  14. package/chunk-D6G4REZN-69cf348a.mjs +64 -0
  15. package/chunk-RZ5BOZE2-ebe3985e.mjs +24 -0
  16. package/chunk-XZIHB7SX-ed9a9d65.mjs +15 -0
  17. package/classDiagram-GIVACNV2-4d61f06d.mjs +18 -0
  18. package/classDiagram-v2-COTLJTTW-4d61f06d.mjs +18 -0
  19. package/clone-44064c55.mjs +8 -0
  20. package/cytoscape.esm-bb479f88.mjs +18232 -0
  21. package/dagre-OKDRZEBW-0574359b.mjs +448 -0
  22. package/diagram-SSKATNLV-f4dd04b2.mjs +225 -0
  23. package/diagram-VNBRO52H-f77f925a.mjs +130 -0
  24. package/erDiagram-Q7BY3M3F-8213684f.mjs +843 -0
  25. package/flowDiagram-4HSFHLVR-1decdff6.mjs +1624 -0
  26. package/ganttDiagram-APWFNJXF-461381a5.mjs +2521 -0
  27. package/gitGraph-O2Q2CXLX-d961db16.mjs +10 -0
  28. package/gitGraphDiagram-7IBYFJ6S-be6c39c3.mjs +716 -0
  29. package/graph-7ba79f74.mjs +249 -0
  30. package/index-f5aac161.mjs +93487 -0
  31. package/info-4N47QTOZ-615527c9.mjs +10 -0
  32. package/infoDiagram-PH2N3AL5-064df479.mjs +26 -0
  33. package/init-f9637058.mjs +16 -0
  34. package/journeyDiagram-U35MCT3I-94c54b39.mjs +811 -0
  35. package/kanban-definition-NDS4AKOZ-58a05db1.mjs +720 -0
  36. package/katex-2e45926a.mjs +11700 -0
  37. package/layout-c953b0e7.mjs +1344 -0
  38. package/linear-3c81794f.mjs +447 -0
  39. package/mermaid-parser.core-7afd2b2f.mjs +12845 -0
  40. package/mindmap-definition-ALO5MXBD-60e68e28.mjs +3222 -0
  41. package/ordinal-980380c7.mjs +65 -0
  42. package/package.json +1 -1
  43. package/packet-KVYON367-4b5a305e.mjs +10 -0
  44. package/pie-R6RNRRYF-0f27d16d.mjs +10 -0
  45. package/pieDiagram-IB7DONF6-66cebf11.mjs +167 -0
  46. package/quadrantDiagram-7GDLP6J5-f2cbfc79.mjs +1027 -0
  47. package/radar-MK3ICKWK-9e1913d7.mjs +10 -0
  48. package/requirementDiagram-KVF5MWMF-36d316c2.mjs +853 -0
  49. package/sankeyDiagram-QLVOVGJD-76245efb.mjs +826 -0
  50. package/sequenceDiagram-X6HHIX6F-a0ec0021.mjs +2283 -0
  51. package/stateDiagram-DGXRK772-e6387816.mjs +274 -0
  52. package/stateDiagram-v2-YXO3MK2T-f011ada4.mjs +18 -0
  53. package/style.css +1 -1
  54. package/timeline-definition-BDJGKUSR-a62514a7.mjs +806 -0
  55. package/xychartDiagram-VJFVF3MP-1b807048.mjs +1306 -0
@@ -0,0 +1,4640 @@
1
+ import { aH as Ne, aI as qe, C as Je, _ as nt, aJ as Qe, aK as Ke, n as je, o as _e, s as tr, g as er, c as rr, b as ir, d as fe, l as be, j as ar, t as nr, H as or, V as sr, aj as Le, aL as Ee } from "./index-f5aac161.mjs";
2
+ import { p as hr } from "./chunk-4BMEZGHF-55420838.mjs";
3
+ import { I as lr } from "./chunk-XZIHB7SX-ed9a9d65.mjs";
4
+ import { p as fr } from "./mermaid-parser.core-7afd2b2f.mjs";
5
+ import { c as Pe } from "./cytoscape.esm-bb479f88.mjs";
6
+ import "vue";
7
+ import "./_baseUniq-1876be04.mjs";
8
+ import "./_basePickBy-7d00d05e.mjs";
9
+ import "./clone-44064c55.mjs";
10
+ var Ge = { exports: {} }, pe = { exports: {} }, ye = { exports: {} }, xe;
11
+ function cr() {
12
+ return xe || (xe = 1, function(C, U) {
13
+ (function(G, L) {
14
+ C.exports = L();
15
+ })(Ne, function() {
16
+ return (
17
+ /******/
18
+ function(A) {
19
+ var G = {};
20
+ function L(u) {
21
+ if (G[u])
22
+ return G[u].exports;
23
+ var l = G[u] = {
24
+ /******/
25
+ i: u,
26
+ /******/
27
+ l: !1,
28
+ /******/
29
+ exports: {}
30
+ /******/
31
+ };
32
+ return A[u].call(l.exports, l, l.exports, L), l.l = !0, l.exports;
33
+ }
34
+ return L.m = A, L.c = G, L.i = function(u) {
35
+ return u;
36
+ }, L.d = function(u, l, a) {
37
+ L.o(u, l) || Object.defineProperty(u, l, {
38
+ /******/
39
+ configurable: !1,
40
+ /******/
41
+ enumerable: !0,
42
+ /******/
43
+ get: a
44
+ /******/
45
+ });
46
+ }, L.n = function(u) {
47
+ var l = u && u.__esModule ? (
48
+ /******/
49
+ function() {
50
+ return u.default;
51
+ }
52
+ ) : (
53
+ /******/
54
+ function() {
55
+ return u;
56
+ }
57
+ );
58
+ return L.d(l, "a", l), l;
59
+ }, L.o = function(u, l) {
60
+ return Object.prototype.hasOwnProperty.call(u, l);
61
+ }, L.p = "", L(L.s = 28);
62
+ }([
63
+ /* 0 */
64
+ /***/
65
+ function(A, G, L) {
66
+ function u() {
67
+ }
68
+ u.QUALITY = 1, u.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, u.DEFAULT_INCREMENTAL = !1, u.DEFAULT_ANIMATION_ON_LAYOUT = !0, u.DEFAULT_ANIMATION_DURING_LAYOUT = !1, u.DEFAULT_ANIMATION_PERIOD = 50, u.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, u.DEFAULT_GRAPH_MARGIN = 15, u.NODE_DIMENSIONS_INCLUDE_LABELS = !1, u.SIMPLE_NODE_SIZE = 40, u.SIMPLE_NODE_HALF_SIZE = u.SIMPLE_NODE_SIZE / 2, u.EMPTY_COMPOUND_NODE_SIZE = 40, u.MIN_EDGE_LENGTH = 1, u.WORLD_BOUNDARY = 1e6, u.INITIAL_WORLD_BOUNDARY = u.WORLD_BOUNDARY / 1e3, u.WORLD_CENTER_X = 1200, u.WORLD_CENTER_Y = 900, A.exports = u;
69
+ },
70
+ /* 1 */
71
+ /***/
72
+ function(A, G, L) {
73
+ var u = L(2), l = L(8), a = L(9);
74
+ function r(f, i, g) {
75
+ u.call(this, g), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = g, this.bendpoints = [], this.source = f, this.target = i;
76
+ }
77
+ r.prototype = Object.create(u.prototype);
78
+ for (var e in u)
79
+ r[e] = u[e];
80
+ r.prototype.getSource = function() {
81
+ return this.source;
82
+ }, r.prototype.getTarget = function() {
83
+ return this.target;
84
+ }, r.prototype.isInterGraph = function() {
85
+ return this.isInterGraph;
86
+ }, r.prototype.getLength = function() {
87
+ return this.length;
88
+ }, r.prototype.isOverlapingSourceAndTarget = function() {
89
+ return this.isOverlapingSourceAndTarget;
90
+ }, r.prototype.getBendpoints = function() {
91
+ return this.bendpoints;
92
+ }, r.prototype.getLca = function() {
93
+ return this.lca;
94
+ }, r.prototype.getSourceInLca = function() {
95
+ return this.sourceInLca;
96
+ }, r.prototype.getTargetInLca = function() {
97
+ return this.targetInLca;
98
+ }, r.prototype.getOtherEnd = function(f) {
99
+ if (this.source === f)
100
+ return this.target;
101
+ if (this.target === f)
102
+ return this.source;
103
+ throw "Node is not incident with this edge";
104
+ }, r.prototype.getOtherEndInGraph = function(f, i) {
105
+ for (var g = this.getOtherEnd(f), t = i.getGraphManager().getRoot(); ; ) {
106
+ if (g.getOwner() == i)
107
+ return g;
108
+ if (g.getOwner() == t)
109
+ break;
110
+ g = g.getOwner().getParent();
111
+ }
112
+ return null;
113
+ }, r.prototype.updateLength = function() {
114
+ var f = new Array(4);
115
+ this.isOverlapingSourceAndTarget = l.getIntersection(this.target.getRect(), this.source.getRect(), f), this.isOverlapingSourceAndTarget || (this.lengthX = f[0] - f[2], this.lengthY = f[1] - f[3], Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
116
+ }, r.prototype.updateLengthSimple = function() {
117
+ this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = a.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = a.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
118
+ }, A.exports = r;
119
+ },
120
+ /* 2 */
121
+ /***/
122
+ function(A, G, L) {
123
+ function u(l) {
124
+ this.vGraphObject = l;
125
+ }
126
+ A.exports = u;
127
+ },
128
+ /* 3 */
129
+ /***/
130
+ function(A, G, L) {
131
+ var u = L(2), l = L(10), a = L(13), r = L(0), e = L(16), f = L(5);
132
+ function i(t, s, o, c) {
133
+ o == null && c == null && (c = s), u.call(this, c), t.graphManager != null && (t = t.graphManager), this.estimatedSize = l.MIN_VALUE, this.inclusionTreeDepth = l.MAX_VALUE, this.vGraphObject = c, this.edges = [], this.graphManager = t, o != null && s != null ? this.rect = new a(s.x, s.y, o.width, o.height) : this.rect = new a();
134
+ }
135
+ i.prototype = Object.create(u.prototype);
136
+ for (var g in u)
137
+ i[g] = u[g];
138
+ i.prototype.getEdges = function() {
139
+ return this.edges;
140
+ }, i.prototype.getChild = function() {
141
+ return this.child;
142
+ }, i.prototype.getOwner = function() {
143
+ return this.owner;
144
+ }, i.prototype.getWidth = function() {
145
+ return this.rect.width;
146
+ }, i.prototype.setWidth = function(t) {
147
+ this.rect.width = t;
148
+ }, i.prototype.getHeight = function() {
149
+ return this.rect.height;
150
+ }, i.prototype.setHeight = function(t) {
151
+ this.rect.height = t;
152
+ }, i.prototype.getCenterX = function() {
153
+ return this.rect.x + this.rect.width / 2;
154
+ }, i.prototype.getCenterY = function() {
155
+ return this.rect.y + this.rect.height / 2;
156
+ }, i.prototype.getCenter = function() {
157
+ return new f(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
158
+ }, i.prototype.getLocation = function() {
159
+ return new f(this.rect.x, this.rect.y);
160
+ }, i.prototype.getRect = function() {
161
+ return this.rect;
162
+ }, i.prototype.getDiagonal = function() {
163
+ return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
164
+ }, i.prototype.getHalfTheDiagonal = function() {
165
+ return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
166
+ }, i.prototype.setRect = function(t, s) {
167
+ this.rect.x = t.x, this.rect.y = t.y, this.rect.width = s.width, this.rect.height = s.height;
168
+ }, i.prototype.setCenter = function(t, s) {
169
+ this.rect.x = t - this.rect.width / 2, this.rect.y = s - this.rect.height / 2;
170
+ }, i.prototype.setLocation = function(t, s) {
171
+ this.rect.x = t, this.rect.y = s;
172
+ }, i.prototype.moveBy = function(t, s) {
173
+ this.rect.x += t, this.rect.y += s;
174
+ }, i.prototype.getEdgeListToNode = function(t) {
175
+ var s = [], o = this;
176
+ return o.edges.forEach(function(c) {
177
+ if (c.target == t) {
178
+ if (c.source != o)
179
+ throw "Incorrect edge source!";
180
+ s.push(c);
181
+ }
182
+ }), s;
183
+ }, i.prototype.getEdgesBetween = function(t) {
184
+ var s = [], o = this;
185
+ return o.edges.forEach(function(c) {
186
+ if (!(c.source == o || c.target == o))
187
+ throw "Incorrect edge source and/or target";
188
+ (c.target == t || c.source == t) && s.push(c);
189
+ }), s;
190
+ }, i.prototype.getNeighborsList = function() {
191
+ var t = /* @__PURE__ */ new Set(), s = this;
192
+ return s.edges.forEach(function(o) {
193
+ if (o.source == s)
194
+ t.add(o.target);
195
+ else {
196
+ if (o.target != s)
197
+ throw "Incorrect incidency!";
198
+ t.add(o.source);
199
+ }
200
+ }), t;
201
+ }, i.prototype.withChildren = function() {
202
+ var t = /* @__PURE__ */ new Set(), s, o;
203
+ if (t.add(this), this.child != null)
204
+ for (var c = this.child.getNodes(), h = 0; h < c.length; h++)
205
+ s = c[h], o = s.withChildren(), o.forEach(function(T) {
206
+ t.add(T);
207
+ });
208
+ return t;
209
+ }, i.prototype.getNoOfChildren = function() {
210
+ var t = 0, s;
211
+ if (this.child == null)
212
+ t = 1;
213
+ else
214
+ for (var o = this.child.getNodes(), c = 0; c < o.length; c++)
215
+ s = o[c], t += s.getNoOfChildren();
216
+ return t == 0 && (t = 1), t;
217
+ }, i.prototype.getEstimatedSize = function() {
218
+ if (this.estimatedSize == l.MIN_VALUE)
219
+ throw "assert failed";
220
+ return this.estimatedSize;
221
+ }, i.prototype.calcEstimatedSize = function() {
222
+ 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);
223
+ }, i.prototype.scatter = function() {
224
+ var t, s, o = -r.INITIAL_WORLD_BOUNDARY, c = r.INITIAL_WORLD_BOUNDARY;
225
+ t = r.WORLD_CENTER_X + e.nextDouble() * (c - o) + o;
226
+ var h = -r.INITIAL_WORLD_BOUNDARY, T = r.INITIAL_WORLD_BOUNDARY;
227
+ s = r.WORLD_CENTER_Y + e.nextDouble() * (T - h) + h, this.rect.x = t, this.rect.y = s;
228
+ }, i.prototype.updateBounds = function() {
229
+ if (this.getChild() == null)
230
+ throw "assert failed";
231
+ if (this.getChild().getNodes().length != 0) {
232
+ var t = this.getChild();
233
+ if (t.updateBounds(!0), this.rect.x = t.getLeft(), this.rect.y = t.getTop(), this.setWidth(t.getRight() - t.getLeft()), this.setHeight(t.getBottom() - t.getTop()), r.NODE_DIMENSIONS_INCLUDE_LABELS) {
234
+ var s = t.getRight() - t.getLeft(), o = t.getBottom() - t.getTop();
235
+ this.labelWidth && (this.labelPosHorizontal == "left" ? (this.rect.x -= this.labelWidth, this.setWidth(s + this.labelWidth)) : this.labelPosHorizontal == "center" && this.labelWidth > s ? (this.rect.x -= (this.labelWidth - s) / 2, this.setWidth(this.labelWidth)) : this.labelPosHorizontal == "right" && this.setWidth(s + this.labelWidth)), this.labelHeight && (this.labelPosVertical == "top" ? (this.rect.y -= this.labelHeight, this.setHeight(o + this.labelHeight)) : this.labelPosVertical == "center" && this.labelHeight > o ? (this.rect.y -= (this.labelHeight - o) / 2, this.setHeight(this.labelHeight)) : this.labelPosVertical == "bottom" && this.setHeight(o + this.labelHeight));
236
+ }
237
+ }
238
+ }, i.prototype.getInclusionTreeDepth = function() {
239
+ if (this.inclusionTreeDepth == l.MAX_VALUE)
240
+ throw "assert failed";
241
+ return this.inclusionTreeDepth;
242
+ }, i.prototype.transform = function(t) {
243
+ var s = this.rect.x;
244
+ s > r.WORLD_BOUNDARY ? s = r.WORLD_BOUNDARY : s < -r.WORLD_BOUNDARY && (s = -r.WORLD_BOUNDARY);
245
+ var o = this.rect.y;
246
+ o > r.WORLD_BOUNDARY ? o = r.WORLD_BOUNDARY : o < -r.WORLD_BOUNDARY && (o = -r.WORLD_BOUNDARY);
247
+ var c = new f(s, o), h = t.inverseTransformPoint(c);
248
+ this.setLocation(h.x, h.y);
249
+ }, i.prototype.getLeft = function() {
250
+ return this.rect.x;
251
+ }, i.prototype.getRight = function() {
252
+ return this.rect.x + this.rect.width;
253
+ }, i.prototype.getTop = function() {
254
+ return this.rect.y;
255
+ }, i.prototype.getBottom = function() {
256
+ return this.rect.y + this.rect.height;
257
+ }, i.prototype.getParent = function() {
258
+ return this.owner == null ? null : this.owner.getParent();
259
+ }, A.exports = i;
260
+ },
261
+ /* 4 */
262
+ /***/
263
+ function(A, G, L) {
264
+ var u = L(0);
265
+ function l() {
266
+ }
267
+ for (var a in u)
268
+ l[a] = u[a];
269
+ l.MAX_ITERATIONS = 2500, l.DEFAULT_EDGE_LENGTH = 50, l.DEFAULT_SPRING_STRENGTH = 0.45, l.DEFAULT_REPULSION_STRENGTH = 4500, l.DEFAULT_GRAVITY_STRENGTH = 0.4, l.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, l.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, l.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, l.COOLING_ADAPTATION_FACTOR = 0.33, l.ADAPTATION_LOWER_NODE_LIMIT = 1e3, l.ADAPTATION_UPPER_NODE_LIMIT = 5e3, l.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, l.MAX_NODE_DISPLACEMENT = l.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, l.MIN_REPULSION_DIST = l.DEFAULT_EDGE_LENGTH / 10, l.CONVERGENCE_CHECK_PERIOD = 100, l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, l.MIN_EDGE_LENGTH = 1, l.GRID_CALCULATION_CHECK_PERIOD = 10, A.exports = l;
270
+ },
271
+ /* 5 */
272
+ /***/
273
+ function(A, G, L) {
274
+ function u(l, a) {
275
+ l == null && a == null ? (this.x = 0, this.y = 0) : (this.x = l, this.y = a);
276
+ }
277
+ u.prototype.getX = function() {
278
+ return this.x;
279
+ }, u.prototype.getY = function() {
280
+ return this.y;
281
+ }, u.prototype.setX = function(l) {
282
+ this.x = l;
283
+ }, u.prototype.setY = function(l) {
284
+ this.y = l;
285
+ }, u.prototype.getDifference = function(l) {
286
+ return new DimensionD(this.x - l.x, this.y - l.y);
287
+ }, u.prototype.getCopy = function() {
288
+ return new u(this.x, this.y);
289
+ }, u.prototype.translate = function(l) {
290
+ return this.x += l.width, this.y += l.height, this;
291
+ }, A.exports = u;
292
+ },
293
+ /* 6 */
294
+ /***/
295
+ function(A, G, L) {
296
+ var u = L(2), l = L(10), a = L(0), r = L(7), e = L(3), f = L(1), i = L(13), g = L(12), t = L(11);
297
+ function s(c, h, T) {
298
+ u.call(this, T), this.estimatedSize = l.MIN_VALUE, this.margin = a.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = c, h != null && h instanceof r ? this.graphManager = h : h != null && h instanceof Layout && (this.graphManager = h.graphManager);
299
+ }
300
+ s.prototype = Object.create(u.prototype);
301
+ for (var o in u)
302
+ s[o] = u[o];
303
+ s.prototype.getNodes = function() {
304
+ return this.nodes;
305
+ }, s.prototype.getEdges = function() {
306
+ return this.edges;
307
+ }, s.prototype.getGraphManager = function() {
308
+ return this.graphManager;
309
+ }, s.prototype.getParent = function() {
310
+ return this.parent;
311
+ }, s.prototype.getLeft = function() {
312
+ return this.left;
313
+ }, s.prototype.getRight = function() {
314
+ return this.right;
315
+ }, s.prototype.getTop = function() {
316
+ return this.top;
317
+ }, s.prototype.getBottom = function() {
318
+ return this.bottom;
319
+ }, s.prototype.isConnected = function() {
320
+ return this.isConnected;
321
+ }, s.prototype.add = function(c, h, T) {
322
+ if (h == null && T == null) {
323
+ var v = c;
324
+ if (this.graphManager == null)
325
+ throw "Graph has no graph mgr!";
326
+ if (this.getNodes().indexOf(v) > -1)
327
+ throw "Node already in graph!";
328
+ return v.owner = this, this.getNodes().push(v), v;
329
+ } else {
330
+ var d = c;
331
+ if (!(this.getNodes().indexOf(h) > -1 && this.getNodes().indexOf(T) > -1))
332
+ throw "Source or target not in graph!";
333
+ if (!(h.owner == T.owner && h.owner == this))
334
+ throw "Both owners must be this graph!";
335
+ return h.owner != T.owner ? null : (d.source = h, d.target = T, d.isInterGraph = !1, this.getEdges().push(d), h.edges.push(d), T != h && T.edges.push(d), d);
336
+ }
337
+ }, s.prototype.remove = function(c) {
338
+ var h = c;
339
+ if (c instanceof e) {
340
+ if (h == null)
341
+ throw "Node is null!";
342
+ if (!(h.owner != null && h.owner == this))
343
+ throw "Owner graph is invalid!";
344
+ if (this.graphManager == null)
345
+ throw "Owner graph manager is invalid!";
346
+ for (var T = h.edges.slice(), v, d = T.length, N = 0; N < d; N++)
347
+ v = T[N], v.isInterGraph ? this.graphManager.remove(v) : v.source.owner.remove(v);
348
+ var S = this.nodes.indexOf(h);
349
+ if (S == -1)
350
+ throw "Node not in owner node list!";
351
+ this.nodes.splice(S, 1);
352
+ } else if (c instanceof f) {
353
+ var v = c;
354
+ if (v == null)
355
+ throw "Edge is null!";
356
+ if (!(v.source != null && v.target != null))
357
+ throw "Source and/or target is null!";
358
+ if (!(v.source.owner != null && v.target.owner != null && v.source.owner == this && v.target.owner == this))
359
+ throw "Source and/or target owner is invalid!";
360
+ var M = v.source.edges.indexOf(v), P = v.target.edges.indexOf(v);
361
+ if (!(M > -1 && P > -1))
362
+ throw "Source and/or target doesn't know this edge!";
363
+ v.source.edges.splice(M, 1), v.target != v.source && v.target.edges.splice(P, 1);
364
+ var S = v.source.owner.getEdges().indexOf(v);
365
+ if (S == -1)
366
+ throw "Not in owner's edge list!";
367
+ v.source.owner.getEdges().splice(S, 1);
368
+ }
369
+ }, s.prototype.updateLeftTop = function() {
370
+ for (var c = l.MAX_VALUE, h = l.MAX_VALUE, T, v, d, N = this.getNodes(), S = N.length, M = 0; M < S; M++) {
371
+ var P = N[M];
372
+ T = P.getTop(), v = P.getLeft(), c > T && (c = T), h > v && (h = v);
373
+ }
374
+ return c == l.MAX_VALUE ? null : (N[0].getParent().paddingLeft != null ? d = N[0].getParent().paddingLeft : d = this.margin, this.left = h - d, this.top = c - d, new g(this.left, this.top));
375
+ }, s.prototype.updateBounds = function(c) {
376
+ for (var h = l.MAX_VALUE, T = -l.MAX_VALUE, v = l.MAX_VALUE, d = -l.MAX_VALUE, N, S, M, P, K, X = this.nodes, k = X.length, D = 0; D < k; D++) {
377
+ var rt = X[D];
378
+ c && rt.child != null && rt.updateBounds(), N = rt.getLeft(), S = rt.getRight(), M = rt.getTop(), P = rt.getBottom(), h > N && (h = N), T < S && (T = S), v > M && (v = M), d < P && (d = P);
379
+ }
380
+ var n = new i(h, v, T - h, d - v);
381
+ h == l.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), X[0].getParent().paddingLeft != null ? K = X[0].getParent().paddingLeft : K = this.margin, this.left = n.x - K, this.right = n.x + n.width + K, this.top = n.y - K, this.bottom = n.y + n.height + K;
382
+ }, s.calculateBounds = function(c) {
383
+ for (var h = l.MAX_VALUE, T = -l.MAX_VALUE, v = l.MAX_VALUE, d = -l.MAX_VALUE, N, S, M, P, K = c.length, X = 0; X < K; X++) {
384
+ var k = c[X];
385
+ N = k.getLeft(), S = k.getRight(), M = k.getTop(), P = k.getBottom(), h > N && (h = N), T < S && (T = S), v > M && (v = M), d < P && (d = P);
386
+ }
387
+ var D = new i(h, v, T - h, d - v);
388
+ return D;
389
+ }, s.prototype.getInclusionTreeDepth = function() {
390
+ return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
391
+ }, s.prototype.getEstimatedSize = function() {
392
+ if (this.estimatedSize == l.MIN_VALUE)
393
+ throw "assert failed";
394
+ return this.estimatedSize;
395
+ }, s.prototype.calcEstimatedSize = function() {
396
+ for (var c = 0, h = this.nodes, T = h.length, v = 0; v < T; v++) {
397
+ var d = h[v];
398
+ c += d.calcEstimatedSize();
399
+ }
400
+ return c == 0 ? this.estimatedSize = a.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = c / Math.sqrt(this.nodes.length), this.estimatedSize;
401
+ }, s.prototype.updateConnected = function() {
402
+ var c = this;
403
+ if (this.nodes.length == 0) {
404
+ this.isConnected = !0;
405
+ return;
406
+ }
407
+ var h = new t(), T = /* @__PURE__ */ new Set(), v = this.nodes[0], d, N, S = v.withChildren();
408
+ for (S.forEach(function(D) {
409
+ h.push(D), T.add(D);
410
+ }); h.length !== 0; ) {
411
+ v = h.shift(), d = v.getEdges();
412
+ for (var M = d.length, P = 0; P < M; P++) {
413
+ var K = d[P];
414
+ if (N = K.getOtherEndInGraph(v, this), N != null && !T.has(N)) {
415
+ var X = N.withChildren();
416
+ X.forEach(function(D) {
417
+ h.push(D), T.add(D);
418
+ });
419
+ }
420
+ }
421
+ }
422
+ if (this.isConnected = !1, T.size >= this.nodes.length) {
423
+ var k = 0;
424
+ T.forEach(function(D) {
425
+ D.owner == c && k++;
426
+ }), k == this.nodes.length && (this.isConnected = !0);
427
+ }
428
+ }, A.exports = s;
429
+ },
430
+ /* 7 */
431
+ /***/
432
+ function(A, G, L) {
433
+ var u, l = L(1);
434
+ function a(r) {
435
+ u = L(6), this.layout = r, this.graphs = [], this.edges = [];
436
+ }
437
+ a.prototype.addRoot = function() {
438
+ var r = this.layout.newGraph(), e = this.layout.newNode(null), f = this.add(r, e);
439
+ return this.setRootGraph(f), this.rootGraph;
440
+ }, a.prototype.add = function(r, e, f, i, g) {
441
+ if (f == null && i == null && g == null) {
442
+ if (r == null)
443
+ throw "Graph is null!";
444
+ if (e == null)
445
+ throw "Parent node is null!";
446
+ if (this.graphs.indexOf(r) > -1)
447
+ throw "Graph already in this graph mgr!";
448
+ if (this.graphs.push(r), r.parent != null)
449
+ throw "Already has a parent!";
450
+ if (e.child != null)
451
+ throw "Already has a child!";
452
+ return r.parent = e, e.child = r, r;
453
+ } else {
454
+ g = f, i = e, f = r;
455
+ var t = i.getOwner(), s = g.getOwner();
456
+ if (!(t != null && t.getGraphManager() == this))
457
+ throw "Source not in this graph mgr!";
458
+ if (!(s != null && s.getGraphManager() == this))
459
+ throw "Target not in this graph mgr!";
460
+ if (t == s)
461
+ return f.isInterGraph = !1, t.add(f, i, g);
462
+ if (f.isInterGraph = !0, f.source = i, f.target = g, this.edges.indexOf(f) > -1)
463
+ throw "Edge already in inter-graph edge list!";
464
+ if (this.edges.push(f), !(f.source != null && f.target != null))
465
+ throw "Edge source and/or target is null!";
466
+ if (!(f.source.edges.indexOf(f) == -1 && f.target.edges.indexOf(f) == -1))
467
+ throw "Edge already in source and/or target incidency list!";
468
+ return f.source.edges.push(f), f.target.edges.push(f), f;
469
+ }
470
+ }, a.prototype.remove = function(r) {
471
+ if (r instanceof u) {
472
+ var e = r;
473
+ if (e.getGraphManager() != this)
474
+ throw "Graph not in this graph mgr";
475
+ if (!(e == this.rootGraph || e.parent != null && e.parent.graphManager == this))
476
+ throw "Invalid parent node!";
477
+ var f = [];
478
+ f = f.concat(e.getEdges());
479
+ for (var i, g = f.length, t = 0; t < g; t++)
480
+ i = f[t], e.remove(i);
481
+ var s = [];
482
+ s = s.concat(e.getNodes());
483
+ var o;
484
+ g = s.length;
485
+ for (var t = 0; t < g; t++)
486
+ o = s[t], e.remove(o);
487
+ e == this.rootGraph && this.setRootGraph(null);
488
+ var c = this.graphs.indexOf(e);
489
+ this.graphs.splice(c, 1), e.parent = null;
490
+ } else if (r instanceof l) {
491
+ if (i = r, i == null)
492
+ throw "Edge is null!";
493
+ if (!i.isInterGraph)
494
+ throw "Not an inter-graph edge!";
495
+ if (!(i.source != null && i.target != null))
496
+ throw "Source and/or target is null!";
497
+ if (!(i.source.edges.indexOf(i) != -1 && i.target.edges.indexOf(i) != -1))
498
+ throw "Source and/or target doesn't know this edge!";
499
+ var c = i.source.edges.indexOf(i);
500
+ if (i.source.edges.splice(c, 1), c = i.target.edges.indexOf(i), i.target.edges.splice(c, 1), !(i.source.owner != null && i.source.owner.getGraphManager() != null))
501
+ throw "Edge owner graph or owner graph manager is null!";
502
+ if (i.source.owner.getGraphManager().edges.indexOf(i) == -1)
503
+ throw "Not in owner graph manager's edge list!";
504
+ var c = i.source.owner.getGraphManager().edges.indexOf(i);
505
+ i.source.owner.getGraphManager().edges.splice(c, 1);
506
+ }
507
+ }, a.prototype.updateBounds = function() {
508
+ this.rootGraph.updateBounds(!0);
509
+ }, a.prototype.getGraphs = function() {
510
+ return this.graphs;
511
+ }, a.prototype.getAllNodes = function() {
512
+ if (this.allNodes == null) {
513
+ for (var r = [], e = this.getGraphs(), f = e.length, i = 0; i < f; i++)
514
+ r = r.concat(e[i].getNodes());
515
+ this.allNodes = r;
516
+ }
517
+ return this.allNodes;
518
+ }, a.prototype.resetAllNodes = function() {
519
+ this.allNodes = null;
520
+ }, a.prototype.resetAllEdges = function() {
521
+ this.allEdges = null;
522
+ }, a.prototype.resetAllNodesToApplyGravitation = function() {
523
+ this.allNodesToApplyGravitation = null;
524
+ }, a.prototype.getAllEdges = function() {
525
+ if (this.allEdges == null) {
526
+ var r = [], e = this.getGraphs();
527
+ e.length;
528
+ for (var f = 0; f < e.length; f++)
529
+ r = r.concat(e[f].getEdges());
530
+ r = r.concat(this.edges), this.allEdges = r;
531
+ }
532
+ return this.allEdges;
533
+ }, a.prototype.getAllNodesToApplyGravitation = function() {
534
+ return this.allNodesToApplyGravitation;
535
+ }, a.prototype.setAllNodesToApplyGravitation = function(r) {
536
+ if (this.allNodesToApplyGravitation != null)
537
+ throw "assert failed";
538
+ this.allNodesToApplyGravitation = r;
539
+ }, a.prototype.getRoot = function() {
540
+ return this.rootGraph;
541
+ }, a.prototype.setRootGraph = function(r) {
542
+ if (r.getGraphManager() != this)
543
+ throw "Root not in this graph mgr!";
544
+ this.rootGraph = r, r.parent == null && (r.parent = this.layout.newNode("Root node"));
545
+ }, a.prototype.getLayout = function() {
546
+ return this.layout;
547
+ }, a.prototype.isOneAncestorOfOther = function(r, e) {
548
+ if (!(r != null && e != null))
549
+ throw "assert failed";
550
+ if (r == e)
551
+ return !0;
552
+ var f = r.getOwner(), i;
553
+ do {
554
+ if (i = f.getParent(), i == null)
555
+ break;
556
+ if (i == e)
557
+ return !0;
558
+ if (f = i.getOwner(), f == null)
559
+ break;
560
+ } while (!0);
561
+ f = e.getOwner();
562
+ do {
563
+ if (i = f.getParent(), i == null)
564
+ break;
565
+ if (i == r)
566
+ return !0;
567
+ if (f = i.getOwner(), f == null)
568
+ break;
569
+ } while (!0);
570
+ return !1;
571
+ }, a.prototype.calcLowestCommonAncestors = function() {
572
+ for (var r, e, f, i, g, t = this.getAllEdges(), s = t.length, o = 0; o < s; o++) {
573
+ if (r = t[o], e = r.source, f = r.target, r.lca = null, r.sourceInLca = e, r.targetInLca = f, e == f) {
574
+ r.lca = e.getOwner();
575
+ continue;
576
+ }
577
+ for (i = e.getOwner(); r.lca == null; ) {
578
+ for (r.targetInLca = f, g = f.getOwner(); r.lca == null; ) {
579
+ if (g == i) {
580
+ r.lca = g;
581
+ break;
582
+ }
583
+ if (g == this.rootGraph)
584
+ break;
585
+ if (r.lca != null)
586
+ throw "assert failed";
587
+ r.targetInLca = g.getParent(), g = r.targetInLca.getOwner();
588
+ }
589
+ if (i == this.rootGraph)
590
+ break;
591
+ r.lca == null && (r.sourceInLca = i.getParent(), i = r.sourceInLca.getOwner());
592
+ }
593
+ if (r.lca == null)
594
+ throw "assert failed";
595
+ }
596
+ }, a.prototype.calcLowestCommonAncestor = function(r, e) {
597
+ if (r == e)
598
+ return r.getOwner();
599
+ var f = r.getOwner();
600
+ do {
601
+ if (f == null)
602
+ break;
603
+ var i = e.getOwner();
604
+ do {
605
+ if (i == null)
606
+ break;
607
+ if (i == f)
608
+ return i;
609
+ i = i.getParent().getOwner();
610
+ } while (!0);
611
+ f = f.getParent().getOwner();
612
+ } while (!0);
613
+ return f;
614
+ }, a.prototype.calcInclusionTreeDepths = function(r, e) {
615
+ r == null && e == null && (r = this.rootGraph, e = 1);
616
+ for (var f, i = r.getNodes(), g = i.length, t = 0; t < g; t++)
617
+ f = i[t], f.inclusionTreeDepth = e, f.child != null && this.calcInclusionTreeDepths(f.child, e + 1);
618
+ }, a.prototype.includesInvalidEdge = function() {
619
+ for (var r, e = [], f = this.edges.length, i = 0; i < f; i++)
620
+ r = this.edges[i], this.isOneAncestorOfOther(r.source, r.target) && e.push(r);
621
+ for (var i = 0; i < e.length; i++)
622
+ this.remove(e[i]);
623
+ return !1;
624
+ }, A.exports = a;
625
+ },
626
+ /* 8 */
627
+ /***/
628
+ function(A, G, L) {
629
+ var u = L(12);
630
+ function l() {
631
+ }
632
+ l.calcSeparationAmount = function(a, r, e, f) {
633
+ if (!a.intersects(r))
634
+ throw "assert failed";
635
+ var i = new Array(2);
636
+ this.decideDirectionsForOverlappingNodes(a, r, i), e[0] = Math.min(a.getRight(), r.getRight()) - Math.max(a.x, r.x), e[1] = Math.min(a.getBottom(), r.getBottom()) - Math.max(a.y, r.y), a.getX() <= r.getX() && a.getRight() >= r.getRight() ? e[0] += Math.min(r.getX() - a.getX(), a.getRight() - r.getRight()) : r.getX() <= a.getX() && r.getRight() >= a.getRight() && (e[0] += Math.min(a.getX() - r.getX(), r.getRight() - a.getRight())), a.getY() <= r.getY() && a.getBottom() >= r.getBottom() ? e[1] += Math.min(r.getY() - a.getY(), a.getBottom() - r.getBottom()) : r.getY() <= a.getY() && r.getBottom() >= a.getBottom() && (e[1] += Math.min(a.getY() - r.getY(), r.getBottom() - a.getBottom()));
637
+ var g = Math.abs((r.getCenterY() - a.getCenterY()) / (r.getCenterX() - a.getCenterX()));
638
+ r.getCenterY() === a.getCenterY() && r.getCenterX() === a.getCenterX() && (g = 1);
639
+ var t = g * e[0], s = e[1] / g;
640
+ e[0] < s ? s = e[0] : t = e[1], e[0] = -1 * i[0] * (s / 2 + f), e[1] = -1 * i[1] * (t / 2 + f);
641
+ }, l.decideDirectionsForOverlappingNodes = function(a, r, e) {
642
+ a.getCenterX() < r.getCenterX() ? e[0] = -1 : e[0] = 1, a.getCenterY() < r.getCenterY() ? e[1] = -1 : e[1] = 1;
643
+ }, l.getIntersection2 = function(a, r, e) {
644
+ var f = a.getCenterX(), i = a.getCenterY(), g = r.getCenterX(), t = r.getCenterY();
645
+ if (a.intersects(r))
646
+ return e[0] = f, e[1] = i, e[2] = g, e[3] = t, !0;
647
+ var s = a.getX(), o = a.getY(), c = a.getRight(), h = a.getX(), T = a.getBottom(), v = a.getRight(), d = a.getWidthHalf(), N = a.getHeightHalf(), S = r.getX(), M = r.getY(), P = r.getRight(), K = r.getX(), X = r.getBottom(), k = r.getRight(), D = r.getWidthHalf(), rt = r.getHeightHalf(), n = !1, m = !1;
648
+ if (f === g) {
649
+ if (i > t)
650
+ return e[0] = f, e[1] = o, e[2] = g, e[3] = X, !1;
651
+ if (i < t)
652
+ return e[0] = f, e[1] = T, e[2] = g, e[3] = M, !1;
653
+ } else if (i === t) {
654
+ if (f > g)
655
+ return e[0] = s, e[1] = i, e[2] = P, e[3] = t, !1;
656
+ if (f < g)
657
+ return e[0] = c, e[1] = i, e[2] = S, e[3] = t, !1;
658
+ } else {
659
+ var p = a.height / a.width, E = r.height / r.width, y = (t - i) / (g - f), I = void 0, w = void 0, R = void 0, W = void 0, x = void 0, q = void 0;
660
+ if (-p === y ? f > g ? (e[0] = h, e[1] = T, n = !0) : (e[0] = c, e[1] = o, n = !0) : p === y && (f > g ? (e[0] = s, e[1] = o, n = !0) : (e[0] = v, e[1] = T, n = !0)), -E === y ? g > f ? (e[2] = K, e[3] = X, m = !0) : (e[2] = P, e[3] = M, m = !0) : E === y && (g > f ? (e[2] = S, e[3] = M, m = !0) : (e[2] = k, e[3] = X, m = !0)), n && m)
661
+ return !1;
662
+ if (f > g ? i > t ? (I = this.getCardinalDirection(p, y, 4), w = this.getCardinalDirection(E, y, 2)) : (I = this.getCardinalDirection(-p, y, 3), w = this.getCardinalDirection(-E, y, 1)) : i > t ? (I = this.getCardinalDirection(-p, y, 1), w = this.getCardinalDirection(-E, y, 3)) : (I = this.getCardinalDirection(p, y, 2), w = this.getCardinalDirection(E, y, 4)), !n)
663
+ switch (I) {
664
+ case 1:
665
+ W = o, R = f + -N / y, e[0] = R, e[1] = W;
666
+ break;
667
+ case 2:
668
+ R = v, W = i + d * y, e[0] = R, e[1] = W;
669
+ break;
670
+ case 3:
671
+ W = T, R = f + N / y, e[0] = R, e[1] = W;
672
+ break;
673
+ case 4:
674
+ R = h, W = i + -d * y, e[0] = R, e[1] = W;
675
+ break;
676
+ }
677
+ if (!m)
678
+ switch (w) {
679
+ case 1:
680
+ q = M, x = g + -rt / y, e[2] = x, e[3] = q;
681
+ break;
682
+ case 2:
683
+ x = k, q = t + D * y, e[2] = x, e[3] = q;
684
+ break;
685
+ case 3:
686
+ q = X, x = g + rt / y, e[2] = x, e[3] = q;
687
+ break;
688
+ case 4:
689
+ x = K, q = t + -D * y, e[2] = x, e[3] = q;
690
+ break;
691
+ }
692
+ }
693
+ return !1;
694
+ }, l.getCardinalDirection = function(a, r, e) {
695
+ return a > r ? e : 1 + e % 4;
696
+ }, l.getIntersection = function(a, r, e, f) {
697
+ if (f == null)
698
+ return this.getIntersection2(a, r, e);
699
+ var i = a.x, g = a.y, t = r.x, s = r.y, o = e.x, c = e.y, h = f.x, T = f.y, v = void 0, d = void 0, N = void 0, S = void 0, M = void 0, P = void 0, K = void 0, X = void 0, k = void 0;
700
+ return N = s - g, M = i - t, K = t * g - i * s, S = T - c, P = o - h, X = h * c - o * T, k = N * P - S * M, k === 0 ? null : (v = (M * X - P * K) / k, d = (S * K - N * X) / k, new u(v, d));
701
+ }, l.angleOfVector = function(a, r, e, f) {
702
+ var i = void 0;
703
+ return a !== e ? (i = Math.atan((f - r) / (e - a)), e < a ? i += Math.PI : f < r && (i += this.TWO_PI)) : f < r ? i = this.ONE_AND_HALF_PI : i = this.HALF_PI, i;
704
+ }, l.doIntersect = function(a, r, e, f) {
705
+ var i = a.x, g = a.y, t = r.x, s = r.y, o = e.x, c = e.y, h = f.x, T = f.y, v = (t - i) * (T - c) - (h - o) * (s - g);
706
+ if (v === 0)
707
+ return !1;
708
+ var d = ((T - c) * (h - i) + (o - h) * (T - g)) / v, N = ((g - s) * (h - i) + (t - i) * (T - g)) / v;
709
+ return 0 < d && d < 1 && 0 < N && N < 1;
710
+ }, l.findCircleLineIntersections = function(a, r, e, f, i, g, t) {
711
+ var s = (e - a) * (e - a) + (f - r) * (f - r), o = 2 * ((a - i) * (e - a) + (r - g) * (f - r)), c = (a - i) * (a - i) + (r - g) * (r - g) - t * t, h = o * o - 4 * s * c;
712
+ if (h >= 0) {
713
+ var T = (-o + Math.sqrt(o * o - 4 * s * c)) / (2 * s), v = (-o - Math.sqrt(o * o - 4 * s * c)) / (2 * s), d = null;
714
+ return T >= 0 && T <= 1 ? [T] : v >= 0 && v <= 1 ? [v] : d;
715
+ } else
716
+ return null;
717
+ }, l.HALF_PI = 0.5 * Math.PI, l.ONE_AND_HALF_PI = 1.5 * Math.PI, l.TWO_PI = 2 * Math.PI, l.THREE_PI = 3 * Math.PI, A.exports = l;
718
+ },
719
+ /* 9 */
720
+ /***/
721
+ function(A, G, L) {
722
+ function u() {
723
+ }
724
+ u.sign = function(l) {
725
+ return l > 0 ? 1 : l < 0 ? -1 : 0;
726
+ }, u.floor = function(l) {
727
+ return l < 0 ? Math.ceil(l) : Math.floor(l);
728
+ }, u.ceil = function(l) {
729
+ return l < 0 ? Math.floor(l) : Math.ceil(l);
730
+ }, A.exports = u;
731
+ },
732
+ /* 10 */
733
+ /***/
734
+ function(A, G, L) {
735
+ function u() {
736
+ }
737
+ u.MAX_VALUE = 2147483647, u.MIN_VALUE = -2147483648, A.exports = u;
738
+ },
739
+ /* 11 */
740
+ /***/
741
+ function(A, G, L) {
742
+ var u = function() {
743
+ function i(g, t) {
744
+ for (var s = 0; s < t.length; s++) {
745
+ var o = t[s];
746
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(g, o.key, o);
747
+ }
748
+ }
749
+ return function(g, t, s) {
750
+ return t && i(g.prototype, t), s && i(g, s), g;
751
+ };
752
+ }();
753
+ function l(i, g) {
754
+ if (!(i instanceof g))
755
+ throw new TypeError("Cannot call a class as a function");
756
+ }
757
+ var a = function(g) {
758
+ return { value: g, next: null, prev: null };
759
+ }, r = function(g, t, s, o) {
760
+ return g !== null ? g.next = t : o.head = t, s !== null ? s.prev = t : o.tail = t, t.prev = g, t.next = s, o.length++, t;
761
+ }, e = function(g, t) {
762
+ var s = g.prev, o = g.next;
763
+ return s !== null ? s.next = o : t.head = o, o !== null ? o.prev = s : t.tail = s, g.prev = g.next = null, t.length--, g;
764
+ }, f = function() {
765
+ function i(g) {
766
+ var t = this;
767
+ l(this, i), this.length = 0, this.head = null, this.tail = null, g != null && g.forEach(function(s) {
768
+ return t.push(s);
769
+ });
770
+ }
771
+ return u(i, [{
772
+ key: "size",
773
+ value: function() {
774
+ return this.length;
775
+ }
776
+ }, {
777
+ key: "insertBefore",
778
+ value: function(t, s) {
779
+ return r(s.prev, a(t), s, this);
780
+ }
781
+ }, {
782
+ key: "insertAfter",
783
+ value: function(t, s) {
784
+ return r(s, a(t), s.next, this);
785
+ }
786
+ }, {
787
+ key: "insertNodeBefore",
788
+ value: function(t, s) {
789
+ return r(s.prev, t, s, this);
790
+ }
791
+ }, {
792
+ key: "insertNodeAfter",
793
+ value: function(t, s) {
794
+ return r(s, t, s.next, this);
795
+ }
796
+ }, {
797
+ key: "push",
798
+ value: function(t) {
799
+ return r(this.tail, a(t), null, this);
800
+ }
801
+ }, {
802
+ key: "unshift",
803
+ value: function(t) {
804
+ return r(null, a(t), this.head, this);
805
+ }
806
+ }, {
807
+ key: "remove",
808
+ value: function(t) {
809
+ return e(t, this);
810
+ }
811
+ }, {
812
+ key: "pop",
813
+ value: function() {
814
+ return e(this.tail, this).value;
815
+ }
816
+ }, {
817
+ key: "popNode",
818
+ value: function() {
819
+ return e(this.tail, this);
820
+ }
821
+ }, {
822
+ key: "shift",
823
+ value: function() {
824
+ return e(this.head, this).value;
825
+ }
826
+ }, {
827
+ key: "shiftNode",
828
+ value: function() {
829
+ return e(this.head, this);
830
+ }
831
+ }, {
832
+ key: "get_object_at",
833
+ value: function(t) {
834
+ if (t <= this.length()) {
835
+ for (var s = 1, o = this.head; s < t; )
836
+ o = o.next, s++;
837
+ return o.value;
838
+ }
839
+ }
840
+ }, {
841
+ key: "set_object_at",
842
+ value: function(t, s) {
843
+ if (t <= this.length()) {
844
+ for (var o = 1, c = this.head; o < t; )
845
+ c = c.next, o++;
846
+ c.value = s;
847
+ }
848
+ }
849
+ }]), i;
850
+ }();
851
+ A.exports = f;
852
+ },
853
+ /* 12 */
854
+ /***/
855
+ function(A, G, L) {
856
+ function u(l, a, r) {
857
+ this.x = null, this.y = null, l == null && a == null && r == null ? (this.x = 0, this.y = 0) : typeof l == "number" && typeof a == "number" && r == null ? (this.x = l, this.y = a) : l.constructor.name == "Point" && a == null && r == null && (r = l, this.x = r.x, this.y = r.y);
858
+ }
859
+ u.prototype.getX = function() {
860
+ return this.x;
861
+ }, u.prototype.getY = function() {
862
+ return this.y;
863
+ }, u.prototype.getLocation = function() {
864
+ return new u(this.x, this.y);
865
+ }, u.prototype.setLocation = function(l, a, r) {
866
+ l.constructor.name == "Point" && a == null && r == null ? (r = l, this.setLocation(r.x, r.y)) : typeof l == "number" && typeof a == "number" && r == null && (parseInt(l) == l && parseInt(a) == a ? this.move(l, a) : (this.x = Math.floor(l + 0.5), this.y = Math.floor(a + 0.5)));
867
+ }, u.prototype.move = function(l, a) {
868
+ this.x = l, this.y = a;
869
+ }, u.prototype.translate = function(l, a) {
870
+ this.x += l, this.y += a;
871
+ }, u.prototype.equals = function(l) {
872
+ if (l.constructor.name == "Point") {
873
+ var a = l;
874
+ return this.x == a.x && this.y == a.y;
875
+ }
876
+ return this == l;
877
+ }, u.prototype.toString = function() {
878
+ return new u().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
879
+ }, A.exports = u;
880
+ },
881
+ /* 13 */
882
+ /***/
883
+ function(A, G, L) {
884
+ function u(l, a, r, e) {
885
+ this.x = 0, this.y = 0, this.width = 0, this.height = 0, l != null && a != null && r != null && e != null && (this.x = l, this.y = a, this.width = r, this.height = e);
886
+ }
887
+ u.prototype.getX = function() {
888
+ return this.x;
889
+ }, u.prototype.setX = function(l) {
890
+ this.x = l;
891
+ }, u.prototype.getY = function() {
892
+ return this.y;
893
+ }, u.prototype.setY = function(l) {
894
+ this.y = l;
895
+ }, u.prototype.getWidth = function() {
896
+ return this.width;
897
+ }, u.prototype.setWidth = function(l) {
898
+ this.width = l;
899
+ }, u.prototype.getHeight = function() {
900
+ return this.height;
901
+ }, u.prototype.setHeight = function(l) {
902
+ this.height = l;
903
+ }, u.prototype.getRight = function() {
904
+ return this.x + this.width;
905
+ }, u.prototype.getBottom = function() {
906
+ return this.y + this.height;
907
+ }, u.prototype.intersects = function(l) {
908
+ return !(this.getRight() < l.x || this.getBottom() < l.y || l.getRight() < this.x || l.getBottom() < this.y);
909
+ }, u.prototype.getCenterX = function() {
910
+ return this.x + this.width / 2;
911
+ }, u.prototype.getMinX = function() {
912
+ return this.getX();
913
+ }, u.prototype.getMaxX = function() {
914
+ return this.getX() + this.width;
915
+ }, u.prototype.getCenterY = function() {
916
+ return this.y + this.height / 2;
917
+ }, u.prototype.getMinY = function() {
918
+ return this.getY();
919
+ }, u.prototype.getMaxY = function() {
920
+ return this.getY() + this.height;
921
+ }, u.prototype.getWidthHalf = function() {
922
+ return this.width / 2;
923
+ }, u.prototype.getHeightHalf = function() {
924
+ return this.height / 2;
925
+ }, A.exports = u;
926
+ },
927
+ /* 14 */
928
+ /***/
929
+ function(A, G, L) {
930
+ var u = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(a) {
931
+ return typeof a;
932
+ } : function(a) {
933
+ return a && typeof Symbol == "function" && a.constructor === Symbol && a !== Symbol.prototype ? "symbol" : typeof a;
934
+ };
935
+ function l() {
936
+ }
937
+ l.lastID = 0, l.createID = function(a) {
938
+ return l.isPrimitive(a) ? a : (a.uniqueID != null || (a.uniqueID = l.getString(), l.lastID++), a.uniqueID);
939
+ }, l.getString = function(a) {
940
+ return a == null && (a = l.lastID), "Object#" + a;
941
+ }, l.isPrimitive = function(a) {
942
+ var r = typeof a > "u" ? "undefined" : u(a);
943
+ return a == null || r != "object" && r != "function";
944
+ }, A.exports = l;
945
+ },
946
+ /* 15 */
947
+ /***/
948
+ function(A, G, L) {
949
+ function u(o) {
950
+ if (Array.isArray(o)) {
951
+ for (var c = 0, h = Array(o.length); c < o.length; c++)
952
+ h[c] = o[c];
953
+ return h;
954
+ } else
955
+ return Array.from(o);
956
+ }
957
+ var l = L(0), a = L(7), r = L(3), e = L(1), f = L(6), i = L(5), g = L(17), t = L(29);
958
+ function s(o) {
959
+ t.call(this), this.layoutQuality = l.QUALITY, this.createBendsAsNeeded = l.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = l.DEFAULT_INCREMENTAL, this.animationOnLayout = l.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = l.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = l.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = l.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new a(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, o != null && (this.isRemoteUse = o);
960
+ }
961
+ s.RANDOM_SEED = 1, s.prototype = Object.create(t.prototype), s.prototype.getGraphManager = function() {
962
+ return this.graphManager;
963
+ }, s.prototype.getAllNodes = function() {
964
+ return this.graphManager.getAllNodes();
965
+ }, s.prototype.getAllEdges = function() {
966
+ return this.graphManager.getAllEdges();
967
+ }, s.prototype.getAllNodesToApplyGravitation = function() {
968
+ return this.graphManager.getAllNodesToApplyGravitation();
969
+ }, s.prototype.newGraphManager = function() {
970
+ var o = new a(this);
971
+ return this.graphManager = o, o;
972
+ }, s.prototype.newGraph = function(o) {
973
+ return new f(null, this.graphManager, o);
974
+ }, s.prototype.newNode = function(o) {
975
+ return new r(this.graphManager, o);
976
+ }, s.prototype.newEdge = function(o) {
977
+ return new e(null, null, o);
978
+ }, s.prototype.checkLayoutSuccess = function() {
979
+ return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
980
+ }, s.prototype.runLayout = function() {
981
+ this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
982
+ var o;
983
+ return this.checkLayoutSuccess() ? o = !1 : o = this.layout(), l.ANIMATE === "during" ? !1 : (o && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, o);
984
+ }, s.prototype.doPostLayout = function() {
985
+ this.incremental || this.transform(), this.update();
986
+ }, s.prototype.update2 = function() {
987
+ if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
988
+ for (var o = this.graphManager.getAllEdges(), c = 0; c < o.length; c++)
989
+ o[c];
990
+ for (var h = this.graphManager.getRoot().getNodes(), c = 0; c < h.length; c++)
991
+ h[c];
992
+ this.update(this.graphManager.getRoot());
993
+ }
994
+ }, s.prototype.update = function(o) {
995
+ if (o == null)
996
+ this.update2();
997
+ else if (o instanceof r) {
998
+ var c = o;
999
+ if (c.getChild() != null)
1000
+ for (var h = c.getChild().getNodes(), T = 0; T < h.length; T++)
1001
+ update(h[T]);
1002
+ if (c.vGraphObject != null) {
1003
+ var v = c.vGraphObject;
1004
+ v.update(c);
1005
+ }
1006
+ } else if (o instanceof e) {
1007
+ var d = o;
1008
+ if (d.vGraphObject != null) {
1009
+ var N = d.vGraphObject;
1010
+ N.update(d);
1011
+ }
1012
+ } else if (o instanceof f) {
1013
+ var S = o;
1014
+ if (S.vGraphObject != null) {
1015
+ var M = S.vGraphObject;
1016
+ M.update(S);
1017
+ }
1018
+ }
1019
+ }, s.prototype.initParameters = function() {
1020
+ this.isSubLayout || (this.layoutQuality = l.QUALITY, this.animationDuringLayout = l.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = l.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = l.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = l.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = l.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = l.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
1021
+ }, s.prototype.transform = function(o) {
1022
+ if (o == null)
1023
+ this.transform(new i(0, 0));
1024
+ else {
1025
+ var c = new g(), h = this.graphManager.getRoot().updateLeftTop();
1026
+ if (h != null) {
1027
+ c.setWorldOrgX(o.x), c.setWorldOrgY(o.y), c.setDeviceOrgX(h.x), c.setDeviceOrgY(h.y);
1028
+ for (var T = this.getAllNodes(), v, d = 0; d < T.length; d++)
1029
+ v = T[d], v.transform(c);
1030
+ }
1031
+ }
1032
+ }, s.prototype.positionNodesRandomly = function(o) {
1033
+ if (o == null)
1034
+ this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
1035
+ else
1036
+ for (var c, h, T = o.getNodes(), v = 0; v < T.length; v++)
1037
+ c = T[v], h = c.getChild(), h == null || h.getNodes().length == 0 ? c.scatter() : (this.positionNodesRandomly(h), c.updateBounds());
1038
+ }, s.prototype.getFlatForest = function() {
1039
+ for (var o = [], c = !0, h = this.graphManager.getRoot().getNodes(), T = !0, v = 0; v < h.length; v++)
1040
+ h[v].getChild() != null && (T = !1);
1041
+ if (!T)
1042
+ return o;
1043
+ var d = /* @__PURE__ */ new Set(), N = [], S = /* @__PURE__ */ new Map(), M = [];
1044
+ for (M = M.concat(h); M.length > 0 && c; ) {
1045
+ for (N.push(M[0]); N.length > 0 && c; ) {
1046
+ var P = N[0];
1047
+ N.splice(0, 1), d.add(P);
1048
+ for (var K = P.getEdges(), v = 0; v < K.length; v++) {
1049
+ var X = K[v].getOtherEnd(P);
1050
+ if (S.get(P) != X)
1051
+ if (!d.has(X))
1052
+ N.push(X), S.set(X, P);
1053
+ else {
1054
+ c = !1;
1055
+ break;
1056
+ }
1057
+ }
1058
+ }
1059
+ if (!c)
1060
+ o = [];
1061
+ else {
1062
+ var k = [].concat(u(d));
1063
+ o.push(k);
1064
+ for (var v = 0; v < k.length; v++) {
1065
+ var D = k[v], rt = M.indexOf(D);
1066
+ rt > -1 && M.splice(rt, 1);
1067
+ }
1068
+ d = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Map();
1069
+ }
1070
+ }
1071
+ return o;
1072
+ }, s.prototype.createDummyNodesForBendpoints = function(o) {
1073
+ for (var c = [], h = o.source, T = this.graphManager.calcLowestCommonAncestor(o.source, o.target), v = 0; v < o.bendpoints.length; v++) {
1074
+ var d = this.newNode(null);
1075
+ d.setRect(new Point(0, 0), new Dimension(1, 1)), T.add(d);
1076
+ var N = this.newEdge(null);
1077
+ this.graphManager.add(N, h, d), c.add(d), h = d;
1078
+ }
1079
+ var N = this.newEdge(null);
1080
+ return this.graphManager.add(N, h, o.target), this.edgeToDummyNodes.set(o, c), o.isInterGraph() ? this.graphManager.remove(o) : T.remove(o), c;
1081
+ }, s.prototype.createBendpointsFromDummyNodes = function() {
1082
+ var o = [];
1083
+ o = o.concat(this.graphManager.getAllEdges()), o = [].concat(u(this.edgeToDummyNodes.keys())).concat(o);
1084
+ for (var c = 0; c < o.length; c++) {
1085
+ var h = o[c];
1086
+ if (h.bendpoints.length > 0) {
1087
+ for (var T = this.edgeToDummyNodes.get(h), v = 0; v < T.length; v++) {
1088
+ var d = T[v], N = new i(d.getCenterX(), d.getCenterY()), S = h.bendpoints.get(v);
1089
+ S.x = N.x, S.y = N.y, d.getOwner().remove(d);
1090
+ }
1091
+ this.graphManager.add(h, h.source, h.target);
1092
+ }
1093
+ }
1094
+ }, s.transform = function(o, c, h, T) {
1095
+ if (h != null && T != null) {
1096
+ var v = c;
1097
+ if (o <= 50) {
1098
+ var d = c / h;
1099
+ v -= (c - d) / 50 * (50 - o);
1100
+ } else {
1101
+ var N = c * T;
1102
+ v += (N - c) / 50 * (o - 50);
1103
+ }
1104
+ return v;
1105
+ } else {
1106
+ var S, M;
1107
+ return o <= 50 ? (S = 9 * c / 500, M = c / 10) : (S = 9 * c / 50, M = -8 * c), S * o + M;
1108
+ }
1109
+ }, s.findCenterOfTree = function(o) {
1110
+ var c = [];
1111
+ c = c.concat(o);
1112
+ var h = [], T = /* @__PURE__ */ new Map(), v = !1, d = null;
1113
+ (c.length == 1 || c.length == 2) && (v = !0, d = c[0]);
1114
+ for (var N = 0; N < c.length; N++) {
1115
+ var S = c[N], M = S.getNeighborsList().size;
1116
+ T.set(S, S.getNeighborsList().size), M == 1 && h.push(S);
1117
+ }
1118
+ var P = [];
1119
+ for (P = P.concat(h); !v; ) {
1120
+ var K = [];
1121
+ K = K.concat(P), P = [];
1122
+ for (var N = 0; N < c.length; N++) {
1123
+ var S = c[N], X = c.indexOf(S);
1124
+ X >= 0 && c.splice(X, 1);
1125
+ var k = S.getNeighborsList();
1126
+ k.forEach(function(n) {
1127
+ if (h.indexOf(n) < 0) {
1128
+ var m = T.get(n), p = m - 1;
1129
+ p == 1 && P.push(n), T.set(n, p);
1130
+ }
1131
+ });
1132
+ }
1133
+ h = h.concat(P), (c.length == 1 || c.length == 2) && (v = !0, d = c[0]);
1134
+ }
1135
+ return d;
1136
+ }, s.prototype.setGraphManager = function(o) {
1137
+ this.graphManager = o;
1138
+ }, A.exports = s;
1139
+ },
1140
+ /* 16 */
1141
+ /***/
1142
+ function(A, G, L) {
1143
+ function u() {
1144
+ }
1145
+ u.seed = 1, u.x = 0, u.nextDouble = function() {
1146
+ return u.x = Math.sin(u.seed++) * 1e4, u.x - Math.floor(u.x);
1147
+ }, A.exports = u;
1148
+ },
1149
+ /* 17 */
1150
+ /***/
1151
+ function(A, G, L) {
1152
+ var u = L(5);
1153
+ function l(a, r) {
1154
+ this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
1155
+ }
1156
+ l.prototype.getWorldOrgX = function() {
1157
+ return this.lworldOrgX;
1158
+ }, l.prototype.setWorldOrgX = function(a) {
1159
+ this.lworldOrgX = a;
1160
+ }, l.prototype.getWorldOrgY = function() {
1161
+ return this.lworldOrgY;
1162
+ }, l.prototype.setWorldOrgY = function(a) {
1163
+ this.lworldOrgY = a;
1164
+ }, l.prototype.getWorldExtX = function() {
1165
+ return this.lworldExtX;
1166
+ }, l.prototype.setWorldExtX = function(a) {
1167
+ this.lworldExtX = a;
1168
+ }, l.prototype.getWorldExtY = function() {
1169
+ return this.lworldExtY;
1170
+ }, l.prototype.setWorldExtY = function(a) {
1171
+ this.lworldExtY = a;
1172
+ }, l.prototype.getDeviceOrgX = function() {
1173
+ return this.ldeviceOrgX;
1174
+ }, l.prototype.setDeviceOrgX = function(a) {
1175
+ this.ldeviceOrgX = a;
1176
+ }, l.prototype.getDeviceOrgY = function() {
1177
+ return this.ldeviceOrgY;
1178
+ }, l.prototype.setDeviceOrgY = function(a) {
1179
+ this.ldeviceOrgY = a;
1180
+ }, l.prototype.getDeviceExtX = function() {
1181
+ return this.ldeviceExtX;
1182
+ }, l.prototype.setDeviceExtX = function(a) {
1183
+ this.ldeviceExtX = a;
1184
+ }, l.prototype.getDeviceExtY = function() {
1185
+ return this.ldeviceExtY;
1186
+ }, l.prototype.setDeviceExtY = function(a) {
1187
+ this.ldeviceExtY = a;
1188
+ }, l.prototype.transformX = function(a) {
1189
+ var r = 0, e = this.lworldExtX;
1190
+ return e != 0 && (r = this.ldeviceOrgX + (a - this.lworldOrgX) * this.ldeviceExtX / e), r;
1191
+ }, l.prototype.transformY = function(a) {
1192
+ var r = 0, e = this.lworldExtY;
1193
+ return e != 0 && (r = this.ldeviceOrgY + (a - this.lworldOrgY) * this.ldeviceExtY / e), r;
1194
+ }, l.prototype.inverseTransformX = function(a) {
1195
+ var r = 0, e = this.ldeviceExtX;
1196
+ return e != 0 && (r = this.lworldOrgX + (a - this.ldeviceOrgX) * this.lworldExtX / e), r;
1197
+ }, l.prototype.inverseTransformY = function(a) {
1198
+ var r = 0, e = this.ldeviceExtY;
1199
+ return e != 0 && (r = this.lworldOrgY + (a - this.ldeviceOrgY) * this.lworldExtY / e), r;
1200
+ }, l.prototype.inverseTransformPoint = function(a) {
1201
+ var r = new u(this.inverseTransformX(a.x), this.inverseTransformY(a.y));
1202
+ return r;
1203
+ }, A.exports = l;
1204
+ },
1205
+ /* 18 */
1206
+ /***/
1207
+ function(A, G, L) {
1208
+ function u(t) {
1209
+ if (Array.isArray(t)) {
1210
+ for (var s = 0, o = Array(t.length); s < t.length; s++)
1211
+ o[s] = t[s];
1212
+ return o;
1213
+ } else
1214
+ return Array.from(t);
1215
+ }
1216
+ var l = L(15), a = L(4), r = L(0), e = L(8), f = L(9);
1217
+ function i() {
1218
+ l.call(this), this.useSmartIdealEdgeLengthCalculation = a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = a.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = a.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = a.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = a.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = a.MAX_ITERATIONS;
1219
+ }
1220
+ i.prototype = Object.create(l.prototype);
1221
+ for (var g in l)
1222
+ i[g] = l[g];
1223
+ i.prototype.initParameters = function() {
1224
+ l.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1225
+ }, i.prototype.calcIdealEdgeLengths = function() {
1226
+ for (var t, s, o, c, h, T, v, d = this.getGraphManager().getAllEdges(), N = 0; N < d.length; N++)
1227
+ t = d[N], s = t.idealLength, t.isInterGraph && (c = t.getSource(), h = t.getTarget(), T = t.getSourceInLca().getEstimatedSize(), v = t.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (t.idealLength += T + v - 2 * r.SIMPLE_NODE_SIZE), o = t.getLca().getInclusionTreeDepth(), t.idealLength += s * a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (c.getInclusionTreeDepth() + h.getInclusionTreeDepth() - 2 * o));
1228
+ }, i.prototype.initSpringEmbedder = function() {
1229
+ var t = this.getAllNodes().length;
1230
+ this.incremental ? (t > a.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * a.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (t - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - a.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (t > a.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(a.COOLING_ADAPTATION_FACTOR, 1 - (t - a.ADAPTATION_LOWER_NODE_LIMIT) / (a.ADAPTATION_UPPER_NODE_LIMIT - a.ADAPTATION_LOWER_NODE_LIMIT) * (1 - a.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = a.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.displacementThresholdPerNode = 3 * a.DEFAULT_EDGE_LENGTH / 100, this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1231
+ }, i.prototype.calcSpringForces = function() {
1232
+ for (var t = this.getAllEdges(), s, o = 0; o < t.length; o++)
1233
+ s = t[o], this.calcSpringForce(s, s.idealLength);
1234
+ }, i.prototype.calcRepulsionForces = function() {
1235
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, o, c, h, T, v = this.getAllNodes(), d;
1236
+ if (this.useFRGridVariant)
1237
+ for (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && t && this.updateGrid(), d = /* @__PURE__ */ new Set(), o = 0; o < v.length; o++)
1238
+ h = v[o], this.calculateRepulsionForceOfANode(h, d, t, s), d.add(h);
1239
+ else
1240
+ for (o = 0; o < v.length; o++)
1241
+ for (h = v[o], c = o + 1; c < v.length; c++)
1242
+ T = v[c], h.getOwner() == T.getOwner() && this.calcRepulsionForce(h, T);
1243
+ }, i.prototype.calcGravitationalForces = function() {
1244
+ for (var t, s = this.getAllNodesToApplyGravitation(), o = 0; o < s.length; o++)
1245
+ t = s[o], this.calcGravitationalForce(t);
1246
+ }, i.prototype.moveNodes = function() {
1247
+ for (var t = this.getAllNodes(), s, o = 0; o < t.length; o++)
1248
+ s = t[o], s.move();
1249
+ }, i.prototype.calcSpringForce = function(t, s) {
1250
+ var o = t.getSource(), c = t.getTarget(), h, T, v, d;
1251
+ if (this.uniformLeafNodeSizes && o.getChild() == null && c.getChild() == null)
1252
+ t.updateLengthSimple();
1253
+ else if (t.updateLength(), t.isOverlapingSourceAndTarget)
1254
+ return;
1255
+ h = t.getLength(), h != 0 && (T = t.edgeElasticity * (h - s), v = T * (t.lengthX / h), d = T * (t.lengthY / h), o.springForceX += v, o.springForceY += d, c.springForceX -= v, c.springForceY -= d);
1256
+ }, i.prototype.calcRepulsionForce = function(t, s) {
1257
+ var o = t.getRect(), c = s.getRect(), h = new Array(2), T = new Array(4), v, d, N, S, M, P, K;
1258
+ if (o.intersects(c)) {
1259
+ e.calcSeparationAmount(o, c, h, a.DEFAULT_EDGE_LENGTH / 2), P = 2 * h[0], K = 2 * h[1];
1260
+ var X = t.noOfChildren * s.noOfChildren / (t.noOfChildren + s.noOfChildren);
1261
+ t.repulsionForceX -= X * P, t.repulsionForceY -= X * K, s.repulsionForceX += X * P, s.repulsionForceY += X * K;
1262
+ } else
1263
+ this.uniformLeafNodeSizes && t.getChild() == null && s.getChild() == null ? (v = c.getCenterX() - o.getCenterX(), d = c.getCenterY() - o.getCenterY()) : (e.getIntersection(o, c, T), v = T[2] - T[0], d = T[3] - T[1]), Math.abs(v) < a.MIN_REPULSION_DIST && (v = f.sign(v) * a.MIN_REPULSION_DIST), Math.abs(d) < a.MIN_REPULSION_DIST && (d = f.sign(d) * a.MIN_REPULSION_DIST), N = v * v + d * d, S = Math.sqrt(N), M = (t.nodeRepulsion / 2 + s.nodeRepulsion / 2) * t.noOfChildren * s.noOfChildren / N, P = M * v / S, K = M * d / S, t.repulsionForceX -= P, t.repulsionForceY -= K, s.repulsionForceX += P, s.repulsionForceY += K;
1264
+ }, i.prototype.calcGravitationalForce = function(t) {
1265
+ var s, o, c, h, T, v, d, N;
1266
+ s = t.getOwner(), o = (s.getRight() + s.getLeft()) / 2, c = (s.getTop() + s.getBottom()) / 2, h = t.getCenterX() - o, T = t.getCenterY() - c, v = Math.abs(h) + t.getWidth() / 2, d = Math.abs(T) + t.getHeight() / 2, t.getOwner() == this.graphManager.getRoot() ? (N = s.getEstimatedSize() * this.gravityRangeFactor, (v > N || d > N) && (t.gravitationForceX = -this.gravityConstant * h, t.gravitationForceY = -this.gravityConstant * T)) : (N = s.getEstimatedSize() * this.compoundGravityRangeFactor, (v > N || d > N) && (t.gravitationForceX = -this.gravityConstant * h * this.compoundGravityConstant, t.gravitationForceY = -this.gravityConstant * T * this.compoundGravityConstant));
1267
+ }, i.prototype.isConverged = function() {
1268
+ var t, s = !1;
1269
+ return this.totalIterations > this.maxIterations / 3 && (s = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), t = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, t || s;
1270
+ }, i.prototype.animate = function() {
1271
+ this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1272
+ }, i.prototype.calcNoOfChildrenForAllNodes = function() {
1273
+ for (var t, s = this.graphManager.getAllNodes(), o = 0; o < s.length; o++)
1274
+ t = s[o], t.noOfChildren = t.getNoOfChildren();
1275
+ }, i.prototype.calcGrid = function(t) {
1276
+ var s = 0, o = 0;
1277
+ s = parseInt(Math.ceil((t.getRight() - t.getLeft()) / this.repulsionRange)), o = parseInt(Math.ceil((t.getBottom() - t.getTop()) / this.repulsionRange));
1278
+ for (var c = new Array(s), h = 0; h < s; h++)
1279
+ c[h] = new Array(o);
1280
+ for (var h = 0; h < s; h++)
1281
+ for (var T = 0; T < o; T++)
1282
+ c[h][T] = new Array();
1283
+ return c;
1284
+ }, i.prototype.addNodeToGrid = function(t, s, o) {
1285
+ var c = 0, h = 0, T = 0, v = 0;
1286
+ c = parseInt(Math.floor((t.getRect().x - s) / this.repulsionRange)), h = parseInt(Math.floor((t.getRect().width + t.getRect().x - s) / this.repulsionRange)), T = parseInt(Math.floor((t.getRect().y - o) / this.repulsionRange)), v = parseInt(Math.floor((t.getRect().height + t.getRect().y - o) / this.repulsionRange));
1287
+ for (var d = c; d <= h; d++)
1288
+ for (var N = T; N <= v; N++)
1289
+ this.grid[d][N].push(t), t.setGridCoordinates(c, h, T, v);
1290
+ }, i.prototype.updateGrid = function() {
1291
+ var t, s, o = this.getAllNodes();
1292
+ for (this.grid = this.calcGrid(this.graphManager.getRoot()), t = 0; t < o.length; t++)
1293
+ s = o[t], this.addNodeToGrid(s, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1294
+ }, i.prototype.calculateRepulsionForceOfANode = function(t, s, o, c) {
1295
+ if (this.totalIterations % a.GRID_CALCULATION_CHECK_PERIOD == 1 && o || c) {
1296
+ var h = /* @__PURE__ */ new Set();
1297
+ t.surrounding = new Array();
1298
+ for (var T, v = this.grid, d = t.startX - 1; d < t.finishX + 2; d++)
1299
+ for (var N = t.startY - 1; N < t.finishY + 2; N++)
1300
+ if (!(d < 0 || N < 0 || d >= v.length || N >= v[0].length)) {
1301
+ for (var S = 0; S < v[d][N].length; S++)
1302
+ if (T = v[d][N][S], !(t.getOwner() != T.getOwner() || t == T) && !s.has(T) && !h.has(T)) {
1303
+ var M = Math.abs(t.getCenterX() - T.getCenterX()) - (t.getWidth() / 2 + T.getWidth() / 2), P = Math.abs(t.getCenterY() - T.getCenterY()) - (t.getHeight() / 2 + T.getHeight() / 2);
1304
+ M <= this.repulsionRange && P <= this.repulsionRange && h.add(T);
1305
+ }
1306
+ }
1307
+ t.surrounding = [].concat(u(h));
1308
+ }
1309
+ for (d = 0; d < t.surrounding.length; d++)
1310
+ this.calcRepulsionForce(t, t.surrounding[d]);
1311
+ }, i.prototype.calcRepulsionRange = function() {
1312
+ return 0;
1313
+ }, A.exports = i;
1314
+ },
1315
+ /* 19 */
1316
+ /***/
1317
+ function(A, G, L) {
1318
+ var u = L(1), l = L(4);
1319
+ function a(e, f, i) {
1320
+ u.call(this, e, f, i), this.idealLength = l.DEFAULT_EDGE_LENGTH, this.edgeElasticity = l.DEFAULT_SPRING_STRENGTH;
1321
+ }
1322
+ a.prototype = Object.create(u.prototype);
1323
+ for (var r in u)
1324
+ a[r] = u[r];
1325
+ A.exports = a;
1326
+ },
1327
+ /* 20 */
1328
+ /***/
1329
+ function(A, G, L) {
1330
+ var u = L(3), l = L(4);
1331
+ function a(e, f, i, g) {
1332
+ u.call(this, e, f, i, g), this.nodeRepulsion = l.DEFAULT_REPULSION_STRENGTH, this.springForceX = 0, this.springForceY = 0, this.repulsionForceX = 0, this.repulsionForceY = 0, this.gravitationForceX = 0, this.gravitationForceY = 0, this.displacementX = 0, this.displacementY = 0, this.startX = 0, this.finishX = 0, this.startY = 0, this.finishY = 0, this.surrounding = [];
1333
+ }
1334
+ a.prototype = Object.create(u.prototype);
1335
+ for (var r in u)
1336
+ a[r] = u[r];
1337
+ a.prototype.setGridCoordinates = function(e, f, i, g) {
1338
+ this.startX = e, this.finishX = f, this.startY = i, this.finishY = g;
1339
+ }, A.exports = a;
1340
+ },
1341
+ /* 21 */
1342
+ /***/
1343
+ function(A, G, L) {
1344
+ function u(l, a) {
1345
+ this.width = 0, this.height = 0, l !== null && a !== null && (this.height = a, this.width = l);
1346
+ }
1347
+ u.prototype.getWidth = function() {
1348
+ return this.width;
1349
+ }, u.prototype.setWidth = function(l) {
1350
+ this.width = l;
1351
+ }, u.prototype.getHeight = function() {
1352
+ return this.height;
1353
+ }, u.prototype.setHeight = function(l) {
1354
+ this.height = l;
1355
+ }, A.exports = u;
1356
+ },
1357
+ /* 22 */
1358
+ /***/
1359
+ function(A, G, L) {
1360
+ var u = L(14);
1361
+ function l() {
1362
+ this.map = {}, this.keys = [];
1363
+ }
1364
+ l.prototype.put = function(a, r) {
1365
+ var e = u.createID(a);
1366
+ this.contains(e) || (this.map[e] = r, this.keys.push(a));
1367
+ }, l.prototype.contains = function(a) {
1368
+ return u.createID(a), this.map[a] != null;
1369
+ }, l.prototype.get = function(a) {
1370
+ var r = u.createID(a);
1371
+ return this.map[r];
1372
+ }, l.prototype.keySet = function() {
1373
+ return this.keys;
1374
+ }, A.exports = l;
1375
+ },
1376
+ /* 23 */
1377
+ /***/
1378
+ function(A, G, L) {
1379
+ var u = L(14);
1380
+ function l() {
1381
+ this.set = {};
1382
+ }
1383
+ l.prototype.add = function(a) {
1384
+ var r = u.createID(a);
1385
+ this.contains(r) || (this.set[r] = a);
1386
+ }, l.prototype.remove = function(a) {
1387
+ delete this.set[u.createID(a)];
1388
+ }, l.prototype.clear = function() {
1389
+ this.set = {};
1390
+ }, l.prototype.contains = function(a) {
1391
+ return this.set[u.createID(a)] == a;
1392
+ }, l.prototype.isEmpty = function() {
1393
+ return this.size() === 0;
1394
+ }, l.prototype.size = function() {
1395
+ return Object.keys(this.set).length;
1396
+ }, l.prototype.addAllTo = function(a) {
1397
+ for (var r = Object.keys(this.set), e = r.length, f = 0; f < e; f++)
1398
+ a.push(this.set[r[f]]);
1399
+ }, l.prototype.size = function() {
1400
+ return Object.keys(this.set).length;
1401
+ }, l.prototype.addAll = function(a) {
1402
+ for (var r = a.length, e = 0; e < r; e++) {
1403
+ var f = a[e];
1404
+ this.add(f);
1405
+ }
1406
+ }, A.exports = l;
1407
+ },
1408
+ /* 24 */
1409
+ /***/
1410
+ function(A, G, L) {
1411
+ function u() {
1412
+ }
1413
+ u.multMat = function(l, a) {
1414
+ for (var r = [], e = 0; e < l.length; e++) {
1415
+ r[e] = [];
1416
+ for (var f = 0; f < a[0].length; f++) {
1417
+ r[e][f] = 0;
1418
+ for (var i = 0; i < l[0].length; i++)
1419
+ r[e][f] += l[e][i] * a[i][f];
1420
+ }
1421
+ }
1422
+ return r;
1423
+ }, u.transpose = function(l) {
1424
+ for (var a = [], r = 0; r < l[0].length; r++) {
1425
+ a[r] = [];
1426
+ for (var e = 0; e < l.length; e++)
1427
+ a[r][e] = l[e][r];
1428
+ }
1429
+ return a;
1430
+ }, u.multCons = function(l, a) {
1431
+ for (var r = [], e = 0; e < l.length; e++)
1432
+ r[e] = l[e] * a;
1433
+ return r;
1434
+ }, u.minusOp = function(l, a) {
1435
+ for (var r = [], e = 0; e < l.length; e++)
1436
+ r[e] = l[e] - a[e];
1437
+ return r;
1438
+ }, u.dotProduct = function(l, a) {
1439
+ for (var r = 0, e = 0; e < l.length; e++)
1440
+ r += l[e] * a[e];
1441
+ return r;
1442
+ }, u.mag = function(l) {
1443
+ return Math.sqrt(this.dotProduct(l, l));
1444
+ }, u.normalize = function(l) {
1445
+ for (var a = [], r = this.mag(l), e = 0; e < l.length; e++)
1446
+ a[e] = l[e] / r;
1447
+ return a;
1448
+ }, u.multGamma = function(l) {
1449
+ for (var a = [], r = 0, e = 0; e < l.length; e++)
1450
+ r += l[e];
1451
+ r *= -1 / l.length;
1452
+ for (var f = 0; f < l.length; f++)
1453
+ a[f] = r + l[f];
1454
+ return a;
1455
+ }, u.multL = function(l, a, r) {
1456
+ for (var e = [], f = [], i = [], g = 0; g < a[0].length; g++) {
1457
+ for (var t = 0, s = 0; s < a.length; s++)
1458
+ t += -0.5 * a[s][g] * l[s];
1459
+ f[g] = t;
1460
+ }
1461
+ for (var o = 0; o < r.length; o++) {
1462
+ for (var c = 0, h = 0; h < r.length; h++)
1463
+ c += r[o][h] * f[h];
1464
+ i[o] = c;
1465
+ }
1466
+ for (var T = 0; T < a.length; T++) {
1467
+ for (var v = 0, d = 0; d < a[0].length; d++)
1468
+ v += a[T][d] * i[d];
1469
+ e[T] = v;
1470
+ }
1471
+ return e;
1472
+ }, A.exports = u;
1473
+ },
1474
+ /* 25 */
1475
+ /***/
1476
+ function(A, G, L) {
1477
+ var u = function() {
1478
+ function e(f, i) {
1479
+ for (var g = 0; g < i.length; g++) {
1480
+ var t = i[g];
1481
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(f, t.key, t);
1482
+ }
1483
+ }
1484
+ return function(f, i, g) {
1485
+ return i && e(f.prototype, i), g && e(f, g), f;
1486
+ };
1487
+ }();
1488
+ function l(e, f) {
1489
+ if (!(e instanceof f))
1490
+ throw new TypeError("Cannot call a class as a function");
1491
+ }
1492
+ var a = L(11), r = function() {
1493
+ function e(f, i) {
1494
+ l(this, e), (i !== null || i !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1495
+ var g = void 0;
1496
+ f instanceof a ? g = f.size() : g = f.length, this._quicksort(f, 0, g - 1);
1497
+ }
1498
+ return u(e, [{
1499
+ key: "_quicksort",
1500
+ value: function(i, g, t) {
1501
+ if (g < t) {
1502
+ var s = this._partition(i, g, t);
1503
+ this._quicksort(i, g, s), this._quicksort(i, s + 1, t);
1504
+ }
1505
+ }
1506
+ }, {
1507
+ key: "_partition",
1508
+ value: function(i, g, t) {
1509
+ for (var s = this._get(i, g), o = g, c = t; ; ) {
1510
+ for (; this.compareFunction(s, this._get(i, c)); )
1511
+ c--;
1512
+ for (; this.compareFunction(this._get(i, o), s); )
1513
+ o++;
1514
+ if (o < c)
1515
+ this._swap(i, o, c), o++, c--;
1516
+ else
1517
+ return c;
1518
+ }
1519
+ }
1520
+ }, {
1521
+ key: "_get",
1522
+ value: function(i, g) {
1523
+ return i instanceof a ? i.get_object_at(g) : i[g];
1524
+ }
1525
+ }, {
1526
+ key: "_set",
1527
+ value: function(i, g, t) {
1528
+ i instanceof a ? i.set_object_at(g, t) : i[g] = t;
1529
+ }
1530
+ }, {
1531
+ key: "_swap",
1532
+ value: function(i, g, t) {
1533
+ var s = this._get(i, g);
1534
+ this._set(i, g, this._get(i, t)), this._set(i, t, s);
1535
+ }
1536
+ }, {
1537
+ key: "_defaultCompareFunction",
1538
+ value: function(i, g) {
1539
+ return g > i;
1540
+ }
1541
+ }]), e;
1542
+ }();
1543
+ A.exports = r;
1544
+ },
1545
+ /* 26 */
1546
+ /***/
1547
+ function(A, G, L) {
1548
+ function u() {
1549
+ }
1550
+ u.svd = function(l) {
1551
+ this.U = null, this.V = null, this.s = null, this.m = 0, this.n = 0, this.m = l.length, this.n = l[0].length;
1552
+ var a = Math.min(this.m, this.n);
1553
+ this.s = function(Nt) {
1554
+ for (var Mt = []; Nt-- > 0; )
1555
+ Mt.push(0);
1556
+ return Mt;
1557
+ }(Math.min(this.m + 1, this.n)), this.U = function(Nt) {
1558
+ var Mt = function Zt(Gt) {
1559
+ if (Gt.length == 0)
1560
+ return 0;
1561
+ for (var $t = [], Ft = 0; Ft < Gt[0]; Ft++)
1562
+ $t.push(Zt(Gt.slice(1)));
1563
+ return $t;
1564
+ };
1565
+ return Mt(Nt);
1566
+ }([this.m, a]), this.V = function(Nt) {
1567
+ var Mt = function Zt(Gt) {
1568
+ if (Gt.length == 0)
1569
+ return 0;
1570
+ for (var $t = [], Ft = 0; Ft < Gt[0]; Ft++)
1571
+ $t.push(Zt(Gt.slice(1)));
1572
+ return $t;
1573
+ };
1574
+ return Mt(Nt);
1575
+ }([this.n, this.n]);
1576
+ for (var r = function(Nt) {
1577
+ for (var Mt = []; Nt-- > 0; )
1578
+ Mt.push(0);
1579
+ return Mt;
1580
+ }(this.n), e = function(Nt) {
1581
+ for (var Mt = []; Nt-- > 0; )
1582
+ Mt.push(0);
1583
+ return Mt;
1584
+ }(this.m), f = !0, i = Math.min(this.m - 1, this.n), g = Math.max(0, Math.min(this.n - 2, this.m)), t = 0; t < Math.max(i, g); t++) {
1585
+ if (t < i) {
1586
+ this.s[t] = 0;
1587
+ for (var s = t; s < this.m; s++)
1588
+ this.s[t] = u.hypot(this.s[t], l[s][t]);
1589
+ if (this.s[t] !== 0) {
1590
+ l[t][t] < 0 && (this.s[t] = -this.s[t]);
1591
+ for (var o = t; o < this.m; o++)
1592
+ l[o][t] /= this.s[t];
1593
+ l[t][t] += 1;
1594
+ }
1595
+ this.s[t] = -this.s[t];
1596
+ }
1597
+ for (var c = t + 1; c < this.n; c++) {
1598
+ if (function(Nt, Mt) {
1599
+ return Nt && Mt;
1600
+ }(t < i, this.s[t] !== 0)) {
1601
+ for (var h = 0, T = t; T < this.m; T++)
1602
+ h += l[T][t] * l[T][c];
1603
+ h = -h / l[t][t];
1604
+ for (var v = t; v < this.m; v++)
1605
+ l[v][c] += h * l[v][t];
1606
+ }
1607
+ r[c] = l[t][c];
1608
+ }
1609
+ if (function(Nt, Mt) {
1610
+ return Nt && Mt;
1611
+ }(f, t < i))
1612
+ for (var d = t; d < this.m; d++)
1613
+ this.U[d][t] = l[d][t];
1614
+ if (t < g) {
1615
+ r[t] = 0;
1616
+ for (var N = t + 1; N < this.n; N++)
1617
+ r[t] = u.hypot(r[t], r[N]);
1618
+ if (r[t] !== 0) {
1619
+ r[t + 1] < 0 && (r[t] = -r[t]);
1620
+ for (var S = t + 1; S < this.n; S++)
1621
+ r[S] /= r[t];
1622
+ r[t + 1] += 1;
1623
+ }
1624
+ if (r[t] = -r[t], function(Nt, Mt) {
1625
+ return Nt && Mt;
1626
+ }(t + 1 < this.m, r[t] !== 0)) {
1627
+ for (var M = t + 1; M < this.m; M++)
1628
+ e[M] = 0;
1629
+ for (var P = t + 1; P < this.n; P++)
1630
+ for (var K = t + 1; K < this.m; K++)
1631
+ e[K] += r[P] * l[K][P];
1632
+ for (var X = t + 1; X < this.n; X++)
1633
+ for (var k = -r[X] / r[t + 1], D = t + 1; D < this.m; D++)
1634
+ l[D][X] += k * e[D];
1635
+ }
1636
+ for (var rt = t + 1; rt < this.n; rt++)
1637
+ this.V[rt][t] = r[rt];
1638
+ }
1639
+ }
1640
+ var n = Math.min(this.n, this.m + 1);
1641
+ i < this.n && (this.s[i] = l[i][i]), this.m < n && (this.s[n - 1] = 0), g + 1 < n && (r[g] = l[g][n - 1]), r[n - 1] = 0;
1642
+ {
1643
+ for (var m = i; m < a; m++) {
1644
+ for (var p = 0; p < this.m; p++)
1645
+ this.U[p][m] = 0;
1646
+ this.U[m][m] = 1;
1647
+ }
1648
+ for (var E = i - 1; E >= 0; E--)
1649
+ if (this.s[E] !== 0) {
1650
+ for (var y = E + 1; y < a; y++) {
1651
+ for (var I = 0, w = E; w < this.m; w++)
1652
+ I += this.U[w][E] * this.U[w][y];
1653
+ I = -I / this.U[E][E];
1654
+ for (var R = E; R < this.m; R++)
1655
+ this.U[R][y] += I * this.U[R][E];
1656
+ }
1657
+ for (var W = E; W < this.m; W++)
1658
+ this.U[W][E] = -this.U[W][E];
1659
+ this.U[E][E] = 1 + this.U[E][E];
1660
+ for (var x = 0; x < E - 1; x++)
1661
+ this.U[x][E] = 0;
1662
+ } else {
1663
+ for (var q = 0; q < this.m; q++)
1664
+ this.U[q][E] = 0;
1665
+ this.U[E][E] = 1;
1666
+ }
1667
+ }
1668
+ for (var V = this.n - 1; V >= 0; V--) {
1669
+ if (function(Nt, Mt) {
1670
+ return Nt && Mt;
1671
+ }(V < g, r[V] !== 0))
1672
+ for (var Y = V + 1; Y < a; Y++) {
1673
+ for (var et = 0, z = V + 1; z < this.n; z++)
1674
+ et += this.V[z][V] * this.V[z][Y];
1675
+ et = -et / this.V[V + 1][V];
1676
+ for (var O = V + 1; O < this.n; O++)
1677
+ this.V[O][Y] += et * this.V[O][V];
1678
+ }
1679
+ for (var H = 0; H < this.n; H++)
1680
+ this.V[H][V] = 0;
1681
+ this.V[V][V] = 1;
1682
+ }
1683
+ for (var B = n - 1, _ = Math.pow(2, -52), lt = Math.pow(2, -966); n > 0; ) {
1684
+ var J = void 0, Rt = void 0;
1685
+ for (J = n - 2; J >= -1 && J !== -1; J--)
1686
+ if (Math.abs(r[J]) <= lt + _ * (Math.abs(this.s[J]) + Math.abs(this.s[J + 1]))) {
1687
+ r[J] = 0;
1688
+ break;
1689
+ }
1690
+ if (J === n - 2)
1691
+ Rt = 4;
1692
+ else {
1693
+ var Lt = void 0;
1694
+ for (Lt = n - 1; Lt >= J && Lt !== J; Lt--) {
1695
+ var vt = (Lt !== n ? Math.abs(r[Lt]) : 0) + (Lt !== J + 1 ? Math.abs(r[Lt - 1]) : 0);
1696
+ if (Math.abs(this.s[Lt]) <= lt + _ * vt) {
1697
+ this.s[Lt] = 0;
1698
+ break;
1699
+ }
1700
+ }
1701
+ Lt === J ? Rt = 3 : Lt === n - 1 ? Rt = 1 : (Rt = 2, J = Lt);
1702
+ }
1703
+ switch (J++, Rt) {
1704
+ case 1:
1705
+ {
1706
+ var it = r[n - 2];
1707
+ r[n - 2] = 0;
1708
+ for (var gt = n - 2; gt >= J; gt--) {
1709
+ var Tt = u.hypot(this.s[gt], it), At = this.s[gt] / Tt, Dt = it / Tt;
1710
+ this.s[gt] = Tt, gt !== J && (it = -Dt * r[gt - 1], r[gt - 1] = At * r[gt - 1]);
1711
+ for (var mt = 0; mt < this.n; mt++)
1712
+ Tt = At * this.V[mt][gt] + Dt * this.V[mt][n - 1], this.V[mt][n - 1] = -Dt * this.V[mt][gt] + At * this.V[mt][n - 1], this.V[mt][gt] = Tt;
1713
+ }
1714
+ }
1715
+ break;
1716
+ case 2:
1717
+ {
1718
+ var xt = r[J - 1];
1719
+ r[J - 1] = 0;
1720
+ for (var St = J; St < n; St++) {
1721
+ var Vt = u.hypot(this.s[St], xt), Xt = this.s[St] / Vt, Ut = xt / Vt;
1722
+ this.s[St] = Vt, xt = -Ut * r[St], r[St] = Xt * r[St];
1723
+ for (var bt = 0; bt < this.m; bt++)
1724
+ Vt = Xt * this.U[bt][St] + Ut * this.U[bt][J - 1], this.U[bt][J - 1] = -Ut * this.U[bt][St] + Xt * this.U[bt][J - 1], this.U[bt][St] = Vt;
1725
+ }
1726
+ }
1727
+ break;
1728
+ case 3:
1729
+ {
1730
+ var Ht = Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[n - 1]), Math.abs(this.s[n - 2])), Math.abs(r[n - 2])), Math.abs(this.s[J])), Math.abs(r[J])), Bt = this.s[n - 1] / Ht, F = this.s[n - 2] / Ht, b = r[n - 2] / Ht, $ = this.s[J] / Ht, Q = r[J] / Ht, Z = ((F + Bt) * (F - Bt) + b * b) / 2, at = Bt * b * (Bt * b), ut = 0;
1731
+ (function(Nt, Mt) {
1732
+ return Nt || Mt;
1733
+ })(Z !== 0, at !== 0) && (ut = Math.sqrt(Z * Z + at), Z < 0 && (ut = -ut), ut = at / (Z + ut));
1734
+ for (var ot = ($ + Bt) * ($ - Bt) + ut, tt = $ * Q, j = J; j < n - 1; j++) {
1735
+ var dt = u.hypot(ot, tt), wt = ot / dt, yt = tt / dt;
1736
+ j !== J && (r[j - 1] = dt), ot = wt * this.s[j] + yt * r[j], r[j] = wt * r[j] - yt * this.s[j], tt = yt * this.s[j + 1], this.s[j + 1] = wt * this.s[j + 1];
1737
+ for (var It = 0; It < this.n; It++)
1738
+ dt = wt * this.V[It][j] + yt * this.V[It][j + 1], this.V[It][j + 1] = -yt * this.V[It][j] + wt * this.V[It][j + 1], this.V[It][j] = dt;
1739
+ if (dt = u.hypot(ot, tt), wt = ot / dt, yt = tt / dt, this.s[j] = dt, ot = wt * r[j] + yt * this.s[j + 1], this.s[j + 1] = -yt * r[j] + wt * this.s[j + 1], tt = yt * r[j + 1], r[j + 1] = wt * r[j + 1], j < this.m - 1)
1740
+ for (var ft = 0; ft < this.m; ft++)
1741
+ dt = wt * this.U[ft][j] + yt * this.U[ft][j + 1], this.U[ft][j + 1] = -yt * this.U[ft][j] + wt * this.U[ft][j + 1], this.U[ft][j] = dt;
1742
+ }
1743
+ r[n - 2] = ot;
1744
+ }
1745
+ break;
1746
+ case 4:
1747
+ {
1748
+ if (this.s[J] <= 0) {
1749
+ this.s[J] = this.s[J] < 0 ? -this.s[J] : 0;
1750
+ for (var st = 0; st <= B; st++)
1751
+ this.V[st][J] = -this.V[st][J];
1752
+ }
1753
+ for (; J < B && !(this.s[J] >= this.s[J + 1]); ) {
1754
+ var Ct = this.s[J];
1755
+ if (this.s[J] = this.s[J + 1], this.s[J + 1] = Ct, J < this.n - 1)
1756
+ for (var ct = 0; ct < this.n; ct++)
1757
+ Ct = this.V[ct][J + 1], this.V[ct][J + 1] = this.V[ct][J], this.V[ct][J] = Ct;
1758
+ if (J < this.m - 1)
1759
+ for (var ht = 0; ht < this.m; ht++)
1760
+ Ct = this.U[ht][J + 1], this.U[ht][J + 1] = this.U[ht][J], this.U[ht][J] = Ct;
1761
+ J++;
1762
+ }
1763
+ n--;
1764
+ }
1765
+ break;
1766
+ }
1767
+ }
1768
+ var Wt = { U: this.U, V: this.V, S: this.s };
1769
+ return Wt;
1770
+ }, u.hypot = function(l, a) {
1771
+ var r = void 0;
1772
+ return Math.abs(l) > Math.abs(a) ? (r = a / l, r = Math.abs(l) * Math.sqrt(1 + r * r)) : a != 0 ? (r = l / a, r = Math.abs(a) * Math.sqrt(1 + r * r)) : r = 0, r;
1773
+ }, A.exports = u;
1774
+ },
1775
+ /* 27 */
1776
+ /***/
1777
+ function(A, G, L) {
1778
+ var u = function() {
1779
+ function r(e, f) {
1780
+ for (var i = 0; i < f.length; i++) {
1781
+ var g = f[i];
1782
+ g.enumerable = g.enumerable || !1, g.configurable = !0, "value" in g && (g.writable = !0), Object.defineProperty(e, g.key, g);
1783
+ }
1784
+ }
1785
+ return function(e, f, i) {
1786
+ return f && r(e.prototype, f), i && r(e, i), e;
1787
+ };
1788
+ }();
1789
+ function l(r, e) {
1790
+ if (!(r instanceof e))
1791
+ throw new TypeError("Cannot call a class as a function");
1792
+ }
1793
+ var a = function() {
1794
+ function r(e, f) {
1795
+ var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, g = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, t = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1796
+ l(this, r), this.sequence1 = e, this.sequence2 = f, this.match_score = i, this.mismatch_penalty = g, this.gap_penalty = t, this.iMax = e.length + 1, this.jMax = f.length + 1, this.grid = new Array(this.iMax);
1797
+ for (var s = 0; s < this.iMax; s++) {
1798
+ this.grid[s] = new Array(this.jMax);
1799
+ for (var o = 0; o < this.jMax; o++)
1800
+ this.grid[s][o] = 0;
1801
+ }
1802
+ this.tracebackGrid = new Array(this.iMax);
1803
+ for (var c = 0; c < this.iMax; c++) {
1804
+ this.tracebackGrid[c] = new Array(this.jMax);
1805
+ for (var h = 0; h < this.jMax; h++)
1806
+ this.tracebackGrid[c][h] = [null, null, null];
1807
+ }
1808
+ this.alignments = [], this.score = -1, this.computeGrids();
1809
+ }
1810
+ return u(r, [{
1811
+ key: "getScore",
1812
+ value: function() {
1813
+ return this.score;
1814
+ }
1815
+ }, {
1816
+ key: "getAlignments",
1817
+ value: function() {
1818
+ return this.alignments;
1819
+ }
1820
+ // Main dynamic programming procedure
1821
+ }, {
1822
+ key: "computeGrids",
1823
+ value: function() {
1824
+ for (var f = 1; f < this.jMax; f++)
1825
+ this.grid[0][f] = this.grid[0][f - 1] + this.gap_penalty, this.tracebackGrid[0][f] = [!1, !1, !0];
1826
+ for (var i = 1; i < this.iMax; i++)
1827
+ this.grid[i][0] = this.grid[i - 1][0] + this.gap_penalty, this.tracebackGrid[i][0] = [!1, !0, !1];
1828
+ for (var g = 1; g < this.iMax; g++)
1829
+ for (var t = 1; t < this.jMax; t++) {
1830
+ var s = void 0;
1831
+ this.sequence1[g - 1] === this.sequence2[t - 1] ? s = this.grid[g - 1][t - 1] + this.match_score : s = this.grid[g - 1][t - 1] + this.mismatch_penalty;
1832
+ var o = this.grid[g - 1][t] + this.gap_penalty, c = this.grid[g][t - 1] + this.gap_penalty, h = [s, o, c], T = this.arrayAllMaxIndexes(h);
1833
+ this.grid[g][t] = h[T[0]], this.tracebackGrid[g][t] = [T.includes(0), T.includes(1), T.includes(2)];
1834
+ }
1835
+ this.score = this.grid[this.iMax - 1][this.jMax - 1];
1836
+ }
1837
+ // Gets all possible valid sequence combinations
1838
+ }, {
1839
+ key: "alignmentTraceback",
1840
+ value: function() {
1841
+ var f = [];
1842
+ for (f.push({
1843
+ pos: [this.sequence1.length, this.sequence2.length],
1844
+ seq1: "",
1845
+ seq2: ""
1846
+ }); f[0]; ) {
1847
+ var i = f[0], g = this.tracebackGrid[i.pos[0]][i.pos[1]];
1848
+ g[0] && f.push({
1849
+ pos: [i.pos[0] - 1, i.pos[1] - 1],
1850
+ seq1: this.sequence1[i.pos[0] - 1] + i.seq1,
1851
+ seq2: this.sequence2[i.pos[1] - 1] + i.seq2
1852
+ }), g[1] && f.push({
1853
+ pos: [i.pos[0] - 1, i.pos[1]],
1854
+ seq1: this.sequence1[i.pos[0] - 1] + i.seq1,
1855
+ seq2: "-" + i.seq2
1856
+ }), g[2] && f.push({
1857
+ pos: [i.pos[0], i.pos[1] - 1],
1858
+ seq1: "-" + i.seq1,
1859
+ seq2: this.sequence2[i.pos[1] - 1] + i.seq2
1860
+ }), i.pos[0] === 0 && i.pos[1] === 0 && this.alignments.push({
1861
+ sequence1: i.seq1,
1862
+ sequence2: i.seq2
1863
+ }), f.shift();
1864
+ }
1865
+ return this.alignments;
1866
+ }
1867
+ // Helper Functions
1868
+ }, {
1869
+ key: "getAllIndexes",
1870
+ value: function(f, i) {
1871
+ for (var g = [], t = -1; (t = f.indexOf(i, t + 1)) !== -1; )
1872
+ g.push(t);
1873
+ return g;
1874
+ }
1875
+ }, {
1876
+ key: "arrayAllMaxIndexes",
1877
+ value: function(f) {
1878
+ return this.getAllIndexes(f, Math.max.apply(null, f));
1879
+ }
1880
+ }]), r;
1881
+ }();
1882
+ A.exports = a;
1883
+ },
1884
+ /* 28 */
1885
+ /***/
1886
+ function(A, G, L) {
1887
+ var u = function() {
1888
+ };
1889
+ u.FDLayout = L(18), u.FDLayoutConstants = L(4), u.FDLayoutEdge = L(19), u.FDLayoutNode = L(20), u.DimensionD = L(21), u.HashMap = L(22), u.HashSet = L(23), u.IGeometry = L(8), u.IMath = L(9), u.Integer = L(10), u.Point = L(12), u.PointD = L(5), u.RandomSeed = L(16), u.RectangleD = L(13), u.Transform = L(17), u.UniqueIDGeneretor = L(14), u.Quicksort = L(25), u.LinkedList = L(11), u.LGraphObject = L(2), u.LGraph = L(6), u.LEdge = L(1), u.LGraphManager = L(7), u.LNode = L(3), u.Layout = L(15), u.LayoutConstants = L(0), u.NeedlemanWunsch = L(27), u.Matrix = L(24), u.SVD = L(26), A.exports = u;
1890
+ },
1891
+ /* 29 */
1892
+ /***/
1893
+ function(A, G, L) {
1894
+ function u() {
1895
+ this.listeners = [];
1896
+ }
1897
+ var l = u.prototype;
1898
+ l.addListener = function(a, r) {
1899
+ this.listeners.push({
1900
+ event: a,
1901
+ callback: r
1902
+ });
1903
+ }, l.removeListener = function(a, r) {
1904
+ for (var e = this.listeners.length; e >= 0; e--) {
1905
+ var f = this.listeners[e];
1906
+ f.event === a && f.callback === r && this.listeners.splice(e, 1);
1907
+ }
1908
+ }, l.emit = function(a, r) {
1909
+ for (var e = 0; e < this.listeners.length; e++) {
1910
+ var f = this.listeners[e];
1911
+ a === f.event && f.callback(r);
1912
+ }
1913
+ }, A.exports = u;
1914
+ }
1915
+ /******/
1916
+ ])
1917
+ );
1918
+ });
1919
+ }(ye)), ye.exports;
1920
+ }
1921
+ var Ie;
1922
+ function ur() {
1923
+ return Ie || (Ie = 1, function(C, U) {
1924
+ (function(G, L) {
1925
+ C.exports = L(cr());
1926
+ })(Ne, function(A) {
1927
+ return (
1928
+ /******/
1929
+ (() => {
1930
+ var G = {
1931
+ /***/
1932
+ 45: (
1933
+ /***/
1934
+ (a, r, e) => {
1935
+ var f = {};
1936
+ f.layoutBase = e(551), f.CoSEConstants = e(806), f.CoSEEdge = e(767), f.CoSEGraph = e(880), f.CoSEGraphManager = e(578), f.CoSELayout = e(765), f.CoSENode = e(991), f.ConstraintHandler = e(902), a.exports = f;
1937
+ }
1938
+ ),
1939
+ /***/
1940
+ 806: (
1941
+ /***/
1942
+ (a, r, e) => {
1943
+ var f = e(551).FDLayoutConstants;
1944
+ function i() {
1945
+ }
1946
+ for (var g in f)
1947
+ i[g] = f[g];
1948
+ i.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, i.DEFAULT_RADIAL_SEPARATION = f.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, a.exports = i;
1949
+ }
1950
+ ),
1951
+ /***/
1952
+ 767: (
1953
+ /***/
1954
+ (a, r, e) => {
1955
+ var f = e(551).FDLayoutEdge;
1956
+ function i(t, s, o) {
1957
+ f.call(this, t, s, o);
1958
+ }
1959
+ i.prototype = Object.create(f.prototype);
1960
+ for (var g in f)
1961
+ i[g] = f[g];
1962
+ a.exports = i;
1963
+ }
1964
+ ),
1965
+ /***/
1966
+ 880: (
1967
+ /***/
1968
+ (a, r, e) => {
1969
+ var f = e(551).LGraph;
1970
+ function i(t, s, o) {
1971
+ f.call(this, t, s, o);
1972
+ }
1973
+ i.prototype = Object.create(f.prototype);
1974
+ for (var g in f)
1975
+ i[g] = f[g];
1976
+ a.exports = i;
1977
+ }
1978
+ ),
1979
+ /***/
1980
+ 578: (
1981
+ /***/
1982
+ (a, r, e) => {
1983
+ var f = e(551).LGraphManager;
1984
+ function i(t) {
1985
+ f.call(this, t);
1986
+ }
1987
+ i.prototype = Object.create(f.prototype);
1988
+ for (var g in f)
1989
+ i[g] = f[g];
1990
+ a.exports = i;
1991
+ }
1992
+ ),
1993
+ /***/
1994
+ 765: (
1995
+ /***/
1996
+ (a, r, e) => {
1997
+ var f = e(551).FDLayout, i = e(578), g = e(880), t = e(991), s = e(767), o = e(806), c = e(902), h = e(551).FDLayoutConstants, T = e(551).LayoutConstants, v = e(551).Point, d = e(551).PointD, N = e(551).DimensionD, S = e(551).Layout, M = e(551).Integer, P = e(551).IGeometry, K = e(551).LGraph, X = e(551).Transform, k = e(551).LinkedList;
1998
+ function D() {
1999
+ f.call(this), this.toBeTiled = {}, this.constraints = {};
2000
+ }
2001
+ D.prototype = Object.create(f.prototype);
2002
+ for (var rt in f)
2003
+ D[rt] = f[rt];
2004
+ D.prototype.newGraphManager = function() {
2005
+ var n = new i(this);
2006
+ return this.graphManager = n, n;
2007
+ }, D.prototype.newGraph = function(n) {
2008
+ return new g(null, this.graphManager, n);
2009
+ }, D.prototype.newNode = function(n) {
2010
+ return new t(this.graphManager, n);
2011
+ }, D.prototype.newEdge = function(n) {
2012
+ return new s(null, null, n);
2013
+ }, D.prototype.initParameters = function() {
2014
+ f.prototype.initParameters.call(this, arguments), this.isSubLayout || (o.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = o.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.gravityConstant = h.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = h.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = h.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1);
2015
+ }, D.prototype.initSpringEmbedder = function() {
2016
+ f.prototype.initSpringEmbedder.call(this), this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / h.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = 0.04, this.coolingAdjuster = 1;
2017
+ }, D.prototype.layout = function() {
2018
+ var n = T.DEFAULT_CREATE_BENDS_AS_NEEDED;
2019
+ return n && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
2020
+ }, D.prototype.classicLayout = function() {
2021
+ 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) {
2022
+ if (o.TREE_REDUCTION_ON_INCREMENTAL) {
2023
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
2024
+ var m = new Set(this.getAllNodes()), p = this.nodesWithGravity.filter(function(I) {
2025
+ return m.has(I);
2026
+ });
2027
+ this.graphManager.setAllNodesToApplyGravitation(p);
2028
+ }
2029
+ } else {
2030
+ var n = this.getFlatForest();
2031
+ if (n.length > 0)
2032
+ this.positionNodesRadially(n);
2033
+ else {
2034
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
2035
+ var m = new Set(this.getAllNodes()), p = this.nodesWithGravity.filter(function(E) {
2036
+ return m.has(E);
2037
+ });
2038
+ this.graphManager.setAllNodesToApplyGravitation(p), this.positionNodesRandomly();
2039
+ }
2040
+ }
2041
+ return Object.keys(this.constraints).length > 0 && (c.handleConstraints(this), this.initConstraintVariables()), this.initSpringEmbedder(), o.APPLY_LAYOUT && this.runSpringEmbedder(), !0;
2042
+ }, D.prototype.tick = function() {
2043
+ if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
2044
+ if (this.prunedNodesAll.length > 0)
2045
+ this.isTreeGrowing = !0;
2046
+ else
2047
+ return !0;
2048
+ if (this.totalIterations % h.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
2049
+ if (this.isConverged())
2050
+ if (this.prunedNodesAll.length > 0)
2051
+ this.isTreeGrowing = !0;
2052
+ else
2053
+ return !0;
2054
+ this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - Math.pow(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));
2055
+ }
2056
+ if (this.isTreeGrowing) {
2057
+ if (this.growTreeIterations % 10 == 0)
2058
+ if (this.prunedNodesAll.length > 0) {
2059
+ this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
2060
+ var n = new Set(this.getAllNodes()), m = this.nodesWithGravity.filter(function(y) {
2061
+ return n.has(y);
2062
+ });
2063
+ this.graphManager.setAllNodesToApplyGravitation(m), this.graphManager.updateBounds(), this.updateGrid(), o.PURE_INCREMENTAL ? this.coolingFactor = h.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 : this.coolingFactor = h.DEFAULT_COOLING_FACTOR_INCREMENTAL;
2064
+ } else
2065
+ this.isTreeGrowing = !1, this.isGrowthFinished = !0;
2066
+ this.growTreeIterations++;
2067
+ }
2068
+ if (this.isGrowthFinished) {
2069
+ if (this.isConverged())
2070
+ return !0;
2071
+ this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), o.PURE_INCREMENTAL ? this.coolingFactor = h.DEFAULT_COOLING_FACTOR_INCREMENTAL / 2 * ((100 - this.afterGrowthIterations) / 100) : this.coolingFactor = h.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
2072
+ }
2073
+ var p = !this.isTreeGrowing && !this.isGrowthFinished, E = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
2074
+ return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(p, E), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
2075
+ }, D.prototype.getPositionsData = function() {
2076
+ for (var n = this.graphManager.getAllNodes(), m = {}, p = 0; p < n.length; p++) {
2077
+ var E = n[p].rect, y = n[p].id;
2078
+ m[y] = {
2079
+ id: y,
2080
+ x: E.getCenterX(),
2081
+ y: E.getCenterY(),
2082
+ w: E.width,
2083
+ h: E.height
2084
+ };
2085
+ }
2086
+ return m;
2087
+ }, D.prototype.runSpringEmbedder = function() {
2088
+ this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
2089
+ var n = !1;
2090
+ if (h.ANIMATE === "during")
2091
+ this.emit("layoutstarted");
2092
+ else {
2093
+ for (; !n; )
2094
+ n = this.tick();
2095
+ this.graphManager.updateBounds();
2096
+ }
2097
+ }, D.prototype.moveNodes = function() {
2098
+ for (var n = this.getAllNodes(), m, p = 0; p < n.length; p++)
2099
+ m = n[p], m.calculateDisplacement();
2100
+ Object.keys(this.constraints).length > 0 && this.updateDisplacements();
2101
+ for (var p = 0; p < n.length; p++)
2102
+ m = n[p], m.move();
2103
+ }, D.prototype.initConstraintVariables = function() {
2104
+ var n = this;
2105
+ this.idToNodeMap = /* @__PURE__ */ new Map(), this.fixedNodeSet = /* @__PURE__ */ new Set();
2106
+ for (var m = this.graphManager.getAllNodes(), p = 0; p < m.length; p++) {
2107
+ var E = m[p];
2108
+ this.idToNodeMap.set(E.id, E);
2109
+ }
2110
+ var y = function O(H) {
2111
+ for (var B = H.getChild().getNodes(), _, lt = 0, J = 0; J < B.length; J++)
2112
+ _ = B[J], _.getChild() == null ? n.fixedNodeSet.has(_.id) && (lt += 100) : lt += O(_);
2113
+ return lt;
2114
+ };
2115
+ if (this.constraints.fixedNodeConstraint) {
2116
+ this.constraints.fixedNodeConstraint.forEach(function(B) {
2117
+ n.fixedNodeSet.add(B.nodeId);
2118
+ });
2119
+ for (var m = this.graphManager.getAllNodes(), E, p = 0; p < m.length; p++)
2120
+ if (E = m[p], E.getChild() != null) {
2121
+ var I = y(E);
2122
+ I > 0 && (E.fixedNodeWeight = I);
2123
+ }
2124
+ }
2125
+ if (this.constraints.relativePlacementConstraint) {
2126
+ var w = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
2127
+ 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(O) {
2128
+ n.fixedNodesOnHorizontal.add(O), n.fixedNodesOnVertical.add(O);
2129
+ }), this.constraints.alignmentConstraint) {
2130
+ if (this.constraints.alignmentConstraint.vertical)
2131
+ for (var W = this.constraints.alignmentConstraint.vertical, p = 0; p < W.length; p++)
2132
+ this.dummyToNodeForVerticalAlignment.set("dummy" + p, []), W[p].forEach(function(H) {
2133
+ w.set(H, "dummy" + p), n.dummyToNodeForVerticalAlignment.get("dummy" + p).push(H), n.fixedNodeSet.has(H) && n.fixedNodesOnHorizontal.add("dummy" + p);
2134
+ });
2135
+ if (this.constraints.alignmentConstraint.horizontal)
2136
+ for (var x = this.constraints.alignmentConstraint.horizontal, p = 0; p < x.length; p++)
2137
+ this.dummyToNodeForHorizontalAlignment.set("dummy" + p, []), x[p].forEach(function(H) {
2138
+ R.set(H, "dummy" + p), n.dummyToNodeForHorizontalAlignment.get("dummy" + p).push(H), n.fixedNodeSet.has(H) && n.fixedNodesOnVertical.add("dummy" + p);
2139
+ });
2140
+ }
2141
+ if (o.RELAX_MOVEMENT_ON_CONSTRAINTS)
2142
+ this.shuffle = function(O) {
2143
+ var H, B, _;
2144
+ for (_ = O.length - 1; _ >= 2 * O.length / 3; _--)
2145
+ H = Math.floor(Math.random() * (_ + 1)), B = O[_], O[_] = O[H], O[H] = B;
2146
+ return O;
2147
+ }, 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(O) {
2148
+ if (O.left) {
2149
+ var H = w.has(O.left) ? w.get(O.left) : O.left, B = w.has(O.right) ? w.get(O.right) : O.right;
2150
+ n.nodesInRelativeHorizontal.includes(H) || (n.nodesInRelativeHorizontal.push(H), n.nodeToRelativeConstraintMapHorizontal.set(H, []), n.dummyToNodeForVerticalAlignment.has(H) ? n.nodeToTempPositionMapHorizontal.set(H, n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()) : n.nodeToTempPositionMapHorizontal.set(H, n.idToNodeMap.get(H).getCenterX())), n.nodesInRelativeHorizontal.includes(B) || (n.nodesInRelativeHorizontal.push(B), n.nodeToRelativeConstraintMapHorizontal.set(B, []), n.dummyToNodeForVerticalAlignment.has(B) ? n.nodeToTempPositionMapHorizontal.set(B, n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).getCenterX()) : n.nodeToTempPositionMapHorizontal.set(B, n.idToNodeMap.get(B).getCenterX())), n.nodeToRelativeConstraintMapHorizontal.get(H).push({ right: B, gap: O.gap }), n.nodeToRelativeConstraintMapHorizontal.get(B).push({ left: H, gap: O.gap });
2151
+ } else {
2152
+ var _ = R.has(O.top) ? R.get(O.top) : O.top, lt = R.has(O.bottom) ? R.get(O.bottom) : O.bottom;
2153
+ n.nodesInRelativeVertical.includes(_) || (n.nodesInRelativeVertical.push(_), n.nodeToRelativeConstraintMapVertical.set(_, []), n.dummyToNodeForHorizontalAlignment.has(_) ? n.nodeToTempPositionMapVertical.set(_, n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(_)[0]).getCenterY()) : n.nodeToTempPositionMapVertical.set(_, n.idToNodeMap.get(_).getCenterY())), n.nodesInRelativeVertical.includes(lt) || (n.nodesInRelativeVertical.push(lt), n.nodeToRelativeConstraintMapVertical.set(lt, []), n.dummyToNodeForHorizontalAlignment.has(lt) ? n.nodeToTempPositionMapVertical.set(lt, n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(lt)[0]).getCenterY()) : n.nodeToTempPositionMapVertical.set(lt, n.idToNodeMap.get(lt).getCenterY())), n.nodeToRelativeConstraintMapVertical.get(_).push({ bottom: lt, gap: O.gap }), n.nodeToRelativeConstraintMapVertical.get(lt).push({ top: _, gap: O.gap });
2154
+ }
2155
+ });
2156
+ else {
2157
+ var q = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Map();
2158
+ this.constraints.relativePlacementConstraint.forEach(function(O) {
2159
+ if (O.left) {
2160
+ var H = w.has(O.left) ? w.get(O.left) : O.left, B = w.has(O.right) ? w.get(O.right) : O.right;
2161
+ q.has(H) ? q.get(H).push(B) : q.set(H, [B]), q.has(B) ? q.get(B).push(H) : q.set(B, [H]);
2162
+ } else {
2163
+ var _ = R.has(O.top) ? R.get(O.top) : O.top, lt = R.has(O.bottom) ? R.get(O.bottom) : O.bottom;
2164
+ V.has(_) ? V.get(_).push(lt) : V.set(_, [lt]), V.has(lt) ? V.get(lt).push(_) : V.set(lt, [_]);
2165
+ }
2166
+ });
2167
+ var Y = function(H, B) {
2168
+ var _ = [], lt = [], J = new k(), Rt = /* @__PURE__ */ new Set(), Lt = 0;
2169
+ return H.forEach(function(vt, it) {
2170
+ if (!Rt.has(it)) {
2171
+ _[Lt] = [], lt[Lt] = !1;
2172
+ var gt = it;
2173
+ for (J.push(gt), Rt.add(gt), _[Lt].push(gt); J.length != 0; ) {
2174
+ gt = J.shift(), B.has(gt) && (lt[Lt] = !0);
2175
+ var Tt = H.get(gt);
2176
+ Tt.forEach(function(At) {
2177
+ Rt.has(At) || (J.push(At), Rt.add(At), _[Lt].push(At));
2178
+ });
2179
+ }
2180
+ Lt++;
2181
+ }
2182
+ }), { components: _, isFixed: lt };
2183
+ }, et = Y(q, n.fixedNodesOnHorizontal);
2184
+ this.componentsOnHorizontal = et.components, this.fixedComponentsOnHorizontal = et.isFixed;
2185
+ var z = Y(V, n.fixedNodesOnVertical);
2186
+ this.componentsOnVertical = z.components, this.fixedComponentsOnVertical = z.isFixed;
2187
+ }
2188
+ }
2189
+ }, D.prototype.updateDisplacements = function() {
2190
+ var n = this;
2191
+ if (this.constraints.fixedNodeConstraint && this.constraints.fixedNodeConstraint.forEach(function(z) {
2192
+ var O = n.idToNodeMap.get(z.nodeId);
2193
+ O.displacementX = 0, O.displacementY = 0;
2194
+ }), this.constraints.alignmentConstraint) {
2195
+ if (this.constraints.alignmentConstraint.vertical)
2196
+ for (var m = this.constraints.alignmentConstraint.vertical, p = 0; p < m.length; p++) {
2197
+ for (var E = 0, y = 0; y < m[p].length; y++) {
2198
+ if (this.fixedNodeSet.has(m[p][y])) {
2199
+ E = 0;
2200
+ break;
2201
+ }
2202
+ E += this.idToNodeMap.get(m[p][y]).displacementX;
2203
+ }
2204
+ for (var I = E / m[p].length, y = 0; y < m[p].length; y++)
2205
+ this.idToNodeMap.get(m[p][y]).displacementX = I;
2206
+ }
2207
+ if (this.constraints.alignmentConstraint.horizontal)
2208
+ for (var w = this.constraints.alignmentConstraint.horizontal, p = 0; p < w.length; p++) {
2209
+ for (var R = 0, y = 0; y < w[p].length; y++) {
2210
+ if (this.fixedNodeSet.has(w[p][y])) {
2211
+ R = 0;
2212
+ break;
2213
+ }
2214
+ R += this.idToNodeMap.get(w[p][y]).displacementY;
2215
+ }
2216
+ for (var W = R / w[p].length, y = 0; y < w[p].length; y++)
2217
+ this.idToNodeMap.get(w[p][y]).displacementY = W;
2218
+ }
2219
+ }
2220
+ if (this.constraints.relativePlacementConstraint)
2221
+ if (o.RELAX_MOVEMENT_ON_CONSTRAINTS)
2222
+ this.totalIterations % 10 == 0 && (this.shuffle(this.nodesInRelativeHorizontal), this.shuffle(this.nodesInRelativeVertical)), this.nodesInRelativeHorizontal.forEach(function(z) {
2223
+ if (!n.fixedNodesOnHorizontal.has(z)) {
2224
+ var O = 0;
2225
+ n.dummyToNodeForVerticalAlignment.has(z) ? O = n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(z)[0]).displacementX : O = n.idToNodeMap.get(z).displacementX, n.nodeToRelativeConstraintMapHorizontal.get(z).forEach(function(H) {
2226
+ if (H.right) {
2227
+ var B = n.nodeToTempPositionMapHorizontal.get(H.right) - n.nodeToTempPositionMapHorizontal.get(z) - O;
2228
+ B < H.gap && (O -= H.gap - B);
2229
+ } else {
2230
+ var B = n.nodeToTempPositionMapHorizontal.get(z) - n.nodeToTempPositionMapHorizontal.get(H.left) + O;
2231
+ B < H.gap && (O += H.gap - B);
2232
+ }
2233
+ }), n.nodeToTempPositionMapHorizontal.set(z, n.nodeToTempPositionMapHorizontal.get(z) + O), n.dummyToNodeForVerticalAlignment.has(z) ? n.dummyToNodeForVerticalAlignment.get(z).forEach(function(H) {
2234
+ n.idToNodeMap.get(H).displacementX = O;
2235
+ }) : n.idToNodeMap.get(z).displacementX = O;
2236
+ }
2237
+ }), this.nodesInRelativeVertical.forEach(function(z) {
2238
+ if (!n.fixedNodesOnHorizontal.has(z)) {
2239
+ var O = 0;
2240
+ n.dummyToNodeForHorizontalAlignment.has(z) ? O = n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(z)[0]).displacementY : O = n.idToNodeMap.get(z).displacementY, n.nodeToRelativeConstraintMapVertical.get(z).forEach(function(H) {
2241
+ if (H.bottom) {
2242
+ var B = n.nodeToTempPositionMapVertical.get(H.bottom) - n.nodeToTempPositionMapVertical.get(z) - O;
2243
+ B < H.gap && (O -= H.gap - B);
2244
+ } else {
2245
+ var B = n.nodeToTempPositionMapVertical.get(z) - n.nodeToTempPositionMapVertical.get(H.top) + O;
2246
+ B < H.gap && (O += H.gap - B);
2247
+ }
2248
+ }), n.nodeToTempPositionMapVertical.set(z, n.nodeToTempPositionMapVertical.get(z) + O), n.dummyToNodeForHorizontalAlignment.has(z) ? n.dummyToNodeForHorizontalAlignment.get(z).forEach(function(H) {
2249
+ n.idToNodeMap.get(H).displacementY = O;
2250
+ }) : n.idToNodeMap.get(z).displacementY = O;
2251
+ }
2252
+ });
2253
+ else {
2254
+ for (var p = 0; p < this.componentsOnHorizontal.length; p++) {
2255
+ var x = this.componentsOnHorizontal[p];
2256
+ if (this.fixedComponentsOnHorizontal[p])
2257
+ for (var y = 0; y < x.length; y++)
2258
+ this.dummyToNodeForVerticalAlignment.has(x[y]) ? this.dummyToNodeForVerticalAlignment.get(x[y]).forEach(function(H) {
2259
+ n.idToNodeMap.get(H).displacementX = 0;
2260
+ }) : this.idToNodeMap.get(x[y]).displacementX = 0;
2261
+ else {
2262
+ for (var q = 0, V = 0, y = 0; y < x.length; y++)
2263
+ if (this.dummyToNodeForVerticalAlignment.has(x[y])) {
2264
+ var Y = this.dummyToNodeForVerticalAlignment.get(x[y]);
2265
+ q += Y.length * this.idToNodeMap.get(Y[0]).displacementX, V += Y.length;
2266
+ } else
2267
+ q += this.idToNodeMap.get(x[y]).displacementX, V++;
2268
+ for (var et = q / V, y = 0; y < x.length; y++)
2269
+ this.dummyToNodeForVerticalAlignment.has(x[y]) ? this.dummyToNodeForVerticalAlignment.get(x[y]).forEach(function(H) {
2270
+ n.idToNodeMap.get(H).displacementX = et;
2271
+ }) : this.idToNodeMap.get(x[y]).displacementX = et;
2272
+ }
2273
+ }
2274
+ for (var p = 0; p < this.componentsOnVertical.length; p++) {
2275
+ var x = this.componentsOnVertical[p];
2276
+ if (this.fixedComponentsOnVertical[p])
2277
+ for (var y = 0; y < x.length; y++)
2278
+ this.dummyToNodeForHorizontalAlignment.has(x[y]) ? this.dummyToNodeForHorizontalAlignment.get(x[y]).forEach(function(B) {
2279
+ n.idToNodeMap.get(B).displacementY = 0;
2280
+ }) : this.idToNodeMap.get(x[y]).displacementY = 0;
2281
+ else {
2282
+ for (var q = 0, V = 0, y = 0; y < x.length; y++)
2283
+ if (this.dummyToNodeForHorizontalAlignment.has(x[y])) {
2284
+ var Y = this.dummyToNodeForHorizontalAlignment.get(x[y]);
2285
+ q += Y.length * this.idToNodeMap.get(Y[0]).displacementY, V += Y.length;
2286
+ } else
2287
+ q += this.idToNodeMap.get(x[y]).displacementY, V++;
2288
+ for (var et = q / V, y = 0; y < x.length; y++)
2289
+ this.dummyToNodeForHorizontalAlignment.has(x[y]) ? this.dummyToNodeForHorizontalAlignment.get(x[y]).forEach(function(J) {
2290
+ n.idToNodeMap.get(J).displacementY = et;
2291
+ }) : this.idToNodeMap.get(x[y]).displacementY = et;
2292
+ }
2293
+ }
2294
+ }
2295
+ }, D.prototype.calculateNodesToApplyGravitationTo = function() {
2296
+ var n = [], m, p = this.graphManager.getGraphs(), E = p.length, y;
2297
+ for (y = 0; y < E; y++)
2298
+ m = p[y], m.updateConnected(), m.isConnected || (n = n.concat(m.getNodes()));
2299
+ return n;
2300
+ }, D.prototype.createBendpoints = function() {
2301
+ var n = [];
2302
+ n = n.concat(this.graphManager.getAllEdges());
2303
+ var m = /* @__PURE__ */ new Set(), p;
2304
+ for (p = 0; p < n.length; p++) {
2305
+ var E = n[p];
2306
+ if (!m.has(E)) {
2307
+ var y = E.getSource(), I = E.getTarget();
2308
+ if (y == I)
2309
+ E.getBendpoints().push(new d()), E.getBendpoints().push(new d()), this.createDummyNodesForBendpoints(E), m.add(E);
2310
+ else {
2311
+ var w = [];
2312
+ if (w = w.concat(y.getEdgeListToNode(I)), w = w.concat(I.getEdgeListToNode(y)), !m.has(w[0])) {
2313
+ if (w.length > 1) {
2314
+ var R;
2315
+ for (R = 0; R < w.length; R++) {
2316
+ var W = w[R];
2317
+ W.getBendpoints().push(new d()), this.createDummyNodesForBendpoints(W);
2318
+ }
2319
+ }
2320
+ w.forEach(function(x) {
2321
+ m.add(x);
2322
+ });
2323
+ }
2324
+ }
2325
+ }
2326
+ if (m.size == n.length)
2327
+ break;
2328
+ }
2329
+ }, D.prototype.positionNodesRadially = function(n) {
2330
+ for (var m = new v(0, 0), p = Math.ceil(Math.sqrt(n.length)), E = 0, y = 0, I = 0, w = new d(0, 0), R = 0; R < n.length; R++) {
2331
+ R % p == 0 && (I = 0, y = E, R != 0 && (y += o.DEFAULT_COMPONENT_SEPERATION), E = 0);
2332
+ var W = n[R], x = S.findCenterOfTree(W);
2333
+ m.x = I, m.y = y, w = D.radialLayout(W, x, m), w.y > E && (E = Math.floor(w.y)), I = Math.floor(w.x + o.DEFAULT_COMPONENT_SEPERATION);
2334
+ }
2335
+ this.transform(new d(T.WORLD_CENTER_X - w.x / 2, T.WORLD_CENTER_Y - w.y / 2));
2336
+ }, D.radialLayout = function(n, m, p) {
2337
+ var E = Math.max(this.maxDiagonalInTree(n), o.DEFAULT_RADIAL_SEPARATION);
2338
+ D.branchRadialLayout(m, null, 0, 359, 0, E);
2339
+ var y = K.calculateBounds(n), I = new X();
2340
+ I.setDeviceOrgX(y.getMinX()), I.setDeviceOrgY(y.getMinY()), I.setWorldOrgX(p.x), I.setWorldOrgY(p.y);
2341
+ for (var w = 0; w < n.length; w++) {
2342
+ var R = n[w];
2343
+ R.transform(I);
2344
+ }
2345
+ var W = new d(y.getMaxX(), y.getMaxY());
2346
+ return I.inverseTransformPoint(W);
2347
+ }, D.branchRadialLayout = function(n, m, p, E, y, I) {
2348
+ var w = (E - p + 1) / 2;
2349
+ w < 0 && (w += 180);
2350
+ var R = (w + p) % 360, W = R * P.TWO_PI / 360, x = y * Math.cos(W), q = y * Math.sin(W);
2351
+ n.setCenter(x, q);
2352
+ var V = [];
2353
+ V = V.concat(n.getEdges());
2354
+ var Y = V.length;
2355
+ m != null && Y--;
2356
+ for (var et = 0, z = V.length, O, H = n.getEdgesBetween(m); H.length > 1; ) {
2357
+ var B = H[0];
2358
+ H.splice(0, 1);
2359
+ var _ = V.indexOf(B);
2360
+ _ >= 0 && V.splice(_, 1), z--, Y--;
2361
+ }
2362
+ m != null ? O = (V.indexOf(H[0]) + 1) % z : O = 0;
2363
+ for (var lt = Math.abs(E - p) / Y, J = O; et != Y; J = ++J % z) {
2364
+ var Rt = V[J].getOtherEnd(n);
2365
+ if (Rt != m) {
2366
+ var Lt = (p + et * lt) % 360, vt = (Lt + lt) % 360;
2367
+ D.branchRadialLayout(Rt, n, Lt, vt, y + I, I), et++;
2368
+ }
2369
+ }
2370
+ }, D.maxDiagonalInTree = function(n) {
2371
+ for (var m = M.MIN_VALUE, p = 0; p < n.length; p++) {
2372
+ var E = n[p], y = E.getDiagonal();
2373
+ y > m && (m = y);
2374
+ }
2375
+ return m;
2376
+ }, D.prototype.calcRepulsionRange = function() {
2377
+ return 2 * (this.level + 1) * this.idealEdgeLength;
2378
+ }, D.prototype.groupZeroDegreeMembers = function() {
2379
+ var n = this, m = {};
2380
+ this.memberGroups = {}, this.idToDummyNode = {};
2381
+ for (var p = [], E = this.graphManager.getAllNodes(), y = 0; y < E.length; y++) {
2382
+ var I = E[y], w = I.getParent();
2383
+ this.getNodeDegreeWithChildren(I) === 0 && (w.id == null || !this.getToBeTiled(w)) && p.push(I);
2384
+ }
2385
+ for (var y = 0; y < p.length; y++) {
2386
+ var I = p[y], R = I.getParent().id;
2387
+ typeof m[R] > "u" && (m[R] = []), m[R] = m[R].concat(I);
2388
+ }
2389
+ Object.keys(m).forEach(function(W) {
2390
+ if (m[W].length > 1) {
2391
+ var x = "DummyCompound_" + W;
2392
+ n.memberGroups[x] = m[W];
2393
+ var q = m[W][0].getParent(), V = new t(n.graphManager);
2394
+ V.id = x, V.paddingLeft = q.paddingLeft || 0, V.paddingRight = q.paddingRight || 0, V.paddingBottom = q.paddingBottom || 0, V.paddingTop = q.paddingTop || 0, n.idToDummyNode[x] = V;
2395
+ var Y = n.getGraphManager().add(n.newGraph(), V), et = q.getChild();
2396
+ et.add(V);
2397
+ for (var z = 0; z < m[W].length; z++) {
2398
+ var O = m[W][z];
2399
+ et.remove(O), Y.add(O);
2400
+ }
2401
+ }
2402
+ });
2403
+ }, D.prototype.clearCompounds = function() {
2404
+ var n = {}, m = {};
2405
+ this.performDFSOnCompounds();
2406
+ for (var p = 0; p < this.compoundOrder.length; p++)
2407
+ m[this.compoundOrder[p].id] = this.compoundOrder[p], n[this.compoundOrder[p].id] = [].concat(this.compoundOrder[p].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[p].getChild()), this.compoundOrder[p].child = null;
2408
+ this.graphManager.resetAllNodes(), this.tileCompoundMembers(n, m);
2409
+ }, D.prototype.clearZeroDegreeMembers = function() {
2410
+ var n = this, m = this.tiledZeroDegreePack = [];
2411
+ Object.keys(this.memberGroups).forEach(function(p) {
2412
+ var E = n.idToDummyNode[p];
2413
+ if (m[p] = n.tileNodes(n.memberGroups[p], E.paddingLeft + E.paddingRight), E.rect.width = m[p].width, E.rect.height = m[p].height, E.setCenter(m[p].centerX, m[p].centerY), E.labelMarginLeft = 0, E.labelMarginTop = 0, o.NODE_DIMENSIONS_INCLUDE_LABELS) {
2414
+ var y = E.rect.width, I = E.rect.height;
2415
+ E.labelWidth && (E.labelPosHorizontal == "left" ? (E.rect.x -= E.labelWidth, E.setWidth(y + E.labelWidth), E.labelMarginLeft = E.labelWidth) : E.labelPosHorizontal == "center" && E.labelWidth > y ? (E.rect.x -= (E.labelWidth - y) / 2, E.setWidth(E.labelWidth), E.labelMarginLeft = (E.labelWidth - y) / 2) : E.labelPosHorizontal == "right" && E.setWidth(y + E.labelWidth)), E.labelHeight && (E.labelPosVertical == "top" ? (E.rect.y -= E.labelHeight, E.setHeight(I + E.labelHeight), E.labelMarginTop = E.labelHeight) : E.labelPosVertical == "center" && E.labelHeight > I ? (E.rect.y -= (E.labelHeight - I) / 2, E.setHeight(E.labelHeight), E.labelMarginTop = (E.labelHeight - I) / 2) : E.labelPosVertical == "bottom" && E.setHeight(I + E.labelHeight));
2416
+ }
2417
+ });
2418
+ }, D.prototype.repopulateCompounds = function() {
2419
+ for (var n = this.compoundOrder.length - 1; n >= 0; n--) {
2420
+ var m = this.compoundOrder[n], p = m.id, E = m.paddingLeft, y = m.paddingTop, I = m.labelMarginLeft, w = m.labelMarginTop;
2421
+ this.adjustLocations(this.tiledMemberPack[p], m.rect.x, m.rect.y, E, y, I, w);
2422
+ }
2423
+ }, D.prototype.repopulateZeroDegreeMembers = function() {
2424
+ var n = this, m = this.tiledZeroDegreePack;
2425
+ Object.keys(m).forEach(function(p) {
2426
+ var E = n.idToDummyNode[p], y = E.paddingLeft, I = E.paddingTop, w = E.labelMarginLeft, R = E.labelMarginTop;
2427
+ n.adjustLocations(m[p], E.rect.x, E.rect.y, y, I, w, R);
2428
+ });
2429
+ }, D.prototype.getToBeTiled = function(n) {
2430
+ var m = n.id;
2431
+ if (this.toBeTiled[m] != null)
2432
+ return this.toBeTiled[m];
2433
+ var p = n.getChild();
2434
+ if (p == null)
2435
+ return this.toBeTiled[m] = !1, !1;
2436
+ for (var E = p.getNodes(), y = 0; y < E.length; y++) {
2437
+ var I = E[y];
2438
+ if (this.getNodeDegree(I) > 0)
2439
+ return this.toBeTiled[m] = !1, !1;
2440
+ if (I.getChild() == null) {
2441
+ this.toBeTiled[I.id] = !1;
2442
+ continue;
2443
+ }
2444
+ if (!this.getToBeTiled(I))
2445
+ return this.toBeTiled[m] = !1, !1;
2446
+ }
2447
+ return this.toBeTiled[m] = !0, !0;
2448
+ }, D.prototype.getNodeDegree = function(n) {
2449
+ n.id;
2450
+ for (var m = n.getEdges(), p = 0, E = 0; E < m.length; E++) {
2451
+ var y = m[E];
2452
+ y.getSource().id !== y.getTarget().id && (p = p + 1);
2453
+ }
2454
+ return p;
2455
+ }, D.prototype.getNodeDegreeWithChildren = function(n) {
2456
+ var m = this.getNodeDegree(n);
2457
+ if (n.getChild() == null)
2458
+ return m;
2459
+ for (var p = n.getChild().getNodes(), E = 0; E < p.length; E++) {
2460
+ var y = p[E];
2461
+ m += this.getNodeDegreeWithChildren(y);
2462
+ }
2463
+ return m;
2464
+ }, D.prototype.performDFSOnCompounds = function() {
2465
+ this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2466
+ }, D.prototype.fillCompexOrderByDFS = function(n) {
2467
+ for (var m = 0; m < n.length; m++) {
2468
+ var p = n[m];
2469
+ p.getChild() != null && this.fillCompexOrderByDFS(p.getChild().getNodes()), this.getToBeTiled(p) && this.compoundOrder.push(p);
2470
+ }
2471
+ }, D.prototype.adjustLocations = function(n, m, p, E, y, I, w) {
2472
+ m += E + I, p += y + w;
2473
+ for (var R = m, W = 0; W < n.rows.length; W++) {
2474
+ var x = n.rows[W];
2475
+ m = R;
2476
+ for (var q = 0, V = 0; V < x.length; V++) {
2477
+ var Y = x[V];
2478
+ Y.rect.x = m, Y.rect.y = p, m += Y.rect.width + n.horizontalPadding, Y.rect.height > q && (q = Y.rect.height);
2479
+ }
2480
+ p += q + n.verticalPadding;
2481
+ }
2482
+ }, D.prototype.tileCompoundMembers = function(n, m) {
2483
+ var p = this;
2484
+ this.tiledMemberPack = [], Object.keys(n).forEach(function(E) {
2485
+ var y = m[E];
2486
+ if (p.tiledMemberPack[E] = p.tileNodes(n[E], y.paddingLeft + y.paddingRight), y.rect.width = p.tiledMemberPack[E].width, y.rect.height = p.tiledMemberPack[E].height, y.setCenter(p.tiledMemberPack[E].centerX, p.tiledMemberPack[E].centerY), y.labelMarginLeft = 0, y.labelMarginTop = 0, o.NODE_DIMENSIONS_INCLUDE_LABELS) {
2487
+ var I = y.rect.width, w = y.rect.height;
2488
+ y.labelWidth && (y.labelPosHorizontal == "left" ? (y.rect.x -= y.labelWidth, y.setWidth(I + y.labelWidth), y.labelMarginLeft = y.labelWidth) : y.labelPosHorizontal == "center" && y.labelWidth > I ? (y.rect.x -= (y.labelWidth - I) / 2, y.setWidth(y.labelWidth), y.labelMarginLeft = (y.labelWidth - I) / 2) : y.labelPosHorizontal == "right" && y.setWidth(I + y.labelWidth)), y.labelHeight && (y.labelPosVertical == "top" ? (y.rect.y -= y.labelHeight, y.setHeight(w + y.labelHeight), y.labelMarginTop = y.labelHeight) : y.labelPosVertical == "center" && y.labelHeight > w ? (y.rect.y -= (y.labelHeight - w) / 2, y.setHeight(y.labelHeight), y.labelMarginTop = (y.labelHeight - w) / 2) : y.labelPosVertical == "bottom" && y.setHeight(w + y.labelHeight));
2489
+ }
2490
+ });
2491
+ }, D.prototype.tileNodes = function(n, m) {
2492
+ var p = this.tileNodesByFavoringDim(n, m, !0), E = this.tileNodesByFavoringDim(n, m, !1), y = this.getOrgRatio(p), I = this.getOrgRatio(E), w;
2493
+ return I < y ? w = E : w = p, w;
2494
+ }, D.prototype.getOrgRatio = function(n) {
2495
+ var m = n.width, p = n.height, E = m / p;
2496
+ return E < 1 && (E = 1 / E), E;
2497
+ }, D.prototype.calcIdealRowWidth = function(n, m) {
2498
+ var p = o.TILING_PADDING_VERTICAL, E = o.TILING_PADDING_HORIZONTAL, y = n.length, I = 0, w = 0, R = 0;
2499
+ n.forEach(function(z) {
2500
+ I += z.getWidth(), w += z.getHeight(), z.getWidth() > R && (R = z.getWidth());
2501
+ });
2502
+ var W = I / y, x = w / y, q = Math.pow(p - E, 2) + 4 * (W + E) * (x + p) * y, V = (E - p + Math.sqrt(q)) / (2 * (W + E)), Y;
2503
+ m ? (Y = Math.ceil(V), Y == V && Y++) : Y = Math.floor(V);
2504
+ var et = Y * (W + E) - E;
2505
+ return R > et && (et = R), et += E * 2, et;
2506
+ }, D.prototype.tileNodesByFavoringDim = function(n, m, p) {
2507
+ var E = o.TILING_PADDING_VERTICAL, y = o.TILING_PADDING_HORIZONTAL, I = o.TILING_COMPARE_BY, w = {
2508
+ rows: [],
2509
+ rowWidth: [],
2510
+ rowHeight: [],
2511
+ width: 0,
2512
+ height: m,
2513
+ // assume minHeight equals to minWidth
2514
+ verticalPadding: E,
2515
+ horizontalPadding: y,
2516
+ centerX: 0,
2517
+ centerY: 0
2518
+ };
2519
+ I && (w.idealRowWidth = this.calcIdealRowWidth(n, p));
2520
+ var R = function(O) {
2521
+ return O.rect.width * O.rect.height;
2522
+ }, W = function(O, H) {
2523
+ return R(H) - R(O);
2524
+ };
2525
+ n.sort(function(z, O) {
2526
+ var H = W;
2527
+ return w.idealRowWidth ? (H = I, H(z.id, O.id)) : H(z, O);
2528
+ });
2529
+ for (var x = 0, q = 0, V = 0; V < n.length; V++) {
2530
+ var Y = n[V];
2531
+ x += Y.getCenterX(), q += Y.getCenterY();
2532
+ }
2533
+ w.centerX = x / n.length, w.centerY = q / n.length;
2534
+ for (var V = 0; V < n.length; V++) {
2535
+ var Y = n[V];
2536
+ if (w.rows.length == 0)
2537
+ this.insertNodeToRow(w, Y, 0, m);
2538
+ else if (this.canAddHorizontal(w, Y.rect.width, Y.rect.height)) {
2539
+ var et = w.rows.length - 1;
2540
+ w.idealRowWidth || (et = this.getShortestRowIndex(w)), this.insertNodeToRow(w, Y, et, m);
2541
+ } else
2542
+ this.insertNodeToRow(w, Y, w.rows.length, m);
2543
+ this.shiftToLastRow(w);
2544
+ }
2545
+ return w;
2546
+ }, D.prototype.insertNodeToRow = function(n, m, p, E) {
2547
+ var y = E;
2548
+ if (p == n.rows.length) {
2549
+ var I = [];
2550
+ n.rows.push(I), n.rowWidth.push(y), n.rowHeight.push(0);
2551
+ }
2552
+ var w = n.rowWidth[p] + m.rect.width;
2553
+ n.rows[p].length > 0 && (w += n.horizontalPadding), n.rowWidth[p] = w, n.width < w && (n.width = w);
2554
+ var R = m.rect.height;
2555
+ p > 0 && (R += n.verticalPadding);
2556
+ var W = 0;
2557
+ R > n.rowHeight[p] && (W = n.rowHeight[p], n.rowHeight[p] = R, W = n.rowHeight[p] - W), n.height += W, n.rows[p].push(m);
2558
+ }, D.prototype.getShortestRowIndex = function(n) {
2559
+ for (var m = -1, p = Number.MAX_VALUE, E = 0; E < n.rows.length; E++)
2560
+ n.rowWidth[E] < p && (m = E, p = n.rowWidth[E]);
2561
+ return m;
2562
+ }, D.prototype.getLongestRowIndex = function(n) {
2563
+ for (var m = -1, p = Number.MIN_VALUE, E = 0; E < n.rows.length; E++)
2564
+ n.rowWidth[E] > p && (m = E, p = n.rowWidth[E]);
2565
+ return m;
2566
+ }, D.prototype.canAddHorizontal = function(n, m, p) {
2567
+ if (n.idealRowWidth) {
2568
+ var E = n.rows.length - 1, y = n.rowWidth[E];
2569
+ return y + m + n.horizontalPadding <= n.idealRowWidth;
2570
+ }
2571
+ var I = this.getShortestRowIndex(n);
2572
+ if (I < 0)
2573
+ return !0;
2574
+ var w = n.rowWidth[I];
2575
+ if (w + n.horizontalPadding + m <= n.width)
2576
+ return !0;
2577
+ var R = 0;
2578
+ n.rowHeight[I] < p && I > 0 && (R = p + n.verticalPadding - n.rowHeight[I]);
2579
+ var W;
2580
+ n.width - w >= m + n.horizontalPadding ? W = (n.height + R) / (w + m + n.horizontalPadding) : W = (n.height + R) / n.width, R = p + n.verticalPadding;
2581
+ var x;
2582
+ return n.width < m ? x = (n.height + R) / m : x = (n.height + R) / n.width, x < 1 && (x = 1 / x), W < 1 && (W = 1 / W), W < x;
2583
+ }, D.prototype.shiftToLastRow = function(n) {
2584
+ var m = this.getLongestRowIndex(n), p = n.rowWidth.length - 1, E = n.rows[m], y = E[E.length - 1], I = y.width + n.horizontalPadding;
2585
+ if (n.width - n.rowWidth[p] > I && m != p) {
2586
+ E.splice(-1, 1), n.rows[p].push(y), n.rowWidth[m] = n.rowWidth[m] - I, n.rowWidth[p] = n.rowWidth[p] + I, n.width = n.rowWidth[instance.getLongestRowIndex(n)];
2587
+ for (var w = Number.MIN_VALUE, R = 0; R < E.length; R++)
2588
+ E[R].height > w && (w = E[R].height);
2589
+ m > 0 && (w += n.verticalPadding);
2590
+ var W = n.rowHeight[m] + n.rowHeight[p];
2591
+ n.rowHeight[m] = w, n.rowHeight[p] < y.height + n.verticalPadding && (n.rowHeight[p] = y.height + n.verticalPadding);
2592
+ var x = n.rowHeight[m] + n.rowHeight[p];
2593
+ n.height += x - W, this.shiftToLastRow(n);
2594
+ }
2595
+ }, D.prototype.tilingPreLayout = function() {
2596
+ o.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2597
+ }, D.prototype.tilingPostLayout = function() {
2598
+ o.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2599
+ }, D.prototype.reduceTrees = function() {
2600
+ for (var n = [], m = !0, p; m; ) {
2601
+ var E = this.graphManager.getAllNodes(), y = [];
2602
+ m = !1;
2603
+ for (var I = 0; I < E.length; I++)
2604
+ if (p = E[I], p.getEdges().length == 1 && !p.getEdges()[0].isInterGraph && p.getChild() == null) {
2605
+ if (o.PURE_INCREMENTAL) {
2606
+ var w = p.getEdges()[0].getOtherEnd(p), R = new N(p.getCenterX() - w.getCenterX(), p.getCenterY() - w.getCenterY());
2607
+ y.push([p, p.getEdges()[0], p.getOwner(), R]);
2608
+ } else
2609
+ y.push([p, p.getEdges()[0], p.getOwner()]);
2610
+ m = !0;
2611
+ }
2612
+ if (m == !0) {
2613
+ for (var W = [], x = 0; x < y.length; x++)
2614
+ y[x][0].getEdges().length == 1 && (W.push(y[x]), y[x][0].getOwner().remove(y[x][0]));
2615
+ n.push(W), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2616
+ }
2617
+ }
2618
+ this.prunedNodesAll = n;
2619
+ }, D.prototype.growTree = function(n) {
2620
+ for (var m = n.length, p = n[m - 1], E, y = 0; y < p.length; y++)
2621
+ E = p[y], this.findPlaceforPrunedNode(E), E[2].add(E[0]), E[2].add(E[1], E[1].source, E[1].target);
2622
+ n.splice(n.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2623
+ }, D.prototype.findPlaceforPrunedNode = function(n) {
2624
+ var m, p, E = n[0];
2625
+ if (E == n[1].source ? p = n[1].target : p = n[1].source, o.PURE_INCREMENTAL)
2626
+ E.setCenter(p.getCenterX() + n[3].getWidth(), p.getCenterY() + n[3].getHeight());
2627
+ else {
2628
+ var y = p.startX, I = p.finishX, w = p.startY, R = p.finishY, W = 0, x = 0, q = 0, V = 0, Y = [W, q, x, V];
2629
+ if (w > 0)
2630
+ for (var et = y; et <= I; et++)
2631
+ Y[0] += this.grid[et][w - 1].length + this.grid[et][w].length - 1;
2632
+ if (I < this.grid.length - 1)
2633
+ for (var et = w; et <= R; et++)
2634
+ Y[1] += this.grid[I + 1][et].length + this.grid[I][et].length - 1;
2635
+ if (R < this.grid[0].length - 1)
2636
+ for (var et = y; et <= I; et++)
2637
+ Y[2] += this.grid[et][R + 1].length + this.grid[et][R].length - 1;
2638
+ if (y > 0)
2639
+ for (var et = w; et <= R; et++)
2640
+ Y[3] += this.grid[y - 1][et].length + this.grid[y][et].length - 1;
2641
+ for (var z = M.MAX_VALUE, O, H, B = 0; B < Y.length; B++)
2642
+ Y[B] < z ? (z = Y[B], O = 1, H = B) : Y[B] == z && O++;
2643
+ if (O == 3 && z == 0)
2644
+ Y[0] == 0 && Y[1] == 0 && Y[2] == 0 ? m = 1 : Y[0] == 0 && Y[1] == 0 && Y[3] == 0 ? m = 0 : Y[0] == 0 && Y[2] == 0 && Y[3] == 0 ? m = 3 : Y[1] == 0 && Y[2] == 0 && Y[3] == 0 && (m = 2);
2645
+ else if (O == 2 && z == 0) {
2646
+ var _ = Math.floor(Math.random() * 2);
2647
+ Y[0] == 0 && Y[1] == 0 ? _ == 0 ? m = 0 : m = 1 : Y[0] == 0 && Y[2] == 0 ? _ == 0 ? m = 0 : m = 2 : Y[0] == 0 && Y[3] == 0 ? _ == 0 ? m = 0 : m = 3 : Y[1] == 0 && Y[2] == 0 ? _ == 0 ? m = 1 : m = 2 : Y[1] == 0 && Y[3] == 0 ? _ == 0 ? m = 1 : m = 3 : _ == 0 ? m = 2 : m = 3;
2648
+ } else if (O == 4 && z == 0) {
2649
+ var _ = Math.floor(Math.random() * 4);
2650
+ m = _;
2651
+ } else
2652
+ m = H;
2653
+ m == 0 ? E.setCenter(p.getCenterX(), p.getCenterY() - p.getHeight() / 2 - h.DEFAULT_EDGE_LENGTH - E.getHeight() / 2) : m == 1 ? E.setCenter(p.getCenterX() + p.getWidth() / 2 + h.DEFAULT_EDGE_LENGTH + E.getWidth() / 2, p.getCenterY()) : m == 2 ? E.setCenter(p.getCenterX(), p.getCenterY() + p.getHeight() / 2 + h.DEFAULT_EDGE_LENGTH + E.getHeight() / 2) : E.setCenter(p.getCenterX() - p.getWidth() / 2 - h.DEFAULT_EDGE_LENGTH - E.getWidth() / 2, p.getCenterY());
2654
+ }
2655
+ }, a.exports = D;
2656
+ }
2657
+ ),
2658
+ /***/
2659
+ 991: (
2660
+ /***/
2661
+ (a, r, e) => {
2662
+ var f = e(551).FDLayoutNode, i = e(551).IMath;
2663
+ function g(s, o, c, h) {
2664
+ f.call(this, s, o, c, h);
2665
+ }
2666
+ g.prototype = Object.create(f.prototype);
2667
+ for (var t in f)
2668
+ g[t] = f[t];
2669
+ g.prototype.calculateDisplacement = function() {
2670
+ var s = this.graphManager.getLayout();
2671
+ this.getChild() != null && this.fixedNodeWeight ? (this.displacementX += s.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.fixedNodeWeight, this.displacementY += s.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.fixedNodeWeight) : (this.displacementX += s.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY += s.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren), Math.abs(this.displacementX) > s.coolingFactor * s.maxNodeDisplacement && (this.displacementX = s.coolingFactor * s.maxNodeDisplacement * i.sign(this.displacementX)), Math.abs(this.displacementY) > s.coolingFactor * s.maxNodeDisplacement && (this.displacementY = s.coolingFactor * s.maxNodeDisplacement * i.sign(this.displacementY)), this.child && this.child.getNodes().length > 0 && this.propogateDisplacementToChildren(this.displacementX, this.displacementY);
2672
+ }, g.prototype.propogateDisplacementToChildren = function(s, o) {
2673
+ for (var c = this.getChild().getNodes(), h, T = 0; T < c.length; T++)
2674
+ h = c[T], h.getChild() == null ? (h.displacementX += s, h.displacementY += o) : h.propogateDisplacementToChildren(s, o);
2675
+ }, g.prototype.move = function() {
2676
+ var s = this.graphManager.getLayout();
2677
+ (this.child == null || this.child.getNodes().length == 0) && (this.moveBy(this.displacementX, this.displacementY), s.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;
2678
+ }, g.prototype.setPred1 = function(s) {
2679
+ this.pred1 = s;
2680
+ }, g.prototype.getPred1 = function() {
2681
+ return pred1;
2682
+ }, g.prototype.getPred2 = function() {
2683
+ return pred2;
2684
+ }, g.prototype.setNext = function(s) {
2685
+ this.next = s;
2686
+ }, g.prototype.getNext = function() {
2687
+ return next;
2688
+ }, g.prototype.setProcessed = function(s) {
2689
+ this.processed = s;
2690
+ }, g.prototype.isProcessed = function() {
2691
+ return processed;
2692
+ }, a.exports = g;
2693
+ }
2694
+ ),
2695
+ /***/
2696
+ 902: (
2697
+ /***/
2698
+ (a, r, e) => {
2699
+ function f(c) {
2700
+ if (Array.isArray(c)) {
2701
+ for (var h = 0, T = Array(c.length); h < c.length; h++)
2702
+ T[h] = c[h];
2703
+ return T;
2704
+ } else
2705
+ return Array.from(c);
2706
+ }
2707
+ var i = e(806), g = e(551).LinkedList, t = e(551).Matrix, s = e(551).SVD;
2708
+ function o() {
2709
+ }
2710
+ o.handleConstraints = function(c) {
2711
+ var h = {};
2712
+ h.fixedNodeConstraint = c.constraints.fixedNodeConstraint, h.alignmentConstraint = c.constraints.alignmentConstraint, h.relativePlacementConstraint = c.constraints.relativePlacementConstraint;
2713
+ for (var T = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), d = [], N = [], S = c.getAllNodes(), M = 0, P = 0; P < S.length; P++) {
2714
+ var K = S[P];
2715
+ K.getChild() == null && (v.set(K.id, M++), d.push(K.getCenterX()), N.push(K.getCenterY()), T.set(K.id, K));
2716
+ }
2717
+ h.relativePlacementConstraint && h.relativePlacementConstraint.forEach(function(F) {
2718
+ !F.gap && F.gap != 0 && (F.left ? F.gap = i.DEFAULT_EDGE_LENGTH + T.get(F.left).getWidth() / 2 + T.get(F.right).getWidth() / 2 : F.gap = i.DEFAULT_EDGE_LENGTH + T.get(F.top).getHeight() / 2 + T.get(F.bottom).getHeight() / 2);
2719
+ });
2720
+ var X = function(b, $) {
2721
+ return { x: b.x - $.x, y: b.y - $.y };
2722
+ }, k = function(b) {
2723
+ var $ = 0, Q = 0;
2724
+ return b.forEach(function(Z) {
2725
+ $ += d[v.get(Z)], Q += N[v.get(Z)];
2726
+ }), { x: $ / b.size, y: Q / b.size };
2727
+ }, D = function(b, $, Q, Z, at) {
2728
+ function ut(ft, st) {
2729
+ var Ct = new Set(ft), ct = !0, ht = !1, Wt = void 0;
2730
+ try {
2731
+ for (var Nt = st[Symbol.iterator](), Mt; !(ct = (Mt = Nt.next()).done); ct = !0) {
2732
+ var Zt = Mt.value;
2733
+ Ct.add(Zt);
2734
+ }
2735
+ } catch (Gt) {
2736
+ ht = !0, Wt = Gt;
2737
+ } finally {
2738
+ try {
2739
+ !ct && Nt.return && Nt.return();
2740
+ } finally {
2741
+ if (ht)
2742
+ throw Wt;
2743
+ }
2744
+ }
2745
+ return Ct;
2746
+ }
2747
+ var ot = /* @__PURE__ */ new Map();
2748
+ b.forEach(function(ft, st) {
2749
+ ot.set(st, 0);
2750
+ }), b.forEach(function(ft, st) {
2751
+ ft.forEach(function(Ct) {
2752
+ ot.set(Ct.id, ot.get(Ct.id) + 1);
2753
+ });
2754
+ });
2755
+ var tt = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), dt = new g();
2756
+ ot.forEach(function(ft, st) {
2757
+ ft == 0 ? (dt.push(st), Q || ($ == "horizontal" ? tt.set(st, v.has(st) ? d[v.get(st)] : Z.get(st)) : tt.set(st, v.has(st) ? N[v.get(st)] : Z.get(st)))) : tt.set(st, Number.NEGATIVE_INFINITY), Q && j.set(st, /* @__PURE__ */ new Set([st]));
2758
+ }), Q && at.forEach(function(ft) {
2759
+ var st = [];
2760
+ if (ft.forEach(function(ht) {
2761
+ Q.has(ht) && st.push(ht);
2762
+ }), st.length > 0) {
2763
+ var Ct = 0;
2764
+ st.forEach(function(ht) {
2765
+ $ == "horizontal" ? (tt.set(ht, v.has(ht) ? d[v.get(ht)] : Z.get(ht)), Ct += tt.get(ht)) : (tt.set(ht, v.has(ht) ? N[v.get(ht)] : Z.get(ht)), Ct += tt.get(ht));
2766
+ }), Ct = Ct / st.length, ft.forEach(function(ht) {
2767
+ Q.has(ht) || tt.set(ht, Ct);
2768
+ });
2769
+ } else {
2770
+ var ct = 0;
2771
+ ft.forEach(function(ht) {
2772
+ $ == "horizontal" ? ct += v.has(ht) ? d[v.get(ht)] : Z.get(ht) : ct += v.has(ht) ? N[v.get(ht)] : Z.get(ht);
2773
+ }), ct = ct / ft.length, ft.forEach(function(ht) {
2774
+ tt.set(ht, ct);
2775
+ });
2776
+ }
2777
+ });
2778
+ for (var wt = function() {
2779
+ var st = dt.shift(), Ct = b.get(st);
2780
+ Ct.forEach(function(ct) {
2781
+ if (tt.get(ct.id) < tt.get(st) + ct.gap)
2782
+ if (Q && Q.has(ct.id)) {
2783
+ var ht = void 0;
2784
+ if ($ == "horizontal" ? ht = v.has(ct.id) ? d[v.get(ct.id)] : Z.get(ct.id) : ht = v.has(ct.id) ? N[v.get(ct.id)] : Z.get(ct.id), tt.set(ct.id, ht), ht < tt.get(st) + ct.gap) {
2785
+ var Wt = tt.get(st) + ct.gap - ht;
2786
+ j.get(st).forEach(function(Nt) {
2787
+ tt.set(Nt, tt.get(Nt) - Wt);
2788
+ });
2789
+ }
2790
+ } else
2791
+ tt.set(ct.id, tt.get(st) + ct.gap);
2792
+ ot.set(ct.id, ot.get(ct.id) - 1), ot.get(ct.id) == 0 && dt.push(ct.id), Q && j.set(ct.id, ut(j.get(st), j.get(ct.id)));
2793
+ });
2794
+ }; dt.length != 0; )
2795
+ wt();
2796
+ if (Q) {
2797
+ var yt = /* @__PURE__ */ new Set();
2798
+ b.forEach(function(ft, st) {
2799
+ ft.length == 0 && yt.add(st);
2800
+ });
2801
+ var It = [];
2802
+ j.forEach(function(ft, st) {
2803
+ if (yt.has(st)) {
2804
+ var Ct = !1, ct = !0, ht = !1, Wt = void 0;
2805
+ try {
2806
+ for (var Nt = ft[Symbol.iterator](), Mt; !(ct = (Mt = Nt.next()).done); ct = !0) {
2807
+ var Zt = Mt.value;
2808
+ Q.has(Zt) && (Ct = !0);
2809
+ }
2810
+ } catch (Ft) {
2811
+ ht = !0, Wt = Ft;
2812
+ } finally {
2813
+ try {
2814
+ !ct && Nt.return && Nt.return();
2815
+ } finally {
2816
+ if (ht)
2817
+ throw Wt;
2818
+ }
2819
+ }
2820
+ if (!Ct) {
2821
+ var Gt = !1, $t = void 0;
2822
+ It.forEach(function(Ft, qt) {
2823
+ Ft.has([].concat(f(ft))[0]) && (Gt = !0, $t = qt);
2824
+ }), Gt ? ft.forEach(function(Ft) {
2825
+ It[$t].add(Ft);
2826
+ }) : It.push(new Set(ft));
2827
+ }
2828
+ }
2829
+ }), It.forEach(function(ft, st) {
2830
+ var Ct = Number.POSITIVE_INFINITY, ct = Number.POSITIVE_INFINITY, ht = Number.NEGATIVE_INFINITY, Wt = Number.NEGATIVE_INFINITY, Nt = !0, Mt = !1, Zt = void 0;
2831
+ try {
2832
+ for (var Gt = ft[Symbol.iterator](), $t; !(Nt = ($t = Gt.next()).done); Nt = !0) {
2833
+ var Ft = $t.value, qt = void 0;
2834
+ $ == "horizontal" ? qt = v.has(Ft) ? d[v.get(Ft)] : Z.get(Ft) : qt = v.has(Ft) ? N[v.get(Ft)] : Z.get(Ft);
2835
+ var _t = tt.get(Ft);
2836
+ qt < Ct && (Ct = qt), qt > ht && (ht = qt), _t < ct && (ct = _t), _t > Wt && (Wt = _t);
2837
+ }
2838
+ } catch (ie) {
2839
+ Mt = !0, Zt = ie;
2840
+ } finally {
2841
+ try {
2842
+ !Nt && Gt.return && Gt.return();
2843
+ } finally {
2844
+ if (Mt)
2845
+ throw Zt;
2846
+ }
2847
+ }
2848
+ var ce = (Ct + ht) / 2 - (ct + Wt) / 2, Kt = !0, te = !1, ee = void 0;
2849
+ try {
2850
+ for (var jt = ft[Symbol.iterator](), se; !(Kt = (se = jt.next()).done); Kt = !0) {
2851
+ var re = se.value;
2852
+ tt.set(re, tt.get(re) + ce);
2853
+ }
2854
+ } catch (ie) {
2855
+ te = !0, ee = ie;
2856
+ } finally {
2857
+ try {
2858
+ !Kt && jt.return && jt.return();
2859
+ } finally {
2860
+ if (te)
2861
+ throw ee;
2862
+ }
2863
+ }
2864
+ });
2865
+ }
2866
+ return tt;
2867
+ }, rt = function(b) {
2868
+ var $ = 0, Q = 0, Z = 0, at = 0;
2869
+ if (b.forEach(function(j) {
2870
+ j.left ? d[v.get(j.left)] - d[v.get(j.right)] >= 0 ? $++ : Q++ : N[v.get(j.top)] - N[v.get(j.bottom)] >= 0 ? Z++ : at++;
2871
+ }), $ > Q && Z > at)
2872
+ for (var ut = 0; ut < v.size; ut++)
2873
+ d[ut] = -1 * d[ut], N[ut] = -1 * N[ut];
2874
+ else if ($ > Q)
2875
+ for (var ot = 0; ot < v.size; ot++)
2876
+ d[ot] = -1 * d[ot];
2877
+ else if (Z > at)
2878
+ for (var tt = 0; tt < v.size; tt++)
2879
+ N[tt] = -1 * N[tt];
2880
+ }, n = function(b) {
2881
+ var $ = [], Q = new g(), Z = /* @__PURE__ */ new Set(), at = 0;
2882
+ return b.forEach(function(ut, ot) {
2883
+ if (!Z.has(ot)) {
2884
+ $[at] = [];
2885
+ var tt = ot;
2886
+ for (Q.push(tt), Z.add(tt), $[at].push(tt); Q.length != 0; ) {
2887
+ tt = Q.shift();
2888
+ var j = b.get(tt);
2889
+ j.forEach(function(dt) {
2890
+ Z.has(dt.id) || (Q.push(dt.id), Z.add(dt.id), $[at].push(dt.id));
2891
+ });
2892
+ }
2893
+ at++;
2894
+ }
2895
+ }), $;
2896
+ }, m = function(b) {
2897
+ var $ = /* @__PURE__ */ new Map();
2898
+ return b.forEach(function(Q, Z) {
2899
+ $.set(Z, []);
2900
+ }), b.forEach(function(Q, Z) {
2901
+ Q.forEach(function(at) {
2902
+ $.get(Z).push(at), $.get(at.id).push({ id: Z, gap: at.gap, direction: at.direction });
2903
+ });
2904
+ }), $;
2905
+ }, p = function(b) {
2906
+ var $ = /* @__PURE__ */ new Map();
2907
+ return b.forEach(function(Q, Z) {
2908
+ $.set(Z, []);
2909
+ }), b.forEach(function(Q, Z) {
2910
+ Q.forEach(function(at) {
2911
+ $.get(at.id).push({ id: Z, gap: at.gap, direction: at.direction });
2912
+ });
2913
+ }), $;
2914
+ }, E = [], y = [], I = !1, w = !1, R = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), q = [];
2915
+ if (h.fixedNodeConstraint && h.fixedNodeConstraint.forEach(function(F) {
2916
+ R.add(F.nodeId);
2917
+ }), h.relativePlacementConstraint && (h.relativePlacementConstraint.forEach(function(F) {
2918
+ F.left ? (W.has(F.left) ? W.get(F.left).push({ id: F.right, gap: F.gap, direction: "horizontal" }) : W.set(F.left, [{ id: F.right, gap: F.gap, direction: "horizontal" }]), W.has(F.right) || W.set(F.right, [])) : (W.has(F.top) ? W.get(F.top).push({ id: F.bottom, gap: F.gap, direction: "vertical" }) : W.set(F.top, [{ id: F.bottom, gap: F.gap, direction: "vertical" }]), W.has(F.bottom) || W.set(F.bottom, []));
2919
+ }), x = m(W), q = n(x)), i.TRANSFORM_ON_CONSTRAINT_HANDLING) {
2920
+ if (h.fixedNodeConstraint && h.fixedNodeConstraint.length > 1)
2921
+ h.fixedNodeConstraint.forEach(function(F, b) {
2922
+ E[b] = [F.position.x, F.position.y], y[b] = [d[v.get(F.nodeId)], N[v.get(F.nodeId)]];
2923
+ }), I = !0;
2924
+ else if (h.alignmentConstraint)
2925
+ (function() {
2926
+ var F = 0;
2927
+ if (h.alignmentConstraint.vertical) {
2928
+ for (var b = h.alignmentConstraint.vertical, $ = function(tt) {
2929
+ var j = /* @__PURE__ */ new Set();
2930
+ b[tt].forEach(function(yt) {
2931
+ j.add(yt);
2932
+ });
2933
+ var dt = new Set([].concat(f(j)).filter(function(yt) {
2934
+ return R.has(yt);
2935
+ })), wt = void 0;
2936
+ dt.size > 0 ? wt = d[v.get(dt.values().next().value)] : wt = k(j).x, b[tt].forEach(function(yt) {
2937
+ E[F] = [wt, N[v.get(yt)]], y[F] = [d[v.get(yt)], N[v.get(yt)]], F++;
2938
+ });
2939
+ }, Q = 0; Q < b.length; Q++)
2940
+ $(Q);
2941
+ I = !0;
2942
+ }
2943
+ if (h.alignmentConstraint.horizontal) {
2944
+ for (var Z = h.alignmentConstraint.horizontal, at = function(tt) {
2945
+ var j = /* @__PURE__ */ new Set();
2946
+ Z[tt].forEach(function(yt) {
2947
+ j.add(yt);
2948
+ });
2949
+ var dt = new Set([].concat(f(j)).filter(function(yt) {
2950
+ return R.has(yt);
2951
+ })), wt = void 0;
2952
+ dt.size > 0 ? wt = d[v.get(dt.values().next().value)] : wt = k(j).y, Z[tt].forEach(function(yt) {
2953
+ E[F] = [d[v.get(yt)], wt], y[F] = [d[v.get(yt)], N[v.get(yt)]], F++;
2954
+ });
2955
+ }, ut = 0; ut < Z.length; ut++)
2956
+ at(ut);
2957
+ I = !0;
2958
+ }
2959
+ h.relativePlacementConstraint && (w = !0);
2960
+ })();
2961
+ else if (h.relativePlacementConstraint) {
2962
+ for (var V = 0, Y = 0, et = 0; et < q.length; et++)
2963
+ q[et].length > V && (V = q[et].length, Y = et);
2964
+ if (V < x.size / 2)
2965
+ rt(h.relativePlacementConstraint), I = !1, w = !1;
2966
+ else {
2967
+ var z = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), H = [];
2968
+ q[Y].forEach(function(F) {
2969
+ W.get(F).forEach(function(b) {
2970
+ b.direction == "horizontal" ? (z.has(F) ? z.get(F).push(b) : z.set(F, [b]), z.has(b.id) || z.set(b.id, []), H.push({ left: F, right: b.id })) : (O.has(F) ? O.get(F).push(b) : O.set(F, [b]), O.has(b.id) || O.set(b.id, []), H.push({ top: F, bottom: b.id }));
2971
+ });
2972
+ }), rt(H), w = !1;
2973
+ var B = D(z, "horizontal"), _ = D(O, "vertical");
2974
+ q[Y].forEach(function(F, b) {
2975
+ y[b] = [d[v.get(F)], N[v.get(F)]], E[b] = [], B.has(F) ? E[b][0] = B.get(F) : E[b][0] = d[v.get(F)], _.has(F) ? E[b][1] = _.get(F) : E[b][1] = N[v.get(F)];
2976
+ }), I = !0;
2977
+ }
2978
+ }
2979
+ if (I) {
2980
+ for (var lt = void 0, J = t.transpose(E), Rt = t.transpose(y), Lt = 0; Lt < J.length; Lt++)
2981
+ J[Lt] = t.multGamma(J[Lt]), Rt[Lt] = t.multGamma(Rt[Lt]);
2982
+ var vt = t.multMat(J, t.transpose(Rt)), it = s.svd(vt);
2983
+ lt = t.multMat(it.V, t.transpose(it.U));
2984
+ for (var gt = 0; gt < v.size; gt++) {
2985
+ var Tt = [d[gt], N[gt]], At = [lt[0][0], lt[1][0]], Dt = [lt[0][1], lt[1][1]];
2986
+ d[gt] = t.dotProduct(Tt, At), N[gt] = t.dotProduct(Tt, Dt);
2987
+ }
2988
+ w && rt(h.relativePlacementConstraint);
2989
+ }
2990
+ }
2991
+ if (i.ENFORCE_CONSTRAINTS) {
2992
+ if (h.fixedNodeConstraint && h.fixedNodeConstraint.length > 0) {
2993
+ var mt = { x: 0, y: 0 };
2994
+ h.fixedNodeConstraint.forEach(function(F, b) {
2995
+ var $ = { x: d[v.get(F.nodeId)], y: N[v.get(F.nodeId)] }, Q = F.position, Z = X(Q, $);
2996
+ mt.x += Z.x, mt.y += Z.y;
2997
+ }), mt.x /= h.fixedNodeConstraint.length, mt.y /= h.fixedNodeConstraint.length, d.forEach(function(F, b) {
2998
+ d[b] += mt.x;
2999
+ }), N.forEach(function(F, b) {
3000
+ N[b] += mt.y;
3001
+ }), h.fixedNodeConstraint.forEach(function(F) {
3002
+ d[v.get(F.nodeId)] = F.position.x, N[v.get(F.nodeId)] = F.position.y;
3003
+ });
3004
+ }
3005
+ if (h.alignmentConstraint) {
3006
+ if (h.alignmentConstraint.vertical)
3007
+ for (var xt = h.alignmentConstraint.vertical, St = function(b) {
3008
+ var $ = /* @__PURE__ */ new Set();
3009
+ xt[b].forEach(function(at) {
3010
+ $.add(at);
3011
+ });
3012
+ var Q = new Set([].concat(f($)).filter(function(at) {
3013
+ return R.has(at);
3014
+ })), Z = void 0;
3015
+ Q.size > 0 ? Z = d[v.get(Q.values().next().value)] : Z = k($).x, $.forEach(function(at) {
3016
+ R.has(at) || (d[v.get(at)] = Z);
3017
+ });
3018
+ }, Vt = 0; Vt < xt.length; Vt++)
3019
+ St(Vt);
3020
+ if (h.alignmentConstraint.horizontal)
3021
+ for (var Xt = h.alignmentConstraint.horizontal, Ut = function(b) {
3022
+ var $ = /* @__PURE__ */ new Set();
3023
+ Xt[b].forEach(function(at) {
3024
+ $.add(at);
3025
+ });
3026
+ var Q = new Set([].concat(f($)).filter(function(at) {
3027
+ return R.has(at);
3028
+ })), Z = void 0;
3029
+ Q.size > 0 ? Z = N[v.get(Q.values().next().value)] : Z = k($).y, $.forEach(function(at) {
3030
+ R.has(at) || (N[v.get(at)] = Z);
3031
+ });
3032
+ }, bt = 0; bt < Xt.length; bt++)
3033
+ Ut(bt);
3034
+ }
3035
+ h.relativePlacementConstraint && function() {
3036
+ var F = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(), at = /* @__PURE__ */ new Map(), ut = /* @__PURE__ */ new Set(), ot = /* @__PURE__ */ new Set();
3037
+ if (R.forEach(function(Yt) {
3038
+ ut.add(Yt), ot.add(Yt);
3039
+ }), h.alignmentConstraint) {
3040
+ if (h.alignmentConstraint.vertical)
3041
+ for (var tt = h.alignmentConstraint.vertical, j = function(Et) {
3042
+ $.set("dummy" + Et, []), tt[Et].forEach(function(Ot) {
3043
+ F.set(Ot, "dummy" + Et), $.get("dummy" + Et).push(Ot), R.has(Ot) && ut.add("dummy" + Et);
3044
+ }), Z.set("dummy" + Et, d[v.get(tt[Et][0])]);
3045
+ }, dt = 0; dt < tt.length; dt++)
3046
+ j(dt);
3047
+ if (h.alignmentConstraint.horizontal)
3048
+ for (var wt = h.alignmentConstraint.horizontal, yt = function(Et) {
3049
+ Q.set("dummy" + Et, []), wt[Et].forEach(function(Ot) {
3050
+ b.set(Ot, "dummy" + Et), Q.get("dummy" + Et).push(Ot), R.has(Ot) && ot.add("dummy" + Et);
3051
+ }), at.set("dummy" + Et, N[v.get(wt[Et][0])]);
3052
+ }, It = 0; It < wt.length; It++)
3053
+ yt(It);
3054
+ }
3055
+ var ft = /* @__PURE__ */ new Map(), st = /* @__PURE__ */ new Map(), Ct = function(Et) {
3056
+ W.get(Et).forEach(function(Ot) {
3057
+ var Jt = void 0, kt = void 0;
3058
+ Ot.direction == "horizontal" ? (Jt = F.get(Et) ? F.get(Et) : Et, F.get(Ot.id) ? kt = { id: F.get(Ot.id), gap: Ot.gap, direction: Ot.direction } : kt = Ot, ft.has(Jt) ? ft.get(Jt).push(kt) : ft.set(Jt, [kt]), ft.has(kt.id) || ft.set(kt.id, [])) : (Jt = b.get(Et) ? b.get(Et) : Et, b.get(Ot.id) ? kt = { id: b.get(Ot.id), gap: Ot.gap, direction: Ot.direction } : kt = Ot, st.has(Jt) ? st.get(Jt).push(kt) : st.set(Jt, [kt]), st.has(kt.id) || st.set(kt.id, []));
3059
+ });
3060
+ }, ct = !0, ht = !1, Wt = void 0;
3061
+ try {
3062
+ for (var Nt = W.keys()[Symbol.iterator](), Mt; !(ct = (Mt = Nt.next()).done); ct = !0) {
3063
+ var Zt = Mt.value;
3064
+ Ct(Zt);
3065
+ }
3066
+ } catch (Yt) {
3067
+ ht = !0, Wt = Yt;
3068
+ } finally {
3069
+ try {
3070
+ !ct && Nt.return && Nt.return();
3071
+ } finally {
3072
+ if (ht)
3073
+ throw Wt;
3074
+ }
3075
+ }
3076
+ var Gt = m(ft), $t = m(st), Ft = n(Gt), qt = n($t), _t = p(ft), ce = p(st), Kt = [], te = [];
3077
+ Ft.forEach(function(Yt, Et) {
3078
+ Kt[Et] = [], Yt.forEach(function(Ot) {
3079
+ _t.get(Ot).length == 0 && Kt[Et].push(Ot);
3080
+ });
3081
+ }), qt.forEach(function(Yt, Et) {
3082
+ te[Et] = [], Yt.forEach(function(Ot) {
3083
+ ce.get(Ot).length == 0 && te[Et].push(Ot);
3084
+ });
3085
+ });
3086
+ var ee = D(ft, "horizontal", ut, Z, Kt), jt = D(st, "vertical", ot, at, te), se = function(Et) {
3087
+ $.get(Et) ? $.get(Et).forEach(function(Ot) {
3088
+ d[v.get(Ot)] = ee.get(Et);
3089
+ }) : d[v.get(Et)] = ee.get(Et);
3090
+ }, re = !0, ie = !1, Me = void 0;
3091
+ try {
3092
+ for (var ue = ee.keys()[Symbol.iterator](), Ae; !(re = (Ae = ue.next()).done); re = !0) {
3093
+ var ge = Ae.value;
3094
+ se(ge);
3095
+ }
3096
+ } catch (Yt) {
3097
+ ie = !0, Me = Yt;
3098
+ } finally {
3099
+ try {
3100
+ !re && ue.return && ue.return();
3101
+ } finally {
3102
+ if (ie)
3103
+ throw Me;
3104
+ }
3105
+ }
3106
+ var ke = function(Et) {
3107
+ Q.get(Et) ? Q.get(Et).forEach(function(Ot) {
3108
+ N[v.get(Ot)] = jt.get(Et);
3109
+ }) : N[v.get(Et)] = jt.get(Et);
3110
+ }, de = !0, we = !1, Oe = void 0;
3111
+ try {
3112
+ for (var ve = jt.keys()[Symbol.iterator](), De; !(de = (De = ve.next()).done); de = !0) {
3113
+ var ge = De.value;
3114
+ ke(ge);
3115
+ }
3116
+ } catch (Yt) {
3117
+ we = !0, Oe = Yt;
3118
+ } finally {
3119
+ try {
3120
+ !de && ve.return && ve.return();
3121
+ } finally {
3122
+ if (we)
3123
+ throw Oe;
3124
+ }
3125
+ }
3126
+ }();
3127
+ }
3128
+ for (var Ht = 0; Ht < S.length; Ht++) {
3129
+ var Bt = S[Ht];
3130
+ Bt.getChild() == null && Bt.setCenter(d[v.get(Bt.id)], N[v.get(Bt.id)]);
3131
+ }
3132
+ }, a.exports = o;
3133
+ }
3134
+ ),
3135
+ /***/
3136
+ 551: (
3137
+ /***/
3138
+ (a) => {
3139
+ a.exports = A;
3140
+ }
3141
+ )
3142
+ /******/
3143
+ }, L = {};
3144
+ function u(a) {
3145
+ var r = L[a];
3146
+ if (r !== void 0)
3147
+ return r.exports;
3148
+ var e = L[a] = {
3149
+ /******/
3150
+ // no module.id needed
3151
+ /******/
3152
+ // no module.loaded needed
3153
+ /******/
3154
+ exports: {}
3155
+ /******/
3156
+ };
3157
+ return G[a](e, e.exports, u), e.exports;
3158
+ }
3159
+ var l = u(45);
3160
+ return l;
3161
+ })()
3162
+ );
3163
+ });
3164
+ }(pe)), pe.exports;
3165
+ }
3166
+ (function(C, U) {
3167
+ (function(G, L) {
3168
+ C.exports = L(ur());
3169
+ })(Ne, function(A) {
3170
+ return (
3171
+ /******/
3172
+ (() => {
3173
+ var G = {
3174
+ /***/
3175
+ 658: (
3176
+ /***/
3177
+ (a) => {
3178
+ a.exports = Object.assign != null ? Object.assign.bind(Object) : function(r) {
3179
+ for (var e = arguments.length, f = Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
3180
+ f[i - 1] = arguments[i];
3181
+ return f.forEach(function(g) {
3182
+ Object.keys(g).forEach(function(t) {
3183
+ return r[t] = g[t];
3184
+ });
3185
+ }), r;
3186
+ };
3187
+ }
3188
+ ),
3189
+ /***/
3190
+ 548: (
3191
+ /***/
3192
+ (a, r, e) => {
3193
+ var f = function() {
3194
+ function t(s, o) {
3195
+ var c = [], h = !0, T = !1, v = void 0;
3196
+ try {
3197
+ for (var d = s[Symbol.iterator](), N; !(h = (N = d.next()).done) && (c.push(N.value), !(o && c.length === o)); h = !0)
3198
+ ;
3199
+ } catch (S) {
3200
+ T = !0, v = S;
3201
+ } finally {
3202
+ try {
3203
+ !h && d.return && d.return();
3204
+ } finally {
3205
+ if (T)
3206
+ throw v;
3207
+ }
3208
+ }
3209
+ return c;
3210
+ }
3211
+ return function(s, o) {
3212
+ if (Array.isArray(s))
3213
+ return s;
3214
+ if (Symbol.iterator in Object(s))
3215
+ return t(s, o);
3216
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
3217
+ };
3218
+ }(), i = e(140).layoutBase.LinkedList, g = {};
3219
+ g.getTopMostNodes = function(t) {
3220
+ for (var s = {}, o = 0; o < t.length; o++)
3221
+ s[t[o].id()] = !0;
3222
+ var c = t.filter(function(h, T) {
3223
+ typeof h == "number" && (h = T);
3224
+ for (var v = h.parent()[0]; v != null; ) {
3225
+ if (s[v.id()])
3226
+ return !1;
3227
+ v = v.parent()[0];
3228
+ }
3229
+ return !0;
3230
+ });
3231
+ return c;
3232
+ }, g.connectComponents = function(t, s, o, c) {
3233
+ var h = new i(), T = /* @__PURE__ */ new Set(), v = [], d = void 0, N = void 0, S = void 0, M = !1, P = 1, K = [], X = [], k = function() {
3234
+ var rt = t.collection();
3235
+ X.push(rt);
3236
+ var n = o[0], m = t.collection();
3237
+ m.merge(n).merge(n.descendants().intersection(s)), v.push(n), m.forEach(function(y) {
3238
+ h.push(y), T.add(y), rt.merge(y);
3239
+ });
3240
+ for (var p = function() {
3241
+ n = h.shift();
3242
+ var I = t.collection();
3243
+ n.neighborhood().nodes().forEach(function(x) {
3244
+ s.intersection(n.edgesWith(x)).length > 0 && I.merge(x);
3245
+ });
3246
+ for (var w = 0; w < I.length; w++) {
3247
+ var R = I[w];
3248
+ if (d = o.intersection(R.union(R.ancestors())), d != null && !T.has(d[0])) {
3249
+ var W = d.union(d.descendants());
3250
+ W.forEach(function(x) {
3251
+ h.push(x), T.add(x), rt.merge(x), o.has(x) && v.push(x);
3252
+ });
3253
+ }
3254
+ }
3255
+ }; h.length != 0; )
3256
+ p();
3257
+ if (rt.forEach(function(y) {
3258
+ s.intersection(y.connectedEdges()).forEach(function(I) {
3259
+ rt.has(I.source()) && rt.has(I.target()) && rt.merge(I);
3260
+ });
3261
+ }), v.length == o.length && (M = !0), !M || M && P > 1) {
3262
+ N = v[0], S = N.connectedEdges().length, v.forEach(function(y) {
3263
+ y.connectedEdges().length < S && (S = y.connectedEdges().length, N = y);
3264
+ }), K.push(N.id());
3265
+ var E = t.collection();
3266
+ E.merge(v[0]), v.forEach(function(y) {
3267
+ E.merge(y);
3268
+ }), v = [], o = o.difference(E), P++;
3269
+ }
3270
+ };
3271
+ do
3272
+ k();
3273
+ while (!M);
3274
+ return c && K.length > 0 && c.set("dummy" + (c.size + 1), K), X;
3275
+ }, g.relocateComponent = function(t, s, o) {
3276
+ if (!o.fixedNodeConstraint) {
3277
+ var c = Number.POSITIVE_INFINITY, h = Number.NEGATIVE_INFINITY, T = Number.POSITIVE_INFINITY, v = Number.NEGATIVE_INFINITY;
3278
+ if (o.quality == "draft") {
3279
+ var d = !0, N = !1, S = void 0;
3280
+ try {
3281
+ for (var M = s.nodeIndexes[Symbol.iterator](), P; !(d = (P = M.next()).done); d = !0) {
3282
+ var K = P.value, X = f(K, 2), k = X[0], D = X[1], rt = o.cy.getElementById(k);
3283
+ if (rt) {
3284
+ var n = rt.boundingBox(), m = s.xCoords[D] - n.w / 2, p = s.xCoords[D] + n.w / 2, E = s.yCoords[D] - n.h / 2, y = s.yCoords[D] + n.h / 2;
3285
+ m < c && (c = m), p > h && (h = p), E < T && (T = E), y > v && (v = y);
3286
+ }
3287
+ }
3288
+ } catch (x) {
3289
+ N = !0, S = x;
3290
+ } finally {
3291
+ try {
3292
+ !d && M.return && M.return();
3293
+ } finally {
3294
+ if (N)
3295
+ throw S;
3296
+ }
3297
+ }
3298
+ var I = t.x - (h + c) / 2, w = t.y - (v + T) / 2;
3299
+ s.xCoords = s.xCoords.map(function(x) {
3300
+ return x + I;
3301
+ }), s.yCoords = s.yCoords.map(function(x) {
3302
+ return x + w;
3303
+ });
3304
+ } else {
3305
+ Object.keys(s).forEach(function(x) {
3306
+ var q = s[x], V = q.getRect().x, Y = q.getRect().x + q.getRect().width, et = q.getRect().y, z = q.getRect().y + q.getRect().height;
3307
+ V < c && (c = V), Y > h && (h = Y), et < T && (T = et), z > v && (v = z);
3308
+ });
3309
+ var R = t.x - (h + c) / 2, W = t.y - (v + T) / 2;
3310
+ Object.keys(s).forEach(function(x) {
3311
+ var q = s[x];
3312
+ q.setCenter(q.getCenterX() + R, q.getCenterY() + W);
3313
+ });
3314
+ }
3315
+ }
3316
+ }, g.calcBoundingBox = function(t, s, o, c) {
3317
+ for (var h = Number.MAX_SAFE_INTEGER, T = Number.MIN_SAFE_INTEGER, v = Number.MAX_SAFE_INTEGER, d = Number.MIN_SAFE_INTEGER, N = void 0, S = void 0, M = void 0, P = void 0, K = t.descendants().not(":parent"), X = K.length, k = 0; k < X; k++) {
3318
+ var D = K[k];
3319
+ N = s[c.get(D.id())] - D.width() / 2, S = s[c.get(D.id())] + D.width() / 2, M = o[c.get(D.id())] - D.height() / 2, P = o[c.get(D.id())] + D.height() / 2, h > N && (h = N), T < S && (T = S), v > M && (v = M), d < P && (d = P);
3320
+ }
3321
+ var rt = {};
3322
+ return rt.topLeftX = h, rt.topLeftY = v, rt.width = T - h, rt.height = d - v, rt;
3323
+ }, g.calcParentsWithoutChildren = function(t, s) {
3324
+ var o = t.collection();
3325
+ return s.nodes(":parent").forEach(function(c) {
3326
+ var h = !1;
3327
+ c.children().forEach(function(T) {
3328
+ T.css("display") != "none" && (h = !0);
3329
+ }), h || o.merge(c);
3330
+ }), o;
3331
+ }, a.exports = g;
3332
+ }
3333
+ ),
3334
+ /***/
3335
+ 816: (
3336
+ /***/
3337
+ (a, r, e) => {
3338
+ var f = e(548), i = e(140).CoSELayout, g = e(140).CoSENode, t = e(140).layoutBase.PointD, s = e(140).layoutBase.DimensionD, o = e(140).layoutBase.LayoutConstants, c = e(140).layoutBase.FDLayoutConstants, h = e(140).CoSEConstants, T = function(d, N) {
3339
+ var S = d.cy, M = d.eles, P = M.nodes(), K = M.edges(), X = void 0, k = void 0, D = void 0, rt = {};
3340
+ d.randomize && (X = N.nodeIndexes, k = N.xCoords, D = N.yCoords);
3341
+ var n = function(x) {
3342
+ return typeof x == "function";
3343
+ }, m = function(x, q) {
3344
+ return n(x) ? x(q) : x;
3345
+ }, p = f.calcParentsWithoutChildren(S, M), E = function W(x, q, V, Y) {
3346
+ for (var et = q.length, z = 0; z < et; z++) {
3347
+ var O = q[z], H = null;
3348
+ O.intersection(p).length == 0 && (H = O.children());
3349
+ var B = void 0, _ = O.layoutDimensions({
3350
+ nodeDimensionsIncludeLabels: Y.nodeDimensionsIncludeLabels
3351
+ });
3352
+ if (O.outerWidth() != null && O.outerHeight() != null)
3353
+ if (Y.randomize)
3354
+ if (!O.isParent())
3355
+ B = x.add(new g(V.graphManager, new t(k[X.get(O.id())] - _.w / 2, D[X.get(O.id())] - _.h / 2), new s(parseFloat(_.w), parseFloat(_.h))));
3356
+ else {
3357
+ var lt = f.calcBoundingBox(O, k, D, X);
3358
+ O.intersection(p).length == 0 ? B = x.add(new g(V.graphManager, new t(lt.topLeftX, lt.topLeftY), new s(lt.width, lt.height))) : B = x.add(new g(V.graphManager, new t(lt.topLeftX, lt.topLeftY), new s(parseFloat(_.w), parseFloat(_.h))));
3359
+ }
3360
+ else
3361
+ B = x.add(new g(V.graphManager, new t(O.position("x") - _.w / 2, O.position("y") - _.h / 2), new s(parseFloat(_.w), parseFloat(_.h))));
3362
+ else
3363
+ B = x.add(new g(this.graphManager));
3364
+ if (B.id = O.data("id"), B.nodeRepulsion = m(Y.nodeRepulsion, O), B.paddingLeft = parseInt(O.css("padding")), B.paddingTop = parseInt(O.css("padding")), B.paddingRight = parseInt(O.css("padding")), B.paddingBottom = parseInt(O.css("padding")), Y.nodeDimensionsIncludeLabels && (B.labelWidth = O.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).w, B.labelHeight = O.boundingBox({ includeLabels: !0, includeNodes: !1, includeOverlays: !1 }).h, B.labelPosVertical = O.css("text-valign"), B.labelPosHorizontal = O.css("text-halign")), rt[O.data("id")] = B, isNaN(B.rect.x) && (B.rect.x = 0), isNaN(B.rect.y) && (B.rect.y = 0), H != null && H.length > 0) {
3365
+ var J = void 0;
3366
+ J = V.getGraphManager().add(V.newGraph(), B), W(J, H, V, Y);
3367
+ }
3368
+ }
3369
+ }, y = function(x, q, V) {
3370
+ for (var Y = 0, et = 0, z = 0; z < V.length; z++) {
3371
+ var O = V[z], H = rt[O.data("source")], B = rt[O.data("target")];
3372
+ if (H && B && H !== B && H.getEdgesBetween(B).length == 0) {
3373
+ var _ = q.add(x.newEdge(), H, B);
3374
+ _.id = O.id(), _.idealLength = m(d.idealEdgeLength, O), _.edgeElasticity = m(d.edgeElasticity, O), Y += _.idealLength, et++;
3375
+ }
3376
+ }
3377
+ d.idealEdgeLength != null && (et > 0 ? h.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = Y / et : n(d.idealEdgeLength) ? h.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = 50 : h.DEFAULT_EDGE_LENGTH = c.DEFAULT_EDGE_LENGTH = d.idealEdgeLength, h.MIN_REPULSION_DIST = c.MIN_REPULSION_DIST = c.DEFAULT_EDGE_LENGTH / 10, h.DEFAULT_RADIAL_SEPARATION = c.DEFAULT_EDGE_LENGTH);
3378
+ }, I = function(x, q) {
3379
+ q.fixedNodeConstraint && (x.constraints.fixedNodeConstraint = q.fixedNodeConstraint), q.alignmentConstraint && (x.constraints.alignmentConstraint = q.alignmentConstraint), q.relativePlacementConstraint && (x.constraints.relativePlacementConstraint = q.relativePlacementConstraint);
3380
+ };
3381
+ d.nestingFactor != null && (h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = d.nestingFactor), d.gravity != null && (h.DEFAULT_GRAVITY_STRENGTH = c.DEFAULT_GRAVITY_STRENGTH = d.gravity), d.numIter != null && (h.MAX_ITERATIONS = c.MAX_ITERATIONS = d.numIter), d.gravityRange != null && (h.DEFAULT_GRAVITY_RANGE_FACTOR = c.DEFAULT_GRAVITY_RANGE_FACTOR = d.gravityRange), d.gravityCompound != null && (h.DEFAULT_COMPOUND_GRAVITY_STRENGTH = c.DEFAULT_COMPOUND_GRAVITY_STRENGTH = d.gravityCompound), d.gravityRangeCompound != null && (h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = d.gravityRangeCompound), d.initialEnergyOnIncremental != null && (h.DEFAULT_COOLING_FACTOR_INCREMENTAL = c.DEFAULT_COOLING_FACTOR_INCREMENTAL = d.initialEnergyOnIncremental), d.tilingCompareBy != null && (h.TILING_COMPARE_BY = d.tilingCompareBy), d.quality == "proof" ? o.QUALITY = 2 : o.QUALITY = 0, h.NODE_DIMENSIONS_INCLUDE_LABELS = c.NODE_DIMENSIONS_INCLUDE_LABELS = o.NODE_DIMENSIONS_INCLUDE_LABELS = d.nodeDimensionsIncludeLabels, h.DEFAULT_INCREMENTAL = c.DEFAULT_INCREMENTAL = o.DEFAULT_INCREMENTAL = !d.randomize, h.ANIMATE = c.ANIMATE = o.ANIMATE = d.animate, h.TILE = d.tile, h.TILING_PADDING_VERTICAL = typeof d.tilingPaddingVertical == "function" ? d.tilingPaddingVertical.call() : d.tilingPaddingVertical, h.TILING_PADDING_HORIZONTAL = typeof d.tilingPaddingHorizontal == "function" ? d.tilingPaddingHorizontal.call() : d.tilingPaddingHorizontal, h.DEFAULT_INCREMENTAL = c.DEFAULT_INCREMENTAL = o.DEFAULT_INCREMENTAL = !0, h.PURE_INCREMENTAL = !d.randomize, o.DEFAULT_UNIFORM_LEAF_NODE_SIZES = d.uniformNodeDimensions, d.step == "transformed" && (h.TRANSFORM_ON_CONSTRAINT_HANDLING = !0, h.ENFORCE_CONSTRAINTS = !1, h.APPLY_LAYOUT = !1), d.step == "enforced" && (h.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, h.ENFORCE_CONSTRAINTS = !0, h.APPLY_LAYOUT = !1), d.step == "cose" && (h.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, h.ENFORCE_CONSTRAINTS = !1, h.APPLY_LAYOUT = !0), d.step == "all" && (d.randomize ? h.TRANSFORM_ON_CONSTRAINT_HANDLING = !0 : h.TRANSFORM_ON_CONSTRAINT_HANDLING = !1, h.ENFORCE_CONSTRAINTS = !0, h.APPLY_LAYOUT = !0), d.fixedNodeConstraint || d.alignmentConstraint || d.relativePlacementConstraint ? h.TREE_REDUCTION_ON_INCREMENTAL = !1 : h.TREE_REDUCTION_ON_INCREMENTAL = !0;
3382
+ var w = new i(), R = w.newGraphManager();
3383
+ return E(R.addRoot(), f.getTopMostNodes(P), w, d), y(w, R, K), I(w, d), w.runLayout(), rt;
3384
+ };
3385
+ a.exports = { coseLayout: T };
3386
+ }
3387
+ ),
3388
+ /***/
3389
+ 212: (
3390
+ /***/
3391
+ (a, r, e) => {
3392
+ var f = function() {
3393
+ function d(N, S) {
3394
+ for (var M = 0; M < S.length; M++) {
3395
+ var P = S[M];
3396
+ P.enumerable = P.enumerable || !1, P.configurable = !0, "value" in P && (P.writable = !0), Object.defineProperty(N, P.key, P);
3397
+ }
3398
+ }
3399
+ return function(N, S, M) {
3400
+ return S && d(N.prototype, S), M && d(N, M), N;
3401
+ };
3402
+ }();
3403
+ function i(d, N) {
3404
+ if (!(d instanceof N))
3405
+ throw new TypeError("Cannot call a class as a function");
3406
+ }
3407
+ var g = e(658), t = e(548), s = e(657), o = s.spectralLayout, c = e(816), h = c.coseLayout, T = Object.freeze({
3408
+ // 'draft', 'default' or 'proof'
3409
+ // - 'draft' only applies spectral layout
3410
+ // - 'default' improves the quality with subsequent CoSE layout (fast cooling rate)
3411
+ // - 'proof' improves the quality with subsequent CoSE layout (slow cooling rate)
3412
+ quality: "default",
3413
+ // Use random node positions at beginning of layout
3414
+ // if this is set to false, then quality option must be "proof"
3415
+ randomize: !0,
3416
+ // Whether or not to animate the layout
3417
+ animate: !0,
3418
+ // Duration of animation in ms, if enabled
3419
+ animationDuration: 1e3,
3420
+ // Easing of animation, if enabled
3421
+ animationEasing: void 0,
3422
+ // Fit the viewport to the repositioned nodes
3423
+ fit: !0,
3424
+ // Padding around layout
3425
+ padding: 30,
3426
+ // Whether to include labels in node dimensions. Valid in "proof" quality
3427
+ nodeDimensionsIncludeLabels: !1,
3428
+ // Whether or not simple nodes (non-compound nodes) are of uniform dimensions
3429
+ uniformNodeDimensions: !1,
3430
+ // Whether to pack disconnected components - valid only if randomize: true
3431
+ packComponents: !0,
3432
+ // Layout step - all, transformed, enforced, cose - for debug purpose only
3433
+ step: "all",
3434
+ /* spectral layout options */
3435
+ // False for random, true for greedy
3436
+ samplingType: !0,
3437
+ // Sample size to construct distance matrix
3438
+ sampleSize: 25,
3439
+ // Separation amount between nodes
3440
+ nodeSeparation: 75,
3441
+ // Power iteration tolerance
3442
+ piTol: 1e-7,
3443
+ /* CoSE layout options */
3444
+ // Node repulsion (non overlapping) multiplier
3445
+ nodeRepulsion: function(N) {
3446
+ return 4500;
3447
+ },
3448
+ // Ideal edge (non nested) length
3449
+ idealEdgeLength: function(N) {
3450
+ return 50;
3451
+ },
3452
+ // Divisor to compute edge forces
3453
+ edgeElasticity: function(N) {
3454
+ return 0.45;
3455
+ },
3456
+ // Nesting factor (multiplier) to compute ideal edge length for nested edges
3457
+ nestingFactor: 0.1,
3458
+ // Gravity force (constant)
3459
+ gravity: 0.25,
3460
+ // Maximum number of iterations to perform
3461
+ numIter: 2500,
3462
+ // For enabling tiling
3463
+ tile: !0,
3464
+ // The function that specifies the criteria for comparing nodes while sorting them during tiling operation.
3465
+ // Takes the node id as a parameter and the default tiling operation is perfomed when this option is not set.
3466
+ tilingCompareBy: void 0,
3467
+ // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
3468
+ tilingPaddingVertical: 10,
3469
+ // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
3470
+ tilingPaddingHorizontal: 10,
3471
+ // Gravity range (constant) for compounds
3472
+ gravityRangeCompound: 1.5,
3473
+ // Gravity force (constant) for compounds
3474
+ gravityCompound: 1,
3475
+ // Gravity range (constant)
3476
+ gravityRange: 3.8,
3477
+ // Initial cooling factor for incremental layout
3478
+ initialEnergyOnIncremental: 0.3,
3479
+ /* constraint options */
3480
+ // Fix required nodes to predefined positions
3481
+ // [{nodeId: 'n1', position: {x: 100, y: 200}, {...}]
3482
+ fixedNodeConstraint: void 0,
3483
+ // Align required nodes in vertical/horizontal direction
3484
+ // {vertical: [['n1', 'n2')], ['n3', 'n4']], horizontal: ['n2', 'n4']}
3485
+ alignmentConstraint: void 0,
3486
+ // Place two nodes relatively in vertical/horizontal direction
3487
+ // [{top: 'n1', bottom: 'n2', gap: 100}, {left: 'n3', right: 'n4', gap: 75}]
3488
+ relativePlacementConstraint: void 0,
3489
+ /* layout event callbacks */
3490
+ ready: function() {
3491
+ },
3492
+ // on layoutready
3493
+ stop: function() {
3494
+ }
3495
+ // on layoutstop
3496
+ }), v = function() {
3497
+ function d(N) {
3498
+ i(this, d), this.options = g({}, T, N);
3499
+ }
3500
+ return f(d, [{
3501
+ key: "run",
3502
+ value: function() {
3503
+ var S = this, M = this.options, P = M.cy, K = M.eles, X = [], k = [], D = void 0, rt = [];
3504
+ M.fixedNodeConstraint && (!Array.isArray(M.fixedNodeConstraint) || M.fixedNodeConstraint.length == 0) && (M.fixedNodeConstraint = void 0), M.alignmentConstraint && (M.alignmentConstraint.vertical && (!Array.isArray(M.alignmentConstraint.vertical) || M.alignmentConstraint.vertical.length == 0) && (M.alignmentConstraint.vertical = void 0), M.alignmentConstraint.horizontal && (!Array.isArray(M.alignmentConstraint.horizontal) || M.alignmentConstraint.horizontal.length == 0) && (M.alignmentConstraint.horizontal = void 0)), M.relativePlacementConstraint && (!Array.isArray(M.relativePlacementConstraint) || M.relativePlacementConstraint.length == 0) && (M.relativePlacementConstraint = void 0);
3505
+ var n = M.fixedNodeConstraint || M.alignmentConstraint || M.relativePlacementConstraint;
3506
+ n && (M.tile = !1, M.packComponents = !1);
3507
+ var m = void 0, p = !1;
3508
+ if (P.layoutUtilities && M.packComponents && (m = P.layoutUtilities("get"), m || (m = P.layoutUtilities()), p = !0), K.nodes().length > 0)
3509
+ if (p) {
3510
+ var I = t.getTopMostNodes(M.eles.nodes());
3511
+ if (D = t.connectComponents(P, M.eles, I), D.forEach(function(vt) {
3512
+ var it = vt.boundingBox();
3513
+ rt.push({ x: it.x1 + it.w / 2, y: it.y1 + it.h / 2 });
3514
+ }), M.randomize && D.forEach(function(vt) {
3515
+ M.eles = vt, X.push(o(M));
3516
+ }), M.quality == "default" || M.quality == "proof") {
3517
+ var w = P.collection();
3518
+ if (M.tile) {
3519
+ var R = /* @__PURE__ */ new Map(), W = [], x = [], q = 0, V = { nodeIndexes: R, xCoords: W, yCoords: x }, Y = [];
3520
+ if (D.forEach(function(vt, it) {
3521
+ vt.edges().length == 0 && (vt.nodes().forEach(function(gt, Tt) {
3522
+ w.merge(vt.nodes()[Tt]), gt.isParent() || (V.nodeIndexes.set(vt.nodes()[Tt].id(), q++), V.xCoords.push(vt.nodes()[0].position().x), V.yCoords.push(vt.nodes()[0].position().y));
3523
+ }), Y.push(it));
3524
+ }), w.length > 1) {
3525
+ var et = w.boundingBox();
3526
+ rt.push({ x: et.x1 + et.w / 2, y: et.y1 + et.h / 2 }), D.push(w), X.push(V);
3527
+ for (var z = Y.length - 1; z >= 0; z--)
3528
+ D.splice(Y[z], 1), X.splice(Y[z], 1), rt.splice(Y[z], 1);
3529
+ }
3530
+ }
3531
+ D.forEach(function(vt, it) {
3532
+ M.eles = vt, k.push(h(M, X[it])), t.relocateComponent(rt[it], k[it], M);
3533
+ });
3534
+ } else
3535
+ D.forEach(function(vt, it) {
3536
+ t.relocateComponent(rt[it], X[it], M);
3537
+ });
3538
+ var O = /* @__PURE__ */ new Set();
3539
+ if (D.length > 1) {
3540
+ var H = [], B = K.filter(function(vt) {
3541
+ return vt.css("display") == "none";
3542
+ });
3543
+ D.forEach(function(vt, it) {
3544
+ var gt = void 0;
3545
+ if (M.quality == "draft" && (gt = X[it].nodeIndexes), vt.nodes().not(B).length > 0) {
3546
+ var Tt = {};
3547
+ Tt.edges = [], Tt.nodes = [];
3548
+ var At = void 0;
3549
+ vt.nodes().not(B).forEach(function(Dt) {
3550
+ if (M.quality == "draft")
3551
+ if (!Dt.isParent())
3552
+ At = gt.get(Dt.id()), Tt.nodes.push({ x: X[it].xCoords[At] - Dt.boundingbox().w / 2, y: X[it].yCoords[At] - Dt.boundingbox().h / 2, width: Dt.boundingbox().w, height: Dt.boundingbox().h });
3553
+ else {
3554
+ var mt = t.calcBoundingBox(Dt, X[it].xCoords, X[it].yCoords, gt);
3555
+ Tt.nodes.push({ x: mt.topLeftX, y: mt.topLeftY, width: mt.width, height: mt.height });
3556
+ }
3557
+ else
3558
+ k[it][Dt.id()] && Tt.nodes.push({ x: k[it][Dt.id()].getLeft(), y: k[it][Dt.id()].getTop(), width: k[it][Dt.id()].getWidth(), height: k[it][Dt.id()].getHeight() });
3559
+ }), vt.edges().forEach(function(Dt) {
3560
+ var mt = Dt.source(), xt = Dt.target();
3561
+ if (mt.css("display") != "none" && xt.css("display") != "none")
3562
+ if (M.quality == "draft") {
3563
+ var St = gt.get(mt.id()), Vt = gt.get(xt.id()), Xt = [], Ut = [];
3564
+ if (mt.isParent()) {
3565
+ var bt = t.calcBoundingBox(mt, X[it].xCoords, X[it].yCoords, gt);
3566
+ Xt.push(bt.topLeftX + bt.width / 2), Xt.push(bt.topLeftY + bt.height / 2);
3567
+ } else
3568
+ Xt.push(X[it].xCoords[St]), Xt.push(X[it].yCoords[St]);
3569
+ if (xt.isParent()) {
3570
+ var Ht = t.calcBoundingBox(xt, X[it].xCoords, X[it].yCoords, gt);
3571
+ Ut.push(Ht.topLeftX + Ht.width / 2), Ut.push(Ht.topLeftY + Ht.height / 2);
3572
+ } else
3573
+ Ut.push(X[it].xCoords[Vt]), Ut.push(X[it].yCoords[Vt]);
3574
+ Tt.edges.push({ startX: Xt[0], startY: Xt[1], endX: Ut[0], endY: Ut[1] });
3575
+ } else
3576
+ k[it][mt.id()] && k[it][xt.id()] && Tt.edges.push({ startX: k[it][mt.id()].getCenterX(), startY: k[it][mt.id()].getCenterY(), endX: k[it][xt.id()].getCenterX(), endY: k[it][xt.id()].getCenterY() });
3577
+ }), Tt.nodes.length > 0 && (H.push(Tt), O.add(it));
3578
+ }
3579
+ });
3580
+ var _ = m.packComponents(H, M.randomize).shifts;
3581
+ if (M.quality == "draft")
3582
+ X.forEach(function(vt, it) {
3583
+ var gt = vt.xCoords.map(function(At) {
3584
+ return At + _[it].dx;
3585
+ }), Tt = vt.yCoords.map(function(At) {
3586
+ return At + _[it].dy;
3587
+ });
3588
+ vt.xCoords = gt, vt.yCoords = Tt;
3589
+ });
3590
+ else {
3591
+ var lt = 0;
3592
+ O.forEach(function(vt) {
3593
+ Object.keys(k[vt]).forEach(function(it) {
3594
+ var gt = k[vt][it];
3595
+ gt.setCenter(gt.getCenterX() + _[lt].dx, gt.getCenterY() + _[lt].dy);
3596
+ }), lt++;
3597
+ });
3598
+ }
3599
+ }
3600
+ } else {
3601
+ var E = M.eles.boundingBox();
3602
+ if (rt.push({ x: E.x1 + E.w / 2, y: E.y1 + E.h / 2 }), M.randomize) {
3603
+ var y = o(M);
3604
+ X.push(y);
3605
+ }
3606
+ M.quality == "default" || M.quality == "proof" ? (k.push(h(M, X[0])), t.relocateComponent(rt[0], k[0], M)) : t.relocateComponent(rt[0], X[0], M);
3607
+ }
3608
+ var J = function(it, gt) {
3609
+ if (M.quality == "default" || M.quality == "proof") {
3610
+ typeof it == "number" && (it = gt);
3611
+ var Tt = void 0, At = void 0, Dt = it.data("id");
3612
+ return k.forEach(function(xt) {
3613
+ Dt in xt && (Tt = { x: xt[Dt].getRect().getCenterX(), y: xt[Dt].getRect().getCenterY() }, At = xt[Dt]);
3614
+ }), M.nodeDimensionsIncludeLabels && (At.labelWidth && (At.labelPosHorizontal == "left" ? Tt.x += At.labelWidth / 2 : At.labelPosHorizontal == "right" && (Tt.x -= At.labelWidth / 2)), At.labelHeight && (At.labelPosVertical == "top" ? Tt.y += At.labelHeight / 2 : At.labelPosVertical == "bottom" && (Tt.y -= At.labelHeight / 2))), Tt == null && (Tt = { x: it.position("x"), y: it.position("y") }), {
3615
+ x: Tt.x,
3616
+ y: Tt.y
3617
+ };
3618
+ } else {
3619
+ var mt = void 0;
3620
+ return X.forEach(function(xt) {
3621
+ var St = xt.nodeIndexes.get(it.id());
3622
+ St != null && (mt = { x: xt.xCoords[St], y: xt.yCoords[St] });
3623
+ }), mt == null && (mt = { x: it.position("x"), y: it.position("y") }), {
3624
+ x: mt.x,
3625
+ y: mt.y
3626
+ };
3627
+ }
3628
+ };
3629
+ if (M.quality == "default" || M.quality == "proof" || M.randomize) {
3630
+ var Rt = t.calcParentsWithoutChildren(P, K), Lt = K.filter(function(vt) {
3631
+ return vt.css("display") == "none";
3632
+ });
3633
+ M.eles = K.not(Lt), K.nodes().not(":parent").not(Lt).layoutPositions(S, M, J), Rt.length > 0 && Rt.forEach(function(vt) {
3634
+ vt.position(J(vt));
3635
+ });
3636
+ } else
3637
+ console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.");
3638
+ }
3639
+ }]), d;
3640
+ }();
3641
+ a.exports = v;
3642
+ }
3643
+ ),
3644
+ /***/
3645
+ 657: (
3646
+ /***/
3647
+ (a, r, e) => {
3648
+ var f = e(548), i = e(140).layoutBase.Matrix, g = e(140).layoutBase.SVD, t = function(o) {
3649
+ var c = o.cy, h = o.eles, T = h.nodes(), v = h.nodes(":parent"), d = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), M = [], P = [], K = [], X = [], k = [], D = [], rt = [], n = [], m = void 0, p = 1e8, E = 1e-9, y = o.piTol, I = o.samplingType, w = o.nodeSeparation, R = void 0, W = function() {
3650
+ for (var b = 0, $ = 0, Q = !1; $ < R; ) {
3651
+ b = Math.floor(Math.random() * m), Q = !1;
3652
+ for (var Z = 0; Z < $; Z++)
3653
+ if (X[Z] == b) {
3654
+ Q = !0;
3655
+ break;
3656
+ }
3657
+ if (!Q)
3658
+ X[$] = b, $++;
3659
+ else
3660
+ continue;
3661
+ }
3662
+ }, x = function(b, $, Q) {
3663
+ for (var Z = [], at = 0, ut = 0, ot = 0, tt = void 0, j = [], dt = 0, wt = 1, yt = 0; yt < m; yt++)
3664
+ j[yt] = p;
3665
+ for (Z[ut] = b, j[b] = 0; ut >= at; ) {
3666
+ ot = Z[at++];
3667
+ for (var It = M[ot], ft = 0; ft < It.length; ft++)
3668
+ tt = N.get(It[ft]), j[tt] == p && (j[tt] = j[ot] + 1, Z[++ut] = tt);
3669
+ D[ot][$] = j[ot] * w;
3670
+ }
3671
+ if (Q) {
3672
+ for (var st = 0; st < m; st++)
3673
+ D[st][$] < k[st] && (k[st] = D[st][$]);
3674
+ for (var Ct = 0; Ct < m; Ct++)
3675
+ k[Ct] > dt && (dt = k[Ct], wt = Ct);
3676
+ }
3677
+ return wt;
3678
+ }, q = function(b) {
3679
+ var $ = void 0;
3680
+ if (b) {
3681
+ $ = Math.floor(Math.random() * m);
3682
+ for (var Z = 0; Z < m; Z++)
3683
+ k[Z] = p;
3684
+ for (var at = 0; at < R; at++)
3685
+ X[at] = $, $ = x($, at, b);
3686
+ } else {
3687
+ W();
3688
+ for (var Q = 0; Q < R; Q++)
3689
+ x(X[Q], Q, b);
3690
+ }
3691
+ for (var ut = 0; ut < m; ut++)
3692
+ for (var ot = 0; ot < R; ot++)
3693
+ D[ut][ot] *= D[ut][ot];
3694
+ for (var tt = 0; tt < R; tt++)
3695
+ rt[tt] = [];
3696
+ for (var j = 0; j < R; j++)
3697
+ for (var dt = 0; dt < R; dt++)
3698
+ rt[j][dt] = D[X[dt]][j];
3699
+ }, V = function() {
3700
+ for (var b = g.svd(rt), $ = b.S, Q = b.U, Z = b.V, at = $[0] * $[0] * $[0], ut = [], ot = 0; ot < R; ot++) {
3701
+ ut[ot] = [];
3702
+ for (var tt = 0; tt < R; tt++)
3703
+ ut[ot][tt] = 0, ot == tt && (ut[ot][tt] = $[ot] / ($[ot] * $[ot] + at / ($[ot] * $[ot])));
3704
+ }
3705
+ n = i.multMat(i.multMat(Z, ut), i.transpose(Q));
3706
+ }, Y = function() {
3707
+ for (var b = void 0, $ = void 0, Q = [], Z = [], at = [], ut = [], ot = 0; ot < m; ot++)
3708
+ Q[ot] = Math.random(), Z[ot] = Math.random();
3709
+ Q = i.normalize(Q), Z = i.normalize(Z);
3710
+ for (var tt = E, j = E, dt = void 0; ; ) {
3711
+ for (var wt = 0; wt < m; wt++)
3712
+ at[wt] = Q[wt];
3713
+ if (Q = i.multGamma(i.multL(i.multGamma(at), D, n)), b = i.dotProduct(at, Q), Q = i.normalize(Q), tt = i.dotProduct(at, Q), dt = Math.abs(tt / j), dt <= 1 + y && dt >= 1)
3714
+ break;
3715
+ j = tt;
3716
+ }
3717
+ for (var yt = 0; yt < m; yt++)
3718
+ at[yt] = Q[yt];
3719
+ for (j = E; ; ) {
3720
+ for (var It = 0; It < m; It++)
3721
+ ut[It] = Z[It];
3722
+ if (ut = i.minusOp(ut, i.multCons(at, i.dotProduct(at, ut))), Z = i.multGamma(i.multL(i.multGamma(ut), D, n)), $ = i.dotProduct(ut, Z), Z = i.normalize(Z), tt = i.dotProduct(ut, Z), dt = Math.abs(tt / j), dt <= 1 + y && dt >= 1)
3723
+ break;
3724
+ j = tt;
3725
+ }
3726
+ for (var ft = 0; ft < m; ft++)
3727
+ ut[ft] = Z[ft];
3728
+ P = i.multCons(at, Math.sqrt(Math.abs(b))), K = i.multCons(ut, Math.sqrt(Math.abs($)));
3729
+ };
3730
+ f.connectComponents(c, h, f.getTopMostNodes(T), d), v.forEach(function(F) {
3731
+ f.connectComponents(c, h, f.getTopMostNodes(F.descendants().intersection(h)), d);
3732
+ });
3733
+ for (var et = 0, z = 0; z < T.length; z++)
3734
+ T[z].isParent() || N.set(T[z].id(), et++);
3735
+ var O = !0, H = !1, B = void 0;
3736
+ try {
3737
+ for (var _ = d.keys()[Symbol.iterator](), lt; !(O = (lt = _.next()).done); O = !0) {
3738
+ var J = lt.value;
3739
+ N.set(J, et++);
3740
+ }
3741
+ } catch (F) {
3742
+ H = !0, B = F;
3743
+ } finally {
3744
+ try {
3745
+ !O && _.return && _.return();
3746
+ } finally {
3747
+ if (H)
3748
+ throw B;
3749
+ }
3750
+ }
3751
+ for (var Rt = 0; Rt < N.size; Rt++)
3752
+ M[Rt] = [];
3753
+ v.forEach(function(F) {
3754
+ for (var b = F.children().intersection(h); b.nodes(":childless").length == 0; )
3755
+ b = b.nodes()[0].children().intersection(h);
3756
+ var $ = 0, Q = b.nodes(":childless")[0].connectedEdges().length;
3757
+ b.nodes(":childless").forEach(function(Z, at) {
3758
+ Z.connectedEdges().length < Q && (Q = Z.connectedEdges().length, $ = at);
3759
+ }), S.set(F.id(), b.nodes(":childless")[$].id());
3760
+ }), T.forEach(function(F) {
3761
+ var b = void 0;
3762
+ F.isParent() ? b = N.get(S.get(F.id())) : b = N.get(F.id()), F.neighborhood().nodes().forEach(function($) {
3763
+ h.intersection(F.edgesWith($)).length > 0 && ($.isParent() ? M[b].push(S.get($.id())) : M[b].push($.id()));
3764
+ });
3765
+ });
3766
+ var Lt = function(b) {
3767
+ var $ = N.get(b), Q = void 0;
3768
+ d.get(b).forEach(function(Z) {
3769
+ c.getElementById(Z).isParent() ? Q = S.get(Z) : Q = Z, M[$].push(Q), M[N.get(Q)].push(b);
3770
+ });
3771
+ }, vt = !0, it = !1, gt = void 0;
3772
+ try {
3773
+ for (var Tt = d.keys()[Symbol.iterator](), At; !(vt = (At = Tt.next()).done); vt = !0) {
3774
+ var Dt = At.value;
3775
+ Lt(Dt);
3776
+ }
3777
+ } catch (F) {
3778
+ it = !0, gt = F;
3779
+ } finally {
3780
+ try {
3781
+ !vt && Tt.return && Tt.return();
3782
+ } finally {
3783
+ if (it)
3784
+ throw gt;
3785
+ }
3786
+ }
3787
+ m = N.size;
3788
+ var mt = void 0;
3789
+ if (m > 2) {
3790
+ R = m < o.sampleSize ? m : o.sampleSize;
3791
+ for (var xt = 0; xt < m; xt++)
3792
+ D[xt] = [];
3793
+ for (var St = 0; St < R; St++)
3794
+ n[St] = [];
3795
+ return o.quality == "draft" || o.step == "all" ? (q(I), V(), Y(), mt = { nodeIndexes: N, xCoords: P, yCoords: K }) : (N.forEach(function(F, b) {
3796
+ P.push(c.getElementById(b).position("x")), K.push(c.getElementById(b).position("y"));
3797
+ }), mt = { nodeIndexes: N, xCoords: P, yCoords: K }), mt;
3798
+ } else {
3799
+ var Vt = N.keys(), Xt = c.getElementById(Vt.next().value), Ut = Xt.position(), bt = Xt.outerWidth();
3800
+ if (P.push(Ut.x), K.push(Ut.y), m == 2) {
3801
+ var Ht = c.getElementById(Vt.next().value), Bt = Ht.outerWidth();
3802
+ P.push(Ut.x + bt / 2 + Bt / 2 + o.idealEdgeLength), K.push(Ut.y);
3803
+ }
3804
+ return mt = { nodeIndexes: N, xCoords: P, yCoords: K }, mt;
3805
+ }
3806
+ };
3807
+ a.exports = { spectralLayout: t };
3808
+ }
3809
+ ),
3810
+ /***/
3811
+ 579: (
3812
+ /***/
3813
+ (a, r, e) => {
3814
+ var f = e(212), i = function(t) {
3815
+ t && t("layout", "fcose", f);
3816
+ };
3817
+ typeof cytoscape < "u" && i(cytoscape), a.exports = i;
3818
+ }
3819
+ ),
3820
+ /***/
3821
+ 140: (
3822
+ /***/
3823
+ (a) => {
3824
+ a.exports = A;
3825
+ }
3826
+ )
3827
+ /******/
3828
+ }, L = {};
3829
+ function u(a) {
3830
+ var r = L[a];
3831
+ if (r !== void 0)
3832
+ return r.exports;
3833
+ var e = L[a] = {
3834
+ /******/
3835
+ // no module.id needed
3836
+ /******/
3837
+ // no module.loaded needed
3838
+ /******/
3839
+ exports: {}
3840
+ /******/
3841
+ };
3842
+ return G[a](e, e.exports, u), e.exports;
3843
+ }
3844
+ var l = u(579);
3845
+ return l;
3846
+ })()
3847
+ );
3848
+ });
3849
+ })(Ge);
3850
+ var gr = Ge.exports;
3851
+ const dr = /* @__PURE__ */ qe(gr);
3852
+ var Re = {
3853
+ L: "left",
3854
+ R: "right",
3855
+ T: "top",
3856
+ B: "bottom"
3857
+ }, Se = {
3858
+ L: /* @__PURE__ */ nt((C) => `${C},${C / 2} 0,${C} 0,0`, "L"),
3859
+ R: /* @__PURE__ */ nt((C) => `0,${C / 2} ${C},0 ${C},${C}`, "R"),
3860
+ T: /* @__PURE__ */ nt((C) => `0,0 ${C},0 ${C / 2},${C}`, "T"),
3861
+ B: /* @__PURE__ */ nt((C) => `${C / 2},0 ${C},${C} 0,${C}`, "B")
3862
+ }, he = {
3863
+ L: /* @__PURE__ */ nt((C, U) => C - U + 2, "L"),
3864
+ R: /* @__PURE__ */ nt((C, U) => C - 2, "R"),
3865
+ T: /* @__PURE__ */ nt((C, U) => C - U + 2, "T"),
3866
+ B: /* @__PURE__ */ nt((C, U) => C - 2, "B")
3867
+ }, vr = /* @__PURE__ */ nt(function(C) {
3868
+ return zt(C) ? C === "L" ? "R" : "L" : C === "T" ? "B" : "T";
3869
+ }, "getOppositeArchitectureDirection"), Fe = /* @__PURE__ */ nt(function(C) {
3870
+ const U = C;
3871
+ return U === "L" || U === "R" || U === "T" || U === "B";
3872
+ }, "isArchitectureDirection"), zt = /* @__PURE__ */ nt(function(C) {
3873
+ const U = C;
3874
+ return U === "L" || U === "R";
3875
+ }, "isArchitectureDirectionX"), Qt = /* @__PURE__ */ nt(function(C) {
3876
+ const U = C;
3877
+ return U === "T" || U === "B";
3878
+ }, "isArchitectureDirectionY"), Ce = /* @__PURE__ */ nt(function(C, U) {
3879
+ const A = zt(C) && Qt(U), G = Qt(C) && zt(U);
3880
+ return A || G;
3881
+ }, "isArchitectureDirectionXY"), pr = /* @__PURE__ */ nt(function(C) {
3882
+ const U = C[0], A = C[1], G = zt(U) && Qt(A), L = Qt(U) && zt(A);
3883
+ return G || L;
3884
+ }, "isArchitecturePairXY"), yr = /* @__PURE__ */ nt(function(C) {
3885
+ return C !== "LL" && C !== "RR" && C !== "TT" && C !== "BB";
3886
+ }, "isValidArchitectureDirectionPair"), me = /* @__PURE__ */ nt(function(C, U) {
3887
+ const A = `${C}${U}`;
3888
+ return yr(A) ? A : void 0;
3889
+ }, "getArchitectureDirectionPair"), Er = /* @__PURE__ */ nt(function([C, U], A) {
3890
+ const G = A[0], L = A[1];
3891
+ return zt(G) ? Qt(L) ? [C + (G === "L" ? -1 : 1), U + (L === "T" ? 1 : -1)] : [C + (G === "L" ? -1 : 1), U] : zt(L) ? [C + (L === "L" ? 1 : -1), U + (G === "T" ? 1 : -1)] : [C, U + (G === "T" ? 1 : -1)];
3892
+ }, "shiftPositionByArchitectureDirectionPair"), mr = /* @__PURE__ */ nt(function(C) {
3893
+ return C === "LT" || C === "TL" ? [1, 1] : C === "BL" || C === "LB" ? [1, -1] : C === "BR" || C === "RB" ? [-1, -1] : [-1, 1];
3894
+ }, "getArchitectureDirectionXYFactors"), Tr = /* @__PURE__ */ nt(function(C, U) {
3895
+ return Ce(C, U) ? "bend" : zt(C) ? "horizontal" : "vertical";
3896
+ }, "getArchitectureDirectionAlignment"), Nr = /* @__PURE__ */ nt(function(C) {
3897
+ return C.type === "service";
3898
+ }, "isArchitectureService"), Lr = /* @__PURE__ */ nt(function(C) {
3899
+ return C.type === "junction";
3900
+ }, "isArchitectureJunction"), Ue = /* @__PURE__ */ nt((C) => C.data(), "edgeData"), ne = /* @__PURE__ */ nt((C) => C.data(), "nodeData"), Ye = Je.architecture, pt = new lr(() => ({
3901
+ nodes: {},
3902
+ groups: {},
3903
+ edges: [],
3904
+ registeredIds: {},
3905
+ config: Ye,
3906
+ dataStructures: void 0,
3907
+ elements: {}
3908
+ })), Cr = /* @__PURE__ */ nt(() => {
3909
+ pt.reset(), nr();
3910
+ }, "clear"), Mr = /* @__PURE__ */ nt(function({
3911
+ id: C,
3912
+ icon: U,
3913
+ in: A,
3914
+ title: G,
3915
+ iconText: L
3916
+ }) {
3917
+ if (pt.records.registeredIds[C] !== void 0)
3918
+ throw new Error(
3919
+ `The service id [${C}] is already in use by another ${pt.records.registeredIds[C]}`
3920
+ );
3921
+ if (A !== void 0) {
3922
+ if (C === A)
3923
+ throw new Error(`The service [${C}] cannot be placed within itself`);
3924
+ if (pt.records.registeredIds[A] === void 0)
3925
+ throw new Error(
3926
+ `The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`
3927
+ );
3928
+ if (pt.records.registeredIds[A] === "node")
3929
+ throw new Error(`The service [${C}]'s parent is not a group`);
3930
+ }
3931
+ pt.records.registeredIds[C] = "node", pt.records.nodes[C] = {
3932
+ id: C,
3933
+ type: "service",
3934
+ icon: U,
3935
+ iconText: L,
3936
+ title: G,
3937
+ edges: [],
3938
+ in: A
3939
+ };
3940
+ }, "addService"), Ar = /* @__PURE__ */ nt(() => Object.values(pt.records.nodes).filter(Nr), "getServices"), wr = /* @__PURE__ */ nt(function({ id: C, in: U }) {
3941
+ pt.records.registeredIds[C] = "node", pt.records.nodes[C] = {
3942
+ id: C,
3943
+ type: "junction",
3944
+ edges: [],
3945
+ in: U
3946
+ };
3947
+ }, "addJunction"), Or = /* @__PURE__ */ nt(() => Object.values(pt.records.nodes).filter(Lr), "getJunctions"), Dr = /* @__PURE__ */ nt(() => Object.values(pt.records.nodes), "getNodes"), Te = /* @__PURE__ */ nt((C) => pt.records.nodes[C], "getNode"), xr = /* @__PURE__ */ nt(function({ id: C, icon: U, in: A, title: G }) {
3948
+ if (pt.records.registeredIds[C] !== void 0)
3949
+ throw new Error(
3950
+ `The group id [${C}] is already in use by another ${pt.records.registeredIds[C]}`
3951
+ );
3952
+ if (A !== void 0) {
3953
+ if (C === A)
3954
+ throw new Error(`The group [${C}] cannot be placed within itself`);
3955
+ if (pt.records.registeredIds[A] === void 0)
3956
+ throw new Error(
3957
+ `The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`
3958
+ );
3959
+ if (pt.records.registeredIds[A] === "node")
3960
+ throw new Error(`The group [${C}]'s parent is not a group`);
3961
+ }
3962
+ pt.records.registeredIds[C] = "group", pt.records.groups[C] = {
3963
+ id: C,
3964
+ icon: U,
3965
+ title: G,
3966
+ in: A
3967
+ };
3968
+ }, "addGroup"), Ir = /* @__PURE__ */ nt(() => Object.values(pt.records.groups), "getGroups"), Rr = /* @__PURE__ */ nt(function({
3969
+ lhsId: C,
3970
+ rhsId: U,
3971
+ lhsDir: A,
3972
+ rhsDir: G,
3973
+ lhsInto: L,
3974
+ rhsInto: u,
3975
+ lhsGroup: l,
3976
+ rhsGroup: a,
3977
+ title: r
3978
+ }) {
3979
+ if (!Fe(A))
3980
+ throw new Error(
3981
+ `Invalid direction given for left hand side of edge ${C}--${U}. Expected (L,R,T,B) got ${A}`
3982
+ );
3983
+ if (!Fe(G))
3984
+ throw new Error(
3985
+ `Invalid direction given for right hand side of edge ${C}--${U}. Expected (L,R,T,B) got ${G}`
3986
+ );
3987
+ if (pt.records.nodes[C] === void 0 && pt.records.groups[C] === void 0)
3988
+ throw new Error(
3989
+ `The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`
3990
+ );
3991
+ if (pt.records.nodes[U] === void 0 && pt.records.groups[C] === void 0)
3992
+ throw new Error(
3993
+ `The right-hand id [${U}] does not yet exist. Please create the service/group before declaring an edge to it.`
3994
+ );
3995
+ const e = pt.records.nodes[C].in, f = pt.records.nodes[U].in;
3996
+ if (l && e && f && e == f)
3997
+ throw new Error(
3998
+ `The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
3999
+ );
4000
+ if (a && e && f && e == f)
4001
+ throw new Error(
4002
+ `The right-hand id [${U}] is modified to traverse the group boundary, but the edge does not pass through two groups.`
4003
+ );
4004
+ const i = {
4005
+ lhsId: C,
4006
+ lhsDir: A,
4007
+ lhsInto: L,
4008
+ lhsGroup: l,
4009
+ rhsId: U,
4010
+ rhsDir: G,
4011
+ rhsInto: u,
4012
+ rhsGroup: a,
4013
+ title: r
4014
+ };
4015
+ pt.records.edges.push(i), pt.records.nodes[C] && pt.records.nodes[U] && (pt.records.nodes[C].edges.push(pt.records.edges[pt.records.edges.length - 1]), pt.records.nodes[U].edges.push(pt.records.edges[pt.records.edges.length - 1]));
4016
+ }, "addEdge"), Sr = /* @__PURE__ */ nt(() => pt.records.edges, "getEdges"), Fr = /* @__PURE__ */ nt(() => {
4017
+ if (pt.records.dataStructures === void 0) {
4018
+ const C = {}, U = Object.entries(pt.records.nodes).reduce((a, [r, e]) => (a[r] = e.edges.reduce((f, i) => {
4019
+ var s, o;
4020
+ const g = (s = Te(i.lhsId)) == null ? void 0 : s.in, t = (o = Te(i.rhsId)) == null ? void 0 : o.in;
4021
+ if (g && t && g !== t) {
4022
+ const c = Tr(i.lhsDir, i.rhsDir);
4023
+ c !== "bend" && (C[g] ?? (C[g] = {}), C[g][t] = c, C[t] ?? (C[t] = {}), C[t][g] = c);
4024
+ }
4025
+ if (i.lhsId === r) {
4026
+ const c = me(i.lhsDir, i.rhsDir);
4027
+ c && (f[c] = i.rhsId);
4028
+ } else {
4029
+ const c = me(i.rhsDir, i.lhsDir);
4030
+ c && (f[c] = i.lhsId);
4031
+ }
4032
+ return f;
4033
+ }, {}), a), {}), A = Object.keys(U)[0], G = { [A]: 1 }, L = Object.keys(U).reduce(
4034
+ (a, r) => r === A ? a : { ...a, [r]: 1 },
4035
+ {}
4036
+ ), u = /* @__PURE__ */ nt((a) => {
4037
+ const r = { [a]: [0, 0] }, e = [a];
4038
+ for (; e.length > 0; ) {
4039
+ const f = e.shift();
4040
+ if (f) {
4041
+ G[f] = 1, delete L[f];
4042
+ const i = U[f], [g, t] = r[f];
4043
+ Object.entries(i).forEach(([s, o]) => {
4044
+ G[o] || (r[o] = Er(
4045
+ [g, t],
4046
+ s
4047
+ ), e.push(o));
4048
+ });
4049
+ }
4050
+ }
4051
+ return r;
4052
+ }, "BFS"), l = [u(A)];
4053
+ for (; Object.keys(L).length > 0; )
4054
+ l.push(u(Object.keys(L)[0]));
4055
+ pt.records.dataStructures = {
4056
+ adjList: U,
4057
+ spatialMaps: l,
4058
+ groupAlignments: C
4059
+ };
4060
+ }
4061
+ return pt.records.dataStructures;
4062
+ }, "getDataStructures"), br = /* @__PURE__ */ nt((C, U) => {
4063
+ pt.records.elements[C] = U;
4064
+ }, "setElementForId"), Pr = /* @__PURE__ */ nt((C) => pt.records.elements[C], "getElementById"), le = {
4065
+ clear: Cr,
4066
+ setDiagramTitle: je,
4067
+ getDiagramTitle: _e,
4068
+ setAccTitle: tr,
4069
+ getAccTitle: er,
4070
+ setAccDescription: rr,
4071
+ getAccDescription: ir,
4072
+ addService: Mr,
4073
+ getServices: Ar,
4074
+ addJunction: wr,
4075
+ getJunctions: Or,
4076
+ getNodes: Dr,
4077
+ getNode: Te,
4078
+ addGroup: xr,
4079
+ getGroups: Ir,
4080
+ addEdge: Rr,
4081
+ getEdges: Sr,
4082
+ setElementForId: br,
4083
+ getElementById: Pr,
4084
+ getDataStructures: Fr
4085
+ };
4086
+ function Pt(C) {
4087
+ const U = fe().architecture;
4088
+ return U != null && U[C] ? U[C] : Ye[C];
4089
+ }
4090
+ nt(Pt, "getConfigField");
4091
+ var Gr = /* @__PURE__ */ nt((C, U) => {
4092
+ hr(C, U), C.groups.map(U.addGroup), C.services.map((A) => U.addService({ ...A, type: "service" })), C.junctions.map((A) => U.addJunction({ ...A, type: "junction" })), C.edges.map(U.addEdge);
4093
+ }, "populateDb"), Ur = {
4094
+ parse: /* @__PURE__ */ nt(async (C) => {
4095
+ const U = await fr("architecture", C);
4096
+ be.debug(U), Gr(U, le);
4097
+ }, "parse")
4098
+ }, Yr = /* @__PURE__ */ nt((C) => `
4099
+ .edge {
4100
+ stroke-width: ${C.archEdgeWidth};
4101
+ stroke: ${C.archEdgeColor};
4102
+ fill: none;
4103
+ }
4104
+
4105
+ .arrow {
4106
+ fill: ${C.archEdgeArrowColor};
4107
+ }
4108
+
4109
+ .node-bkg {
4110
+ fill: none;
4111
+ stroke: ${C.archGroupBorderColor};
4112
+ stroke-width: ${C.archGroupBorderWidth};
4113
+ stroke-dasharray: 8;
4114
+ }
4115
+ .node-icon-text {
4116
+ display: flex;
4117
+ align-items: center;
4118
+ }
4119
+
4120
+ .node-icon-text > div {
4121
+ color: #fff;
4122
+ margin: 1px;
4123
+ height: fit-content;
4124
+ text-align: center;
4125
+ overflow: hidden;
4126
+ display: -webkit-box;
4127
+ -webkit-box-orient: vertical;
4128
+ }
4129
+ `, "getStyles"), Xr = Yr, ae = /* @__PURE__ */ nt((C) => `<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${C}</g>`, "wrapIcon"), oe = {
4130
+ prefix: "mermaid-architecture",
4131
+ height: 80,
4132
+ width: 80,
4133
+ icons: {
4134
+ database: {
4135
+ body: ae(
4136
+ '<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4137
+ )
4138
+ },
4139
+ server: {
4140
+ body: ae(
4141
+ '<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>'
4142
+ )
4143
+ },
4144
+ disk: {
4145
+ body: ae(
4146
+ '<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>'
4147
+ )
4148
+ },
4149
+ internet: {
4150
+ body: ae(
4151
+ '<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4152
+ )
4153
+ },
4154
+ cloud: {
4155
+ body: ae(
4156
+ '<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>'
4157
+ )
4158
+ },
4159
+ unknown: Qe,
4160
+ blank: {
4161
+ body: ae("")
4162
+ }
4163
+ }
4164
+ }, Hr = /* @__PURE__ */ nt(async function(C, U) {
4165
+ const A = Pt("padding"), G = Pt("iconSize"), L = G / 2, u = G / 6, l = u / 2;
4166
+ await Promise.all(
4167
+ U.edges().map(async (a) => {
4168
+ var P, K;
4169
+ const {
4170
+ source: r,
4171
+ sourceDir: e,
4172
+ sourceArrow: f,
4173
+ sourceGroup: i,
4174
+ target: g,
4175
+ targetDir: t,
4176
+ targetArrow: s,
4177
+ targetGroup: o,
4178
+ label: c
4179
+ } = Ue(a);
4180
+ let { x: h, y: T } = a[0].sourceEndpoint();
4181
+ const { x: v, y: d } = a[0].midpoint();
4182
+ let { x: N, y: S } = a[0].targetEndpoint();
4183
+ const M = A + 4;
4184
+ if (i && (zt(e) ? h += e === "L" ? -M : M : T += e === "T" ? -M : M + 18), o && (zt(t) ? N += t === "L" ? -M : M : S += t === "T" ? -M : M + 18), !i && ((P = le.getNode(r)) == null ? void 0 : P.type) === "junction" && (zt(e) ? h += e === "L" ? L : -L : T += e === "T" ? L : -L), !o && ((K = le.getNode(g)) == null ? void 0 : K.type) === "junction" && (zt(t) ? N += t === "L" ? L : -L : S += t === "T" ? L : -L), a[0]._private.rscratch) {
4185
+ const X = C.insert("g");
4186
+ if (X.insert("path").attr("d", `M ${h},${T} L ${v},${d} L${N},${S} `).attr("class", "edge"), f) {
4187
+ const k = zt(e) ? he[e](h, u) : h - l, D = Qt(e) ? he[e](T, u) : T - l;
4188
+ X.insert("polygon").attr("points", Se[e](u)).attr("transform", `translate(${k},${D})`).attr("class", "arrow");
4189
+ }
4190
+ if (s) {
4191
+ const k = zt(t) ? he[t](N, u) : N - l, D = Qt(t) ? he[t](S, u) : S - l;
4192
+ X.insert("polygon").attr("points", Se[t](u)).attr("transform", `translate(${k},${D})`).attr("class", "arrow");
4193
+ }
4194
+ if (c) {
4195
+ const k = Ce(e, t) ? "XY" : zt(e) ? "X" : "Y";
4196
+ let D = 0;
4197
+ k === "X" ? D = Math.abs(h - N) : k === "Y" ? D = Math.abs(T - S) / 1.5 : D = Math.abs(h - N) / 2;
4198
+ const rt = X.append("g");
4199
+ if (await Le(
4200
+ rt,
4201
+ c,
4202
+ {
4203
+ useHtmlLabels: !1,
4204
+ width: D,
4205
+ classes: "architecture-service-label"
4206
+ },
4207
+ fe()
4208
+ ), rt.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), k === "X")
4209
+ rt.attr("transform", "translate(" + v + ", " + d + ")");
4210
+ else if (k === "Y")
4211
+ rt.attr("transform", "translate(" + v + ", " + d + ") rotate(-90)");
4212
+ else if (k === "XY") {
4213
+ const n = me(e, t);
4214
+ if (n && pr(n)) {
4215
+ const m = rt.node().getBoundingClientRect(), [p, E] = mr(n);
4216
+ rt.attr("dominant-baseline", "auto").attr("transform", `rotate(${-1 * p * E * 45})`);
4217
+ const y = rt.node().getBoundingClientRect();
4218
+ rt.attr(
4219
+ "transform",
4220
+ `
4221
+ translate(${v}, ${d - m.height / 2})
4222
+ translate(${p * y.width / 2}, ${E * y.height / 2})
4223
+ rotate(${-1 * p * E * 45}, 0, ${m.height / 2})
4224
+ `
4225
+ );
4226
+ }
4227
+ }
4228
+ }
4229
+ }
4230
+ })
4231
+ );
4232
+ }, "drawEdges"), Wr = /* @__PURE__ */ nt(async function(C, U) {
4233
+ const G = Pt("padding") * 0.75, L = Pt("fontSize"), l = Pt("iconSize") / 2;
4234
+ await Promise.all(
4235
+ U.nodes().map(async (a) => {
4236
+ const r = ne(a);
4237
+ if (r.type === "group") {
4238
+ const { h: e, w: f, x1: i, y1: g } = a.boundingBox();
4239
+ C.append("rect").attr("x", i + l).attr("y", g + l).attr("width", f).attr("height", e).attr("class", "node-bkg");
4240
+ const t = C.append("g");
4241
+ let s = i, o = g;
4242
+ if (r.icon) {
4243
+ const c = t.append("g");
4244
+ c.html(
4245
+ `<g>${await Ee(r.icon, { height: G, width: G, fallbackPrefix: oe.prefix })}</g>`
4246
+ ), c.attr(
4247
+ "transform",
4248
+ "translate(" + (s + l + 1) + ", " + (o + l + 1) + ")"
4249
+ ), s += G, o += L / 2 - 1 - 2;
4250
+ }
4251
+ if (r.label) {
4252
+ const c = t.append("g");
4253
+ await Le(
4254
+ c,
4255
+ r.label,
4256
+ {
4257
+ useHtmlLabels: !1,
4258
+ width: f,
4259
+ classes: "architecture-service-label"
4260
+ },
4261
+ fe()
4262
+ ), c.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "start").attr("text-anchor", "start"), c.attr(
4263
+ "transform",
4264
+ "translate(" + (s + l + 4) + ", " + (o + l + 2) + ")"
4265
+ );
4266
+ }
4267
+ }
4268
+ })
4269
+ );
4270
+ }, "drawGroups"), Vr = /* @__PURE__ */ nt(async function(C, U, A) {
4271
+ for (const G of A) {
4272
+ const L = U.append("g"), u = Pt("iconSize");
4273
+ if (G.title) {
4274
+ const e = L.append("g");
4275
+ await Le(
4276
+ e,
4277
+ G.title,
4278
+ {
4279
+ useHtmlLabels: !1,
4280
+ width: u * 1.5,
4281
+ classes: "architecture-service-label"
4282
+ },
4283
+ fe()
4284
+ ), e.attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle"), e.attr("transform", "translate(" + u / 2 + ", " + u + ")");
4285
+ }
4286
+ const l = L.append("g");
4287
+ if (G.icon)
4288
+ l.html(
4289
+ `<g>${await Ee(G.icon, { height: u, width: u, fallbackPrefix: oe.prefix })}</g>`
4290
+ );
4291
+ else if (G.iconText) {
4292
+ l.html(
4293
+ `<g>${await Ee("blank", { height: u, width: u, fallbackPrefix: oe.prefix })}</g>`
4294
+ );
4295
+ const i = l.append("g").append("foreignObject").attr("width", u).attr("height", u).append("div").attr("class", "node-icon-text").attr("style", `height: ${u}px;`).append("div").html(G.iconText), g = parseInt(
4296
+ window.getComputedStyle(i.node(), null).getPropertyValue("font-size").replace(/\D/g, "")
4297
+ ) ?? 16;
4298
+ i.attr("style", `-webkit-line-clamp: ${Math.floor((u - 2) / g)};`);
4299
+ } else
4300
+ l.append("path").attr("class", "node-bkg").attr("id", "node-" + G.id).attr(
4301
+ "d",
4302
+ `M0 ${u} v${-u} q0,-5 5,-5 h${u} q5,0 5,5 v${u} H0 Z`
4303
+ );
4304
+ L.attr("class", "architecture-service");
4305
+ const { width: a, height: r } = L._groups[0][0].getBBox();
4306
+ G.width = a, G.height = r, C.setElementForId(G.id, L);
4307
+ }
4308
+ return 0;
4309
+ }, "drawServices"), zr = /* @__PURE__ */ nt(function(C, U, A) {
4310
+ A.forEach((G) => {
4311
+ const L = U.append("g"), u = Pt("iconSize");
4312
+ L.append("g").append("rect").attr("id", "node-" + G.id).attr("fill-opacity", "0").attr("width", u).attr("height", u), L.attr("class", "architecture-junction");
4313
+ const { width: a, height: r } = L._groups[0][0].getBBox();
4314
+ L.width = a, L.height = r, C.setElementForId(G.id, L);
4315
+ });
4316
+ }, "drawJunctions");
4317
+ Ke([
4318
+ {
4319
+ name: oe.prefix,
4320
+ icons: oe
4321
+ }
4322
+ ]);
4323
+ Pe.use(dr);
4324
+ function Xe(C, U) {
4325
+ C.forEach((A) => {
4326
+ U.add({
4327
+ group: "nodes",
4328
+ data: {
4329
+ type: "service",
4330
+ id: A.id,
4331
+ icon: A.icon,
4332
+ label: A.title,
4333
+ parent: A.in,
4334
+ width: Pt("iconSize"),
4335
+ height: Pt("iconSize")
4336
+ },
4337
+ classes: "node-service"
4338
+ });
4339
+ });
4340
+ }
4341
+ nt(Xe, "addServices");
4342
+ function He(C, U) {
4343
+ C.forEach((A) => {
4344
+ U.add({
4345
+ group: "nodes",
4346
+ data: {
4347
+ type: "junction",
4348
+ id: A.id,
4349
+ parent: A.in,
4350
+ width: Pt("iconSize"),
4351
+ height: Pt("iconSize")
4352
+ },
4353
+ classes: "node-junction"
4354
+ });
4355
+ });
4356
+ }
4357
+ nt(He, "addJunctions");
4358
+ function We(C, U) {
4359
+ U.nodes().map((A) => {
4360
+ const G = ne(A);
4361
+ if (G.type === "group")
4362
+ return;
4363
+ G.x = A.position().x, G.y = A.position().y, C.getElementById(G.id).attr("transform", "translate(" + (G.x || 0) + "," + (G.y || 0) + ")");
4364
+ });
4365
+ }
4366
+ nt(We, "positionNodes");
4367
+ function Ve(C, U) {
4368
+ C.forEach((A) => {
4369
+ U.add({
4370
+ group: "nodes",
4371
+ data: {
4372
+ type: "group",
4373
+ id: A.id,
4374
+ icon: A.icon,
4375
+ label: A.title,
4376
+ parent: A.in
4377
+ },
4378
+ classes: "node-group"
4379
+ });
4380
+ });
4381
+ }
4382
+ nt(Ve, "addGroups");
4383
+ function ze(C, U) {
4384
+ C.forEach((A) => {
4385
+ const { lhsId: G, rhsId: L, lhsInto: u, lhsGroup: l, rhsInto: a, lhsDir: r, rhsDir: e, rhsGroup: f, title: i } = A, g = Ce(A.lhsDir, A.rhsDir) ? "segments" : "straight", t = {
4386
+ id: `${G}-${L}`,
4387
+ label: i,
4388
+ source: G,
4389
+ sourceDir: r,
4390
+ sourceArrow: u,
4391
+ sourceGroup: l,
4392
+ sourceEndpoint: r === "L" ? "0 50%" : r === "R" ? "100% 50%" : r === "T" ? "50% 0" : "50% 100%",
4393
+ target: L,
4394
+ targetDir: e,
4395
+ targetArrow: a,
4396
+ targetGroup: f,
4397
+ targetEndpoint: e === "L" ? "0 50%" : e === "R" ? "100% 50%" : e === "T" ? "50% 0" : "50% 100%"
4398
+ };
4399
+ U.add({
4400
+ group: "edges",
4401
+ data: t,
4402
+ classes: g
4403
+ });
4404
+ });
4405
+ }
4406
+ nt(ze, "addEdges");
4407
+ function Be(C, U, A) {
4408
+ const G = /* @__PURE__ */ nt((a, r) => Object.entries(a).reduce(
4409
+ (e, [f, i]) => {
4410
+ var s;
4411
+ let g = 0;
4412
+ const t = Object.entries(i);
4413
+ if (t.length === 1)
4414
+ return e[f] = t[0][1], e;
4415
+ for (let o = 0; o < t.length - 1; o++)
4416
+ for (let c = o + 1; c < t.length; c++) {
4417
+ const [h, T] = t[o], [v, d] = t[c];
4418
+ if (((s = A[h]) == null ? void 0 : s[v]) === r)
4419
+ e[f] ?? (e[f] = []), e[f] = [...e[f], ...T, ...d];
4420
+ else if (h === "default" || v === "default")
4421
+ e[f] ?? (e[f] = []), e[f] = [...e[f], ...T, ...d];
4422
+ else {
4423
+ const S = `${f}-${g++}`;
4424
+ e[S] = T;
4425
+ const M = `${f}-${g++}`;
4426
+ e[M] = d;
4427
+ }
4428
+ }
4429
+ return e;
4430
+ },
4431
+ {}
4432
+ ), "flattenAlignments"), L = U.map((a) => {
4433
+ const r = {}, e = {};
4434
+ return Object.entries(a).forEach(([f, [i, g]]) => {
4435
+ var s, o, c;
4436
+ const t = ((s = C.getNode(f)) == null ? void 0 : s.in) ?? "default";
4437
+ r[g] ?? (r[g] = {}), (o = r[g])[t] ?? (o[t] = []), r[g][t].push(f), e[i] ?? (e[i] = {}), (c = e[i])[t] ?? (c[t] = []), e[i][t].push(f);
4438
+ }), {
4439
+ horiz: Object.values(G(r, "horizontal")).filter(
4440
+ (f) => f.length > 1
4441
+ ),
4442
+ vert: Object.values(G(e, "vertical")).filter(
4443
+ (f) => f.length > 1
4444
+ )
4445
+ };
4446
+ }), [u, l] = L.reduce(
4447
+ ([a, r], { horiz: e, vert: f }) => [
4448
+ [...a, ...e],
4449
+ [...r, ...f]
4450
+ ],
4451
+ [[], []]
4452
+ );
4453
+ return {
4454
+ horizontal: u,
4455
+ vertical: l
4456
+ };
4457
+ }
4458
+ nt(Be, "getAlignments");
4459
+ function $e(C) {
4460
+ const U = [], A = /* @__PURE__ */ nt((L) => `${L[0]},${L[1]}`, "posToStr"), G = /* @__PURE__ */ nt((L) => L.split(",").map((u) => parseInt(u)), "strToPos");
4461
+ return C.forEach((L) => {
4462
+ const u = Object.fromEntries(
4463
+ Object.entries(L).map(([e, f]) => [A(f), e])
4464
+ ), l = [A([0, 0])], a = {}, r = {
4465
+ L: [-1, 0],
4466
+ R: [1, 0],
4467
+ T: [0, 1],
4468
+ B: [0, -1]
4469
+ };
4470
+ for (; l.length > 0; ) {
4471
+ const e = l.shift();
4472
+ if (e) {
4473
+ a[e] = 1;
4474
+ const f = u[e];
4475
+ if (f) {
4476
+ const i = G(e);
4477
+ Object.entries(r).forEach(([g, t]) => {
4478
+ const s = A([i[0] + t[0], i[1] + t[1]]), o = u[s];
4479
+ o && !a[s] && (l.push(s), U.push({
4480
+ [Re[g]]: o,
4481
+ [Re[vr(g)]]: f,
4482
+ gap: 1.5 * Pt("iconSize")
4483
+ }));
4484
+ });
4485
+ }
4486
+ }
4487
+ }
4488
+ }), U;
4489
+ }
4490
+ nt($e, "getRelativeConstraints");
4491
+ function Ze(C, U, A, G, L, { spatialMaps: u, groupAlignments: l }) {
4492
+ return new Promise((a) => {
4493
+ const r = ar("body").append("div").attr("id", "cy").attr("style", "display:none"), e = Pe({
4494
+ container: document.getElementById("cy"),
4495
+ style: [
4496
+ {
4497
+ selector: "edge",
4498
+ style: {
4499
+ "curve-style": "straight",
4500
+ label: "data(label)",
4501
+ "source-endpoint": "data(sourceEndpoint)",
4502
+ "target-endpoint": "data(targetEndpoint)"
4503
+ }
4504
+ },
4505
+ {
4506
+ selector: "edge.segments",
4507
+ style: {
4508
+ "curve-style": "segments",
4509
+ "segment-weights": "0",
4510
+ "segment-distances": [0.5],
4511
+ // @ts-ignore Incorrect library types
4512
+ "edge-distances": "endpoints",
4513
+ "source-endpoint": "data(sourceEndpoint)",
4514
+ "target-endpoint": "data(targetEndpoint)"
4515
+ }
4516
+ },
4517
+ {
4518
+ selector: "node",
4519
+ style: {
4520
+ // @ts-ignore Incorrect library types
4521
+ "compound-sizing-wrt-labels": "include"
4522
+ }
4523
+ },
4524
+ {
4525
+ selector: "node[label]",
4526
+ style: {
4527
+ "text-valign": "bottom",
4528
+ "text-halign": "center",
4529
+ "font-size": `${Pt("fontSize")}px`
4530
+ }
4531
+ },
4532
+ {
4533
+ selector: ".node-service",
4534
+ style: {
4535
+ label: "data(label)",
4536
+ width: "data(width)",
4537
+ height: "data(height)"
4538
+ }
4539
+ },
4540
+ {
4541
+ selector: ".node-junction",
4542
+ style: {
4543
+ width: "data(width)",
4544
+ height: "data(height)"
4545
+ }
4546
+ },
4547
+ {
4548
+ selector: ".node-group",
4549
+ style: {
4550
+ // @ts-ignore Incorrect library types
4551
+ padding: `${Pt("padding")}px`
4552
+ }
4553
+ }
4554
+ ]
4555
+ });
4556
+ r.remove(), Ve(A, e), Xe(C, e), He(U, e), ze(G, e);
4557
+ const f = Be(L, u, l), i = $e(u), g = e.layout({
4558
+ name: "fcose",
4559
+ quality: "proof",
4560
+ styleEnabled: !1,
4561
+ animate: !1,
4562
+ nodeDimensionsIncludeLabels: !1,
4563
+ // Adjust the edge parameters if it passes through the border of a group
4564
+ // Hacky fix for: https://github.com/iVis-at-Bilkent/cytoscape.js-fcose/issues/67
4565
+ idealEdgeLength(t) {
4566
+ const [s, o] = t.connectedNodes(), { parent: c } = ne(s), { parent: h } = ne(o);
4567
+ return c === h ? 1.5 * Pt("iconSize") : 0.5 * Pt("iconSize");
4568
+ },
4569
+ edgeElasticity(t) {
4570
+ const [s, o] = t.connectedNodes(), { parent: c } = ne(s), { parent: h } = ne(o);
4571
+ return c === h ? 0.45 : 1e-3;
4572
+ },
4573
+ alignmentConstraint: f,
4574
+ relativePlacementConstraint: i
4575
+ });
4576
+ g.one("layoutstop", () => {
4577
+ var s;
4578
+ function t(o, c, h, T) {
4579
+ let v, d;
4580
+ const { x: N, y: S } = o, { x: M, y: P } = c;
4581
+ d = (T - S + (N - h) * (S - P) / (N - M)) / Math.sqrt(1 + Math.pow((S - P) / (N - M), 2)), v = Math.sqrt(Math.pow(T - S, 2) + Math.pow(h - N, 2) - Math.pow(d, 2));
4582
+ const K = Math.sqrt(Math.pow(M - N, 2) + Math.pow(P - S, 2));
4583
+ v = v / K;
4584
+ let X = (M - N) * (T - S) - (P - S) * (h - N);
4585
+ switch (!0) {
4586
+ case X >= 0:
4587
+ X = 1;
4588
+ break;
4589
+ case X < 0:
4590
+ X = -1;
4591
+ break;
4592
+ }
4593
+ let k = (M - N) * (h - N) + (P - S) * (T - S);
4594
+ switch (!0) {
4595
+ case k >= 0:
4596
+ k = 1;
4597
+ break;
4598
+ case k < 0:
4599
+ k = -1;
4600
+ break;
4601
+ }
4602
+ return d = Math.abs(d) * X, v = v * k, {
4603
+ distances: d,
4604
+ weights: v
4605
+ };
4606
+ }
4607
+ nt(t, "getSegmentWeights"), e.startBatch();
4608
+ for (const o of Object.values(e.edges()))
4609
+ if ((s = o.data) != null && s.call(o)) {
4610
+ const { x: c, y: h } = o.source().position(), { x: T, y: v } = o.target().position();
4611
+ if (c !== T && h !== v) {
4612
+ const d = o.sourceEndpoint(), N = o.targetEndpoint(), { sourceDir: S } = Ue(o), [M, P] = Qt(S) ? [d.x, N.y] : [N.x, d.y], { weights: K, distances: X } = t(d, N, M, P);
4613
+ o.style("segment-distances", X), o.style("segment-weights", K);
4614
+ }
4615
+ }
4616
+ e.endBatch(), g.run();
4617
+ }), g.run(), e.ready((t) => {
4618
+ be.info("Ready", t), a(e);
4619
+ });
4620
+ });
4621
+ }
4622
+ nt(Ze, "layoutArchitecture");
4623
+ var Br = /* @__PURE__ */ nt(async (C, U, A, G) => {
4624
+ const L = G.db, u = L.getServices(), l = L.getJunctions(), a = L.getGroups(), r = L.getEdges(), e = L.getDataStructures(), f = or(U), i = f.append("g");
4625
+ i.attr("class", "architecture-edges");
4626
+ const g = f.append("g");
4627
+ g.attr("class", "architecture-services");
4628
+ const t = f.append("g");
4629
+ t.attr("class", "architecture-groups"), await Vr(L, g, u), zr(L, g, l);
4630
+ const s = await Ze(u, l, a, r, L, e);
4631
+ await Hr(i, s), await Wr(t, s), We(L, s), sr(void 0, f, Pt("padding"), Pt("useMaxWidth"));
4632
+ }, "draw"), $r = { draw: Br }, ei = {
4633
+ parser: Ur,
4634
+ db: le,
4635
+ renderer: $r,
4636
+ styles: Xr
4637
+ };
4638
+ export {
4639
+ ei as diagram
4640
+ };