@ucap-llm/ai-ui 1.1.13 → 1.1.15

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