@data_wise/hyper-markdown 1.0.0

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