@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,2605 @@
1
+ import { aI as $, aJ as lt, _ as V, l as k, d as gt } from "./index-D8q1QLkY.js";
2
+ import { c as z } from "./cytoscape.esm-ZmItrg9y.js";
3
+ var tt = { exports: {} }, Z = { exports: {} }, Q = { exports: {} }, J;
4
+ function ut() {
5
+ return J || (J = 1, function(G, b) {
6
+ (function(I, T) {
7
+ G.exports = T();
8
+ })($, function() {
9
+ return (
10
+ /******/
11
+ function(N) {
12
+ var I = {};
13
+ function T(o) {
14
+ if (I[o])
15
+ return I[o].exports;
16
+ var e = I[o] = {
17
+ /******/
18
+ i: o,
19
+ /******/
20
+ l: !1,
21
+ /******/
22
+ exports: {}
23
+ /******/
24
+ };
25
+ return N[o].call(e.exports, e, e.exports, T), e.l = !0, e.exports;
26
+ }
27
+ return T.m = N, T.c = I, T.i = function(o) {
28
+ return o;
29
+ }, T.d = function(o, e, t) {
30
+ T.o(o, e) || Object.defineProperty(o, e, {
31
+ /******/
32
+ configurable: !1,
33
+ /******/
34
+ enumerable: !0,
35
+ /******/
36
+ get: t
37
+ /******/
38
+ });
39
+ }, T.n = function(o) {
40
+ var e = o && o.__esModule ? (
41
+ /******/
42
+ function() {
43
+ return o.default;
44
+ }
45
+ ) : (
46
+ /******/
47
+ function() {
48
+ return o;
49
+ }
50
+ );
51
+ return T.d(e, "a", e), e;
52
+ }, T.o = function(o, e) {
53
+ return Object.prototype.hasOwnProperty.call(o, e);
54
+ }, T.p = "", T(T.s = 26);
55
+ }([
56
+ /* 0 */
57
+ /***/
58
+ function(N, I, T) {
59
+ function o() {
60
+ }
61
+ o.QUALITY = 1, o.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, o.DEFAULT_INCREMENTAL = !1, o.DEFAULT_ANIMATION_ON_LAYOUT = !0, o.DEFAULT_ANIMATION_DURING_LAYOUT = !1, o.DEFAULT_ANIMATION_PERIOD = 50, o.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, o.DEFAULT_GRAPH_MARGIN = 15, o.NODE_DIMENSIONS_INCLUDE_LABELS = !1, o.SIMPLE_NODE_SIZE = 40, o.SIMPLE_NODE_HALF_SIZE = o.SIMPLE_NODE_SIZE / 2, o.EMPTY_COMPOUND_NODE_SIZE = 40, o.MIN_EDGE_LENGTH = 1, o.WORLD_BOUNDARY = 1e6, o.INITIAL_WORLD_BOUNDARY = o.WORLD_BOUNDARY / 1e3, o.WORLD_CENTER_X = 1200, o.WORLD_CENTER_Y = 900, N.exports = o;
62
+ },
63
+ /* 1 */
64
+ /***/
65
+ function(N, I, T) {
66
+ var o = T(2), e = T(8), t = T(9);
67
+ function i(g, n, d) {
68
+ o.call(this, d), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = d, this.bendpoints = [], this.source = g, this.target = n;
69
+ }
70
+ i.prototype = Object.create(o.prototype);
71
+ for (var l in o)
72
+ i[l] = o[l];
73
+ i.prototype.getSource = function() {
74
+ return this.source;
75
+ }, i.prototype.getTarget = function() {
76
+ return this.target;
77
+ }, i.prototype.isInterGraph = function() {
78
+ return this.isInterGraph;
79
+ }, i.prototype.getLength = function() {
80
+ return this.length;
81
+ }, i.prototype.isOverlapingSourceAndTarget = function() {
82
+ return this.isOverlapingSourceAndTarget;
83
+ }, i.prototype.getBendpoints = function() {
84
+ return this.bendpoints;
85
+ }, i.prototype.getLca = function() {
86
+ return this.lca;
87
+ }, i.prototype.getSourceInLca = function() {
88
+ return this.sourceInLca;
89
+ }, i.prototype.getTargetInLca = function() {
90
+ return this.targetInLca;
91
+ }, i.prototype.getOtherEnd = function(g) {
92
+ if (this.source === g)
93
+ return this.target;
94
+ if (this.target === g)
95
+ return this.source;
96
+ throw "Node is not incident with this edge";
97
+ }, i.prototype.getOtherEndInGraph = function(g, n) {
98
+ for (var d = this.getOtherEnd(g), r = n.getGraphManager().getRoot(); ; ) {
99
+ if (d.getOwner() == n)
100
+ return d;
101
+ if (d.getOwner() == r)
102
+ break;
103
+ d = d.getOwner().getParent();
104
+ }
105
+ return null;
106
+ }, i.prototype.updateLength = function() {
107
+ var g = new Array(4);
108
+ this.isOverlapingSourceAndTarget = e.getIntersection(this.target.getRect(), this.source.getRect(), g), this.isOverlapingSourceAndTarget || (this.lengthX = g[0] - g[2], this.lengthY = g[1] - g[3], Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
109
+ }, i.prototype.updateLengthSimple = function() {
110
+ this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
111
+ }, N.exports = i;
112
+ },
113
+ /* 2 */
114
+ /***/
115
+ function(N, I, T) {
116
+ function o(e) {
117
+ this.vGraphObject = e;
118
+ }
119
+ N.exports = o;
120
+ },
121
+ /* 3 */
122
+ /***/
123
+ function(N, I, T) {
124
+ var o = T(2), e = T(10), t = T(13), i = T(0), l = T(16), g = T(4);
125
+ function n(r, h, a, p) {
126
+ a == null && p == null && (p = h), o.call(this, p), r.graphManager != null && (r = r.graphManager), this.estimatedSize = e.MIN_VALUE, this.inclusionTreeDepth = e.MAX_VALUE, this.vGraphObject = p, this.edges = [], this.graphManager = r, a != null && h != null ? this.rect = new t(h.x, h.y, a.width, a.height) : this.rect = new t();
127
+ }
128
+ n.prototype = Object.create(o.prototype);
129
+ for (var d in o)
130
+ n[d] = o[d];
131
+ n.prototype.getEdges = function() {
132
+ return this.edges;
133
+ }, n.prototype.getChild = function() {
134
+ return this.child;
135
+ }, n.prototype.getOwner = function() {
136
+ return this.owner;
137
+ }, n.prototype.getWidth = function() {
138
+ return this.rect.width;
139
+ }, n.prototype.setWidth = function(r) {
140
+ this.rect.width = r;
141
+ }, n.prototype.getHeight = function() {
142
+ return this.rect.height;
143
+ }, n.prototype.setHeight = function(r) {
144
+ this.rect.height = r;
145
+ }, n.prototype.getCenterX = function() {
146
+ return this.rect.x + this.rect.width / 2;
147
+ }, n.prototype.getCenterY = function() {
148
+ return this.rect.y + this.rect.height / 2;
149
+ }, n.prototype.getCenter = function() {
150
+ return new g(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
151
+ }, n.prototype.getLocation = function() {
152
+ return new g(this.rect.x, this.rect.y);
153
+ }, n.prototype.getRect = function() {
154
+ return this.rect;
155
+ }, n.prototype.getDiagonal = function() {
156
+ return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
157
+ }, n.prototype.getHalfTheDiagonal = function() {
158
+ return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
159
+ }, n.prototype.setRect = function(r, h) {
160
+ this.rect.x = r.x, this.rect.y = r.y, this.rect.width = h.width, this.rect.height = h.height;
161
+ }, n.prototype.setCenter = function(r, h) {
162
+ this.rect.x = r - this.rect.width / 2, this.rect.y = h - this.rect.height / 2;
163
+ }, n.prototype.setLocation = function(r, h) {
164
+ this.rect.x = r, this.rect.y = h;
165
+ }, n.prototype.moveBy = function(r, h) {
166
+ this.rect.x += r, this.rect.y += h;
167
+ }, n.prototype.getEdgeListToNode = function(r) {
168
+ var h = [], a = this;
169
+ return a.edges.forEach(function(p) {
170
+ if (p.target == r) {
171
+ if (p.source != a) throw "Incorrect edge source!";
172
+ h.push(p);
173
+ }
174
+ }), h;
175
+ }, n.prototype.getEdgesBetween = function(r) {
176
+ var h = [], a = this;
177
+ return a.edges.forEach(function(p) {
178
+ if (!(p.source == a || p.target == a)) throw "Incorrect edge source and/or target";
179
+ (p.target == r || p.source == r) && h.push(p);
180
+ }), h;
181
+ }, n.prototype.getNeighborsList = function() {
182
+ var r = /* @__PURE__ */ new Set(), h = this;
183
+ return h.edges.forEach(function(a) {
184
+ if (a.source == h)
185
+ r.add(a.target);
186
+ else {
187
+ if (a.target != h)
188
+ throw "Incorrect incidency!";
189
+ r.add(a.source);
190
+ }
191
+ }), r;
192
+ }, n.prototype.withChildren = function() {
193
+ var r = /* @__PURE__ */ new Set(), h, a;
194
+ if (r.add(this), this.child != null)
195
+ for (var p = this.child.getNodes(), v = 0; v < p.length; v++)
196
+ h = p[v], a = h.withChildren(), a.forEach(function(D) {
197
+ r.add(D);
198
+ });
199
+ return r;
200
+ }, n.prototype.getNoOfChildren = function() {
201
+ var r = 0, h;
202
+ if (this.child == null)
203
+ r = 1;
204
+ else
205
+ for (var a = this.child.getNodes(), p = 0; p < a.length; p++)
206
+ h = a[p], r += h.getNoOfChildren();
207
+ return r == 0 && (r = 1), r;
208
+ }, n.prototype.getEstimatedSize = function() {
209
+ if (this.estimatedSize == e.MIN_VALUE)
210
+ throw "assert failed";
211
+ return this.estimatedSize;
212
+ }, n.prototype.calcEstimatedSize = function() {
213
+ 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);
214
+ }, n.prototype.scatter = function() {
215
+ var r, h, a = -i.INITIAL_WORLD_BOUNDARY, p = i.INITIAL_WORLD_BOUNDARY;
216
+ r = i.WORLD_CENTER_X + l.nextDouble() * (p - a) + a;
217
+ var v = -i.INITIAL_WORLD_BOUNDARY, D = i.INITIAL_WORLD_BOUNDARY;
218
+ h = i.WORLD_CENTER_Y + l.nextDouble() * (D - v) + v, this.rect.x = r, this.rect.y = h;
219
+ }, n.prototype.updateBounds = function() {
220
+ if (this.getChild() == null)
221
+ throw "assert failed";
222
+ if (this.getChild().getNodes().length != 0) {
223
+ var r = this.getChild();
224
+ if (r.updateBounds(!0), this.rect.x = r.getLeft(), this.rect.y = r.getTop(), this.setWidth(r.getRight() - r.getLeft()), this.setHeight(r.getBottom() - r.getTop()), i.NODE_DIMENSIONS_INCLUDE_LABELS) {
225
+ var h = r.getRight() - r.getLeft(), a = r.getBottom() - r.getTop();
226
+ this.labelWidth > h && (this.rect.x -= (this.labelWidth - h) / 2, this.setWidth(this.labelWidth)), this.labelHeight > a && (this.labelPos == "center" ? this.rect.y -= (this.labelHeight - a) / 2 : this.labelPos == "top" && (this.rect.y -= this.labelHeight - a), this.setHeight(this.labelHeight));
227
+ }
228
+ }
229
+ }, n.prototype.getInclusionTreeDepth = function() {
230
+ if (this.inclusionTreeDepth == e.MAX_VALUE)
231
+ throw "assert failed";
232
+ return this.inclusionTreeDepth;
233
+ }, n.prototype.transform = function(r) {
234
+ var h = this.rect.x;
235
+ h > i.WORLD_BOUNDARY ? h = i.WORLD_BOUNDARY : h < -i.WORLD_BOUNDARY && (h = -i.WORLD_BOUNDARY);
236
+ var a = this.rect.y;
237
+ a > i.WORLD_BOUNDARY ? a = i.WORLD_BOUNDARY : a < -i.WORLD_BOUNDARY && (a = -i.WORLD_BOUNDARY);
238
+ var p = new g(h, a), v = r.inverseTransformPoint(p);
239
+ this.setLocation(v.x, v.y);
240
+ }, n.prototype.getLeft = function() {
241
+ return this.rect.x;
242
+ }, n.prototype.getRight = function() {
243
+ return this.rect.x + this.rect.width;
244
+ }, n.prototype.getTop = function() {
245
+ return this.rect.y;
246
+ }, n.prototype.getBottom = function() {
247
+ return this.rect.y + this.rect.height;
248
+ }, n.prototype.getParent = function() {
249
+ return this.owner == null ? null : this.owner.getParent();
250
+ }, N.exports = n;
251
+ },
252
+ /* 4 */
253
+ /***/
254
+ function(N, I, T) {
255
+ function o(e, t) {
256
+ e == null && t == null ? (this.x = 0, this.y = 0) : (this.x = e, this.y = t);
257
+ }
258
+ o.prototype.getX = function() {
259
+ return this.x;
260
+ }, o.prototype.getY = function() {
261
+ return this.y;
262
+ }, o.prototype.setX = function(e) {
263
+ this.x = e;
264
+ }, o.prototype.setY = function(e) {
265
+ this.y = e;
266
+ }, o.prototype.getDifference = function(e) {
267
+ return new DimensionD(this.x - e.x, this.y - e.y);
268
+ }, o.prototype.getCopy = function() {
269
+ return new o(this.x, this.y);
270
+ }, o.prototype.translate = function(e) {
271
+ return this.x += e.width, this.y += e.height, this;
272
+ }, N.exports = o;
273
+ },
274
+ /* 5 */
275
+ /***/
276
+ function(N, I, T) {
277
+ var o = T(2), e = T(10), t = T(0), i = T(6), l = T(3), g = T(1), n = T(13), d = T(12), r = T(11);
278
+ function h(p, v, D) {
279
+ o.call(this, D), this.estimatedSize = e.MIN_VALUE, this.margin = t.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = p, v != null && v instanceof i ? this.graphManager = v : v != null && v instanceof Layout && (this.graphManager = v.graphManager);
280
+ }
281
+ h.prototype = Object.create(o.prototype);
282
+ for (var a in o)
283
+ h[a] = o[a];
284
+ h.prototype.getNodes = function() {
285
+ return this.nodes;
286
+ }, h.prototype.getEdges = function() {
287
+ return this.edges;
288
+ }, h.prototype.getGraphManager = function() {
289
+ return this.graphManager;
290
+ }, h.prototype.getParent = function() {
291
+ return this.parent;
292
+ }, h.prototype.getLeft = function() {
293
+ return this.left;
294
+ }, h.prototype.getRight = function() {
295
+ return this.right;
296
+ }, h.prototype.getTop = function() {
297
+ return this.top;
298
+ }, h.prototype.getBottom = function() {
299
+ return this.bottom;
300
+ }, h.prototype.isConnected = function() {
301
+ return this.isConnected;
302
+ }, h.prototype.add = function(p, v, D) {
303
+ if (v == null && D == null) {
304
+ var u = p;
305
+ if (this.graphManager == null)
306
+ throw "Graph has no graph mgr!";
307
+ if (this.getNodes().indexOf(u) > -1)
308
+ throw "Node already in graph!";
309
+ return u.owner = this, this.getNodes().push(u), u;
310
+ } else {
311
+ var E = p;
312
+ if (!(this.getNodes().indexOf(v) > -1 && this.getNodes().indexOf(D) > -1))
313
+ throw "Source or target not in graph!";
314
+ if (!(v.owner == D.owner && v.owner == this))
315
+ throw "Both owners must be this graph!";
316
+ return v.owner != D.owner ? null : (E.source = v, E.target = D, E.isInterGraph = !1, this.getEdges().push(E), v.edges.push(E), D != v && D.edges.push(E), E);
317
+ }
318
+ }, h.prototype.remove = function(p) {
319
+ var v = p;
320
+ if (p instanceof l) {
321
+ if (v == null)
322
+ throw "Node is null!";
323
+ if (!(v.owner != null && v.owner == this))
324
+ throw "Owner graph is invalid!";
325
+ if (this.graphManager == null)
326
+ throw "Owner graph manager is invalid!";
327
+ for (var D = v.edges.slice(), u, E = D.length, y = 0; y < E; y++)
328
+ u = D[y], u.isInterGraph ? this.graphManager.remove(u) : u.source.owner.remove(u);
329
+ var O = this.nodes.indexOf(v);
330
+ if (O == -1)
331
+ throw "Node not in owner node list!";
332
+ this.nodes.splice(O, 1);
333
+ } else if (p instanceof g) {
334
+ var u = p;
335
+ if (u == null)
336
+ throw "Edge is null!";
337
+ if (!(u.source != null && u.target != null))
338
+ throw "Source and/or target is null!";
339
+ if (!(u.source.owner != null && u.target.owner != null && u.source.owner == this && u.target.owner == this))
340
+ throw "Source and/or target owner is invalid!";
341
+ var s = u.source.edges.indexOf(u), f = u.target.edges.indexOf(u);
342
+ if (!(s > -1 && f > -1))
343
+ throw "Source and/or target doesn't know this edge!";
344
+ u.source.edges.splice(s, 1), u.target != u.source && u.target.edges.splice(f, 1);
345
+ var O = u.source.owner.getEdges().indexOf(u);
346
+ if (O == -1)
347
+ throw "Not in owner's edge list!";
348
+ u.source.owner.getEdges().splice(O, 1);
349
+ }
350
+ }, h.prototype.updateLeftTop = function() {
351
+ for (var p = e.MAX_VALUE, v = e.MAX_VALUE, D, u, E, y = this.getNodes(), O = y.length, s = 0; s < O; s++) {
352
+ var f = y[s];
353
+ D = f.getTop(), u = f.getLeft(), p > D && (p = D), v > u && (v = u);
354
+ }
355
+ return p == e.MAX_VALUE ? null : (y[0].getParent().paddingLeft != null ? E = y[0].getParent().paddingLeft : E = this.margin, this.left = v - E, this.top = p - E, new d(this.left, this.top));
356
+ }, h.prototype.updateBounds = function(p) {
357
+ for (var v = e.MAX_VALUE, D = -e.MAX_VALUE, u = e.MAX_VALUE, E = -e.MAX_VALUE, y, O, s, f, c, L = this.nodes, A = L.length, m = 0; m < A; m++) {
358
+ var R = L[m];
359
+ p && R.child != null && R.updateBounds(), y = R.getLeft(), O = R.getRight(), s = R.getTop(), f = R.getBottom(), v > y && (v = y), D < O && (D = O), u > s && (u = s), E < f && (E = f);
360
+ }
361
+ var C = new n(v, u, D - v, E - u);
362
+ v == e.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), L[0].getParent().paddingLeft != null ? c = L[0].getParent().paddingLeft : c = this.margin, this.left = C.x - c, this.right = C.x + C.width + c, this.top = C.y - c, this.bottom = C.y + C.height + c;
363
+ }, h.calculateBounds = function(p) {
364
+ for (var v = e.MAX_VALUE, D = -e.MAX_VALUE, u = e.MAX_VALUE, E = -e.MAX_VALUE, y, O, s, f, c = p.length, L = 0; L < c; L++) {
365
+ var A = p[L];
366
+ y = A.getLeft(), O = A.getRight(), s = A.getTop(), f = A.getBottom(), v > y && (v = y), D < O && (D = O), u > s && (u = s), E < f && (E = f);
367
+ }
368
+ var m = new n(v, u, D - v, E - u);
369
+ return m;
370
+ }, h.prototype.getInclusionTreeDepth = function() {
371
+ return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
372
+ }, h.prototype.getEstimatedSize = function() {
373
+ if (this.estimatedSize == e.MIN_VALUE)
374
+ throw "assert failed";
375
+ return this.estimatedSize;
376
+ }, h.prototype.calcEstimatedSize = function() {
377
+ for (var p = 0, v = this.nodes, D = v.length, u = 0; u < D; u++) {
378
+ var E = v[u];
379
+ p += E.calcEstimatedSize();
380
+ }
381
+ return p == 0 ? this.estimatedSize = t.EMPTY_COMPOUND_NODE_SIZE : this.estimatedSize = p / Math.sqrt(this.nodes.length), this.estimatedSize;
382
+ }, h.prototype.updateConnected = function() {
383
+ var p = this;
384
+ if (this.nodes.length == 0) {
385
+ this.isConnected = !0;
386
+ return;
387
+ }
388
+ var v = new r(), D = /* @__PURE__ */ new Set(), u = this.nodes[0], E, y, O = u.withChildren();
389
+ for (O.forEach(function(m) {
390
+ v.push(m), D.add(m);
391
+ }); v.length !== 0; ) {
392
+ u = v.shift(), E = u.getEdges();
393
+ for (var s = E.length, f = 0; f < s; f++) {
394
+ var c = E[f];
395
+ if (y = c.getOtherEndInGraph(u, this), y != null && !D.has(y)) {
396
+ var L = y.withChildren();
397
+ L.forEach(function(m) {
398
+ v.push(m), D.add(m);
399
+ });
400
+ }
401
+ }
402
+ }
403
+ if (this.isConnected = !1, D.size >= this.nodes.length) {
404
+ var A = 0;
405
+ D.forEach(function(m) {
406
+ m.owner == p && A++;
407
+ }), A == this.nodes.length && (this.isConnected = !0);
408
+ }
409
+ }, N.exports = h;
410
+ },
411
+ /* 6 */
412
+ /***/
413
+ function(N, I, T) {
414
+ var o, e = T(1);
415
+ function t(i) {
416
+ o = T(5), this.layout = i, this.graphs = [], this.edges = [];
417
+ }
418
+ t.prototype.addRoot = function() {
419
+ var i = this.layout.newGraph(), l = this.layout.newNode(null), g = this.add(i, l);
420
+ return this.setRootGraph(g), this.rootGraph;
421
+ }, t.prototype.add = function(i, l, g, n, d) {
422
+ if (g == null && n == null && d == null) {
423
+ if (i == null)
424
+ throw "Graph is null!";
425
+ if (l == null)
426
+ throw "Parent node is null!";
427
+ if (this.graphs.indexOf(i) > -1)
428
+ throw "Graph already in this graph mgr!";
429
+ if (this.graphs.push(i), i.parent != null)
430
+ throw "Already has a parent!";
431
+ if (l.child != null)
432
+ throw "Already has a child!";
433
+ return i.parent = l, l.child = i, i;
434
+ } else {
435
+ d = g, n = l, g = i;
436
+ var r = n.getOwner(), h = d.getOwner();
437
+ if (!(r != null && r.getGraphManager() == this))
438
+ throw "Source not in this graph mgr!";
439
+ if (!(h != null && h.getGraphManager() == this))
440
+ throw "Target not in this graph mgr!";
441
+ if (r == h)
442
+ return g.isInterGraph = !1, r.add(g, n, d);
443
+ if (g.isInterGraph = !0, g.source = n, g.target = d, this.edges.indexOf(g) > -1)
444
+ throw "Edge already in inter-graph edge list!";
445
+ if (this.edges.push(g), !(g.source != null && g.target != null))
446
+ throw "Edge source and/or target is null!";
447
+ if (!(g.source.edges.indexOf(g) == -1 && g.target.edges.indexOf(g) == -1))
448
+ throw "Edge already in source and/or target incidency list!";
449
+ return g.source.edges.push(g), g.target.edges.push(g), g;
450
+ }
451
+ }, t.prototype.remove = function(i) {
452
+ if (i instanceof o) {
453
+ var l = i;
454
+ if (l.getGraphManager() != this)
455
+ throw "Graph not in this graph mgr";
456
+ if (!(l == this.rootGraph || l.parent != null && l.parent.graphManager == this))
457
+ throw "Invalid parent node!";
458
+ var g = [];
459
+ g = g.concat(l.getEdges());
460
+ for (var n, d = g.length, r = 0; r < d; r++)
461
+ n = g[r], l.remove(n);
462
+ var h = [];
463
+ h = h.concat(l.getNodes());
464
+ var a;
465
+ d = h.length;
466
+ for (var r = 0; r < d; r++)
467
+ a = h[r], l.remove(a);
468
+ l == this.rootGraph && this.setRootGraph(null);
469
+ var p = this.graphs.indexOf(l);
470
+ this.graphs.splice(p, 1), l.parent = null;
471
+ } else if (i instanceof e) {
472
+ if (n = i, n == null)
473
+ throw "Edge is null!";
474
+ if (!n.isInterGraph)
475
+ throw "Not an inter-graph edge!";
476
+ if (!(n.source != null && n.target != null))
477
+ throw "Source and/or target is null!";
478
+ if (!(n.source.edges.indexOf(n) != -1 && n.target.edges.indexOf(n) != -1))
479
+ throw "Source and/or target doesn't know this edge!";
480
+ var p = n.source.edges.indexOf(n);
481
+ if (n.source.edges.splice(p, 1), p = n.target.edges.indexOf(n), n.target.edges.splice(p, 1), !(n.source.owner != null && n.source.owner.getGraphManager() != null))
482
+ throw "Edge owner graph or owner graph manager is null!";
483
+ if (n.source.owner.getGraphManager().edges.indexOf(n) == -1)
484
+ throw "Not in owner graph manager's edge list!";
485
+ var p = n.source.owner.getGraphManager().edges.indexOf(n);
486
+ n.source.owner.getGraphManager().edges.splice(p, 1);
487
+ }
488
+ }, t.prototype.updateBounds = function() {
489
+ this.rootGraph.updateBounds(!0);
490
+ }, t.prototype.getGraphs = function() {
491
+ return this.graphs;
492
+ }, t.prototype.getAllNodes = function() {
493
+ if (this.allNodes == null) {
494
+ for (var i = [], l = this.getGraphs(), g = l.length, n = 0; n < g; n++)
495
+ i = i.concat(l[n].getNodes());
496
+ this.allNodes = i;
497
+ }
498
+ return this.allNodes;
499
+ }, t.prototype.resetAllNodes = function() {
500
+ this.allNodes = null;
501
+ }, t.prototype.resetAllEdges = function() {
502
+ this.allEdges = null;
503
+ }, t.prototype.resetAllNodesToApplyGravitation = function() {
504
+ this.allNodesToApplyGravitation = null;
505
+ }, t.prototype.getAllEdges = function() {
506
+ if (this.allEdges == null) {
507
+ var i = [], l = this.getGraphs();
508
+ l.length;
509
+ for (var g = 0; g < l.length; g++)
510
+ i = i.concat(l[g].getEdges());
511
+ i = i.concat(this.edges), this.allEdges = i;
512
+ }
513
+ return this.allEdges;
514
+ }, t.prototype.getAllNodesToApplyGravitation = function() {
515
+ return this.allNodesToApplyGravitation;
516
+ }, t.prototype.setAllNodesToApplyGravitation = function(i) {
517
+ if (this.allNodesToApplyGravitation != null)
518
+ throw "assert failed";
519
+ this.allNodesToApplyGravitation = i;
520
+ }, t.prototype.getRoot = function() {
521
+ return this.rootGraph;
522
+ }, t.prototype.setRootGraph = function(i) {
523
+ if (i.getGraphManager() != this)
524
+ throw "Root not in this graph mgr!";
525
+ this.rootGraph = i, i.parent == null && (i.parent = this.layout.newNode("Root node"));
526
+ }, t.prototype.getLayout = function() {
527
+ return this.layout;
528
+ }, t.prototype.isOneAncestorOfOther = function(i, l) {
529
+ if (!(i != null && l != null))
530
+ throw "assert failed";
531
+ if (i == l)
532
+ return !0;
533
+ var g = i.getOwner(), n;
534
+ do {
535
+ if (n = g.getParent(), n == null)
536
+ break;
537
+ if (n == l)
538
+ return !0;
539
+ if (g = n.getOwner(), g == null)
540
+ break;
541
+ } while (!0);
542
+ g = l.getOwner();
543
+ do {
544
+ if (n = g.getParent(), n == null)
545
+ break;
546
+ if (n == i)
547
+ return !0;
548
+ if (g = n.getOwner(), g == null)
549
+ break;
550
+ } while (!0);
551
+ return !1;
552
+ }, t.prototype.calcLowestCommonAncestors = function() {
553
+ for (var i, l, g, n, d, r = this.getAllEdges(), h = r.length, a = 0; a < h; a++) {
554
+ if (i = r[a], l = i.source, g = i.target, i.lca = null, i.sourceInLca = l, i.targetInLca = g, l == g) {
555
+ i.lca = l.getOwner();
556
+ continue;
557
+ }
558
+ for (n = l.getOwner(); i.lca == null; ) {
559
+ for (i.targetInLca = g, d = g.getOwner(); i.lca == null; ) {
560
+ if (d == n) {
561
+ i.lca = d;
562
+ break;
563
+ }
564
+ if (d == this.rootGraph)
565
+ break;
566
+ if (i.lca != null)
567
+ throw "assert failed";
568
+ i.targetInLca = d.getParent(), d = i.targetInLca.getOwner();
569
+ }
570
+ if (n == this.rootGraph)
571
+ break;
572
+ i.lca == null && (i.sourceInLca = n.getParent(), n = i.sourceInLca.getOwner());
573
+ }
574
+ if (i.lca == null)
575
+ throw "assert failed";
576
+ }
577
+ }, t.prototype.calcLowestCommonAncestor = function(i, l) {
578
+ if (i == l)
579
+ return i.getOwner();
580
+ var g = i.getOwner();
581
+ do {
582
+ if (g == null)
583
+ break;
584
+ var n = l.getOwner();
585
+ do {
586
+ if (n == null)
587
+ break;
588
+ if (n == g)
589
+ return n;
590
+ n = n.getParent().getOwner();
591
+ } while (!0);
592
+ g = g.getParent().getOwner();
593
+ } while (!0);
594
+ return g;
595
+ }, t.prototype.calcInclusionTreeDepths = function(i, l) {
596
+ i == null && l == null && (i = this.rootGraph, l = 1);
597
+ for (var g, n = i.getNodes(), d = n.length, r = 0; r < d; r++)
598
+ g = n[r], g.inclusionTreeDepth = l, g.child != null && this.calcInclusionTreeDepths(g.child, l + 1);
599
+ }, t.prototype.includesInvalidEdge = function() {
600
+ for (var i, l = this.edges.length, g = 0; g < l; g++)
601
+ if (i = this.edges[g], this.isOneAncestorOfOther(i.source, i.target))
602
+ return !0;
603
+ return !1;
604
+ }, N.exports = t;
605
+ },
606
+ /* 7 */
607
+ /***/
608
+ function(N, I, T) {
609
+ var o = T(0);
610
+ function e() {
611
+ }
612
+ for (var t in o)
613
+ e[t] = o[t];
614
+ e.MAX_ITERATIONS = 2500, e.DEFAULT_EDGE_LENGTH = 50, e.DEFAULT_SPRING_STRENGTH = 0.45, e.DEFAULT_REPULSION_STRENGTH = 4500, e.DEFAULT_GRAVITY_STRENGTH = 0.4, e.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, e.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, e.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, e.COOLING_ADAPTATION_FACTOR = 0.33, e.ADAPTATION_LOWER_NODE_LIMIT = 1e3, e.ADAPTATION_UPPER_NODE_LIMIT = 5e3, e.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, e.MAX_NODE_DISPLACEMENT = e.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, e.MIN_REPULSION_DIST = e.DEFAULT_EDGE_LENGTH / 10, e.CONVERGENCE_CHECK_PERIOD = 100, e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, e.MIN_EDGE_LENGTH = 1, e.GRID_CALCULATION_CHECK_PERIOD = 10, N.exports = e;
615
+ },
616
+ /* 8 */
617
+ /***/
618
+ function(N, I, T) {
619
+ var o = T(12);
620
+ function e() {
621
+ }
622
+ e.calcSeparationAmount = function(t, i, l, g) {
623
+ if (!t.intersects(i))
624
+ throw "assert failed";
625
+ var n = new Array(2);
626
+ this.decideDirectionsForOverlappingNodes(t, i, n), l[0] = Math.min(t.getRight(), i.getRight()) - Math.max(t.x, i.x), l[1] = Math.min(t.getBottom(), i.getBottom()) - Math.max(t.y, i.y), t.getX() <= i.getX() && t.getRight() >= i.getRight() ? l[0] += Math.min(i.getX() - t.getX(), t.getRight() - i.getRight()) : i.getX() <= t.getX() && i.getRight() >= t.getRight() && (l[0] += Math.min(t.getX() - i.getX(), i.getRight() - t.getRight())), t.getY() <= i.getY() && t.getBottom() >= i.getBottom() ? l[1] += Math.min(i.getY() - t.getY(), t.getBottom() - i.getBottom()) : i.getY() <= t.getY() && i.getBottom() >= t.getBottom() && (l[1] += Math.min(t.getY() - i.getY(), i.getBottom() - t.getBottom()));
627
+ var d = Math.abs((i.getCenterY() - t.getCenterY()) / (i.getCenterX() - t.getCenterX()));
628
+ i.getCenterY() === t.getCenterY() && i.getCenterX() === t.getCenterX() && (d = 1);
629
+ var r = d * l[0], h = l[1] / d;
630
+ l[0] < h ? h = l[0] : r = l[1], l[0] = -1 * n[0] * (h / 2 + g), l[1] = -1 * n[1] * (r / 2 + g);
631
+ }, e.decideDirectionsForOverlappingNodes = function(t, i, l) {
632
+ t.getCenterX() < i.getCenterX() ? l[0] = -1 : l[0] = 1, t.getCenterY() < i.getCenterY() ? l[1] = -1 : l[1] = 1;
633
+ }, e.getIntersection2 = function(t, i, l) {
634
+ var g = t.getCenterX(), n = t.getCenterY(), d = i.getCenterX(), r = i.getCenterY();
635
+ if (t.intersects(i))
636
+ return l[0] = g, l[1] = n, l[2] = d, l[3] = r, !0;
637
+ var h = t.getX(), a = t.getY(), p = t.getRight(), v = t.getX(), D = t.getBottom(), u = t.getRight(), E = t.getWidthHalf(), y = t.getHeightHalf(), O = i.getX(), s = i.getY(), f = i.getRight(), c = i.getX(), L = i.getBottom(), A = i.getRight(), m = i.getWidthHalf(), R = i.getHeightHalf(), C = !1, M = !1;
638
+ if (g === d) {
639
+ if (n > r)
640
+ return l[0] = g, l[1] = a, l[2] = d, l[3] = L, !1;
641
+ if (n < r)
642
+ return l[0] = g, l[1] = D, l[2] = d, l[3] = s, !1;
643
+ } else if (n === r) {
644
+ if (g > d)
645
+ return l[0] = h, l[1] = n, l[2] = f, l[3] = r, !1;
646
+ if (g < d)
647
+ return l[0] = p, l[1] = n, l[2] = O, l[3] = r, !1;
648
+ } else {
649
+ var S = t.height / t.width, Y = i.height / i.width, w = (r - n) / (d - g), x = void 0, F = void 0, U = void 0, P = void 0, _ = void 0, X = void 0;
650
+ if (-S === w ? g > d ? (l[0] = v, l[1] = D, C = !0) : (l[0] = p, l[1] = a, C = !0) : S === w && (g > d ? (l[0] = h, l[1] = a, C = !0) : (l[0] = u, l[1] = D, C = !0)), -Y === w ? d > g ? (l[2] = c, l[3] = L, M = !0) : (l[2] = f, l[3] = s, M = !0) : Y === w && (d > g ? (l[2] = O, l[3] = s, M = !0) : (l[2] = A, l[3] = L, M = !0)), C && M)
651
+ return !1;
652
+ if (g > d ? n > r ? (x = this.getCardinalDirection(S, w, 4), F = this.getCardinalDirection(Y, w, 2)) : (x = this.getCardinalDirection(-S, w, 3), F = this.getCardinalDirection(-Y, w, 1)) : n > r ? (x = this.getCardinalDirection(-S, w, 1), F = this.getCardinalDirection(-Y, w, 3)) : (x = this.getCardinalDirection(S, w, 2), F = this.getCardinalDirection(Y, w, 4)), !C)
653
+ switch (x) {
654
+ case 1:
655
+ P = a, U = g + -y / w, l[0] = U, l[1] = P;
656
+ break;
657
+ case 2:
658
+ U = u, P = n + E * w, l[0] = U, l[1] = P;
659
+ break;
660
+ case 3:
661
+ P = D, U = g + y / w, l[0] = U, l[1] = P;
662
+ break;
663
+ case 4:
664
+ U = v, P = n + -E * w, l[0] = U, l[1] = P;
665
+ break;
666
+ }
667
+ if (!M)
668
+ switch (F) {
669
+ case 1:
670
+ X = s, _ = d + -R / w, l[2] = _, l[3] = X;
671
+ break;
672
+ case 2:
673
+ _ = A, X = r + m * w, l[2] = _, l[3] = X;
674
+ break;
675
+ case 3:
676
+ X = L, _ = d + R / w, l[2] = _, l[3] = X;
677
+ break;
678
+ case 4:
679
+ _ = c, X = r + -m * w, l[2] = _, l[3] = X;
680
+ break;
681
+ }
682
+ }
683
+ return !1;
684
+ }, e.getCardinalDirection = function(t, i, l) {
685
+ return t > i ? l : 1 + l % 4;
686
+ }, e.getIntersection = function(t, i, l, g) {
687
+ if (g == null)
688
+ return this.getIntersection2(t, i, l);
689
+ var n = t.x, d = t.y, r = i.x, h = i.y, a = l.x, p = l.y, v = g.x, D = g.y, u = void 0, E = void 0, y = void 0, O = void 0, s = void 0, f = void 0, c = void 0, L = void 0, A = void 0;
690
+ return y = h - d, s = n - r, c = r * d - n * h, O = D - p, f = a - v, L = v * p - a * D, A = y * f - O * s, A === 0 ? null : (u = (s * L - f * c) / A, E = (O * c - y * L) / A, new o(u, E));
691
+ }, e.angleOfVector = function(t, i, l, g) {
692
+ var n = void 0;
693
+ return t !== l ? (n = Math.atan((g - i) / (l - t)), l < t ? n += Math.PI : g < i && (n += this.TWO_PI)) : g < i ? n = this.ONE_AND_HALF_PI : n = this.HALF_PI, n;
694
+ }, e.doIntersect = function(t, i, l, g) {
695
+ var n = t.x, d = t.y, r = i.x, h = i.y, a = l.x, p = l.y, v = g.x, D = g.y, u = (r - n) * (D - p) - (v - a) * (h - d);
696
+ if (u === 0)
697
+ return !1;
698
+ var E = ((D - p) * (v - n) + (a - v) * (D - d)) / u, y = ((d - h) * (v - n) + (r - n) * (D - d)) / u;
699
+ return 0 < E && E < 1 && 0 < y && y < 1;
700
+ }, e.HALF_PI = 0.5 * Math.PI, e.ONE_AND_HALF_PI = 1.5 * Math.PI, e.TWO_PI = 2 * Math.PI, e.THREE_PI = 3 * Math.PI, N.exports = e;
701
+ },
702
+ /* 9 */
703
+ /***/
704
+ function(N, I, T) {
705
+ function o() {
706
+ }
707
+ o.sign = function(e) {
708
+ return e > 0 ? 1 : e < 0 ? -1 : 0;
709
+ }, o.floor = function(e) {
710
+ return e < 0 ? Math.ceil(e) : Math.floor(e);
711
+ }, o.ceil = function(e) {
712
+ return e < 0 ? Math.floor(e) : Math.ceil(e);
713
+ }, N.exports = o;
714
+ },
715
+ /* 10 */
716
+ /***/
717
+ function(N, I, T) {
718
+ function o() {
719
+ }
720
+ o.MAX_VALUE = 2147483647, o.MIN_VALUE = -2147483648, N.exports = o;
721
+ },
722
+ /* 11 */
723
+ /***/
724
+ function(N, I, T) {
725
+ var o = /* @__PURE__ */ function() {
726
+ function n(d, r) {
727
+ for (var h = 0; h < r.length; h++) {
728
+ var a = r[h];
729
+ a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(d, a.key, a);
730
+ }
731
+ }
732
+ return function(d, r, h) {
733
+ return r && n(d.prototype, r), h && n(d, h), d;
734
+ };
735
+ }();
736
+ function e(n, d) {
737
+ if (!(n instanceof d))
738
+ throw new TypeError("Cannot call a class as a function");
739
+ }
740
+ var t = function(d) {
741
+ return { value: d, next: null, prev: null };
742
+ }, i = function(d, r, h, a) {
743
+ return d !== null ? d.next = r : a.head = r, h !== null ? h.prev = r : a.tail = r, r.prev = d, r.next = h, a.length++, r;
744
+ }, l = function(d, r) {
745
+ var h = d.prev, a = d.next;
746
+ return h !== null ? h.next = a : r.head = a, a !== null ? a.prev = h : r.tail = h, d.prev = d.next = null, r.length--, d;
747
+ }, g = function() {
748
+ function n(d) {
749
+ var r = this;
750
+ e(this, n), this.length = 0, this.head = null, this.tail = null, d != null && d.forEach(function(h) {
751
+ return r.push(h);
752
+ });
753
+ }
754
+ return o(n, [{
755
+ key: "size",
756
+ value: function() {
757
+ return this.length;
758
+ }
759
+ }, {
760
+ key: "insertBefore",
761
+ value: function(r, h) {
762
+ return i(h.prev, t(r), h, this);
763
+ }
764
+ }, {
765
+ key: "insertAfter",
766
+ value: function(r, h) {
767
+ return i(h, t(r), h.next, this);
768
+ }
769
+ }, {
770
+ key: "insertNodeBefore",
771
+ value: function(r, h) {
772
+ return i(h.prev, r, h, this);
773
+ }
774
+ }, {
775
+ key: "insertNodeAfter",
776
+ value: function(r, h) {
777
+ return i(h, r, h.next, this);
778
+ }
779
+ }, {
780
+ key: "push",
781
+ value: function(r) {
782
+ return i(this.tail, t(r), null, this);
783
+ }
784
+ }, {
785
+ key: "unshift",
786
+ value: function(r) {
787
+ return i(null, t(r), this.head, this);
788
+ }
789
+ }, {
790
+ key: "remove",
791
+ value: function(r) {
792
+ return l(r, this);
793
+ }
794
+ }, {
795
+ key: "pop",
796
+ value: function() {
797
+ return l(this.tail, this).value;
798
+ }
799
+ }, {
800
+ key: "popNode",
801
+ value: function() {
802
+ return l(this.tail, this);
803
+ }
804
+ }, {
805
+ key: "shift",
806
+ value: function() {
807
+ return l(this.head, this).value;
808
+ }
809
+ }, {
810
+ key: "shiftNode",
811
+ value: function() {
812
+ return l(this.head, this);
813
+ }
814
+ }, {
815
+ key: "get_object_at",
816
+ value: function(r) {
817
+ if (r <= this.length()) {
818
+ for (var h = 1, a = this.head; h < r; )
819
+ a = a.next, h++;
820
+ return a.value;
821
+ }
822
+ }
823
+ }, {
824
+ key: "set_object_at",
825
+ value: function(r, h) {
826
+ if (r <= this.length()) {
827
+ for (var a = 1, p = this.head; a < r; )
828
+ p = p.next, a++;
829
+ p.value = h;
830
+ }
831
+ }
832
+ }]), n;
833
+ }();
834
+ N.exports = g;
835
+ },
836
+ /* 12 */
837
+ /***/
838
+ function(N, I, T) {
839
+ function o(e, t, i) {
840
+ this.x = null, this.y = null, e == null && t == null && i == null ? (this.x = 0, this.y = 0) : typeof e == "number" && typeof t == "number" && i == null ? (this.x = e, this.y = t) : e.constructor.name == "Point" && t == null && i == null && (i = e, this.x = i.x, this.y = i.y);
841
+ }
842
+ o.prototype.getX = function() {
843
+ return this.x;
844
+ }, o.prototype.getY = function() {
845
+ return this.y;
846
+ }, o.prototype.getLocation = function() {
847
+ return new o(this.x, this.y);
848
+ }, o.prototype.setLocation = function(e, t, i) {
849
+ e.constructor.name == "Point" && t == null && i == null ? (i = e, this.setLocation(i.x, i.y)) : typeof e == "number" && typeof t == "number" && i == null && (parseInt(e) == e && parseInt(t) == t ? this.move(e, t) : (this.x = Math.floor(e + 0.5), this.y = Math.floor(t + 0.5)));
850
+ }, o.prototype.move = function(e, t) {
851
+ this.x = e, this.y = t;
852
+ }, o.prototype.translate = function(e, t) {
853
+ this.x += e, this.y += t;
854
+ }, o.prototype.equals = function(e) {
855
+ if (e.constructor.name == "Point") {
856
+ var t = e;
857
+ return this.x == t.x && this.y == t.y;
858
+ }
859
+ return this == e;
860
+ }, o.prototype.toString = function() {
861
+ return new o().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
862
+ }, N.exports = o;
863
+ },
864
+ /* 13 */
865
+ /***/
866
+ function(N, I, T) {
867
+ function o(e, t, i, l) {
868
+ this.x = 0, this.y = 0, this.width = 0, this.height = 0, e != null && t != null && i != null && l != null && (this.x = e, this.y = t, this.width = i, this.height = l);
869
+ }
870
+ o.prototype.getX = function() {
871
+ return this.x;
872
+ }, o.prototype.setX = function(e) {
873
+ this.x = e;
874
+ }, o.prototype.getY = function() {
875
+ return this.y;
876
+ }, o.prototype.setY = function(e) {
877
+ this.y = e;
878
+ }, o.prototype.getWidth = function() {
879
+ return this.width;
880
+ }, o.prototype.setWidth = function(e) {
881
+ this.width = e;
882
+ }, o.prototype.getHeight = function() {
883
+ return this.height;
884
+ }, o.prototype.setHeight = function(e) {
885
+ this.height = e;
886
+ }, o.prototype.getRight = function() {
887
+ return this.x + this.width;
888
+ }, o.prototype.getBottom = function() {
889
+ return this.y + this.height;
890
+ }, o.prototype.intersects = function(e) {
891
+ return !(this.getRight() < e.x || this.getBottom() < e.y || e.getRight() < this.x || e.getBottom() < this.y);
892
+ }, o.prototype.getCenterX = function() {
893
+ return this.x + this.width / 2;
894
+ }, o.prototype.getMinX = function() {
895
+ return this.getX();
896
+ }, o.prototype.getMaxX = function() {
897
+ return this.getX() + this.width;
898
+ }, o.prototype.getCenterY = function() {
899
+ return this.y + this.height / 2;
900
+ }, o.prototype.getMinY = function() {
901
+ return this.getY();
902
+ }, o.prototype.getMaxY = function() {
903
+ return this.getY() + this.height;
904
+ }, o.prototype.getWidthHalf = function() {
905
+ return this.width / 2;
906
+ }, o.prototype.getHeightHalf = function() {
907
+ return this.height / 2;
908
+ }, N.exports = o;
909
+ },
910
+ /* 14 */
911
+ /***/
912
+ function(N, I, T) {
913
+ var o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
914
+ return typeof t;
915
+ } : function(t) {
916
+ return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
917
+ };
918
+ function e() {
919
+ }
920
+ e.lastID = 0, e.createID = function(t) {
921
+ return e.isPrimitive(t) ? t : (t.uniqueID != null || (t.uniqueID = e.getString(), e.lastID++), t.uniqueID);
922
+ }, e.getString = function(t) {
923
+ return t == null && (t = e.lastID), "Object#" + t;
924
+ }, e.isPrimitive = function(t) {
925
+ var i = typeof t > "u" ? "undefined" : o(t);
926
+ return t == null || i != "object" && i != "function";
927
+ }, N.exports = e;
928
+ },
929
+ /* 15 */
930
+ /***/
931
+ function(N, I, T) {
932
+ function o(a) {
933
+ if (Array.isArray(a)) {
934
+ for (var p = 0, v = Array(a.length); p < a.length; p++)
935
+ v[p] = a[p];
936
+ return v;
937
+ } else
938
+ return Array.from(a);
939
+ }
940
+ var e = T(0), t = T(6), i = T(3), l = T(1), g = T(5), n = T(4), d = T(17), r = T(27);
941
+ function h(a) {
942
+ r.call(this), this.layoutQuality = e.QUALITY, this.createBendsAsNeeded = e.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = e.DEFAULT_INCREMENTAL, this.animationOnLayout = e.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = e.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = e.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = e.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new t(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, a != null && (this.isRemoteUse = a);
943
+ }
944
+ h.RANDOM_SEED = 1, h.prototype = Object.create(r.prototype), h.prototype.getGraphManager = function() {
945
+ return this.graphManager;
946
+ }, h.prototype.getAllNodes = function() {
947
+ return this.graphManager.getAllNodes();
948
+ }, h.prototype.getAllEdges = function() {
949
+ return this.graphManager.getAllEdges();
950
+ }, h.prototype.getAllNodesToApplyGravitation = function() {
951
+ return this.graphManager.getAllNodesToApplyGravitation();
952
+ }, h.prototype.newGraphManager = function() {
953
+ var a = new t(this);
954
+ return this.graphManager = a, a;
955
+ }, h.prototype.newGraph = function(a) {
956
+ return new g(null, this.graphManager, a);
957
+ }, h.prototype.newNode = function(a) {
958
+ return new i(this.graphManager, a);
959
+ }, h.prototype.newEdge = function(a) {
960
+ return new l(null, null, a);
961
+ }, h.prototype.checkLayoutSuccess = function() {
962
+ return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
963
+ }, h.prototype.runLayout = function() {
964
+ this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
965
+ var a;
966
+ return this.checkLayoutSuccess() ? a = !1 : a = this.layout(), e.ANIMATE === "during" ? !1 : (a && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, a);
967
+ }, h.prototype.doPostLayout = function() {
968
+ this.incremental || this.transform(), this.update();
969
+ }, h.prototype.update2 = function() {
970
+ if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
971
+ for (var a = this.graphManager.getAllEdges(), p = 0; p < a.length; p++)
972
+ a[p];
973
+ for (var v = this.graphManager.getRoot().getNodes(), p = 0; p < v.length; p++)
974
+ v[p];
975
+ this.update(this.graphManager.getRoot());
976
+ }
977
+ }, h.prototype.update = function(a) {
978
+ if (a == null)
979
+ this.update2();
980
+ else if (a instanceof i) {
981
+ var p = a;
982
+ if (p.getChild() != null)
983
+ for (var v = p.getChild().getNodes(), D = 0; D < v.length; D++)
984
+ update(v[D]);
985
+ if (p.vGraphObject != null) {
986
+ var u = p.vGraphObject;
987
+ u.update(p);
988
+ }
989
+ } else if (a instanceof l) {
990
+ var E = a;
991
+ if (E.vGraphObject != null) {
992
+ var y = E.vGraphObject;
993
+ y.update(E);
994
+ }
995
+ } else if (a instanceof g) {
996
+ var O = a;
997
+ if (O.vGraphObject != null) {
998
+ var s = O.vGraphObject;
999
+ s.update(O);
1000
+ }
1001
+ }
1002
+ }, h.prototype.initParameters = function() {
1003
+ this.isSubLayout || (this.layoutQuality = e.QUALITY, this.animationDuringLayout = e.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = e.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = e.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = e.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = e.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = e.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
1004
+ }, h.prototype.transform = function(a) {
1005
+ if (a == null)
1006
+ this.transform(new n(0, 0));
1007
+ else {
1008
+ var p = new d(), v = this.graphManager.getRoot().updateLeftTop();
1009
+ if (v != null) {
1010
+ p.setWorldOrgX(a.x), p.setWorldOrgY(a.y), p.setDeviceOrgX(v.x), p.setDeviceOrgY(v.y);
1011
+ for (var D = this.getAllNodes(), u, E = 0; E < D.length; E++)
1012
+ u = D[E], u.transform(p);
1013
+ }
1014
+ }
1015
+ }, h.prototype.positionNodesRandomly = function(a) {
1016
+ if (a == null)
1017
+ this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
1018
+ else
1019
+ for (var p, v, D = a.getNodes(), u = 0; u < D.length; u++)
1020
+ p = D[u], v = p.getChild(), v == null || v.getNodes().length == 0 ? p.scatter() : (this.positionNodesRandomly(v), p.updateBounds());
1021
+ }, h.prototype.getFlatForest = function() {
1022
+ for (var a = [], p = !0, v = this.graphManager.getRoot().getNodes(), D = !0, u = 0; u < v.length; u++)
1023
+ v[u].getChild() != null && (D = !1);
1024
+ if (!D)
1025
+ return a;
1026
+ var E = /* @__PURE__ */ new Set(), y = [], O = /* @__PURE__ */ new Map(), s = [];
1027
+ for (s = s.concat(v); s.length > 0 && p; ) {
1028
+ for (y.push(s[0]); y.length > 0 && p; ) {
1029
+ var f = y[0];
1030
+ y.splice(0, 1), E.add(f);
1031
+ for (var c = f.getEdges(), u = 0; u < c.length; u++) {
1032
+ var L = c[u].getOtherEnd(f);
1033
+ if (O.get(f) != L)
1034
+ if (!E.has(L))
1035
+ y.push(L), O.set(L, f);
1036
+ else {
1037
+ p = !1;
1038
+ break;
1039
+ }
1040
+ }
1041
+ }
1042
+ if (!p)
1043
+ a = [];
1044
+ else {
1045
+ var A = [].concat(o(E));
1046
+ a.push(A);
1047
+ for (var u = 0; u < A.length; u++) {
1048
+ var m = A[u], R = s.indexOf(m);
1049
+ R > -1 && s.splice(R, 1);
1050
+ }
1051
+ E = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Map();
1052
+ }
1053
+ }
1054
+ return a;
1055
+ }, h.prototype.createDummyNodesForBendpoints = function(a) {
1056
+ for (var p = [], v = a.source, D = this.graphManager.calcLowestCommonAncestor(a.source, a.target), u = 0; u < a.bendpoints.length; u++) {
1057
+ var E = this.newNode(null);
1058
+ E.setRect(new Point(0, 0), new Dimension(1, 1)), D.add(E);
1059
+ var y = this.newEdge(null);
1060
+ this.graphManager.add(y, v, E), p.add(E), v = E;
1061
+ }
1062
+ var y = this.newEdge(null);
1063
+ return this.graphManager.add(y, v, a.target), this.edgeToDummyNodes.set(a, p), a.isInterGraph() ? this.graphManager.remove(a) : D.remove(a), p;
1064
+ }, h.prototype.createBendpointsFromDummyNodes = function() {
1065
+ var a = [];
1066
+ a = a.concat(this.graphManager.getAllEdges()), a = [].concat(o(this.edgeToDummyNodes.keys())).concat(a);
1067
+ for (var p = 0; p < a.length; p++) {
1068
+ var v = a[p];
1069
+ if (v.bendpoints.length > 0) {
1070
+ for (var D = this.edgeToDummyNodes.get(v), u = 0; u < D.length; u++) {
1071
+ var E = D[u], y = new n(E.getCenterX(), E.getCenterY()), O = v.bendpoints.get(u);
1072
+ O.x = y.x, O.y = y.y, E.getOwner().remove(E);
1073
+ }
1074
+ this.graphManager.add(v, v.source, v.target);
1075
+ }
1076
+ }
1077
+ }, h.transform = function(a, p, v, D) {
1078
+ if (v != null && D != null) {
1079
+ var u = p;
1080
+ if (a <= 50) {
1081
+ var E = p / v;
1082
+ u -= (p - E) / 50 * (50 - a);
1083
+ } else {
1084
+ var y = p * D;
1085
+ u += (y - p) / 50 * (a - 50);
1086
+ }
1087
+ return u;
1088
+ } else {
1089
+ var O, s;
1090
+ return a <= 50 ? (O = 9 * p / 500, s = p / 10) : (O = 9 * p / 50, s = -8 * p), O * a + s;
1091
+ }
1092
+ }, h.findCenterOfTree = function(a) {
1093
+ var p = [];
1094
+ p = p.concat(a);
1095
+ var v = [], D = /* @__PURE__ */ new Map(), u = !1, E = null;
1096
+ (p.length == 1 || p.length == 2) && (u = !0, E = p[0]);
1097
+ for (var y = 0; y < p.length; y++) {
1098
+ var O = p[y], s = O.getNeighborsList().size;
1099
+ D.set(O, O.getNeighborsList().size), s == 1 && v.push(O);
1100
+ }
1101
+ var f = [];
1102
+ for (f = f.concat(v); !u; ) {
1103
+ var c = [];
1104
+ c = c.concat(f), f = [];
1105
+ for (var y = 0; y < p.length; y++) {
1106
+ var O = p[y], L = p.indexOf(O);
1107
+ L >= 0 && p.splice(L, 1);
1108
+ var A = O.getNeighborsList();
1109
+ A.forEach(function(C) {
1110
+ if (v.indexOf(C) < 0) {
1111
+ var M = D.get(C), S = M - 1;
1112
+ S == 1 && f.push(C), D.set(C, S);
1113
+ }
1114
+ });
1115
+ }
1116
+ v = v.concat(f), (p.length == 1 || p.length == 2) && (u = !0, E = p[0]);
1117
+ }
1118
+ return E;
1119
+ }, h.prototype.setGraphManager = function(a) {
1120
+ this.graphManager = a;
1121
+ }, N.exports = h;
1122
+ },
1123
+ /* 16 */
1124
+ /***/
1125
+ function(N, I, T) {
1126
+ function o() {
1127
+ }
1128
+ o.seed = 1, o.x = 0, o.nextDouble = function() {
1129
+ return o.x = Math.sin(o.seed++) * 1e4, o.x - Math.floor(o.x);
1130
+ }, N.exports = o;
1131
+ },
1132
+ /* 17 */
1133
+ /***/
1134
+ function(N, I, T) {
1135
+ var o = T(4);
1136
+ function e(t, i) {
1137
+ this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
1138
+ }
1139
+ e.prototype.getWorldOrgX = function() {
1140
+ return this.lworldOrgX;
1141
+ }, e.prototype.setWorldOrgX = function(t) {
1142
+ this.lworldOrgX = t;
1143
+ }, e.prototype.getWorldOrgY = function() {
1144
+ return this.lworldOrgY;
1145
+ }, e.prototype.setWorldOrgY = function(t) {
1146
+ this.lworldOrgY = t;
1147
+ }, e.prototype.getWorldExtX = function() {
1148
+ return this.lworldExtX;
1149
+ }, e.prototype.setWorldExtX = function(t) {
1150
+ this.lworldExtX = t;
1151
+ }, e.prototype.getWorldExtY = function() {
1152
+ return this.lworldExtY;
1153
+ }, e.prototype.setWorldExtY = function(t) {
1154
+ this.lworldExtY = t;
1155
+ }, e.prototype.getDeviceOrgX = function() {
1156
+ return this.ldeviceOrgX;
1157
+ }, e.prototype.setDeviceOrgX = function(t) {
1158
+ this.ldeviceOrgX = t;
1159
+ }, e.prototype.getDeviceOrgY = function() {
1160
+ return this.ldeviceOrgY;
1161
+ }, e.prototype.setDeviceOrgY = function(t) {
1162
+ this.ldeviceOrgY = t;
1163
+ }, e.prototype.getDeviceExtX = function() {
1164
+ return this.ldeviceExtX;
1165
+ }, e.prototype.setDeviceExtX = function(t) {
1166
+ this.ldeviceExtX = t;
1167
+ }, e.prototype.getDeviceExtY = function() {
1168
+ return this.ldeviceExtY;
1169
+ }, e.prototype.setDeviceExtY = function(t) {
1170
+ this.ldeviceExtY = t;
1171
+ }, e.prototype.transformX = function(t) {
1172
+ var i = 0, l = this.lworldExtX;
1173
+ return l != 0 && (i = this.ldeviceOrgX + (t - this.lworldOrgX) * this.ldeviceExtX / l), i;
1174
+ }, e.prototype.transformY = function(t) {
1175
+ var i = 0, l = this.lworldExtY;
1176
+ return l != 0 && (i = this.ldeviceOrgY + (t - this.lworldOrgY) * this.ldeviceExtY / l), i;
1177
+ }, e.prototype.inverseTransformX = function(t) {
1178
+ var i = 0, l = this.ldeviceExtX;
1179
+ return l != 0 && (i = this.lworldOrgX + (t - this.ldeviceOrgX) * this.lworldExtX / l), i;
1180
+ }, e.prototype.inverseTransformY = function(t) {
1181
+ var i = 0, l = this.ldeviceExtY;
1182
+ return l != 0 && (i = this.lworldOrgY + (t - this.ldeviceOrgY) * this.lworldExtY / l), i;
1183
+ }, e.prototype.inverseTransformPoint = function(t) {
1184
+ var i = new o(this.inverseTransformX(t.x), this.inverseTransformY(t.y));
1185
+ return i;
1186
+ }, N.exports = e;
1187
+ },
1188
+ /* 18 */
1189
+ /***/
1190
+ function(N, I, T) {
1191
+ function o(r) {
1192
+ if (Array.isArray(r)) {
1193
+ for (var h = 0, a = Array(r.length); h < r.length; h++)
1194
+ a[h] = r[h];
1195
+ return a;
1196
+ } else
1197
+ return Array.from(r);
1198
+ }
1199
+ var e = T(15), t = T(7), i = T(0), l = T(8), g = T(9);
1200
+ function n() {
1201
+ e.call(this), this.useSmartIdealEdgeLengthCalculation = t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.idealEdgeLength = t.DEFAULT_EDGE_LENGTH, this.springConstant = t.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = t.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = t.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = t.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * t.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = t.MAX_ITERATIONS;
1202
+ }
1203
+ n.prototype = Object.create(e.prototype);
1204
+ for (var d in e)
1205
+ n[d] = e[d];
1206
+ n.prototype.initParameters = function() {
1207
+ e.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1208
+ }, n.prototype.calcIdealEdgeLengths = function() {
1209
+ for (var r, h, a, p, v, D, u = this.getGraphManager().getAllEdges(), E = 0; E < u.length; E++)
1210
+ r = u[E], r.idealLength = this.idealEdgeLength, r.isInterGraph && (a = r.getSource(), p = r.getTarget(), v = r.getSourceInLca().getEstimatedSize(), D = r.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (r.idealLength += v + D - 2 * i.SIMPLE_NODE_SIZE), h = r.getLca().getInclusionTreeDepth(), r.idealLength += t.DEFAULT_EDGE_LENGTH * t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (a.getInclusionTreeDepth() + p.getInclusionTreeDepth() - 2 * h));
1211
+ }, n.prototype.initSpringEmbedder = function() {
1212
+ var r = this.getAllNodes().length;
1213
+ this.incremental ? (r > t.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * t.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (r - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - t.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (r > t.ADAPTATION_LOWER_NODE_LIMIT ? this.coolingFactor = Math.max(t.COOLING_ADAPTATION_FACTOR, 1 - (r - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * (1 - t.COOLING_ADAPTATION_FACTOR)) : this.coolingFactor = 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1214
+ }, n.prototype.calcSpringForces = function() {
1215
+ for (var r = this.getAllEdges(), h, a = 0; a < r.length; a++)
1216
+ h = r[a], this.calcSpringForce(h, h.idealLength);
1217
+ }, n.prototype.calcRepulsionForces = function() {
1218
+ var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, a, p, v, D, u = this.getAllNodes(), E;
1219
+ if (this.useFRGridVariant)
1220
+ for (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && r && this.updateGrid(), E = /* @__PURE__ */ new Set(), a = 0; a < u.length; a++)
1221
+ v = u[a], this.calculateRepulsionForceOfANode(v, E, r, h), E.add(v);
1222
+ else
1223
+ for (a = 0; a < u.length; a++)
1224
+ for (v = u[a], p = a + 1; p < u.length; p++)
1225
+ D = u[p], v.getOwner() == D.getOwner() && this.calcRepulsionForce(v, D);
1226
+ }, n.prototype.calcGravitationalForces = function() {
1227
+ for (var r, h = this.getAllNodesToApplyGravitation(), a = 0; a < h.length; a++)
1228
+ r = h[a], this.calcGravitationalForce(r);
1229
+ }, n.prototype.moveNodes = function() {
1230
+ for (var r = this.getAllNodes(), h, a = 0; a < r.length; a++)
1231
+ h = r[a], h.move();
1232
+ }, n.prototype.calcSpringForce = function(r, h) {
1233
+ var a = r.getSource(), p = r.getTarget(), v, D, u, E;
1234
+ if (this.uniformLeafNodeSizes && a.getChild() == null && p.getChild() == null)
1235
+ r.updateLengthSimple();
1236
+ else if (r.updateLength(), r.isOverlapingSourceAndTarget)
1237
+ return;
1238
+ v = r.getLength(), v != 0 && (D = this.springConstant * (v - h), u = D * (r.lengthX / v), E = D * (r.lengthY / v), a.springForceX += u, a.springForceY += E, p.springForceX -= u, p.springForceY -= E);
1239
+ }, n.prototype.calcRepulsionForce = function(r, h) {
1240
+ var a = r.getRect(), p = h.getRect(), v = new Array(2), D = new Array(4), u, E, y, O, s, f, c;
1241
+ if (a.intersects(p)) {
1242
+ l.calcSeparationAmount(a, p, v, t.DEFAULT_EDGE_LENGTH / 2), f = 2 * v[0], c = 2 * v[1];
1243
+ var L = r.noOfChildren * h.noOfChildren / (r.noOfChildren + h.noOfChildren);
1244
+ r.repulsionForceX -= L * f, r.repulsionForceY -= L * c, h.repulsionForceX += L * f, h.repulsionForceY += L * c;
1245
+ } else
1246
+ this.uniformLeafNodeSizes && r.getChild() == null && h.getChild() == null ? (u = p.getCenterX() - a.getCenterX(), E = p.getCenterY() - a.getCenterY()) : (l.getIntersection(a, p, D), u = D[2] - D[0], E = D[3] - D[1]), Math.abs(u) < t.MIN_REPULSION_DIST && (u = g.sign(u) * t.MIN_REPULSION_DIST), Math.abs(E) < t.MIN_REPULSION_DIST && (E = g.sign(E) * t.MIN_REPULSION_DIST), y = u * u + E * E, O = Math.sqrt(y), s = this.repulsionConstant * r.noOfChildren * h.noOfChildren / y, f = s * u / O, c = s * E / O, r.repulsionForceX -= f, r.repulsionForceY -= c, h.repulsionForceX += f, h.repulsionForceY += c;
1247
+ }, n.prototype.calcGravitationalForce = function(r) {
1248
+ var h, a, p, v, D, u, E, y;
1249
+ h = r.getOwner(), a = (h.getRight() + h.getLeft()) / 2, p = (h.getTop() + h.getBottom()) / 2, v = r.getCenterX() - a, D = r.getCenterY() - p, u = Math.abs(v) + r.getWidth() / 2, E = Math.abs(D) + r.getHeight() / 2, r.getOwner() == this.graphManager.getRoot() ? (y = h.getEstimatedSize() * this.gravityRangeFactor, (u > y || E > y) && (r.gravitationForceX = -this.gravityConstant * v, r.gravitationForceY = -this.gravityConstant * D)) : (y = h.getEstimatedSize() * this.compoundGravityRangeFactor, (u > y || E > y) && (r.gravitationForceX = -this.gravityConstant * v * this.compoundGravityConstant, r.gravitationForceY = -this.gravityConstant * D * this.compoundGravityConstant));
1250
+ }, n.prototype.isConverged = function() {
1251
+ var r, h = !1;
1252
+ return this.totalIterations > this.maxIterations / 3 && (h = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), r = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, r || h;
1253
+ }, n.prototype.animate = function() {
1254
+ this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1255
+ }, n.prototype.calcNoOfChildrenForAllNodes = function() {
1256
+ for (var r, h = this.graphManager.getAllNodes(), a = 0; a < h.length; a++)
1257
+ r = h[a], r.noOfChildren = r.getNoOfChildren();
1258
+ }, n.prototype.calcGrid = function(r) {
1259
+ var h = 0, a = 0;
1260
+ h = parseInt(Math.ceil((r.getRight() - r.getLeft()) / this.repulsionRange)), a = parseInt(Math.ceil((r.getBottom() - r.getTop()) / this.repulsionRange));
1261
+ for (var p = new Array(h), v = 0; v < h; v++)
1262
+ p[v] = new Array(a);
1263
+ for (var v = 0; v < h; v++)
1264
+ for (var D = 0; D < a; D++)
1265
+ p[v][D] = new Array();
1266
+ return p;
1267
+ }, n.prototype.addNodeToGrid = function(r, h, a) {
1268
+ var p = 0, v = 0, D = 0, u = 0;
1269
+ p = parseInt(Math.floor((r.getRect().x - h) / this.repulsionRange)), v = parseInt(Math.floor((r.getRect().width + r.getRect().x - h) / this.repulsionRange)), D = parseInt(Math.floor((r.getRect().y - a) / this.repulsionRange)), u = parseInt(Math.floor((r.getRect().height + r.getRect().y - a) / this.repulsionRange));
1270
+ for (var E = p; E <= v; E++)
1271
+ for (var y = D; y <= u; y++)
1272
+ this.grid[E][y].push(r), r.setGridCoordinates(p, v, D, u);
1273
+ }, n.prototype.updateGrid = function() {
1274
+ var r, h, a = this.getAllNodes();
1275
+ for (this.grid = this.calcGrid(this.graphManager.getRoot()), r = 0; r < a.length; r++)
1276
+ h = a[r], this.addNodeToGrid(h, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1277
+ }, n.prototype.calculateRepulsionForceOfANode = function(r, h, a, p) {
1278
+ if (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && a || p) {
1279
+ var v = /* @__PURE__ */ new Set();
1280
+ r.surrounding = new Array();
1281
+ for (var D, u = this.grid, E = r.startX - 1; E < r.finishX + 2; E++)
1282
+ for (var y = r.startY - 1; y < r.finishY + 2; y++)
1283
+ if (!(E < 0 || y < 0 || E >= u.length || y >= u[0].length)) {
1284
+ for (var O = 0; O < u[E][y].length; O++)
1285
+ if (D = u[E][y][O], !(r.getOwner() != D.getOwner() || r == D) && !h.has(D) && !v.has(D)) {
1286
+ var s = Math.abs(r.getCenterX() - D.getCenterX()) - (r.getWidth() / 2 + D.getWidth() / 2), f = Math.abs(r.getCenterY() - D.getCenterY()) - (r.getHeight() / 2 + D.getHeight() / 2);
1287
+ s <= this.repulsionRange && f <= this.repulsionRange && v.add(D);
1288
+ }
1289
+ }
1290
+ r.surrounding = [].concat(o(v));
1291
+ }
1292
+ for (E = 0; E < r.surrounding.length; E++)
1293
+ this.calcRepulsionForce(r, r.surrounding[E]);
1294
+ }, n.prototype.calcRepulsionRange = function() {
1295
+ return 0;
1296
+ }, N.exports = n;
1297
+ },
1298
+ /* 19 */
1299
+ /***/
1300
+ function(N, I, T) {
1301
+ var o = T(1), e = T(7);
1302
+ function t(l, g, n) {
1303
+ o.call(this, l, g, n), this.idealLength = e.DEFAULT_EDGE_LENGTH;
1304
+ }
1305
+ t.prototype = Object.create(o.prototype);
1306
+ for (var i in o)
1307
+ t[i] = o[i];
1308
+ N.exports = t;
1309
+ },
1310
+ /* 20 */
1311
+ /***/
1312
+ function(N, I, T) {
1313
+ var o = T(3);
1314
+ function e(i, l, g, n) {
1315
+ o.call(this, i, l, g, n), 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 = [];
1316
+ }
1317
+ e.prototype = Object.create(o.prototype);
1318
+ for (var t in o)
1319
+ e[t] = o[t];
1320
+ e.prototype.setGridCoordinates = function(i, l, g, n) {
1321
+ this.startX = i, this.finishX = l, this.startY = g, this.finishY = n;
1322
+ }, N.exports = e;
1323
+ },
1324
+ /* 21 */
1325
+ /***/
1326
+ function(N, I, T) {
1327
+ function o(e, t) {
1328
+ this.width = 0, this.height = 0, e !== null && t !== null && (this.height = t, this.width = e);
1329
+ }
1330
+ o.prototype.getWidth = function() {
1331
+ return this.width;
1332
+ }, o.prototype.setWidth = function(e) {
1333
+ this.width = e;
1334
+ }, o.prototype.getHeight = function() {
1335
+ return this.height;
1336
+ }, o.prototype.setHeight = function(e) {
1337
+ this.height = e;
1338
+ }, N.exports = o;
1339
+ },
1340
+ /* 22 */
1341
+ /***/
1342
+ function(N, I, T) {
1343
+ var o = T(14);
1344
+ function e() {
1345
+ this.map = {}, this.keys = [];
1346
+ }
1347
+ e.prototype.put = function(t, i) {
1348
+ var l = o.createID(t);
1349
+ this.contains(l) || (this.map[l] = i, this.keys.push(t));
1350
+ }, e.prototype.contains = function(t) {
1351
+ return o.createID(t), this.map[t] != null;
1352
+ }, e.prototype.get = function(t) {
1353
+ var i = o.createID(t);
1354
+ return this.map[i];
1355
+ }, e.prototype.keySet = function() {
1356
+ return this.keys;
1357
+ }, N.exports = e;
1358
+ },
1359
+ /* 23 */
1360
+ /***/
1361
+ function(N, I, T) {
1362
+ var o = T(14);
1363
+ function e() {
1364
+ this.set = {};
1365
+ }
1366
+ e.prototype.add = function(t) {
1367
+ var i = o.createID(t);
1368
+ this.contains(i) || (this.set[i] = t);
1369
+ }, e.prototype.remove = function(t) {
1370
+ delete this.set[o.createID(t)];
1371
+ }, e.prototype.clear = function() {
1372
+ this.set = {};
1373
+ }, e.prototype.contains = function(t) {
1374
+ return this.set[o.createID(t)] == t;
1375
+ }, e.prototype.isEmpty = function() {
1376
+ return this.size() === 0;
1377
+ }, e.prototype.size = function() {
1378
+ return Object.keys(this.set).length;
1379
+ }, e.prototype.addAllTo = function(t) {
1380
+ for (var i = Object.keys(this.set), l = i.length, g = 0; g < l; g++)
1381
+ t.push(this.set[i[g]]);
1382
+ }, e.prototype.size = function() {
1383
+ return Object.keys(this.set).length;
1384
+ }, e.prototype.addAll = function(t) {
1385
+ for (var i = t.length, l = 0; l < i; l++) {
1386
+ var g = t[l];
1387
+ this.add(g);
1388
+ }
1389
+ }, N.exports = e;
1390
+ },
1391
+ /* 24 */
1392
+ /***/
1393
+ function(N, I, T) {
1394
+ var o = /* @__PURE__ */ function() {
1395
+ function l(g, n) {
1396
+ for (var d = 0; d < n.length; d++) {
1397
+ var r = n[d];
1398
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(g, r.key, r);
1399
+ }
1400
+ }
1401
+ return function(g, n, d) {
1402
+ return n && l(g.prototype, n), d && l(g, d), g;
1403
+ };
1404
+ }();
1405
+ function e(l, g) {
1406
+ if (!(l instanceof g))
1407
+ throw new TypeError("Cannot call a class as a function");
1408
+ }
1409
+ var t = T(11), i = function() {
1410
+ function l(g, n) {
1411
+ e(this, l), (n !== null || n !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1412
+ var d = void 0;
1413
+ g instanceof t ? d = g.size() : d = g.length, this._quicksort(g, 0, d - 1);
1414
+ }
1415
+ return o(l, [{
1416
+ key: "_quicksort",
1417
+ value: function(n, d, r) {
1418
+ if (d < r) {
1419
+ var h = this._partition(n, d, r);
1420
+ this._quicksort(n, d, h), this._quicksort(n, h + 1, r);
1421
+ }
1422
+ }
1423
+ }, {
1424
+ key: "_partition",
1425
+ value: function(n, d, r) {
1426
+ for (var h = this._get(n, d), a = d, p = r; ; ) {
1427
+ for (; this.compareFunction(h, this._get(n, p)); )
1428
+ p--;
1429
+ for (; this.compareFunction(this._get(n, a), h); )
1430
+ a++;
1431
+ if (a < p)
1432
+ this._swap(n, a, p), a++, p--;
1433
+ else return p;
1434
+ }
1435
+ }
1436
+ }, {
1437
+ key: "_get",
1438
+ value: function(n, d) {
1439
+ return n instanceof t ? n.get_object_at(d) : n[d];
1440
+ }
1441
+ }, {
1442
+ key: "_set",
1443
+ value: function(n, d, r) {
1444
+ n instanceof t ? n.set_object_at(d, r) : n[d] = r;
1445
+ }
1446
+ }, {
1447
+ key: "_swap",
1448
+ value: function(n, d, r) {
1449
+ var h = this._get(n, d);
1450
+ this._set(n, d, this._get(n, r)), this._set(n, r, h);
1451
+ }
1452
+ }, {
1453
+ key: "_defaultCompareFunction",
1454
+ value: function(n, d) {
1455
+ return d > n;
1456
+ }
1457
+ }]), l;
1458
+ }();
1459
+ N.exports = i;
1460
+ },
1461
+ /* 25 */
1462
+ /***/
1463
+ function(N, I, T) {
1464
+ var o = /* @__PURE__ */ function() {
1465
+ function i(l, g) {
1466
+ for (var n = 0; n < g.length; n++) {
1467
+ var d = g[n];
1468
+ d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(l, d.key, d);
1469
+ }
1470
+ }
1471
+ return function(l, g, n) {
1472
+ return g && i(l.prototype, g), n && i(l, n), l;
1473
+ };
1474
+ }();
1475
+ function e(i, l) {
1476
+ if (!(i instanceof l))
1477
+ throw new TypeError("Cannot call a class as a function");
1478
+ }
1479
+ var t = function() {
1480
+ function i(l, g) {
1481
+ var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, d = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1482
+ e(this, i), this.sequence1 = l, this.sequence2 = g, this.match_score = n, this.mismatch_penalty = d, this.gap_penalty = r, this.iMax = l.length + 1, this.jMax = g.length + 1, this.grid = new Array(this.iMax);
1483
+ for (var h = 0; h < this.iMax; h++) {
1484
+ this.grid[h] = new Array(this.jMax);
1485
+ for (var a = 0; a < this.jMax; a++)
1486
+ this.grid[h][a] = 0;
1487
+ }
1488
+ this.tracebackGrid = new Array(this.iMax);
1489
+ for (var p = 0; p < this.iMax; p++) {
1490
+ this.tracebackGrid[p] = new Array(this.jMax);
1491
+ for (var v = 0; v < this.jMax; v++)
1492
+ this.tracebackGrid[p][v] = [null, null, null];
1493
+ }
1494
+ this.alignments = [], this.score = -1, this.computeGrids();
1495
+ }
1496
+ return o(i, [{
1497
+ key: "getScore",
1498
+ value: function() {
1499
+ return this.score;
1500
+ }
1501
+ }, {
1502
+ key: "getAlignments",
1503
+ value: function() {
1504
+ return this.alignments;
1505
+ }
1506
+ // Main dynamic programming procedure
1507
+ }, {
1508
+ key: "computeGrids",
1509
+ value: function() {
1510
+ for (var g = 1; g < this.jMax; g++)
1511
+ this.grid[0][g] = this.grid[0][g - 1] + this.gap_penalty, this.tracebackGrid[0][g] = [!1, !1, !0];
1512
+ for (var n = 1; n < this.iMax; n++)
1513
+ this.grid[n][0] = this.grid[n - 1][0] + this.gap_penalty, this.tracebackGrid[n][0] = [!1, !0, !1];
1514
+ for (var d = 1; d < this.iMax; d++)
1515
+ for (var r = 1; r < this.jMax; r++) {
1516
+ var h = void 0;
1517
+ this.sequence1[d - 1] === this.sequence2[r - 1] ? h = this.grid[d - 1][r - 1] + this.match_score : h = this.grid[d - 1][r - 1] + this.mismatch_penalty;
1518
+ var a = this.grid[d - 1][r] + this.gap_penalty, p = this.grid[d][r - 1] + this.gap_penalty, v = [h, a, p], D = this.arrayAllMaxIndexes(v);
1519
+ this.grid[d][r] = v[D[0]], this.tracebackGrid[d][r] = [D.includes(0), D.includes(1), D.includes(2)];
1520
+ }
1521
+ this.score = this.grid[this.iMax - 1][this.jMax - 1];
1522
+ }
1523
+ // Gets all possible valid sequence combinations
1524
+ }, {
1525
+ key: "alignmentTraceback",
1526
+ value: function() {
1527
+ var g = [];
1528
+ for (g.push({
1529
+ pos: [this.sequence1.length, this.sequence2.length],
1530
+ seq1: "",
1531
+ seq2: ""
1532
+ }); g[0]; ) {
1533
+ var n = g[0], d = this.tracebackGrid[n.pos[0]][n.pos[1]];
1534
+ d[0] && g.push({
1535
+ pos: [n.pos[0] - 1, n.pos[1] - 1],
1536
+ seq1: this.sequence1[n.pos[0] - 1] + n.seq1,
1537
+ seq2: this.sequence2[n.pos[1] - 1] + n.seq2
1538
+ }), d[1] && g.push({
1539
+ pos: [n.pos[0] - 1, n.pos[1]],
1540
+ seq1: this.sequence1[n.pos[0] - 1] + n.seq1,
1541
+ seq2: "-" + n.seq2
1542
+ }), d[2] && g.push({
1543
+ pos: [n.pos[0], n.pos[1] - 1],
1544
+ seq1: "-" + n.seq1,
1545
+ seq2: this.sequence2[n.pos[1] - 1] + n.seq2
1546
+ }), n.pos[0] === 0 && n.pos[1] === 0 && this.alignments.push({
1547
+ sequence1: n.seq1,
1548
+ sequence2: n.seq2
1549
+ }), g.shift();
1550
+ }
1551
+ return this.alignments;
1552
+ }
1553
+ // Helper Functions
1554
+ }, {
1555
+ key: "getAllIndexes",
1556
+ value: function(g, n) {
1557
+ for (var d = [], r = -1; (r = g.indexOf(n, r + 1)) !== -1; )
1558
+ d.push(r);
1559
+ return d;
1560
+ }
1561
+ }, {
1562
+ key: "arrayAllMaxIndexes",
1563
+ value: function(g) {
1564
+ return this.getAllIndexes(g, Math.max.apply(null, g));
1565
+ }
1566
+ }]), i;
1567
+ }();
1568
+ N.exports = t;
1569
+ },
1570
+ /* 26 */
1571
+ /***/
1572
+ function(N, I, T) {
1573
+ var o = function() {
1574
+ };
1575
+ o.FDLayout = T(18), o.FDLayoutConstants = T(7), o.FDLayoutEdge = T(19), o.FDLayoutNode = T(20), o.DimensionD = T(21), o.HashMap = T(22), o.HashSet = T(23), o.IGeometry = T(8), o.IMath = T(9), o.Integer = T(10), o.Point = T(12), o.PointD = T(4), o.RandomSeed = T(16), o.RectangleD = T(13), o.Transform = T(17), o.UniqueIDGeneretor = T(14), o.Quicksort = T(24), o.LinkedList = T(11), o.LGraphObject = T(2), o.LGraph = T(5), o.LEdge = T(1), o.LGraphManager = T(6), o.LNode = T(3), o.Layout = T(15), o.LayoutConstants = T(0), o.NeedlemanWunsch = T(25), N.exports = o;
1576
+ },
1577
+ /* 27 */
1578
+ /***/
1579
+ function(N, I, T) {
1580
+ function o() {
1581
+ this.listeners = [];
1582
+ }
1583
+ var e = o.prototype;
1584
+ e.addListener = function(t, i) {
1585
+ this.listeners.push({
1586
+ event: t,
1587
+ callback: i
1588
+ });
1589
+ }, e.removeListener = function(t, i) {
1590
+ for (var l = this.listeners.length; l >= 0; l--) {
1591
+ var g = this.listeners[l];
1592
+ g.event === t && g.callback === i && this.listeners.splice(l, 1);
1593
+ }
1594
+ }, e.emit = function(t, i) {
1595
+ for (var l = 0; l < this.listeners.length; l++) {
1596
+ var g = this.listeners[l];
1597
+ t === g.event && g.callback(i);
1598
+ }
1599
+ }, N.exports = o;
1600
+ }
1601
+ /******/
1602
+ ])
1603
+ );
1604
+ });
1605
+ }(Q)), Q.exports;
1606
+ }
1607
+ var q;
1608
+ function ft() {
1609
+ return q || (q = 1, function(G, b) {
1610
+ (function(I, T) {
1611
+ G.exports = T(ut());
1612
+ })($, function(N) {
1613
+ return (
1614
+ /******/
1615
+ function(I) {
1616
+ var T = {};
1617
+ function o(e) {
1618
+ if (T[e])
1619
+ return T[e].exports;
1620
+ var t = T[e] = {
1621
+ /******/
1622
+ i: e,
1623
+ /******/
1624
+ l: !1,
1625
+ /******/
1626
+ exports: {}
1627
+ /******/
1628
+ };
1629
+ return I[e].call(t.exports, t, t.exports, o), t.l = !0, t.exports;
1630
+ }
1631
+ return o.m = I, o.c = T, o.i = function(e) {
1632
+ return e;
1633
+ }, o.d = function(e, t, i) {
1634
+ o.o(e, t) || Object.defineProperty(e, t, {
1635
+ /******/
1636
+ configurable: !1,
1637
+ /******/
1638
+ enumerable: !0,
1639
+ /******/
1640
+ get: i
1641
+ /******/
1642
+ });
1643
+ }, o.n = function(e) {
1644
+ var t = e && e.__esModule ? (
1645
+ /******/
1646
+ function() {
1647
+ return e.default;
1648
+ }
1649
+ ) : (
1650
+ /******/
1651
+ function() {
1652
+ return e;
1653
+ }
1654
+ );
1655
+ return o.d(t, "a", t), t;
1656
+ }, o.o = function(e, t) {
1657
+ return Object.prototype.hasOwnProperty.call(e, t);
1658
+ }, o.p = "", o(o.s = 7);
1659
+ }([
1660
+ /* 0 */
1661
+ /***/
1662
+ function(I, T) {
1663
+ I.exports = N;
1664
+ },
1665
+ /* 1 */
1666
+ /***/
1667
+ function(I, T, o) {
1668
+ var e = o(0).FDLayoutConstants;
1669
+ function t() {
1670
+ }
1671
+ for (var i in e)
1672
+ t[i] = e[i];
1673
+ t.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, t.DEFAULT_RADIAL_SEPARATION = e.DEFAULT_EDGE_LENGTH, t.DEFAULT_COMPONENT_SEPERATION = 60, t.TILE = !0, t.TILING_PADDING_VERTICAL = 10, t.TILING_PADDING_HORIZONTAL = 10, t.TREE_REDUCTION_ON_INCREMENTAL = !1, I.exports = t;
1674
+ },
1675
+ /* 2 */
1676
+ /***/
1677
+ function(I, T, o) {
1678
+ var e = o(0).FDLayoutEdge;
1679
+ function t(l, g, n) {
1680
+ e.call(this, l, g, n);
1681
+ }
1682
+ t.prototype = Object.create(e.prototype);
1683
+ for (var i in e)
1684
+ t[i] = e[i];
1685
+ I.exports = t;
1686
+ },
1687
+ /* 3 */
1688
+ /***/
1689
+ function(I, T, o) {
1690
+ var e = o(0).LGraph;
1691
+ function t(l, g, n) {
1692
+ e.call(this, l, g, n);
1693
+ }
1694
+ t.prototype = Object.create(e.prototype);
1695
+ for (var i in e)
1696
+ t[i] = e[i];
1697
+ I.exports = t;
1698
+ },
1699
+ /* 4 */
1700
+ /***/
1701
+ function(I, T, o) {
1702
+ var e = o(0).LGraphManager;
1703
+ function t(l) {
1704
+ e.call(this, l);
1705
+ }
1706
+ t.prototype = Object.create(e.prototype);
1707
+ for (var i in e)
1708
+ t[i] = e[i];
1709
+ I.exports = t;
1710
+ },
1711
+ /* 5 */
1712
+ /***/
1713
+ function(I, T, o) {
1714
+ var e = o(0).FDLayoutNode, t = o(0).IMath;
1715
+ function i(g, n, d, r) {
1716
+ e.call(this, g, n, d, r);
1717
+ }
1718
+ i.prototype = Object.create(e.prototype);
1719
+ for (var l in e)
1720
+ i[l] = e[l];
1721
+ i.prototype.move = function() {
1722
+ var g = this.graphManager.getLayout();
1723
+ this.displacementX = g.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = g.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > g.coolingFactor * g.maxNodeDisplacement && (this.displacementX = g.coolingFactor * g.maxNodeDisplacement * t.sign(this.displacementX)), Math.abs(this.displacementY) > g.coolingFactor * g.maxNodeDisplacement && (this.displacementY = g.coolingFactor * g.maxNodeDisplacement * t.sign(this.displacementY)), this.child == null ? this.moveBy(this.displacementX, this.displacementY) : this.child.getNodes().length == 0 ? this.moveBy(this.displacementX, this.displacementY) : this.propogateDisplacementToChildren(this.displacementX, this.displacementY), g.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;
1724
+ }, i.prototype.propogateDisplacementToChildren = function(g, n) {
1725
+ for (var d = this.getChild().getNodes(), r, h = 0; h < d.length; h++)
1726
+ r = d[h], r.getChild() == null ? (r.moveBy(g, n), r.displacementX += g, r.displacementY += n) : r.propogateDisplacementToChildren(g, n);
1727
+ }, i.prototype.setPred1 = function(g) {
1728
+ this.pred1 = g;
1729
+ }, i.prototype.getPred1 = function() {
1730
+ return pred1;
1731
+ }, i.prototype.getPred2 = function() {
1732
+ return pred2;
1733
+ }, i.prototype.setNext = function(g) {
1734
+ this.next = g;
1735
+ }, i.prototype.getNext = function() {
1736
+ return next;
1737
+ }, i.prototype.setProcessed = function(g) {
1738
+ this.processed = g;
1739
+ }, i.prototype.isProcessed = function() {
1740
+ return processed;
1741
+ }, I.exports = i;
1742
+ },
1743
+ /* 6 */
1744
+ /***/
1745
+ function(I, T, o) {
1746
+ var e = o(0).FDLayout, t = o(4), i = o(3), l = o(5), g = o(2), n = o(1), d = o(0).FDLayoutConstants, r = o(0).LayoutConstants, h = o(0).Point, a = o(0).PointD, p = o(0).Layout, v = o(0).Integer, D = o(0).IGeometry, u = o(0).LGraph, E = o(0).Transform;
1747
+ function y() {
1748
+ e.call(this), this.toBeTiled = {};
1749
+ }
1750
+ y.prototype = Object.create(e.prototype);
1751
+ for (var O in e)
1752
+ y[O] = e[O];
1753
+ y.prototype.newGraphManager = function() {
1754
+ var s = new t(this);
1755
+ return this.graphManager = s, s;
1756
+ }, y.prototype.newGraph = function(s) {
1757
+ return new i(null, this.graphManager, s);
1758
+ }, y.prototype.newNode = function(s) {
1759
+ return new l(this.graphManager, s);
1760
+ }, y.prototype.newEdge = function(s) {
1761
+ return new g(null, null, s);
1762
+ }, y.prototype.initParameters = function() {
1763
+ e.prototype.initParameters.call(this, arguments), this.isSubLayout || (n.DEFAULT_EDGE_LENGTH < 10 ? this.idealEdgeLength = 10 : this.idealEdgeLength = n.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = d.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = d.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = d.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = d.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = d.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / d.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = d.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
1764
+ }, y.prototype.layout = function() {
1765
+ var s = r.DEFAULT_CREATE_BENDS_AS_NEEDED;
1766
+ return s && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1767
+ }, y.prototype.classicLayout = function() {
1768
+ 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) {
1769
+ if (n.TREE_REDUCTION_ON_INCREMENTAL) {
1770
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1771
+ var f = new Set(this.getAllNodes()), c = this.nodesWithGravity.filter(function(m) {
1772
+ return f.has(m);
1773
+ });
1774
+ this.graphManager.setAllNodesToApplyGravitation(c);
1775
+ }
1776
+ } else {
1777
+ var s = this.getFlatForest();
1778
+ if (s.length > 0)
1779
+ this.positionNodesRadially(s);
1780
+ else {
1781
+ this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1782
+ var f = new Set(this.getAllNodes()), c = this.nodesWithGravity.filter(function(L) {
1783
+ return f.has(L);
1784
+ });
1785
+ this.graphManager.setAllNodesToApplyGravitation(c), this.positionNodesRandomly();
1786
+ }
1787
+ }
1788
+ return this.initSpringEmbedder(), this.runSpringEmbedder(), !0;
1789
+ }, y.prototype.tick = function() {
1790
+ if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
1791
+ if (this.prunedNodesAll.length > 0)
1792
+ this.isTreeGrowing = !0;
1793
+ else
1794
+ return !0;
1795
+ if (this.totalIterations % d.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1796
+ if (this.isConverged())
1797
+ if (this.prunedNodesAll.length > 0)
1798
+ this.isTreeGrowing = !0;
1799
+ else
1800
+ return !0;
1801
+ 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));
1802
+ }
1803
+ if (this.isTreeGrowing) {
1804
+ if (this.growTreeIterations % 10 == 0)
1805
+ if (this.prunedNodesAll.length > 0) {
1806
+ this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1807
+ var s = new Set(this.getAllNodes()), f = this.nodesWithGravity.filter(function(A) {
1808
+ return s.has(A);
1809
+ });
1810
+ this.graphManager.setAllNodesToApplyGravitation(f), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = d.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1811
+ } else
1812
+ this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1813
+ this.growTreeIterations++;
1814
+ }
1815
+ if (this.isGrowthFinished) {
1816
+ if (this.isConverged())
1817
+ return !0;
1818
+ this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = d.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1819
+ }
1820
+ var c = !this.isTreeGrowing && !this.isGrowthFinished, L = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1821
+ return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(c, L), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1822
+ }, y.prototype.getPositionsData = function() {
1823
+ for (var s = this.graphManager.getAllNodes(), f = {}, c = 0; c < s.length; c++) {
1824
+ var L = s[c].rect, A = s[c].id;
1825
+ f[A] = {
1826
+ id: A,
1827
+ x: L.getCenterX(),
1828
+ y: L.getCenterY(),
1829
+ w: L.width,
1830
+ h: L.height
1831
+ };
1832
+ }
1833
+ return f;
1834
+ }, y.prototype.runSpringEmbedder = function() {
1835
+ this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1836
+ var s = !1;
1837
+ if (d.ANIMATE === "during")
1838
+ this.emit("layoutstarted");
1839
+ else {
1840
+ for (; !s; )
1841
+ s = this.tick();
1842
+ this.graphManager.updateBounds();
1843
+ }
1844
+ }, y.prototype.calculateNodesToApplyGravitationTo = function() {
1845
+ var s = [], f, c = this.graphManager.getGraphs(), L = c.length, A;
1846
+ for (A = 0; A < L; A++)
1847
+ f = c[A], f.updateConnected(), f.isConnected || (s = s.concat(f.getNodes()));
1848
+ return s;
1849
+ }, y.prototype.createBendpoints = function() {
1850
+ var s = [];
1851
+ s = s.concat(this.graphManager.getAllEdges());
1852
+ var f = /* @__PURE__ */ new Set(), c;
1853
+ for (c = 0; c < s.length; c++) {
1854
+ var L = s[c];
1855
+ if (!f.has(L)) {
1856
+ var A = L.getSource(), m = L.getTarget();
1857
+ if (A == m)
1858
+ L.getBendpoints().push(new a()), L.getBendpoints().push(new a()), this.createDummyNodesForBendpoints(L), f.add(L);
1859
+ else {
1860
+ var R = [];
1861
+ if (R = R.concat(A.getEdgeListToNode(m)), R = R.concat(m.getEdgeListToNode(A)), !f.has(R[0])) {
1862
+ if (R.length > 1) {
1863
+ var C;
1864
+ for (C = 0; C < R.length; C++) {
1865
+ var M = R[C];
1866
+ M.getBendpoints().push(new a()), this.createDummyNodesForBendpoints(M);
1867
+ }
1868
+ }
1869
+ R.forEach(function(S) {
1870
+ f.add(S);
1871
+ });
1872
+ }
1873
+ }
1874
+ }
1875
+ if (f.size == s.length)
1876
+ break;
1877
+ }
1878
+ }, y.prototype.positionNodesRadially = function(s) {
1879
+ for (var f = new h(0, 0), c = Math.ceil(Math.sqrt(s.length)), L = 0, A = 0, m = 0, R = new a(0, 0), C = 0; C < s.length; C++) {
1880
+ C % c == 0 && (m = 0, A = L, C != 0 && (A += n.DEFAULT_COMPONENT_SEPERATION), L = 0);
1881
+ var M = s[C], S = p.findCenterOfTree(M);
1882
+ f.x = m, f.y = A, R = y.radialLayout(M, S, f), R.y > L && (L = Math.floor(R.y)), m = Math.floor(R.x + n.DEFAULT_COMPONENT_SEPERATION);
1883
+ }
1884
+ this.transform(new a(r.WORLD_CENTER_X - R.x / 2, r.WORLD_CENTER_Y - R.y / 2));
1885
+ }, y.radialLayout = function(s, f, c) {
1886
+ var L = Math.max(this.maxDiagonalInTree(s), n.DEFAULT_RADIAL_SEPARATION);
1887
+ y.branchRadialLayout(f, null, 0, 359, 0, L);
1888
+ var A = u.calculateBounds(s), m = new E();
1889
+ m.setDeviceOrgX(A.getMinX()), m.setDeviceOrgY(A.getMinY()), m.setWorldOrgX(c.x), m.setWorldOrgY(c.y);
1890
+ for (var R = 0; R < s.length; R++) {
1891
+ var C = s[R];
1892
+ C.transform(m);
1893
+ }
1894
+ var M = new a(A.getMaxX(), A.getMaxY());
1895
+ return m.inverseTransformPoint(M);
1896
+ }, y.branchRadialLayout = function(s, f, c, L, A, m) {
1897
+ var R = (L - c + 1) / 2;
1898
+ R < 0 && (R += 180);
1899
+ var C = (R + c) % 360, M = C * D.TWO_PI / 360, S = A * Math.cos(M), Y = A * Math.sin(M);
1900
+ s.setCenter(S, Y);
1901
+ var w = [];
1902
+ w = w.concat(s.getEdges());
1903
+ var x = w.length;
1904
+ f != null && x--;
1905
+ for (var F = 0, U = w.length, P, _ = s.getEdgesBetween(f); _.length > 1; ) {
1906
+ var X = _[0];
1907
+ _.splice(0, 1);
1908
+ var H = w.indexOf(X);
1909
+ H >= 0 && w.splice(H, 1), U--, x--;
1910
+ }
1911
+ f != null ? P = (w.indexOf(_[0]) + 1) % U : P = 0;
1912
+ for (var W = Math.abs(L - c) / x, B = P; F != x; B = ++B % U) {
1913
+ var K = w[B].getOtherEnd(s);
1914
+ if (K != f) {
1915
+ var j = (c + F * W) % 360, ht = (j + W) % 360;
1916
+ y.branchRadialLayout(K, s, j, ht, A + m, m), F++;
1917
+ }
1918
+ }
1919
+ }, y.maxDiagonalInTree = function(s) {
1920
+ for (var f = v.MIN_VALUE, c = 0; c < s.length; c++) {
1921
+ var L = s[c], A = L.getDiagonal();
1922
+ A > f && (f = A);
1923
+ }
1924
+ return f;
1925
+ }, y.prototype.calcRepulsionRange = function() {
1926
+ return 2 * (this.level + 1) * this.idealEdgeLength;
1927
+ }, y.prototype.groupZeroDegreeMembers = function() {
1928
+ var s = this, f = {};
1929
+ this.memberGroups = {}, this.idToDummyNode = {};
1930
+ for (var c = [], L = this.graphManager.getAllNodes(), A = 0; A < L.length; A++) {
1931
+ var m = L[A], R = m.getParent();
1932
+ this.getNodeDegreeWithChildren(m) === 0 && (R.id == null || !this.getToBeTiled(R)) && c.push(m);
1933
+ }
1934
+ for (var A = 0; A < c.length; A++) {
1935
+ var m = c[A], C = m.getParent().id;
1936
+ typeof f[C] > "u" && (f[C] = []), f[C] = f[C].concat(m);
1937
+ }
1938
+ Object.keys(f).forEach(function(M) {
1939
+ if (f[M].length > 1) {
1940
+ var S = "DummyCompound_" + M;
1941
+ s.memberGroups[S] = f[M];
1942
+ var Y = f[M][0].getParent(), w = new l(s.graphManager);
1943
+ w.id = S, w.paddingLeft = Y.paddingLeft || 0, w.paddingRight = Y.paddingRight || 0, w.paddingBottom = Y.paddingBottom || 0, w.paddingTop = Y.paddingTop || 0, s.idToDummyNode[S] = w;
1944
+ var x = s.getGraphManager().add(s.newGraph(), w), F = Y.getChild();
1945
+ F.add(w);
1946
+ for (var U = 0; U < f[M].length; U++) {
1947
+ var P = f[M][U];
1948
+ F.remove(P), x.add(P);
1949
+ }
1950
+ }
1951
+ });
1952
+ }, y.prototype.clearCompounds = function() {
1953
+ var s = {}, f = {};
1954
+ this.performDFSOnCompounds();
1955
+ for (var c = 0; c < this.compoundOrder.length; c++)
1956
+ f[this.compoundOrder[c].id] = this.compoundOrder[c], s[this.compoundOrder[c].id] = [].concat(this.compoundOrder[c].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[c].getChild()), this.compoundOrder[c].child = null;
1957
+ this.graphManager.resetAllNodes(), this.tileCompoundMembers(s, f);
1958
+ }, y.prototype.clearZeroDegreeMembers = function() {
1959
+ var s = this, f = this.tiledZeroDegreePack = [];
1960
+ Object.keys(this.memberGroups).forEach(function(c) {
1961
+ var L = s.idToDummyNode[c];
1962
+ f[c] = s.tileNodes(s.memberGroups[c], L.paddingLeft + L.paddingRight), L.rect.width = f[c].width, L.rect.height = f[c].height;
1963
+ });
1964
+ }, y.prototype.repopulateCompounds = function() {
1965
+ for (var s = this.compoundOrder.length - 1; s >= 0; s--) {
1966
+ var f = this.compoundOrder[s], c = f.id, L = f.paddingLeft, A = f.paddingTop;
1967
+ this.adjustLocations(this.tiledMemberPack[c], f.rect.x, f.rect.y, L, A);
1968
+ }
1969
+ }, y.prototype.repopulateZeroDegreeMembers = function() {
1970
+ var s = this, f = this.tiledZeroDegreePack;
1971
+ Object.keys(f).forEach(function(c) {
1972
+ var L = s.idToDummyNode[c], A = L.paddingLeft, m = L.paddingTop;
1973
+ s.adjustLocations(f[c], L.rect.x, L.rect.y, A, m);
1974
+ });
1975
+ }, y.prototype.getToBeTiled = function(s) {
1976
+ var f = s.id;
1977
+ if (this.toBeTiled[f] != null)
1978
+ return this.toBeTiled[f];
1979
+ var c = s.getChild();
1980
+ if (c == null)
1981
+ return this.toBeTiled[f] = !1, !1;
1982
+ for (var L = c.getNodes(), A = 0; A < L.length; A++) {
1983
+ var m = L[A];
1984
+ if (this.getNodeDegree(m) > 0)
1985
+ return this.toBeTiled[f] = !1, !1;
1986
+ if (m.getChild() == null) {
1987
+ this.toBeTiled[m.id] = !1;
1988
+ continue;
1989
+ }
1990
+ if (!this.getToBeTiled(m))
1991
+ return this.toBeTiled[f] = !1, !1;
1992
+ }
1993
+ return this.toBeTiled[f] = !0, !0;
1994
+ }, y.prototype.getNodeDegree = function(s) {
1995
+ s.id;
1996
+ for (var f = s.getEdges(), c = 0, L = 0; L < f.length; L++) {
1997
+ var A = f[L];
1998
+ A.getSource().id !== A.getTarget().id && (c = c + 1);
1999
+ }
2000
+ return c;
2001
+ }, y.prototype.getNodeDegreeWithChildren = function(s) {
2002
+ var f = this.getNodeDegree(s);
2003
+ if (s.getChild() == null)
2004
+ return f;
2005
+ for (var c = s.getChild().getNodes(), L = 0; L < c.length; L++) {
2006
+ var A = c[L];
2007
+ f += this.getNodeDegreeWithChildren(A);
2008
+ }
2009
+ return f;
2010
+ }, y.prototype.performDFSOnCompounds = function() {
2011
+ this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
2012
+ }, y.prototype.fillCompexOrderByDFS = function(s) {
2013
+ for (var f = 0; f < s.length; f++) {
2014
+ var c = s[f];
2015
+ c.getChild() != null && this.fillCompexOrderByDFS(c.getChild().getNodes()), this.getToBeTiled(c) && this.compoundOrder.push(c);
2016
+ }
2017
+ }, y.prototype.adjustLocations = function(s, f, c, L, A) {
2018
+ f += L, c += A;
2019
+ for (var m = f, R = 0; R < s.rows.length; R++) {
2020
+ var C = s.rows[R];
2021
+ f = m;
2022
+ for (var M = 0, S = 0; S < C.length; S++) {
2023
+ var Y = C[S];
2024
+ Y.rect.x = f, Y.rect.y = c, f += Y.rect.width + s.horizontalPadding, Y.rect.height > M && (M = Y.rect.height);
2025
+ }
2026
+ c += M + s.verticalPadding;
2027
+ }
2028
+ }, y.prototype.tileCompoundMembers = function(s, f) {
2029
+ var c = this;
2030
+ this.tiledMemberPack = [], Object.keys(s).forEach(function(L) {
2031
+ var A = f[L];
2032
+ c.tiledMemberPack[L] = c.tileNodes(s[L], A.paddingLeft + A.paddingRight), A.rect.width = c.tiledMemberPack[L].width, A.rect.height = c.tiledMemberPack[L].height;
2033
+ });
2034
+ }, y.prototype.tileNodes = function(s, f) {
2035
+ var c = n.TILING_PADDING_VERTICAL, L = n.TILING_PADDING_HORIZONTAL, A = {
2036
+ rows: [],
2037
+ rowWidth: [],
2038
+ rowHeight: [],
2039
+ width: 0,
2040
+ height: f,
2041
+ // assume minHeight equals to minWidth
2042
+ verticalPadding: c,
2043
+ horizontalPadding: L
2044
+ };
2045
+ s.sort(function(C, M) {
2046
+ return C.rect.width * C.rect.height > M.rect.width * M.rect.height ? -1 : C.rect.width * C.rect.height < M.rect.width * M.rect.height ? 1 : 0;
2047
+ });
2048
+ for (var m = 0; m < s.length; m++) {
2049
+ var R = s[m];
2050
+ A.rows.length == 0 ? this.insertNodeToRow(A, R, 0, f) : this.canAddHorizontal(A, R.rect.width, R.rect.height) ? this.insertNodeToRow(A, R, this.getShortestRowIndex(A), f) : this.insertNodeToRow(A, R, A.rows.length, f), this.shiftToLastRow(A);
2051
+ }
2052
+ return A;
2053
+ }, y.prototype.insertNodeToRow = function(s, f, c, L) {
2054
+ var A = L;
2055
+ if (c == s.rows.length) {
2056
+ var m = [];
2057
+ s.rows.push(m), s.rowWidth.push(A), s.rowHeight.push(0);
2058
+ }
2059
+ var R = s.rowWidth[c] + f.rect.width;
2060
+ s.rows[c].length > 0 && (R += s.horizontalPadding), s.rowWidth[c] = R, s.width < R && (s.width = R);
2061
+ var C = f.rect.height;
2062
+ c > 0 && (C += s.verticalPadding);
2063
+ var M = 0;
2064
+ C > s.rowHeight[c] && (M = s.rowHeight[c], s.rowHeight[c] = C, M = s.rowHeight[c] - M), s.height += M, s.rows[c].push(f);
2065
+ }, y.prototype.getShortestRowIndex = function(s) {
2066
+ for (var f = -1, c = Number.MAX_VALUE, L = 0; L < s.rows.length; L++)
2067
+ s.rowWidth[L] < c && (f = L, c = s.rowWidth[L]);
2068
+ return f;
2069
+ }, y.prototype.getLongestRowIndex = function(s) {
2070
+ for (var f = -1, c = Number.MIN_VALUE, L = 0; L < s.rows.length; L++)
2071
+ s.rowWidth[L] > c && (f = L, c = s.rowWidth[L]);
2072
+ return f;
2073
+ }, y.prototype.canAddHorizontal = function(s, f, c) {
2074
+ var L = this.getShortestRowIndex(s);
2075
+ if (L < 0)
2076
+ return !0;
2077
+ var A = s.rowWidth[L];
2078
+ if (A + s.horizontalPadding + f <= s.width) return !0;
2079
+ var m = 0;
2080
+ s.rowHeight[L] < c && L > 0 && (m = c + s.verticalPadding - s.rowHeight[L]);
2081
+ var R;
2082
+ s.width - A >= f + s.horizontalPadding ? R = (s.height + m) / (A + f + s.horizontalPadding) : R = (s.height + m) / s.width, m = c + s.verticalPadding;
2083
+ var C;
2084
+ return s.width < f ? C = (s.height + m) / f : C = (s.height + m) / s.width, C < 1 && (C = 1 / C), R < 1 && (R = 1 / R), R < C;
2085
+ }, y.prototype.shiftToLastRow = function(s) {
2086
+ var f = this.getLongestRowIndex(s), c = s.rowWidth.length - 1, L = s.rows[f], A = L[L.length - 1], m = A.width + s.horizontalPadding;
2087
+ if (s.width - s.rowWidth[c] > m && f != c) {
2088
+ L.splice(-1, 1), s.rows[c].push(A), s.rowWidth[f] = s.rowWidth[f] - m, s.rowWidth[c] = s.rowWidth[c] + m, s.width = s.rowWidth[instance.getLongestRowIndex(s)];
2089
+ for (var R = Number.MIN_VALUE, C = 0; C < L.length; C++)
2090
+ L[C].height > R && (R = L[C].height);
2091
+ f > 0 && (R += s.verticalPadding);
2092
+ var M = s.rowHeight[f] + s.rowHeight[c];
2093
+ s.rowHeight[f] = R, s.rowHeight[c] < A.height + s.verticalPadding && (s.rowHeight[c] = A.height + s.verticalPadding);
2094
+ var S = s.rowHeight[f] + s.rowHeight[c];
2095
+ s.height += S - M, this.shiftToLastRow(s);
2096
+ }
2097
+ }, y.prototype.tilingPreLayout = function() {
2098
+ n.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
2099
+ }, y.prototype.tilingPostLayout = function() {
2100
+ n.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
2101
+ }, y.prototype.reduceTrees = function() {
2102
+ for (var s = [], f = !0, c; f; ) {
2103
+ var L = this.graphManager.getAllNodes(), A = [];
2104
+ f = !1;
2105
+ for (var m = 0; m < L.length; m++)
2106
+ c = L[m], c.getEdges().length == 1 && !c.getEdges()[0].isInterGraph && c.getChild() == null && (A.push([c, c.getEdges()[0], c.getOwner()]), f = !0);
2107
+ if (f == !0) {
2108
+ for (var R = [], C = 0; C < A.length; C++)
2109
+ A[C][0].getEdges().length == 1 && (R.push(A[C]), A[C][0].getOwner().remove(A[C][0]));
2110
+ s.push(R), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2111
+ }
2112
+ }
2113
+ this.prunedNodesAll = s;
2114
+ }, y.prototype.growTree = function(s) {
2115
+ for (var f = s.length, c = s[f - 1], L, A = 0; A < c.length; A++)
2116
+ L = c[A], this.findPlaceforPrunedNode(L), L[2].add(L[0]), L[2].add(L[1], L[1].source, L[1].target);
2117
+ s.splice(s.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
2118
+ }, y.prototype.findPlaceforPrunedNode = function(s) {
2119
+ var f, c, L = s[0];
2120
+ L == s[1].source ? c = s[1].target : c = s[1].source;
2121
+ var A = c.startX, m = c.finishX, R = c.startY, C = c.finishY, M = 0, S = 0, Y = 0, w = 0, x = [M, Y, S, w];
2122
+ if (R > 0)
2123
+ for (var F = A; F <= m; F++)
2124
+ x[0] += this.grid[F][R - 1].length + this.grid[F][R].length - 1;
2125
+ if (m < this.grid.length - 1)
2126
+ for (var F = R; F <= C; F++)
2127
+ x[1] += this.grid[m + 1][F].length + this.grid[m][F].length - 1;
2128
+ if (C < this.grid[0].length - 1)
2129
+ for (var F = A; F <= m; F++)
2130
+ x[2] += this.grid[F][C + 1].length + this.grid[F][C].length - 1;
2131
+ if (A > 0)
2132
+ for (var F = R; F <= C; F++)
2133
+ x[3] += this.grid[A - 1][F].length + this.grid[A][F].length - 1;
2134
+ for (var U = v.MAX_VALUE, P, _, X = 0; X < x.length; X++)
2135
+ x[X] < U ? (U = x[X], P = 1, _ = X) : x[X] == U && P++;
2136
+ if (P == 3 && U == 0)
2137
+ x[0] == 0 && x[1] == 0 && x[2] == 0 ? f = 1 : x[0] == 0 && x[1] == 0 && x[3] == 0 ? f = 0 : x[0] == 0 && x[2] == 0 && x[3] == 0 ? f = 3 : x[1] == 0 && x[2] == 0 && x[3] == 0 && (f = 2);
2138
+ else if (P == 2 && U == 0) {
2139
+ var H = Math.floor(Math.random() * 2);
2140
+ x[0] == 0 && x[1] == 0 ? H == 0 ? f = 0 : f = 1 : x[0] == 0 && x[2] == 0 ? H == 0 ? f = 0 : f = 2 : x[0] == 0 && x[3] == 0 ? H == 0 ? f = 0 : f = 3 : x[1] == 0 && x[2] == 0 ? H == 0 ? f = 1 : f = 2 : x[1] == 0 && x[3] == 0 ? H == 0 ? f = 1 : f = 3 : H == 0 ? f = 2 : f = 3;
2141
+ } else if (P == 4 && U == 0) {
2142
+ var H = Math.floor(Math.random() * 4);
2143
+ f = H;
2144
+ } else
2145
+ f = _;
2146
+ f == 0 ? L.setCenter(c.getCenterX(), c.getCenterY() - c.getHeight() / 2 - d.DEFAULT_EDGE_LENGTH - L.getHeight() / 2) : f == 1 ? L.setCenter(c.getCenterX() + c.getWidth() / 2 + d.DEFAULT_EDGE_LENGTH + L.getWidth() / 2, c.getCenterY()) : f == 2 ? L.setCenter(c.getCenterX(), c.getCenterY() + c.getHeight() / 2 + d.DEFAULT_EDGE_LENGTH + L.getHeight() / 2) : L.setCenter(c.getCenterX() - c.getWidth() / 2 - d.DEFAULT_EDGE_LENGTH - L.getWidth() / 2, c.getCenterY());
2147
+ }, I.exports = y;
2148
+ },
2149
+ /* 7 */
2150
+ /***/
2151
+ function(I, T, o) {
2152
+ var e = {};
2153
+ e.layoutBase = o(0), e.CoSEConstants = o(1), e.CoSEEdge = o(2), e.CoSEGraph = o(3), e.CoSEGraphManager = o(4), e.CoSELayout = o(6), e.CoSENode = o(5), I.exports = e;
2154
+ }
2155
+ /******/
2156
+ ])
2157
+ );
2158
+ });
2159
+ }(Z)), Z.exports;
2160
+ }
2161
+ (function(G, b) {
2162
+ (function(I, T) {
2163
+ G.exports = T(ft());
2164
+ })($, function(N) {
2165
+ return (
2166
+ /******/
2167
+ function(I) {
2168
+ var T = {};
2169
+ function o(e) {
2170
+ if (T[e])
2171
+ return T[e].exports;
2172
+ var t = T[e] = {
2173
+ /******/
2174
+ i: e,
2175
+ /******/
2176
+ l: !1,
2177
+ /******/
2178
+ exports: {}
2179
+ /******/
2180
+ };
2181
+ return I[e].call(t.exports, t, t.exports, o), t.l = !0, t.exports;
2182
+ }
2183
+ return o.m = I, o.c = T, o.i = function(e) {
2184
+ return e;
2185
+ }, o.d = function(e, t, i) {
2186
+ o.o(e, t) || Object.defineProperty(e, t, {
2187
+ /******/
2188
+ configurable: !1,
2189
+ /******/
2190
+ enumerable: !0,
2191
+ /******/
2192
+ get: i
2193
+ /******/
2194
+ });
2195
+ }, o.n = function(e) {
2196
+ var t = e && e.__esModule ? (
2197
+ /******/
2198
+ function() {
2199
+ return e.default;
2200
+ }
2201
+ ) : (
2202
+ /******/
2203
+ function() {
2204
+ return e;
2205
+ }
2206
+ );
2207
+ return o.d(t, "a", t), t;
2208
+ }, o.o = function(e, t) {
2209
+ return Object.prototype.hasOwnProperty.call(e, t);
2210
+ }, o.p = "", o(o.s = 1);
2211
+ }([
2212
+ /* 0 */
2213
+ /***/
2214
+ function(I, T) {
2215
+ I.exports = N;
2216
+ },
2217
+ /* 1 */
2218
+ /***/
2219
+ function(I, T, o) {
2220
+ var e = o(0).layoutBase.LayoutConstants, t = o(0).layoutBase.FDLayoutConstants, i = o(0).CoSEConstants, l = o(0).CoSELayout, g = o(0).CoSENode, n = o(0).layoutBase.PointD, d = o(0).layoutBase.DimensionD, r = {
2221
+ // Called on `layoutready`
2222
+ ready: function() {
2223
+ },
2224
+ // Called on `layoutstop`
2225
+ stop: function() {
2226
+ },
2227
+ // 'draft', 'default' or 'proof"
2228
+ // - 'draft' fast cooling rate
2229
+ // - 'default' moderate cooling rate
2230
+ // - "proof" slow cooling rate
2231
+ quality: "default",
2232
+ // include labels in node dimensions
2233
+ nodeDimensionsIncludeLabels: !1,
2234
+ // number of ticks per frame; higher is faster but more jerky
2235
+ refresh: 30,
2236
+ // Whether to fit the network view after when done
2237
+ fit: !0,
2238
+ // Padding on fit
2239
+ padding: 10,
2240
+ // Whether to enable incremental mode
2241
+ randomize: !0,
2242
+ // Node repulsion (non overlapping) multiplier
2243
+ nodeRepulsion: 4500,
2244
+ // Ideal edge (non nested) length
2245
+ idealEdgeLength: 50,
2246
+ // Divisor to compute edge forces
2247
+ edgeElasticity: 0.45,
2248
+ // Nesting factor (multiplier) to compute ideal edge length for nested edges
2249
+ nestingFactor: 0.1,
2250
+ // Gravity force (constant)
2251
+ gravity: 0.25,
2252
+ // Maximum number of iterations to perform
2253
+ numIter: 2500,
2254
+ // For enabling tiling
2255
+ tile: !0,
2256
+ // Type of layout animation. The option set is {'during', 'end', false}
2257
+ animate: "end",
2258
+ // Duration for animate:end
2259
+ animationDuration: 500,
2260
+ // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)
2261
+ tilingPaddingVertical: 10,
2262
+ // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)
2263
+ tilingPaddingHorizontal: 10,
2264
+ // Gravity range (constant) for compounds
2265
+ gravityRangeCompound: 1.5,
2266
+ // Gravity force (constant) for compounds
2267
+ gravityCompound: 1,
2268
+ // Gravity range (constant)
2269
+ gravityRange: 3.8,
2270
+ // Initial cooling factor for incremental layout
2271
+ initialEnergyOnIncremental: 0.5
2272
+ };
2273
+ function h(D, u) {
2274
+ var E = {};
2275
+ for (var y in D)
2276
+ E[y] = D[y];
2277
+ for (var y in u)
2278
+ E[y] = u[y];
2279
+ return E;
2280
+ }
2281
+ function a(D) {
2282
+ this.options = h(r, D), p(this.options);
2283
+ }
2284
+ var p = function(u) {
2285
+ u.nodeRepulsion != null && (i.DEFAULT_REPULSION_STRENGTH = t.DEFAULT_REPULSION_STRENGTH = u.nodeRepulsion), u.idealEdgeLength != null && (i.DEFAULT_EDGE_LENGTH = t.DEFAULT_EDGE_LENGTH = u.idealEdgeLength), u.edgeElasticity != null && (i.DEFAULT_SPRING_STRENGTH = t.DEFAULT_SPRING_STRENGTH = u.edgeElasticity), u.nestingFactor != null && (i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = u.nestingFactor), u.gravity != null && (i.DEFAULT_GRAVITY_STRENGTH = t.DEFAULT_GRAVITY_STRENGTH = u.gravity), u.numIter != null && (i.MAX_ITERATIONS = t.MAX_ITERATIONS = u.numIter), u.gravityRange != null && (i.DEFAULT_GRAVITY_RANGE_FACTOR = t.DEFAULT_GRAVITY_RANGE_FACTOR = u.gravityRange), u.gravityCompound != null && (i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH = u.gravityCompound), u.gravityRangeCompound != null && (i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = u.gravityRangeCompound), u.initialEnergyOnIncremental != null && (i.DEFAULT_COOLING_FACTOR_INCREMENTAL = t.DEFAULT_COOLING_FACTOR_INCREMENTAL = u.initialEnergyOnIncremental), u.quality == "draft" ? e.QUALITY = 0 : u.quality == "proof" ? e.QUALITY = 2 : e.QUALITY = 1, i.NODE_DIMENSIONS_INCLUDE_LABELS = t.NODE_DIMENSIONS_INCLUDE_LABELS = e.NODE_DIMENSIONS_INCLUDE_LABELS = u.nodeDimensionsIncludeLabels, i.DEFAULT_INCREMENTAL = t.DEFAULT_INCREMENTAL = e.DEFAULT_INCREMENTAL = !u.randomize, i.ANIMATE = t.ANIMATE = e.ANIMATE = u.animate, i.TILE = u.tile, i.TILING_PADDING_VERTICAL = typeof u.tilingPaddingVertical == "function" ? u.tilingPaddingVertical.call() : u.tilingPaddingVertical, i.TILING_PADDING_HORIZONTAL = typeof u.tilingPaddingHorizontal == "function" ? u.tilingPaddingHorizontal.call() : u.tilingPaddingHorizontal;
2286
+ };
2287
+ a.prototype.run = function() {
2288
+ var D, u, E = this.options;
2289
+ this.idToLNode = {};
2290
+ var y = this.layout = new l(), O = this;
2291
+ O.stopped = !1, this.cy = this.options.cy, this.cy.trigger({ type: "layoutstart", layout: this });
2292
+ var s = y.newGraphManager();
2293
+ this.gm = s;
2294
+ var f = this.options.eles.nodes(), c = this.options.eles.edges();
2295
+ this.root = s.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(f), y);
2296
+ for (var L = 0; L < c.length; L++) {
2297
+ var A = c[L], m = this.idToLNode[A.data("source")], R = this.idToLNode[A.data("target")];
2298
+ if (m !== R && m.getEdgesBetween(R).length == 0) {
2299
+ var C = s.add(y.newEdge(), m, R);
2300
+ C.id = A.id();
2301
+ }
2302
+ }
2303
+ var M = function(w, x) {
2304
+ typeof w == "number" && (w = x);
2305
+ var F = w.data("id"), U = O.idToLNode[F];
2306
+ return {
2307
+ x: U.getRect().getCenterX(),
2308
+ y: U.getRect().getCenterY()
2309
+ };
2310
+ }, S = function Y() {
2311
+ for (var w = function() {
2312
+ E.fit && E.cy.fit(E.eles, E.padding), D || (D = !0, O.cy.one("layoutready", E.ready), O.cy.trigger({ type: "layoutready", layout: O }));
2313
+ }, x = O.options.refresh, F, U = 0; U < x && !F; U++)
2314
+ F = O.stopped || O.layout.tick();
2315
+ if (F) {
2316
+ y.checkLayoutSuccess() && !y.isSubLayout && y.doPostLayout(), y.tilingPostLayout && y.tilingPostLayout(), y.isLayoutFinished = !0, O.options.eles.nodes().positions(M), w(), O.cy.one("layoutstop", O.options.stop), O.cy.trigger({ type: "layoutstop", layout: O }), u && cancelAnimationFrame(u), D = !1;
2317
+ return;
2318
+ }
2319
+ var P = O.layout.getPositionsData();
2320
+ E.eles.nodes().positions(function(_, X) {
2321
+ if (typeof _ == "number" && (_ = X), !_.isParent()) {
2322
+ for (var H = _.id(), W = P[H], B = _; W == null && (W = P[B.data("parent")] || P["DummyCompound_" + B.data("parent")], P[H] = W, B = B.parent()[0], B != null); )
2323
+ ;
2324
+ return W != null ? {
2325
+ x: W.x,
2326
+ y: W.y
2327
+ } : {
2328
+ x: _.position("x"),
2329
+ y: _.position("y")
2330
+ };
2331
+ }
2332
+ }), w(), u = requestAnimationFrame(Y);
2333
+ };
2334
+ return y.addListener("layoutstarted", function() {
2335
+ O.options.animate === "during" && (u = requestAnimationFrame(S));
2336
+ }), y.runLayout(), this.options.animate !== "during" && (O.options.eles.nodes().not(":parent").layoutPositions(O, O.options, M), D = !1), this;
2337
+ }, a.prototype.getTopMostNodes = function(D) {
2338
+ for (var u = {}, E = 0; E < D.length; E++)
2339
+ u[D[E].id()] = !0;
2340
+ var y = D.filter(function(O, s) {
2341
+ typeof O == "number" && (O = s);
2342
+ for (var f = O.parent()[0]; f != null; ) {
2343
+ if (u[f.id()])
2344
+ return !1;
2345
+ f = f.parent()[0];
2346
+ }
2347
+ return !0;
2348
+ });
2349
+ return y;
2350
+ }, a.prototype.processChildrenList = function(D, u, E) {
2351
+ for (var y = u.length, O = 0; O < y; O++) {
2352
+ var s = u[O], f = s.children(), c, L = s.layoutDimensions({
2353
+ nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels
2354
+ });
2355
+ if (s.outerWidth() != null && s.outerHeight() != null ? c = D.add(new g(E.graphManager, new n(s.position("x") - L.w / 2, s.position("y") - L.h / 2), new d(parseFloat(L.w), parseFloat(L.h)))) : c = D.add(new g(this.graphManager)), c.id = s.data("id"), c.paddingLeft = parseInt(s.css("padding")), c.paddingTop = parseInt(s.css("padding")), c.paddingRight = parseInt(s.css("padding")), c.paddingBottom = parseInt(s.css("padding")), this.options.nodeDimensionsIncludeLabels && s.isParent()) {
2356
+ var A = s.boundingBox({ includeLabels: !0, includeNodes: !1 }).w, m = s.boundingBox({ includeLabels: !0, includeNodes: !1 }).h, R = s.css("text-halign");
2357
+ c.labelWidth = A, c.labelHeight = m, c.labelPos = R;
2358
+ }
2359
+ if (this.idToLNode[s.data("id")] = c, isNaN(c.rect.x) && (c.rect.x = 0), isNaN(c.rect.y) && (c.rect.y = 0), f != null && f.length > 0) {
2360
+ var C;
2361
+ C = E.getGraphManager().add(E.newGraph(), c), this.processChildrenList(C, f, E);
2362
+ }
2363
+ }
2364
+ }, a.prototype.stop = function() {
2365
+ return this.stopped = !0, this;
2366
+ };
2367
+ var v = function(u) {
2368
+ u("layout", "cose-bilkent", a);
2369
+ };
2370
+ typeof cytoscape < "u" && v(cytoscape), I.exports = v;
2371
+ }
2372
+ /******/
2373
+ ])
2374
+ );
2375
+ });
2376
+ })(tt);
2377
+ var ct = tt.exports;
2378
+ const pt = /* @__PURE__ */ lt(ct);
2379
+ z.use(pt);
2380
+ function et(G, b) {
2381
+ G.forEach((N) => {
2382
+ const I = {
2383
+ id: N.id,
2384
+ labelText: N.label,
2385
+ height: N.height,
2386
+ width: N.width,
2387
+ padding: N.padding ?? 0
2388
+ };
2389
+ Object.keys(N).forEach((T) => {
2390
+ ["id", "label", "height", "width", "padding", "x", "y"].includes(T) || (I[T] = N[T]);
2391
+ }), b.add({
2392
+ group: "nodes",
2393
+ data: I,
2394
+ position: {
2395
+ x: N.x ?? 0,
2396
+ y: N.y ?? 0
2397
+ }
2398
+ });
2399
+ });
2400
+ }
2401
+ V(et, "addNodes");
2402
+ function rt(G, b) {
2403
+ G.forEach((N) => {
2404
+ const I = {
2405
+ id: N.id,
2406
+ source: N.start,
2407
+ target: N.end
2408
+ };
2409
+ Object.keys(N).forEach((T) => {
2410
+ ["id", "start", "end"].includes(T) || (I[T] = N[T]);
2411
+ }), b.add({
2412
+ group: "edges",
2413
+ data: I
2414
+ });
2415
+ });
2416
+ }
2417
+ V(rt, "addEdges");
2418
+ function it(G) {
2419
+ return new Promise((b) => {
2420
+ const N = gt("body").append("div").attr("id", "cy").attr("style", "display:none"), I = z({
2421
+ container: document.getElementById("cy"),
2422
+ // container to render in
2423
+ style: [
2424
+ {
2425
+ selector: "edge",
2426
+ style: {
2427
+ "curve-style": "bezier"
2428
+ }
2429
+ }
2430
+ ]
2431
+ });
2432
+ N.remove(), et(G.nodes, I), rt(G.edges, I), I.nodes().forEach(function(o) {
2433
+ o.layoutDimensions = () => {
2434
+ const e = o.data();
2435
+ return { w: e.width, h: e.height };
2436
+ };
2437
+ });
2438
+ const T = {
2439
+ name: "cose-bilkent",
2440
+ // @ts-ignore Types for cose-bilkent are not correct?
2441
+ quality: "proof",
2442
+ styleEnabled: !1,
2443
+ animate: !1
2444
+ };
2445
+ I.layout(T).run(), I.ready((o) => {
2446
+ k.info("Cytoscape ready", o), b(I);
2447
+ });
2448
+ });
2449
+ }
2450
+ V(it, "createCytoscapeInstance");
2451
+ function nt(G) {
2452
+ return G.nodes().map((b) => {
2453
+ const N = b.data(), I = b.position(), T = {
2454
+ id: N.id,
2455
+ x: I.x,
2456
+ y: I.y
2457
+ };
2458
+ return Object.keys(N).forEach((o) => {
2459
+ o !== "id" && (T[o] = N[o]);
2460
+ }), T;
2461
+ });
2462
+ }
2463
+ V(nt, "extractPositionedNodes");
2464
+ function ot(G) {
2465
+ return G.edges().map((b) => {
2466
+ const N = b.data(), I = b._private.rscratch, T = {
2467
+ id: N.id,
2468
+ source: N.source,
2469
+ target: N.target,
2470
+ startX: I.startX,
2471
+ startY: I.startY,
2472
+ midX: I.midX,
2473
+ midY: I.midY,
2474
+ endX: I.endX,
2475
+ endY: I.endY
2476
+ };
2477
+ return Object.keys(N).forEach((o) => {
2478
+ ["id", "source", "target"].includes(o) || (T[o] = N[o]);
2479
+ }), T;
2480
+ });
2481
+ }
2482
+ V(ot, "extractPositionedEdges");
2483
+ async function st(G, b) {
2484
+ k.debug("Starting cose-bilkent layout algorithm");
2485
+ try {
2486
+ at(G);
2487
+ const N = await it(G), I = nt(N), T = ot(N);
2488
+ return k.debug(`Layout completed: ${I.length} nodes, ${T.length} edges`), {
2489
+ nodes: I,
2490
+ edges: T
2491
+ };
2492
+ } catch (N) {
2493
+ throw k.error("Error in cose-bilkent layout algorithm:", N), N;
2494
+ }
2495
+ }
2496
+ V(st, "executeCoseBilkentLayout");
2497
+ function at(G) {
2498
+ if (!G)
2499
+ throw new Error("Layout data is required");
2500
+ if (!G.config)
2501
+ throw new Error("Configuration is required in layout data");
2502
+ if (!G.rootNode)
2503
+ throw new Error("Root node is required");
2504
+ if (!G.nodes || !Array.isArray(G.nodes))
2505
+ throw new Error("No nodes found in layout data");
2506
+ if (!Array.isArray(G.edges))
2507
+ throw new Error("Edges array is required in layout data");
2508
+ return !0;
2509
+ }
2510
+ V(at, "validateLayoutData");
2511
+ var dt = /* @__PURE__ */ V(async (G, b, {
2512
+ insertCluster: N,
2513
+ insertEdge: I,
2514
+ insertEdgeLabel: T,
2515
+ insertMarkers: o,
2516
+ insertNode: e,
2517
+ log: t,
2518
+ positionEdgeLabel: i
2519
+ }, { algorithm: l }) => {
2520
+ const g = {}, n = {}, d = b.select("g");
2521
+ o(d, G.markers, G.type, G.diagramId);
2522
+ const r = d.insert("g").attr("class", "subgraphs"), h = d.insert("g").attr("class", "edgePaths"), a = d.insert("g").attr("class", "edgeLabels"), p = d.insert("g").attr("class", "nodes");
2523
+ t.debug("Inserting nodes into DOM for dimension calculation"), await Promise.all(
2524
+ G.nodes.map(async (u) => {
2525
+ if (u.isGroup) {
2526
+ const E = { ...u };
2527
+ n[u.id] = E, g[u.id] = E, await N(r, u);
2528
+ } else {
2529
+ const E = { ...u };
2530
+ g[u.id] = E;
2531
+ const y = await e(p, u, {
2532
+ config: G.config,
2533
+ dir: G.direction || "TB"
2534
+ }), O = y.node().getBBox();
2535
+ E.width = O.width, E.height = O.height, E.domId = y, t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`);
2536
+ }
2537
+ })
2538
+ ), t.debug("Running cose-bilkent layout algorithm");
2539
+ const v = {
2540
+ ...G,
2541
+ nodes: G.nodes.map((u) => {
2542
+ const E = g[u.id];
2543
+ return {
2544
+ ...u,
2545
+ width: E.width,
2546
+ height: E.height
2547
+ };
2548
+ })
2549
+ }, D = await st(v, G.config);
2550
+ t.debug("Positioning nodes based on layout results"), D.nodes.forEach((u) => {
2551
+ const E = g[u.id];
2552
+ E != null && E.domId && (E.domId.attr(
2553
+ "transform",
2554
+ `translate(${u.x}, ${u.y})`
2555
+ ), E.x = u.x, E.y = u.y, t.debug(`Positioned node ${E.id} at center (${u.x}, ${u.y})`));
2556
+ }), D.edges.forEach((u) => {
2557
+ const E = G.edges.find((y) => y.id === u.id);
2558
+ E && (E.points = [
2559
+ { x: u.startX, y: u.startY },
2560
+ { x: u.midX, y: u.midY },
2561
+ { x: u.endX, y: u.endY }
2562
+ ]);
2563
+ }), t.debug("Inserting and positioning edges"), await Promise.all(
2564
+ G.edges.map(async (u) => {
2565
+ await T(a, u);
2566
+ const E = g[u.start ?? ""], y = g[u.end ?? ""];
2567
+ if (E && y) {
2568
+ const O = D.edges.find((s) => s.id === u.id);
2569
+ if (O) {
2570
+ t.debug("APA01 positionedEdge", O);
2571
+ const s = { ...u }, f = I(
2572
+ h,
2573
+ s,
2574
+ n,
2575
+ G.type,
2576
+ E,
2577
+ y,
2578
+ G.diagramId
2579
+ );
2580
+ i(s, f);
2581
+ } else {
2582
+ const s = {
2583
+ ...u,
2584
+ points: [
2585
+ { x: E.x || 0, y: E.y || 0 },
2586
+ { x: y.x || 0, y: y.y || 0 }
2587
+ ]
2588
+ }, f = I(
2589
+ h,
2590
+ s,
2591
+ n,
2592
+ G.type,
2593
+ E,
2594
+ y,
2595
+ G.diagramId
2596
+ );
2597
+ i(s, f);
2598
+ }
2599
+ }
2600
+ })
2601
+ ), t.debug("Cose-bilkent rendering completed");
2602
+ }, "render"), Et = dt;
2603
+ export {
2604
+ Et as render
2605
+ };