@kong-ui-public/documentation 1.8.13 → 1.8.14-pr.4048.7a10d83bb.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/package.json +2 -2
  2. package/dist/abnfDiagram-VCTEODGH-Bzbg7AHk-DFERbIEu.js +0 -92
  3. package/dist/arc-CKhg5DVn-BIpMje7c.js +0 -80
  4. package/dist/architectureDiagram-5GKGNRK7-CqHVyBRI-CLWcRmoG.js +0 -4149
  5. package/dist/astro-DdQ3Kp7Q-BDE5qFXd.js +0 -18
  6. package/dist/blockDiagram-I7D4REHJ-DWFqHR0L-D8v5LhXM.js +0 -2029
  7. package/dist/c-lfOsiBpu-DMPKLUI8.js +0 -4
  8. package/dist/c4Diagram-7LVT6UL2-DXHigzTJ-BR9440iK.js +0 -3067
  9. package/dist/catppuccin-latte-D9NPLB7Y-sAlQrrP2.js +0 -4
  10. package/dist/channel-DUDXYB-g-BsX3Acdu.js +0 -5
  11. package/dist/chunk-2Q5K7J3B-CQFXhYzi-C3CTUgHo.js +0 -12
  12. package/dist/chunk-5VM5RSS4-DF_fkndM-uFSHkP_V.js +0 -19
  13. package/dist/chunk-F27PBJKO-Bf2CKIqN-CUI4z39H.js +0 -65
  14. package/dist/chunk-IMKFNOWR-DIsz_YLV-B6u2fLNJ.js +0 -2116
  15. package/dist/chunk-JWPE2WC7-DI69CthA-D_FsPQj-.js +0 -8
  16. package/dist/chunk-POPQ4Y6H-DycI9Jzm-BWixWzlU.js +0 -24
  17. package/dist/chunk-SHT3W25Y-CKxDgOBI-OOdqZuVE.js +0 -4307
  18. package/dist/chunk-SVP7TREG-tW_qYlvV-vP5bsK2H.js +0 -500
  19. package/dist/chunk-TICWLB2K-CuiDrX3P-WR-FPNea.js +0 -3451
  20. package/dist/chunk-XXDRQBXY-CSrEKR2C-C6SaSSCC.js +0 -8
  21. package/dist/classDiagram-ZZMXUADV-WzcguFxl-CKKn1Tfx.js +0 -17
  22. package/dist/classDiagram-v2-VYDZK3BY-jdAXYY7W-CKKn1Tfx.js +0 -17
  23. package/dist/cose-bilkent-JH36ORCC-DbS7GVMv-bbQOsy5Y.js +0 -2256
  24. package/dist/csharp-RRkgh3c4-lim_vKPd.js +0 -4
  25. package/dist/css-BbwcBM_4-B_2PRTA_.js +0 -4
  26. package/dist/csv-DFU5sVkH-BPWcOTV4.js +0 -4
  27. package/dist/cynefin-OW5HDTMX-CmxQwqmf-D_GdoNIu.js +0 -21781
  28. package/dist/cynefinDiagram-5FMLGOSQ-BNb88xpJ-DfS9O7P4.js +0 -351
  29. package/dist/cytoscape.esm-YSf_2rtb-CoO8mT3p.js +0 -18279
  30. package/dist/dagre-C9xJrfGe-Di-1Ikh0.js +0 -1667
  31. package/dist/dagre-GXQ25YYZ-uiXfyLw2-PU-qeT6_.js +0 -429
  32. package/dist/defaultLocale-TbxLDlcU-BrdwcF9K.js +0 -180
  33. package/dist/diagram-S7CK7UJ4-g67BXvGR-Cp9bzjGj.js +0 -303
  34. package/dist/diagram-UQ7AKVKN-DfJJIsVs-CC7ekguS.js +0 -210
  35. package/dist/diagram-VSXAHHWV-DmtFfqWN-C9ZLHKzj.js +0 -439
  36. package/dist/diagram-VX7I27RA--gfQ90BY-QNtwG6Ck.js +0 -477
  37. package/dist/diagram-Z3DM3KII-Cu_rSHu0-CCCsIuz4.js +0 -127
  38. package/dist/diff-D_LJiFgV-DenOJuyV.js +0 -4
  39. package/dist/docker-DMpUQ2UE-xX8PDoIv.js +0 -4
  40. package/dist/documentation.es.js +0 -7
  41. package/dist/documentation.umd.js +0 -3715
  42. package/dist/ebnfDiagram-PWID7BFC-B_qfACMJ-D_Xjruh2.js +0 -109
  43. package/dist/erDiagram-RLTQ6QDP-Dt9efGmz-BPS1Iwl5.js +0 -2042
  44. package/dist/flowDiagram-HODETNUW-sAcaB3rt-Ci8x-zG0.js +0 -6
  45. package/dist/ganttDiagram-EL5Y4UJY-CtWGP-hX-qar4oLEq.js +0 -3098
  46. package/dist/git-commit--2NDNcyW-Dw9_h8sQ.js +0 -5
  47. package/dist/git-rebase-CbNvxADk-DAgBrkyL.js +0 -5
  48. package/dist/gitGraphDiagram-WWUBYQGX-B7B7IG_5-x8UcOce8.js +0 -737
  49. package/dist/go-BEdBk4fh-DqSXHrGo.js +0 -4
  50. package/dist/graphql-BMuT9GwB-BP9pcQru.js +0 -14
  51. package/dist/haml-D3QmTYiV-BTaBXoPr.js +0 -10
  52. package/dist/handlebars-C_aYHp26-CWcrQHYv.js +0 -14
  53. package/dist/haskell-DSSJ-2AO-BlmVjKNy.js +0 -4
  54. package/dist/html-derivative-DgZQ_xNe-BAs__2u-.js +0 -5
  55. package/dist/html-zcQqUZxh-Dg8OkMBp.js +0 -10
  56. package/dist/http-BGkfDG8i-lqXytFlH.js +0 -14
  57. package/dist/index-BaAWoj3P.js +0 -43522
  58. package/dist/infoDiagram-27XIBGKW-DAx9hub5-CDUrF89O.js +0 -18
  59. package/dist/ini-CmgEGOBJ-70PBzbbb.js +0 -4
  60. package/dist/init-Cgg2UTSf-BsHkAom2.js +0 -15
  61. package/dist/ishikawaDiagram-5VMMS53U-CnBB9iXH-2YyZ3Nxy.js +0 -729
  62. package/dist/java-CaG1IqbK-D6YBp1XX.js +0 -4
  63. package/dist/javascript--0qAxhnA-BRPKgr3C.js +0 -4
  64. package/dist/journeyDiagram-3NMN7TZE-B0a4pOJX-CgtsuE-Y.js +0 -909
  65. package/dist/json-DVwBUiza-D8uacQj0.js +0 -4
  66. package/dist/json5-D2Eltym1-Biib5ALh.js +0 -4
  67. package/dist/jsonc-BPIJyZ7u-BZEKkMok.js +0 -4
  68. package/dist/jsonl-BGkjXns2-BG2V-IA2.js +0 -4
  69. package/dist/jsx-cVAJ0Z2c-Cl0AMtmu.js +0 -4
  70. package/dist/kanban-definition-UXKFOSKX-BGnOZMUl-CHT2EG_7.js +0 -1029
  71. package/dist/katex-Be3DWdAP-BWcdC2Xb.js +0 -22287
  72. package/dist/kotlin-CQsNEM2o-Dy_91eL4.js +0 -4
  73. package/dist/latex-g3NZbvcl-tKQf8TuW.js +0 -5
  74. package/dist/less-9LYkHheD-tcNg8M2_.js +0 -4
  75. package/dist/linear-Cf872ac2-BjGvLlX5.js +0 -254
  76. package/dist/liquid-CG3ph2-5-wZo8nDay.js +0 -14
  77. package/dist/lua-BdA7_iyX-Fg4s9W4F.js +0 -5
  78. package/dist/make-CE9Hryyp-CrUl7LOH.js +0 -4
  79. package/dist/markdown-Gqx6-FHJ-Bcqt-5kX.js +0 -4
  80. package/dist/material-theme-darker-DL4lHZSa-DMHCIvq5.js +0 -4
  81. package/dist/mdc-C-RLGlI2-DzcUIqJQ.js +0 -12
  82. package/dist/mdx-DswfiFg4-CK6jOqmu.js +0 -4
  83. package/dist/mermaid-CAl3BhSL-CpQh0Vft.js +0 -4
  84. package/dist/mindmap-definition-YA3MSWOX-D0iYuN9C-B3uI77eT.js +0 -1026
  85. package/dist/nginx-CokYOiS8-DjML3dpY.js +0 -5
  86. package/dist/objective-c-DK-EKgyd-C809HPrX.js +0 -4
  87. package/dist/ordinal-CNzaYghg-B_JXdapq.js +0 -63
  88. package/dist/pascal-CRtegPzh-a8whuidZ.js +0 -4
  89. package/dist/pegDiagram-XKGWAZYB-6oG4KeYC-CG27veJ_.js +0 -104
  90. package/dist/perl-C45KUBhP-Q6opd9qO.js +0 -16
  91. package/dist/php-COzTb61D-DW91EkjY.js +0 -18
  92. package/dist/pieDiagram-E7YTZNPT-DsNO0m7t-CMKObJlC.js +0 -191
  93. package/dist/plsql-Bx7tup_v-BJoF2Vrf.js +0 -4
  94. package/dist/postcss-DjDdOEzv-DaHMm3XW.js +0 -4
  95. package/dist/powershell-BeUvHe6o-BC3uPZPS.js +0 -4
  96. package/dist/proto-DGLklcji-w0B_itsp.js +0 -4
  97. package/dist/pug-BQ5MM2xz-DMZvJUHt.js +0 -12
  98. package/dist/python-C_6ySqsv-D_5pfY__.js +0 -4
  99. package/dist/quadrantDiagram-AXDQQJYC-B6Dc7fje-C23uvcHP.js +0 -2046
  100. package/dist/r-CNL4a0Qi-pixge7f9.js +0 -4
  101. package/dist/railroadDiagram-O6MQD6OU-D8qLcD4O-B_Hr3s-n.js +0 -80
  102. package/dist/reg-D6txjqBF-bHAwx9Pm.js +0 -4
  103. package/dist/requirementDiagram-BXWQKSXE-Cx28BZaS-Bu-h1fa9.js +0 -2283
  104. package/dist/rst-xmthoFSf-BdN-iqJu.js +0 -20
  105. package/dist/ruby-CmwqiOyg-B5qGUHPy.js +0 -44
  106. package/dist/rust-BrRMzTsN-CaZtBt24.js +0 -4
  107. package/dist/sankeyDiagram-P5KCCOFB-CqEXebJJ-BrChTi-e.js +0 -948
  108. package/dist/sass-CL6GLiPQ-pslLeRRb.js +0 -4
  109. package/dist/scss-CiLZCexj-CladYQkr.js +0 -5
  110. package/dist/sequenceDiagram-WJ2MYXX4-Bs_1V5D1-Da6JW3KG.js +0 -4263
  111. package/dist/shellscript-Dfpezy65-BtH46UX7.js +0 -4
  112. package/dist/shellsession-CRcAC04a-BFLTslz7.js +0 -5
  113. package/dist/sizeCapture-INFHLROL-Bc4fS2u3-DMniWWy4.js +0 -46
  114. package/dist/splunk-MGILMmew-BP8P7eWt.js +0 -4
  115. package/dist/sql-D_W5grEC-Dcn2WLbD.js +0 -4
  116. package/dist/ssh-config-CFmUyPR7-BB1rrGb9.js +0 -4
  117. package/dist/stateDiagram-D77RDMKH-oTiwIYVV-BphZk0uR.js +0 -210
  118. package/dist/stateDiagram-v2-MP3YSRHH-gbAY2cmo-D78HyGx1.js +0 -17
  119. package/dist/style.css +0 -1
  120. package/dist/stylus-Kh83dApl-DAu5PNZ9.js +0 -4
  121. package/dist/svelte-HVIHTyhe-BdPJXyv7.js +0 -14
  122. package/dist/swift-B7Z-rXzN-CQtmhAMw.js +0 -4
  123. package/dist/swimlanes-42K2YHIH-BSXAPn2j-C7pTnVuk.js +0 -4983
  124. package/dist/swimlanesDiagram-VR7AAH4N-Ror_0lre-Di8OVgei.js +0 -17
  125. package/dist/timeline-definition-24CTP7MA-gOHmAY1H-aIgAzo7s.js +0 -1096
  126. package/dist/toml-CIQJnU5u-DjT9Bjqu.js +0 -4
  127. package/dist/tsx-DiMnnori-B-5hSr15.js +0 -4
  128. package/dist/twig-BXXOiPVV-CmgmU-L-.js +0 -18
  129. package/dist/types/components/DiscardChangesPrompt.vue.d.ts +0 -35
  130. package/dist/types/components/DiscardChangesPrompt.vue.d.ts.map +0 -1
  131. package/dist/types/components/DocumentationContent.vue.d.ts +0 -186
  132. package/dist/types/components/DocumentationContent.vue.d.ts.map +0 -1
  133. package/dist/types/components/DocumentationDisplay.vue.d.ts +0 -105
  134. package/dist/types/components/DocumentationDisplay.vue.d.ts.map +0 -1
  135. package/dist/types/components/DocumentationPageEmptyState.vue.d.ts +0 -31
  136. package/dist/types/components/DocumentationPageEmptyState.vue.d.ts.map +0 -1
  137. package/dist/types/components/ProductDocumentModal.vue.d.ts +0 -72
  138. package/dist/types/components/ProductDocumentModal.vue.d.ts.map +0 -1
  139. package/dist/types/composables/index.d.ts +0 -6
  140. package/dist/types/composables/index.d.ts.map +0 -1
  141. package/dist/types/composables/useI18n.d.ts +0 -9
  142. package/dist/types/composables/useI18n.d.ts.map +0 -1
  143. package/dist/types/external-links.d.ts +0 -5
  144. package/dist/types/external-links.d.ts.map +0 -1
  145. package/dist/types/helpers.d.ts +0 -8
  146. package/dist/types/helpers.d.ts.map +0 -1
  147. package/dist/types/index.d.ts +0 -7
  148. package/dist/types/index.d.ts.map +0 -1
  149. package/dist/types/types/document-list.d.ts +0 -28
  150. package/dist/types/types/document-list.d.ts.map +0 -1
  151. package/dist/types/types/document-modal.d.ts +0 -8
  152. package/dist/types/types/document-modal.d.ts.map +0 -1
  153. package/dist/types/types/index.d.ts +0 -3
  154. package/dist/types/types/index.d.ts.map +0 -1
  155. package/dist/typescript-DFf19o_s-B0ag8pir.js +0 -4
  156. package/dist/v-DbYZLS97-CAPuTPjr.js +0 -4
  157. package/dist/vb-DRaXf86R-Bx9Rwnco.js +0 -4
  158. package/dist/vennDiagram-4TSXK5OY-Cr4BWMuk-BjBvyxCC.js +0 -1911
  159. package/dist/viml-DgaHry3T-BeYQ8dZh.js +0 -4
  160. package/dist/vue-DPI5F0qT-D-Ahkoja.js +0 -22
  161. package/dist/vue-html-D7FCsiW2-DLSUNIPr.js +0 -5
  162. package/dist/wardleyDiagram-VM6X3IG4-a6H91k9Q-CsH4gQQ0.js +0 -639
  163. package/dist/wasm-DXa1gtBd-CfuK9YWP.js +0 -4
  164. package/dist/wgsl-Vcm3Lg52-C2IZ7ENh.js +0 -4
  165. package/dist/xml-DnOpIvRK-C-akVYiK.js +0 -5
  166. package/dist/xsl-K_2BlT3G-D3eRZGNO.js +0 -5
  167. package/dist/xychartDiagram-S5SC5T6Z-7mX_nPmO-CoM4SG9q.js +0 -2218
  168. package/dist/yaml-BswqmnDe-X78l_Ibz.js +0 -4
@@ -1,2256 +0,0 @@
1
- import { a as k, m as j, G as nt, C as st, W as V } from "./index-BaAWoj3P.js";
2
- import { Z as $ } from "./cytoscape.esm-YSf_2rtb-CoO8mT3p.js";
3
- var z = /* @__PURE__ */ V(((C, P) => {
4
- (function(m, L) {
5
- typeof C == "object" && typeof P == "object" ? P.exports = L() : typeof define == "function" && define.amd ? define([], L) : typeof C == "object" ? C.layoutBase = L() : m.layoutBase = L();
6
- })(C, function() {
7
- return (function(m) {
8
- var L = {};
9
- function A(n) {
10
- if (L[n]) return L[n].exports;
11
- var i = L[n] = {
12
- i: n,
13
- l: !1,
14
- exports: {}
15
- };
16
- return m[n].call(i.exports, i, i.exports, A), i.l = !0, i.exports;
17
- }
18
- return A.m = m, A.c = L, A.i = function(n) {
19
- return n;
20
- }, A.d = function(n, i, t) {
21
- A.o(n, i) || Object.defineProperty(n, i, {
22
- configurable: !1,
23
- enumerable: !0,
24
- get: t
25
- });
26
- }, A.n = function(n) {
27
- var i = n && n.__esModule ? function() {
28
- return n.default;
29
- } : function() {
30
- return n;
31
- };
32
- return A.d(i, "a", i), i;
33
- }, A.o = function(n, i) {
34
- return Object.prototype.hasOwnProperty.call(n, i);
35
- }, A.p = "", A(A.s = 26);
36
- })([
37
- (function(m, L, A) {
38
- function n() {
39
- }
40
- n.QUALITY = 1, n.DEFAULT_CREATE_BENDS_AS_NEEDED = !1, n.DEFAULT_INCREMENTAL = !1, n.DEFAULT_ANIMATION_ON_LAYOUT = !0, n.DEFAULT_ANIMATION_DURING_LAYOUT = !1, n.DEFAULT_ANIMATION_PERIOD = 50, n.DEFAULT_UNIFORM_LEAF_NODE_SIZES = !1, n.DEFAULT_GRAPH_MARGIN = 15, n.NODE_DIMENSIONS_INCLUDE_LABELS = !1, n.SIMPLE_NODE_SIZE = 40, n.SIMPLE_NODE_HALF_SIZE = n.SIMPLE_NODE_SIZE / 2, n.EMPTY_COMPOUND_NODE_SIZE = 40, n.MIN_EDGE_LENGTH = 1, n.WORLD_BOUNDARY = 1e6, n.INITIAL_WORLD_BOUNDARY = n.WORLD_BOUNDARY / 1e3, n.WORLD_CENTER_X = 1200, n.WORLD_CENTER_Y = 900, m.exports = n;
41
- }),
42
- (function(m, L, A) {
43
- var n = A(2), i = A(8), t = A(9);
44
- function e(h, o, N) {
45
- n.call(this, N), this.isOverlapingSourceAndTarget = !1, this.vGraphObject = N, this.bendpoints = [], this.source = h, this.target = o;
46
- }
47
- for (var r in e.prototype = Object.create(n.prototype), n) e[r] = n[r];
48
- e.prototype.getSource = function() {
49
- return this.source;
50
- }, e.prototype.getTarget = function() {
51
- return this.target;
52
- }, e.prototype.isInterGraph = function() {
53
- return this.isInterGraph;
54
- }, e.prototype.getLength = function() {
55
- return this.length;
56
- }, e.prototype.isOverlapingSourceAndTarget = function() {
57
- return this.isOverlapingSourceAndTarget;
58
- }, e.prototype.getBendpoints = function() {
59
- return this.bendpoints;
60
- }, e.prototype.getLca = function() {
61
- return this.lca;
62
- }, e.prototype.getSourceInLca = function() {
63
- return this.sourceInLca;
64
- }, e.prototype.getTargetInLca = function() {
65
- return this.targetInLca;
66
- }, e.prototype.getOtherEnd = function(h) {
67
- if (this.source === h) return this.target;
68
- if (this.target === h) return this.source;
69
- throw "Node is not incident with this edge";
70
- }, e.prototype.getOtherEndInGraph = function(h, o) {
71
- for (var N = this.getOtherEnd(h), s = o.getGraphManager().getRoot(); ; ) {
72
- if (N.getOwner() == o) return N;
73
- if (N.getOwner() == s) break;
74
- N = N.getOwner().getParent();
75
- }
76
- return null;
77
- }, e.prototype.updateLength = function() {
78
- var h = [
79
- ,
80
- ,
81
- ,
82
- ,
83
- ];
84
- this.isOverlapingSourceAndTarget = i.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 = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY));
85
- }, e.prototype.updateLengthSimple = function() {
86
- this.lengthX = this.target.getCenterX() - this.source.getCenterX(), this.lengthY = this.target.getCenterY() - this.source.getCenterY(), Math.abs(this.lengthX) < 1 && (this.lengthX = t.sign(this.lengthX)), Math.abs(this.lengthY) < 1 && (this.lengthY = t.sign(this.lengthY)), this.length = Math.sqrt(this.lengthX * this.lengthX + this.lengthY * this.lengthY);
87
- }, m.exports = e;
88
- }),
89
- (function(m, L, A) {
90
- function n(i) {
91
- this.vGraphObject = i;
92
- }
93
- m.exports = n;
94
- }),
95
- (function(m, L, A) {
96
- var n = A(2), i = A(10), t = A(13), e = A(0), r = A(16), h = A(4);
97
- function o(s, g, u, p) {
98
- u == null && p == null && (p = g), n.call(this, p), s.graphManager != null && (s = s.graphManager), this.estimatedSize = i.MIN_VALUE, this.inclusionTreeDepth = i.MAX_VALUE, this.vGraphObject = p, this.edges = [], this.graphManager = s, this.rect = u != null && g != null ? new t(g.x, g.y, u.width, u.height) : new t();
99
- }
100
- for (var N in o.prototype = Object.create(n.prototype), n) o[N] = n[N];
101
- o.prototype.getEdges = function() {
102
- return this.edges;
103
- }, o.prototype.getChild = function() {
104
- return this.child;
105
- }, o.prototype.getOwner = function() {
106
- return this.owner;
107
- }, o.prototype.getWidth = function() {
108
- return this.rect.width;
109
- }, o.prototype.setWidth = function(s) {
110
- this.rect.width = s;
111
- }, o.prototype.getHeight = function() {
112
- return this.rect.height;
113
- }, o.prototype.setHeight = function(s) {
114
- this.rect.height = s;
115
- }, o.prototype.getCenterX = function() {
116
- return this.rect.x + this.rect.width / 2;
117
- }, o.prototype.getCenterY = function() {
118
- return this.rect.y + this.rect.height / 2;
119
- }, o.prototype.getCenter = function() {
120
- return new h(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);
121
- }, o.prototype.getLocation = function() {
122
- return new h(this.rect.x, this.rect.y);
123
- }, o.prototype.getRect = function() {
124
- return this.rect;
125
- }, o.prototype.getDiagonal = function() {
126
- return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);
127
- }, o.prototype.getHalfTheDiagonal = function() {
128
- return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;
129
- }, o.prototype.setRect = function(s, g) {
130
- this.rect.x = s.x, this.rect.y = s.y, this.rect.width = g.width, this.rect.height = g.height;
131
- }, o.prototype.setCenter = function(s, g) {
132
- this.rect.x = s - this.rect.width / 2, this.rect.y = g - this.rect.height / 2;
133
- }, o.prototype.setLocation = function(s, g) {
134
- this.rect.x = s, this.rect.y = g;
135
- }, o.prototype.moveBy = function(s, g) {
136
- this.rect.x += s, this.rect.y += g;
137
- }, o.prototype.getEdgeListToNode = function(s) {
138
- var g = [], u = this;
139
- return u.edges.forEach(function(p) {
140
- if (p.target == s) {
141
- if (p.source != u) throw "Incorrect edge source!";
142
- g.push(p);
143
- }
144
- }), g;
145
- }, o.prototype.getEdgesBetween = function(s) {
146
- var g = [], u = this;
147
- return u.edges.forEach(function(p) {
148
- if (p.source != u && p.target != u) throw "Incorrect edge source and/or target";
149
- (p.target == s || p.source == s) && g.push(p);
150
- }), g;
151
- }, o.prototype.getNeighborsList = function() {
152
- var s = /* @__PURE__ */ new Set(), g = this;
153
- return g.edges.forEach(function(u) {
154
- if (u.source == g) s.add(u.target);
155
- else {
156
- if (u.target != g) throw "Incorrect incidency!";
157
- s.add(u.source);
158
- }
159
- }), s;
160
- }, o.prototype.withChildren = function() {
161
- var s = /* @__PURE__ */ new Set(), g, u;
162
- if (s.add(this), this.child != null) for (var p = this.child.getNodes(), y = 0; y < p.length; y++) g = p[y], u = g.withChildren(), u.forEach(function(c) {
163
- s.add(c);
164
- });
165
- return s;
166
- }, o.prototype.getNoOfChildren = function() {
167
- var s = 0, g;
168
- if (this.child == null) s = 1;
169
- else for (var u = this.child.getNodes(), p = 0; p < u.length; p++) g = u[p], s += g.getNoOfChildren();
170
- return s == 0 && (s = 1), s;
171
- }, o.prototype.getEstimatedSize = function() {
172
- if (this.estimatedSize == i.MIN_VALUE) throw "assert failed";
173
- return this.estimatedSize;
174
- }, o.prototype.calcEstimatedSize = function() {
175
- 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);
176
- }, o.prototype.scatter = function() {
177
- var s, g, u = -e.INITIAL_WORLD_BOUNDARY, p = e.INITIAL_WORLD_BOUNDARY;
178
- s = e.WORLD_CENTER_X + r.nextDouble() * (p - u) + u;
179
- var y = -e.INITIAL_WORLD_BOUNDARY, c = e.INITIAL_WORLD_BOUNDARY;
180
- g = e.WORLD_CENTER_Y + r.nextDouble() * (c - y) + y, this.rect.x = s, this.rect.y = g;
181
- }, o.prototype.updateBounds = function() {
182
- if (this.getChild() == null) throw "assert failed";
183
- if (this.getChild().getNodes().length != 0) {
184
- var s = this.getChild();
185
- if (s.updateBounds(!0), this.rect.x = s.getLeft(), this.rect.y = s.getTop(), this.setWidth(s.getRight() - s.getLeft()), this.setHeight(s.getBottom() - s.getTop()), e.NODE_DIMENSIONS_INCLUDE_LABELS) {
186
- var g = s.getRight() - s.getLeft(), u = s.getBottom() - s.getTop();
187
- this.labelWidth > g && (this.rect.x -= (this.labelWidth - g) / 2, this.setWidth(this.labelWidth)), this.labelHeight > u && (this.labelPos == "center" ? this.rect.y -= (this.labelHeight - u) / 2 : this.labelPos == "top" && (this.rect.y -= this.labelHeight - u), this.setHeight(this.labelHeight));
188
- }
189
- }
190
- }, o.prototype.getInclusionTreeDepth = function() {
191
- if (this.inclusionTreeDepth == i.MAX_VALUE) throw "assert failed";
192
- return this.inclusionTreeDepth;
193
- }, o.prototype.transform = function(s) {
194
- var g = this.rect.x;
195
- g > e.WORLD_BOUNDARY ? g = e.WORLD_BOUNDARY : g < -e.WORLD_BOUNDARY && (g = -e.WORLD_BOUNDARY);
196
- var u = this.rect.y;
197
- u > e.WORLD_BOUNDARY ? u = e.WORLD_BOUNDARY : u < -e.WORLD_BOUNDARY && (u = -e.WORLD_BOUNDARY);
198
- var p = new h(g, u), y = s.inverseTransformPoint(p);
199
- this.setLocation(y.x, y.y);
200
- }, o.prototype.getLeft = function() {
201
- return this.rect.x;
202
- }, o.prototype.getRight = function() {
203
- return this.rect.x + this.rect.width;
204
- }, o.prototype.getTop = function() {
205
- return this.rect.y;
206
- }, o.prototype.getBottom = function() {
207
- return this.rect.y + this.rect.height;
208
- }, o.prototype.getParent = function() {
209
- return this.owner == null ? null : this.owner.getParent();
210
- }, m.exports = o;
211
- }),
212
- (function(m, L, A) {
213
- function n(i, t) {
214
- i == null && t == null ? (this.x = 0, this.y = 0) : (this.x = i, this.y = t);
215
- }
216
- n.prototype.getX = function() {
217
- return this.x;
218
- }, n.prototype.getY = function() {
219
- return this.y;
220
- }, n.prototype.setX = function(i) {
221
- this.x = i;
222
- }, n.prototype.setY = function(i) {
223
- this.y = i;
224
- }, n.prototype.getDifference = function(i) {
225
- return new DimensionD(this.x - i.x, this.y - i.y);
226
- }, n.prototype.getCopy = function() {
227
- return new n(this.x, this.y);
228
- }, n.prototype.translate = function(i) {
229
- return this.x += i.width, this.y += i.height, this;
230
- }, m.exports = n;
231
- }),
232
- (function(m, L, A) {
233
- var n = A(2), i = A(10), t = A(0), e = A(6), r = A(3), h = A(1), o = A(13), N = A(12), s = A(11);
234
- function g(p, y, c) {
235
- n.call(this, c), this.estimatedSize = i.MIN_VALUE, this.margin = t.DEFAULT_GRAPH_MARGIN, this.edges = [], this.nodes = [], this.isConnected = !1, this.parent = p, y != null && y instanceof e ? this.graphManager = y : y != null && y instanceof Layout && (this.graphManager = y.graphManager);
236
- }
237
- for (var u in g.prototype = Object.create(n.prototype), n) g[u] = n[u];
238
- g.prototype.getNodes = function() {
239
- return this.nodes;
240
- }, g.prototype.getEdges = function() {
241
- return this.edges;
242
- }, g.prototype.getGraphManager = function() {
243
- return this.graphManager;
244
- }, g.prototype.getParent = function() {
245
- return this.parent;
246
- }, g.prototype.getLeft = function() {
247
- return this.left;
248
- }, g.prototype.getRight = function() {
249
- return this.right;
250
- }, g.prototype.getTop = function() {
251
- return this.top;
252
- }, g.prototype.getBottom = function() {
253
- return this.bottom;
254
- }, g.prototype.isConnected = function() {
255
- return this.isConnected;
256
- }, g.prototype.add = function(p, y, c) {
257
- if (y == null && c == null) {
258
- var f = p;
259
- if (this.graphManager == null) throw "Graph has no graph mgr!";
260
- if (this.getNodes().indexOf(f) > -1) throw "Node already in graph!";
261
- return f.owner = this, this.getNodes().push(f), f;
262
- }
263
- var T = p;
264
- if (!(this.getNodes().indexOf(y) > -1 && this.getNodes().indexOf(c) > -1)) throw "Source or target not in graph!";
265
- if (y.owner != c.owner || y.owner != this) throw "Both owners must be this graph!";
266
- return y.owner == c.owner ? (T.source = y, T.target = c, T.isInterGraph = !1, this.getEdges().push(T), y.edges.push(T), c != y && c.edges.push(T), T) : null;
267
- }, g.prototype.remove = function(p) {
268
- var y = p;
269
- if (p instanceof r) {
270
- if (y == null) throw "Node is null!";
271
- if (y.owner == null || y.owner != this) throw "Owner graph is invalid!";
272
- if (this.graphManager == null) throw "Owner graph manager is invalid!";
273
- for (var c = y.edges.slice(), f, T = c.length, E = 0; E < T; E++) f = c[E], f.isInterGraph ? this.graphManager.remove(f) : f.source.owner.remove(f);
274
- var O = this.nodes.indexOf(y);
275
- if (O == -1) throw "Node not in owner node list!";
276
- this.nodes.splice(O, 1);
277
- } else if (p instanceof h) {
278
- var f = p;
279
- if (f == null) throw "Edge is null!";
280
- if (f.source == null || f.target == null) throw "Source and/or target is null!";
281
- if (f.source.owner == null || f.target.owner == null || f.source.owner != this || f.target.owner != this) throw "Source and/or target owner is invalid!";
282
- var a = f.source.edges.indexOf(f), d = f.target.edges.indexOf(f);
283
- if (!(a > -1 && d > -1)) throw "Source and/or target doesn't know this edge!";
284
- f.source.edges.splice(a, 1), f.target != f.source && f.target.edges.splice(d, 1);
285
- var O = f.source.owner.getEdges().indexOf(f);
286
- if (O == -1) throw "Not in owner's edge list!";
287
- f.source.owner.getEdges().splice(O, 1);
288
- }
289
- }, g.prototype.updateLeftTop = function() {
290
- for (var p = i.MAX_VALUE, y = i.MAX_VALUE, c, f, T, E = this.getNodes(), O = E.length, a = 0; a < O; a++) {
291
- var d = E[a];
292
- c = d.getTop(), f = d.getLeft(), p > c && (p = c), y > f && (y = f);
293
- }
294
- return p == i.MAX_VALUE ? null : (T = E[0].getParent().paddingLeft == null ? this.margin : E[0].getParent().paddingLeft, this.left = y - T, this.top = p - T, new N(this.left, this.top));
295
- }, g.prototype.updateBounds = function(p) {
296
- for (var y = i.MAX_VALUE, c = -i.MAX_VALUE, f = i.MAX_VALUE, T = -i.MAX_VALUE, E, O, a, d, l, v = this.nodes, _ = v.length, D = 0; D < _; D++) {
297
- var I = v[D];
298
- p && I.child != null && I.updateBounds(), E = I.getLeft(), O = I.getRight(), a = I.getTop(), d = I.getBottom(), y > E && (y = E), c < O && (c = O), f > a && (f = a), T < d && (T = d);
299
- }
300
- var w = new o(y, f, c - y, T - f);
301
- y == i.MAX_VALUE && (this.left = this.parent.getLeft(), this.right = this.parent.getRight(), this.top = this.parent.getTop(), this.bottom = this.parent.getBottom()), l = v[0].getParent().paddingLeft == null ? this.margin : v[0].getParent().paddingLeft, this.left = w.x - l, this.right = w.x + w.width + l, this.top = w.y - l, this.bottom = w.y + w.height + l;
302
- }, g.calculateBounds = function(p) {
303
- for (var y = i.MAX_VALUE, c = -i.MAX_VALUE, f = i.MAX_VALUE, T = -i.MAX_VALUE, E, O, a, d, l = p.length, v = 0; v < l; v++) {
304
- var _ = p[v];
305
- E = _.getLeft(), O = _.getRight(), a = _.getTop(), d = _.getBottom(), y > E && (y = E), c < O && (c = O), f > a && (f = a), T < d && (T = d);
306
- }
307
- return new o(y, f, c - y, T - f);
308
- }, g.prototype.getInclusionTreeDepth = function() {
309
- return this == this.graphManager.getRoot() ? 1 : this.parent.getInclusionTreeDepth();
310
- }, g.prototype.getEstimatedSize = function() {
311
- if (this.estimatedSize == i.MIN_VALUE) throw "assert failed";
312
- return this.estimatedSize;
313
- }, g.prototype.calcEstimatedSize = function() {
314
- for (var p = 0, y = this.nodes, c = y.length, f = 0; f < c; f++) {
315
- var T = y[f];
316
- p += T.calcEstimatedSize();
317
- }
318
- return this.estimatedSize = p == 0 ? t.EMPTY_COMPOUND_NODE_SIZE : p / Math.sqrt(this.nodes.length), this.estimatedSize;
319
- }, g.prototype.updateConnected = function() {
320
- var p = this;
321
- if (this.nodes.length == 0) {
322
- this.isConnected = !0;
323
- return;
324
- }
325
- var y = new s(), c = /* @__PURE__ */ new Set(), f = this.nodes[0], T, E;
326
- for (f.withChildren().forEach(function(l) {
327
- y.push(l), c.add(l);
328
- }); y.length !== 0; ) {
329
- f = y.shift(), T = f.getEdges();
330
- for (var O = T.length, a = 0; a < O; a++) E = T[a].getOtherEndInGraph(f, this), E != null && !c.has(E) && E.withChildren().forEach(function(l) {
331
- y.push(l), c.add(l);
332
- });
333
- }
334
- if (this.isConnected = !1, c.size >= this.nodes.length) {
335
- var d = 0;
336
- c.forEach(function(l) {
337
- l.owner == p && d++;
338
- }), d == this.nodes.length && (this.isConnected = !0);
339
- }
340
- }, m.exports = g;
341
- }),
342
- (function(m, L, A) {
343
- var n, i = A(1);
344
- function t(e) {
345
- n = A(5), this.layout = e, this.graphs = [], this.edges = [];
346
- }
347
- t.prototype.addRoot = function() {
348
- var e = this.layout.newGraph(), r = this.layout.newNode(null), h = this.add(e, r);
349
- return this.setRootGraph(h), this.rootGraph;
350
- }, t.prototype.add = function(e, r, h, o, N) {
351
- if (h == null && o == null && N == null) {
352
- if (e == null) throw "Graph is null!";
353
- if (r == null) throw "Parent node is null!";
354
- if (this.graphs.indexOf(e) > -1) throw "Graph already in this graph mgr!";
355
- if (this.graphs.push(e), e.parent != null) throw "Already has a parent!";
356
- if (r.child != null) throw "Already has a child!";
357
- return e.parent = r, r.child = e, e;
358
- }
359
- N = h, o = r, h = e;
360
- var s = o.getOwner(), g = N.getOwner();
361
- if (s == null || s.getGraphManager() != this) throw "Source not in this graph mgr!";
362
- if (g == null || g.getGraphManager() != this) throw "Target not in this graph mgr!";
363
- if (s == g) return h.isInterGraph = !1, s.add(h, o, N);
364
- if (h.isInterGraph = !0, h.source = o, h.target = N, this.edges.indexOf(h) > -1) throw "Edge already in inter-graph edge list!";
365
- if (this.edges.push(h), h.source == null || h.target == null) throw "Edge source and/or target is null!";
366
- if (h.source.edges.indexOf(h) != -1 || h.target.edges.indexOf(h) != -1) throw "Edge already in source and/or target incidency list!";
367
- return h.source.edges.push(h), h.target.edges.push(h), h;
368
- }, t.prototype.remove = function(e) {
369
- if (e instanceof n) {
370
- var r = e;
371
- if (r.getGraphManager() != this) throw "Graph not in this graph mgr";
372
- if (!(r == this.rootGraph || r.parent != null && r.parent.graphManager == this)) throw "Invalid parent node!";
373
- var h = [];
374
- h = h.concat(r.getEdges());
375
- for (var o, N = h.length, s = 0; s < N; s++) o = h[s], r.remove(o);
376
- var g = [];
377
- g = g.concat(r.getNodes());
378
- var u;
379
- N = g.length;
380
- for (var s = 0; s < N; s++) u = g[s], r.remove(u);
381
- r == this.rootGraph && this.setRootGraph(null);
382
- var p = this.graphs.indexOf(r);
383
- this.graphs.splice(p, 1), r.parent = null;
384
- } else if (e instanceof i) {
385
- if (o = e, o == null) throw "Edge is null!";
386
- if (!o.isInterGraph) throw "Not an inter-graph edge!";
387
- if (o.source == null || o.target == null) throw "Source and/or target is null!";
388
- if (o.source.edges.indexOf(o) == -1 || o.target.edges.indexOf(o) == -1) throw "Source and/or target doesn't know this edge!";
389
- var p = o.source.edges.indexOf(o);
390
- if (o.source.edges.splice(p, 1), p = o.target.edges.indexOf(o), o.target.edges.splice(p, 1), o.source.owner == null || o.source.owner.getGraphManager() == null) throw "Edge owner graph or owner graph manager is null!";
391
- if (o.source.owner.getGraphManager().edges.indexOf(o) == -1) throw "Not in owner graph manager's edge list!";
392
- var p = o.source.owner.getGraphManager().edges.indexOf(o);
393
- o.source.owner.getGraphManager().edges.splice(p, 1);
394
- }
395
- }, t.prototype.updateBounds = function() {
396
- this.rootGraph.updateBounds(!0);
397
- }, t.prototype.getGraphs = function() {
398
- return this.graphs;
399
- }, t.prototype.getAllNodes = function() {
400
- if (this.allNodes == null) {
401
- for (var e = [], r = this.getGraphs(), h = r.length, o = 0; o < h; o++) e = e.concat(r[o].getNodes());
402
- this.allNodes = e;
403
- }
404
- return this.allNodes;
405
- }, t.prototype.resetAllNodes = function() {
406
- this.allNodes = null;
407
- }, t.prototype.resetAllEdges = function() {
408
- this.allEdges = null;
409
- }, t.prototype.resetAllNodesToApplyGravitation = function() {
410
- this.allNodesToApplyGravitation = null;
411
- }, t.prototype.getAllEdges = function() {
412
- if (this.allEdges == null) {
413
- var e = [], r = this.getGraphs();
414
- r.length;
415
- for (var h = 0; h < r.length; h++) e = e.concat(r[h].getEdges());
416
- e = e.concat(this.edges), this.allEdges = e;
417
- }
418
- return this.allEdges;
419
- }, t.prototype.getAllNodesToApplyGravitation = function() {
420
- return this.allNodesToApplyGravitation;
421
- }, t.prototype.setAllNodesToApplyGravitation = function(e) {
422
- if (this.allNodesToApplyGravitation != null) throw "assert failed";
423
- this.allNodesToApplyGravitation = e;
424
- }, t.prototype.getRoot = function() {
425
- return this.rootGraph;
426
- }, t.prototype.setRootGraph = function(e) {
427
- if (e.getGraphManager() != this) throw "Root not in this graph mgr!";
428
- this.rootGraph = e, e.parent ??= this.layout.newNode("Root node");
429
- }, t.prototype.getLayout = function() {
430
- return this.layout;
431
- }, t.prototype.isOneAncestorOfOther = function(e, r) {
432
- if (e == null || r == null) throw "assert failed";
433
- if (e == r) return !0;
434
- var h = e.getOwner(), o;
435
- do {
436
- if (o = h.getParent(), o == null) break;
437
- if (o == r) return !0;
438
- if (h = o.getOwner(), h == null) break;
439
- } while (!0);
440
- h = r.getOwner();
441
- do {
442
- if (o = h.getParent(), o == null) break;
443
- if (o == e) return !0;
444
- if (h = o.getOwner(), h == null) break;
445
- } while (!0);
446
- return !1;
447
- }, t.prototype.calcLowestCommonAncestors = function() {
448
- for (var e, r, h, o, N, s = this.getAllEdges(), g = s.length, u = 0; u < g; u++) {
449
- if (e = s[u], r = e.source, h = e.target, e.lca = null, e.sourceInLca = r, e.targetInLca = h, r == h) {
450
- e.lca = r.getOwner();
451
- continue;
452
- }
453
- for (o = r.getOwner(); e.lca == null; ) {
454
- for (e.targetInLca = h, N = h.getOwner(); e.lca == null; ) {
455
- if (N == o) {
456
- e.lca = N;
457
- break;
458
- }
459
- if (N == this.rootGraph) break;
460
- if (e.lca != null) throw "assert failed";
461
- e.targetInLca = N.getParent(), N = e.targetInLca.getOwner();
462
- }
463
- if (o == this.rootGraph) break;
464
- e.lca ?? (e.sourceInLca = o.getParent(), o = e.sourceInLca.getOwner());
465
- }
466
- if (e.lca == null) throw "assert failed";
467
- }
468
- }, t.prototype.calcLowestCommonAncestor = function(e, r) {
469
- if (e == r) return e.getOwner();
470
- var h = e.getOwner();
471
- do {
472
- if (h == null) break;
473
- var o = r.getOwner();
474
- do {
475
- if (o == null) break;
476
- if (o == h) return o;
477
- o = o.getParent().getOwner();
478
- } while (!0);
479
- h = h.getParent().getOwner();
480
- } while (!0);
481
- return h;
482
- }, t.prototype.calcInclusionTreeDepths = function(e, r) {
483
- e == null && r == null && (e = this.rootGraph, r = 1);
484
- for (var h, o = e.getNodes(), N = o.length, s = 0; s < N; s++) h = o[s], h.inclusionTreeDepth = r, h.child != null && this.calcInclusionTreeDepths(h.child, r + 1);
485
- }, t.prototype.includesInvalidEdge = function() {
486
- for (var e, r = this.edges.length, h = 0; h < r; h++) if (e = this.edges[h], this.isOneAncestorOfOther(e.source, e.target)) return !0;
487
- return !1;
488
- }, m.exports = t;
489
- }),
490
- (function(m, L, A) {
491
- var n = A(0);
492
- function i() {
493
- }
494
- for (var t in n) i[t] = n[t];
495
- i.MAX_ITERATIONS = 2500, i.DEFAULT_EDGE_LENGTH = 50, i.DEFAULT_SPRING_STRENGTH = 0.45, i.DEFAULT_REPULSION_STRENGTH = 4500, i.DEFAULT_GRAVITY_STRENGTH = 0.4, i.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1, i.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8, i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5, i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = !0, i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = !0, i.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3, i.COOLING_ADAPTATION_FACTOR = 0.33, i.ADAPTATION_LOWER_NODE_LIMIT = 1e3, i.ADAPTATION_UPPER_NODE_LIMIT = 5e3, i.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100, i.MAX_NODE_DISPLACEMENT = i.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3, i.MIN_REPULSION_DIST = i.DEFAULT_EDGE_LENGTH / 10, i.CONVERGENCE_CHECK_PERIOD = 100, i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1, i.MIN_EDGE_LENGTH = 1, i.GRID_CALCULATION_CHECK_PERIOD = 10, m.exports = i;
496
- }),
497
- (function(m, L, A) {
498
- var n = A(12);
499
- function i() {
500
- }
501
- i.calcSeparationAmount = function(t, e, r, h) {
502
- if (!t.intersects(e)) throw "assert failed";
503
- var o = [, ,];
504
- this.decideDirectionsForOverlappingNodes(t, e, o), r[0] = Math.min(t.getRight(), e.getRight()) - Math.max(t.x, e.x), r[1] = Math.min(t.getBottom(), e.getBottom()) - Math.max(t.y, e.y), t.getX() <= e.getX() && t.getRight() >= e.getRight() ? r[0] += Math.min(e.getX() - t.getX(), t.getRight() - e.getRight()) : e.getX() <= t.getX() && e.getRight() >= t.getRight() && (r[0] += Math.min(t.getX() - e.getX(), e.getRight() - t.getRight())), t.getY() <= e.getY() && t.getBottom() >= e.getBottom() ? r[1] += Math.min(e.getY() - t.getY(), t.getBottom() - e.getBottom()) : e.getY() <= t.getY() && e.getBottom() >= t.getBottom() && (r[1] += Math.min(t.getY() - e.getY(), e.getBottom() - t.getBottom()));
505
- var N = Math.abs((e.getCenterY() - t.getCenterY()) / (e.getCenterX() - t.getCenterX()));
506
- e.getCenterY() === t.getCenterY() && e.getCenterX() === t.getCenterX() && (N = 1);
507
- var s = N * r[0], g = r[1] / N;
508
- r[0] < g ? g = r[0] : s = r[1], r[0] = -1 * o[0] * (g / 2 + h), r[1] = -1 * o[1] * (s / 2 + h);
509
- }, i.decideDirectionsForOverlappingNodes = function(t, e, r) {
510
- r[0] = t.getCenterX() < e.getCenterX() ? -1 : 1, r[1] = t.getCenterY() < e.getCenterY() ? -1 : 1;
511
- }, i.getIntersection2 = function(t, e, r) {
512
- var h = t.getCenterX(), o = t.getCenterY(), N = e.getCenterX(), s = e.getCenterY();
513
- if (t.intersects(e)) return r[0] = h, r[1] = o, r[2] = N, r[3] = s, !0;
514
- var g = t.getX(), u = t.getY(), p = t.getRight(), y = t.getX(), c = t.getBottom(), f = t.getRight(), T = t.getWidthHalf(), E = t.getHeightHalf(), O = e.getX(), a = e.getY(), d = e.getRight(), l = e.getX(), v = e.getBottom(), _ = e.getRight(), D = e.getWidthHalf(), I = e.getHeightHalf(), w = !1, R = !1;
515
- if (h === N) {
516
- if (o > s) return r[0] = h, r[1] = u, r[2] = N, r[3] = v, !1;
517
- if (o < s) return r[0] = h, r[1] = c, r[2] = N, r[3] = a, !1;
518
- } else if (o === s) {
519
- if (h > N) return r[0] = g, r[1] = o, r[2] = d, r[3] = s, !1;
520
- if (h < N) return r[0] = p, r[1] = o, r[2] = O, r[3] = s, !1;
521
- } else {
522
- var G = t.height / t.width, x = e.height / e.width, M = (s - o) / (N - h), U = void 0, b = void 0, F = void 0, S = void 0, Y = void 0, X = void 0;
523
- if (-G === M ? h > N ? (r[0] = y, r[1] = c, w = !0) : (r[0] = p, r[1] = u, w = !0) : G === M && (h > N ? (r[0] = g, r[1] = u, w = !0) : (r[0] = f, r[1] = c, w = !0)), -x === M ? N > h ? (r[2] = l, r[3] = v, R = !0) : (r[2] = d, r[3] = a, R = !0) : x === M && (N > h ? (r[2] = O, r[3] = a, R = !0) : (r[2] = _, r[3] = v, R = !0)), w && R) return !1;
524
- if (h > N ? o > s ? (U = this.getCardinalDirection(G, M, 4), b = this.getCardinalDirection(x, M, 2)) : (U = this.getCardinalDirection(-G, M, 3), b = this.getCardinalDirection(-x, M, 1)) : o > s ? (U = this.getCardinalDirection(-G, M, 1), b = this.getCardinalDirection(-x, M, 3)) : (U = this.getCardinalDirection(G, M, 2), b = this.getCardinalDirection(x, M, 4)), !w) switch (U) {
525
- case 1:
526
- S = u, F = h + -E / M, r[0] = F, r[1] = S;
527
- break;
528
- case 2:
529
- F = f, S = o + T * M, r[0] = F, r[1] = S;
530
- break;
531
- case 3:
532
- S = c, F = h + E / M, r[0] = F, r[1] = S;
533
- break;
534
- case 4:
535
- F = y, S = o + -T * M, r[0] = F, r[1] = S;
536
- }
537
- if (!R) switch (b) {
538
- case 1:
539
- X = a, Y = N + -I / M, r[2] = Y, r[3] = X;
540
- break;
541
- case 2:
542
- Y = _, X = s + D * M, r[2] = Y, r[3] = X;
543
- break;
544
- case 3:
545
- X = v, Y = N + I / M, r[2] = Y, r[3] = X;
546
- break;
547
- case 4:
548
- Y = l, X = s + -D * M, r[2] = Y, r[3] = X;
549
- }
550
- }
551
- return !1;
552
- }, i.getCardinalDirection = function(t, e, r) {
553
- return t > e ? r : 1 + r % 4;
554
- }, i.getIntersection = function(t, e, r, h) {
555
- if (h == null) return this.getIntersection2(t, e, r);
556
- var o = t.x, N = t.y, s = e.x, g = e.y, u = r.x, p = r.y, y = h.x, c = h.y, f = void 0, T = void 0, E = void 0, O = void 0, a = void 0, d = void 0, l = void 0, v = void 0, _ = void 0;
557
- return E = g - N, a = o - s, l = s * N - o * g, O = c - p, d = u - y, v = y * p - u * c, _ = E * d - O * a, _ === 0 ? null : (f = (a * v - d * l) / _, T = (O * l - E * v) / _, new n(f, T));
558
- }, i.angleOfVector = function(t, e, r, h) {
559
- var o = void 0;
560
- return t === r ? o = h < e ? this.ONE_AND_HALF_PI : this.HALF_PI : (o = Math.atan((h - e) / (r - t)), r < t ? o += Math.PI : h < e && (o += this.TWO_PI)), o;
561
- }, i.doIntersect = function(t, e, r, h) {
562
- var o = t.x, N = t.y, s = e.x, g = e.y, u = r.x, p = r.y, y = h.x, c = h.y, f = (s - o) * (c - p) - (y - u) * (g - N);
563
- if (f === 0) return !1;
564
- var T = ((c - p) * (y - o) + (u - y) * (c - N)) / f, E = ((N - g) * (y - o) + (s - o) * (c - N)) / f;
565
- return 0 < T && T < 1 && 0 < E && E < 1;
566
- }, i.HALF_PI = 0.5 * Math.PI, i.ONE_AND_HALF_PI = 1.5 * Math.PI, i.TWO_PI = 2 * Math.PI, i.THREE_PI = 3 * Math.PI, m.exports = i;
567
- }),
568
- (function(m, L, A) {
569
- function n() {
570
- }
571
- n.sign = function(i) {
572
- return i > 0 ? 1 : i < 0 ? -1 : 0;
573
- }, n.floor = function(i) {
574
- return i < 0 ? Math.ceil(i) : Math.floor(i);
575
- }, n.ceil = function(i) {
576
- return i < 0 ? Math.floor(i) : Math.ceil(i);
577
- }, m.exports = n;
578
- }),
579
- (function(m, L, A) {
580
- function n() {
581
- }
582
- n.MAX_VALUE = 2147483647, n.MIN_VALUE = -2147483648, m.exports = n;
583
- }),
584
- (function(m, L, A) {
585
- var n = /* @__PURE__ */ (function() {
586
- function h(o, N) {
587
- for (var s = 0; s < N.length; s++) {
588
- var g = N[s];
589
- g.enumerable = g.enumerable || !1, g.configurable = !0, "value" in g && (g.writable = !0), Object.defineProperty(o, g.key, g);
590
- }
591
- }
592
- return function(o, N, s) {
593
- return N && h(o.prototype, N), s && h(o, s), o;
594
- };
595
- })();
596
- function i(h, o) {
597
- if (!(h instanceof o)) throw TypeError("Cannot call a class as a function");
598
- }
599
- var t = function(h) {
600
- return {
601
- value: h,
602
- next: null,
603
- prev: null
604
- };
605
- }, e = function(h, o, N, s) {
606
- return h === null ? s.head = o : h.next = o, N === null ? s.tail = o : N.prev = o, o.prev = h, o.next = N, s.length++, o;
607
- }, r = function(h, o) {
608
- var N = h.prev, s = h.next;
609
- return N === null ? o.head = s : N.next = s, s === null ? o.tail = N : s.prev = N, h.prev = h.next = null, o.length--, h;
610
- };
611
- m.exports = (function() {
612
- function h(o) {
613
- var N = this;
614
- i(this, h), this.length = 0, this.head = null, this.tail = null, o?.forEach(function(s) {
615
- return N.push(s);
616
- });
617
- }
618
- return n(h, [
619
- {
620
- key: "size",
621
- value: function() {
622
- return this.length;
623
- }
624
- },
625
- {
626
- key: "insertBefore",
627
- value: function(o, N) {
628
- return e(N.prev, t(o), N, this);
629
- }
630
- },
631
- {
632
- key: "insertAfter",
633
- value: function(o, N) {
634
- return e(N, t(o), N.next, this);
635
- }
636
- },
637
- {
638
- key: "insertNodeBefore",
639
- value: function(o, N) {
640
- return e(N.prev, o, N, this);
641
- }
642
- },
643
- {
644
- key: "insertNodeAfter",
645
- value: function(o, N) {
646
- return e(N, o, N.next, this);
647
- }
648
- },
649
- {
650
- key: "push",
651
- value: function(o) {
652
- return e(this.tail, t(o), null, this);
653
- }
654
- },
655
- {
656
- key: "unshift",
657
- value: function(o) {
658
- return e(null, t(o), this.head, this);
659
- }
660
- },
661
- {
662
- key: "remove",
663
- value: function(o) {
664
- return r(o, this);
665
- }
666
- },
667
- {
668
- key: "pop",
669
- value: function() {
670
- return r(this.tail, this).value;
671
- }
672
- },
673
- {
674
- key: "popNode",
675
- value: function() {
676
- return r(this.tail, this);
677
- }
678
- },
679
- {
680
- key: "shift",
681
- value: function() {
682
- return r(this.head, this).value;
683
- }
684
- },
685
- {
686
- key: "shiftNode",
687
- value: function() {
688
- return r(this.head, this);
689
- }
690
- },
691
- {
692
- key: "get_object_at",
693
- value: function(o) {
694
- if (o <= this.length()) {
695
- for (var N = 1, s = this.head; N < o; ) s = s.next, N++;
696
- return s.value;
697
- }
698
- }
699
- },
700
- {
701
- key: "set_object_at",
702
- value: function(o, N) {
703
- if (o <= this.length()) {
704
- for (var s = 1, g = this.head; s < o; ) g = g.next, s++;
705
- g.value = N;
706
- }
707
- }
708
- }
709
- ]), h;
710
- })();
711
- }),
712
- (function(m, L, A) {
713
- function n(i, t, e) {
714
- this.x = null, this.y = null, i == null && t == null && e == null ? (this.x = 0, this.y = 0) : typeof i == "number" && typeof t == "number" && e == null ? (this.x = i, this.y = t) : i.constructor.name == "Point" && t == null && e == null && (e = i, this.x = e.x, this.y = e.y);
715
- }
716
- n.prototype.getX = function() {
717
- return this.x;
718
- }, n.prototype.getY = function() {
719
- return this.y;
720
- }, n.prototype.getLocation = function() {
721
- return new n(this.x, this.y);
722
- }, n.prototype.setLocation = function(i, t, e) {
723
- i.constructor.name == "Point" && t == null && e == null ? (e = i, this.setLocation(e.x, e.y)) : typeof i == "number" && typeof t == "number" && e == null && (parseInt(i) == i && parseInt(t) == t ? this.move(i, t) : (this.x = Math.floor(i + 0.5), this.y = Math.floor(t + 0.5)));
724
- }, n.prototype.move = function(i, t) {
725
- this.x = i, this.y = t;
726
- }, n.prototype.translate = function(i, t) {
727
- this.x += i, this.y += t;
728
- }, n.prototype.equals = function(i) {
729
- if (i.constructor.name == "Point") {
730
- var t = i;
731
- return this.x == t.x && this.y == t.y;
732
- }
733
- return this == i;
734
- }, n.prototype.toString = function() {
735
- return new n().constructor.name + "[x=" + this.x + ",y=" + this.y + "]";
736
- }, m.exports = n;
737
- }),
738
- (function(m, L, A) {
739
- function n(i, t, e, r) {
740
- this.x = 0, this.y = 0, this.width = 0, this.height = 0, i != null && t != null && e != null && r != null && (this.x = i, this.y = t, this.width = e, this.height = r);
741
- }
742
- n.prototype.getX = function() {
743
- return this.x;
744
- }, n.prototype.setX = function(i) {
745
- this.x = i;
746
- }, n.prototype.getY = function() {
747
- return this.y;
748
- }, n.prototype.setY = function(i) {
749
- this.y = i;
750
- }, n.prototype.getWidth = function() {
751
- return this.width;
752
- }, n.prototype.setWidth = function(i) {
753
- this.width = i;
754
- }, n.prototype.getHeight = function() {
755
- return this.height;
756
- }, n.prototype.setHeight = function(i) {
757
- this.height = i;
758
- }, n.prototype.getRight = function() {
759
- return this.x + this.width;
760
- }, n.prototype.getBottom = function() {
761
- return this.y + this.height;
762
- }, n.prototype.intersects = function(i) {
763
- return !(this.getRight() < i.x || this.getBottom() < i.y || i.getRight() < this.x || i.getBottom() < this.y);
764
- }, n.prototype.getCenterX = function() {
765
- return this.x + this.width / 2;
766
- }, n.prototype.getMinX = function() {
767
- return this.getX();
768
- }, n.prototype.getMaxX = function() {
769
- return this.getX() + this.width;
770
- }, n.prototype.getCenterY = function() {
771
- return this.y + this.height / 2;
772
- }, n.prototype.getMinY = function() {
773
- return this.getY();
774
- }, n.prototype.getMaxY = function() {
775
- return this.getY() + this.height;
776
- }, n.prototype.getWidthHalf = function() {
777
- return this.width / 2;
778
- }, n.prototype.getHeightHalf = function() {
779
- return this.height / 2;
780
- }, m.exports = n;
781
- }),
782
- (function(m, L, A) {
783
- var n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
784
- return typeof t;
785
- } : function(t) {
786
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
787
- };
788
- function i() {
789
- }
790
- i.lastID = 0, i.createID = function(t) {
791
- return i.isPrimitive(t) ? t : (t.uniqueID == null && (t.uniqueID = i.getString(), i.lastID++), t.uniqueID);
792
- }, i.getString = function(t) {
793
- return t ??= i.lastID, "Object#" + t;
794
- }, i.isPrimitive = function(t) {
795
- var e = t === void 0 ? "undefined" : n(t);
796
- return t == null || e != "object" && e != "function";
797
- }, m.exports = i;
798
- }),
799
- (function(m, L, A) {
800
- function n(u) {
801
- if (Array.isArray(u)) {
802
- for (var p = 0, y = Array(u.length); p < u.length; p++) y[p] = u[p];
803
- return y;
804
- }
805
- return Array.from(u);
806
- }
807
- var i = A(0), t = A(6), e = A(3), r = A(1), h = A(5), o = A(4), N = A(17), s = A(27);
808
- function g(u) {
809
- s.call(this), this.layoutQuality = i.QUALITY, this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED, this.incremental = i.DEFAULT_INCREMENTAL, this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT, this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD, this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES, this.edgeToDummyNodes = /* @__PURE__ */ new Map(), this.graphManager = new t(this), this.isLayoutFinished = !1, this.isSubLayout = !1, this.isRemoteUse = !1, u != null && (this.isRemoteUse = u);
810
- }
811
- g.RANDOM_SEED = 1, g.prototype = Object.create(s.prototype), g.prototype.getGraphManager = function() {
812
- return this.graphManager;
813
- }, g.prototype.getAllNodes = function() {
814
- return this.graphManager.getAllNodes();
815
- }, g.prototype.getAllEdges = function() {
816
- return this.graphManager.getAllEdges();
817
- }, g.prototype.getAllNodesToApplyGravitation = function() {
818
- return this.graphManager.getAllNodesToApplyGravitation();
819
- }, g.prototype.newGraphManager = function() {
820
- var u = new t(this);
821
- return this.graphManager = u, u;
822
- }, g.prototype.newGraph = function(u) {
823
- return new h(null, this.graphManager, u);
824
- }, g.prototype.newNode = function(u) {
825
- return new e(this.graphManager, u);
826
- }, g.prototype.newEdge = function(u) {
827
- return new r(null, null, u);
828
- }, g.prototype.checkLayoutSuccess = function() {
829
- return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();
830
- }, g.prototype.runLayout = function() {
831
- this.isLayoutFinished = !1, this.tilingPreLayout && this.tilingPreLayout(), this.initParameters();
832
- var u = !this.checkLayoutSuccess() && this.layout();
833
- return i.ANIMATE !== "during" && (u && (this.isSubLayout || this.doPostLayout()), this.tilingPostLayout && this.tilingPostLayout(), this.isLayoutFinished = !0, u);
834
- }, g.prototype.doPostLayout = function() {
835
- this.incremental || this.transform(), this.update();
836
- }, g.prototype.update2 = function() {
837
- if (this.createBendsAsNeeded && (this.createBendpointsFromDummyNodes(), this.graphManager.resetAllEdges()), !this.isRemoteUse) {
838
- for (var u = this.graphManager.getAllEdges(), p = 0; p < u.length; p++) u[p];
839
- for (var y = this.graphManager.getRoot().getNodes(), p = 0; p < y.length; p++) y[p];
840
- this.update(this.graphManager.getRoot());
841
- }
842
- }, g.prototype.update = function(u) {
843
- if (u == null) this.update2();
844
- else if (u instanceof e) {
845
- var p = u;
846
- if (p.getChild() != null) for (var y = p.getChild().getNodes(), c = 0; c < y.length; c++) update(y[c]);
847
- p.vGraphObject != null && p.vGraphObject.update(p);
848
- } else if (u instanceof r) {
849
- var f = u;
850
- f.vGraphObject != null && f.vGraphObject.update(f);
851
- } else if (u instanceof h) {
852
- var T = u;
853
- T.vGraphObject != null && T.vGraphObject.update(T);
854
- }
855
- }, g.prototype.initParameters = function() {
856
- this.isSubLayout || (this.layoutQuality = i.QUALITY, this.animationDuringLayout = i.DEFAULT_ANIMATION_DURING_LAYOUT, this.animationPeriod = i.DEFAULT_ANIMATION_PERIOD, this.animationOnLayout = i.DEFAULT_ANIMATION_ON_LAYOUT, this.incremental = i.DEFAULT_INCREMENTAL, this.createBendsAsNeeded = i.DEFAULT_CREATE_BENDS_AS_NEEDED, this.uniformLeafNodeSizes = i.DEFAULT_UNIFORM_LEAF_NODE_SIZES), this.animationDuringLayout && (this.animationOnLayout = !1);
857
- }, g.prototype.transform = function(u) {
858
- if (u == null) this.transform(new o(0, 0));
859
- else {
860
- var p = new N(), y = this.graphManager.getRoot().updateLeftTop();
861
- if (y != null) {
862
- p.setWorldOrgX(u.x), p.setWorldOrgY(u.y), p.setDeviceOrgX(y.x), p.setDeviceOrgY(y.y);
863
- for (var c = this.getAllNodes(), f, T = 0; T < c.length; T++) f = c[T], f.transform(p);
864
- }
865
- }
866
- }, g.prototype.positionNodesRandomly = function(u) {
867
- if (u == null) this.positionNodesRandomly(this.getGraphManager().getRoot()), this.getGraphManager().getRoot().updateBounds(!0);
868
- else for (var p, y, c = u.getNodes(), f = 0; f < c.length; f++) p = c[f], y = p.getChild(), y == null || y.getNodes().length == 0 ? p.scatter() : (this.positionNodesRandomly(y), p.updateBounds());
869
- }, g.prototype.getFlatForest = function() {
870
- for (var u = [], p = !0, y = this.graphManager.getRoot().getNodes(), c = !0, f = 0; f < y.length; f++) y[f].getChild() != null && (c = !1);
871
- if (!c) return u;
872
- var T = /* @__PURE__ */ new Set(), E = [], O = /* @__PURE__ */ new Map(), a = [];
873
- for (a = a.concat(y); a.length > 0 && p; ) {
874
- for (E.push(a[0]); E.length > 0 && p; ) {
875
- var d = E[0];
876
- E.splice(0, 1), T.add(d);
877
- for (var l = d.getEdges(), f = 0; f < l.length; f++) {
878
- var v = l[f].getOtherEnd(d);
879
- if (O.get(d) != v)
880
- if (!T.has(v)) E.push(v), O.set(v, d);
881
- else {
882
- p = !1;
883
- break;
884
- }
885
- }
886
- }
887
- if (!p) u = [];
888
- else {
889
- var _ = [].concat(n(T));
890
- u.push(_);
891
- for (var f = 0; f < _.length; f++) {
892
- var D = _[f], I = a.indexOf(D);
893
- I > -1 && a.splice(I, 1);
894
- }
895
- T = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Map();
896
- }
897
- }
898
- return u;
899
- }, g.prototype.createDummyNodesForBendpoints = function(u) {
900
- for (var p = [], y = u.source, c = this.graphManager.calcLowestCommonAncestor(u.source, u.target), f = 0; f < u.bendpoints.length; f++) {
901
- var T = this.newNode(null);
902
- T.setRect(new Point(0, 0), new Dimension(1, 1)), c.add(T);
903
- var E = this.newEdge(null);
904
- this.graphManager.add(E, y, T), p.add(T), y = T;
905
- }
906
- var E = this.newEdge(null);
907
- return this.graphManager.add(E, y, u.target), this.edgeToDummyNodes.set(u, p), u.isInterGraph() ? this.graphManager.remove(u) : c.remove(u), p;
908
- }, g.prototype.createBendpointsFromDummyNodes = function() {
909
- var u = [];
910
- u = u.concat(this.graphManager.getAllEdges()), u = [].concat(n(this.edgeToDummyNodes.keys()), u);
911
- for (var p = 0; p < u.length; p++) {
912
- var y = u[p];
913
- if (y.bendpoints.length > 0) {
914
- for (var c = this.edgeToDummyNodes.get(y), f = 0; f < c.length; f++) {
915
- var T = c[f], E = new o(T.getCenterX(), T.getCenterY()), O = y.bendpoints.get(f);
916
- O.x = E.x, O.y = E.y, T.getOwner().remove(T);
917
- }
918
- this.graphManager.add(y, y.source, y.target);
919
- }
920
- }
921
- }, g.transform = function(u, p, y, c) {
922
- if (y != null && c != null) {
923
- var f = p;
924
- if (u <= 50) {
925
- var T = p / y;
926
- f -= (p - T) / 50 * (50 - u);
927
- } else {
928
- var E = p * c;
929
- f += (E - p) / 50 * (u - 50);
930
- }
931
- return f;
932
- }
933
- var O, a;
934
- return u <= 50 ? (O = 9 * p / 500, a = p / 10) : (O = 9 * p / 50, a = -8 * p), O * u + a;
935
- }, g.findCenterOfTree = function(u) {
936
- var p = [];
937
- p = p.concat(u);
938
- var y = [], c = /* @__PURE__ */ new Map(), f = !1, T = null;
939
- (p.length == 1 || p.length == 2) && (f = !0, T = p[0]);
940
- for (var E = 0; E < p.length; E++) {
941
- var O = p[E], a = O.getNeighborsList().size;
942
- c.set(O, O.getNeighborsList().size), a == 1 && y.push(O);
943
- }
944
- var d = [];
945
- for (d = d.concat(y); !f; ) {
946
- var l = [];
947
- l = l.concat(d), d = [];
948
- for (var E = 0; E < p.length; E++) {
949
- var O = p[E], v = p.indexOf(O);
950
- v >= 0 && p.splice(v, 1), O.getNeighborsList().forEach(function(I) {
951
- if (y.indexOf(I) < 0) {
952
- var w = c.get(I) - 1;
953
- w == 1 && d.push(I), c.set(I, w);
954
- }
955
- });
956
- }
957
- y = y.concat(d), (p.length == 1 || p.length == 2) && (f = !0, T = p[0]);
958
- }
959
- return T;
960
- }, g.prototype.setGraphManager = function(u) {
961
- this.graphManager = u;
962
- }, m.exports = g;
963
- }),
964
- (function(m, L, A) {
965
- function n() {
966
- }
967
- n.seed = 1, n.x = 0, n.nextDouble = function() {
968
- return n.x = Math.sin(n.seed++) * 1e4, n.x - Math.floor(n.x);
969
- }, m.exports = n;
970
- }),
971
- (function(m, L, A) {
972
- var n = A(4);
973
- function i(t, e) {
974
- this.lworldOrgX = 0, this.lworldOrgY = 0, this.ldeviceOrgX = 0, this.ldeviceOrgY = 0, this.lworldExtX = 1, this.lworldExtY = 1, this.ldeviceExtX = 1, this.ldeviceExtY = 1;
975
- }
976
- i.prototype.getWorldOrgX = function() {
977
- return this.lworldOrgX;
978
- }, i.prototype.setWorldOrgX = function(t) {
979
- this.lworldOrgX = t;
980
- }, i.prototype.getWorldOrgY = function() {
981
- return this.lworldOrgY;
982
- }, i.prototype.setWorldOrgY = function(t) {
983
- this.lworldOrgY = t;
984
- }, i.prototype.getWorldExtX = function() {
985
- return this.lworldExtX;
986
- }, i.prototype.setWorldExtX = function(t) {
987
- this.lworldExtX = t;
988
- }, i.prototype.getWorldExtY = function() {
989
- return this.lworldExtY;
990
- }, i.prototype.setWorldExtY = function(t) {
991
- this.lworldExtY = t;
992
- }, i.prototype.getDeviceOrgX = function() {
993
- return this.ldeviceOrgX;
994
- }, i.prototype.setDeviceOrgX = function(t) {
995
- this.ldeviceOrgX = t;
996
- }, i.prototype.getDeviceOrgY = function() {
997
- return this.ldeviceOrgY;
998
- }, i.prototype.setDeviceOrgY = function(t) {
999
- this.ldeviceOrgY = t;
1000
- }, i.prototype.getDeviceExtX = function() {
1001
- return this.ldeviceExtX;
1002
- }, i.prototype.setDeviceExtX = function(t) {
1003
- this.ldeviceExtX = t;
1004
- }, i.prototype.getDeviceExtY = function() {
1005
- return this.ldeviceExtY;
1006
- }, i.prototype.setDeviceExtY = function(t) {
1007
- this.ldeviceExtY = t;
1008
- }, i.prototype.transformX = function(t) {
1009
- var e = 0, r = this.lworldExtX;
1010
- return r != 0 && (e = this.ldeviceOrgX + (t - this.lworldOrgX) * this.ldeviceExtX / r), e;
1011
- }, i.prototype.transformY = function(t) {
1012
- var e = 0, r = this.lworldExtY;
1013
- return r != 0 && (e = this.ldeviceOrgY + (t - this.lworldOrgY) * this.ldeviceExtY / r), e;
1014
- }, i.prototype.inverseTransformX = function(t) {
1015
- var e = 0, r = this.ldeviceExtX;
1016
- return r != 0 && (e = this.lworldOrgX + (t - this.ldeviceOrgX) * this.lworldExtX / r), e;
1017
- }, i.prototype.inverseTransformY = function(t) {
1018
- var e = 0, r = this.ldeviceExtY;
1019
- return r != 0 && (e = this.lworldOrgY + (t - this.ldeviceOrgY) * this.lworldExtY / r), e;
1020
- }, i.prototype.inverseTransformPoint = function(t) {
1021
- return new n(this.inverseTransformX(t.x), this.inverseTransformY(t.y));
1022
- }, m.exports = i;
1023
- }),
1024
- (function(m, L, A) {
1025
- function n(s) {
1026
- if (Array.isArray(s)) {
1027
- for (var g = 0, u = Array(s.length); g < s.length; g++) u[g] = s[g];
1028
- return u;
1029
- }
1030
- return Array.from(s);
1031
- }
1032
- var i = A(15), t = A(7), e = A(0), r = A(8), h = A(9);
1033
- function o() {
1034
- i.call(this), this.useSmartIdealEdgeLengthCalculation = t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.idealEdgeLength = t.DEFAULT_EDGE_LENGTH, this.springConstant = t.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = t.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = t.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = t.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.displacementThresholdPerNode = 3 * t.DEFAULT_EDGE_LENGTH / 100, this.coolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.initialCoolingFactor = t.DEFAULT_COOLING_FACTOR_INCREMENTAL, this.totalDisplacement = 0, this.oldTotalDisplacement = 0, this.maxIterations = t.MAX_ITERATIONS;
1035
- }
1036
- for (var N in o.prototype = Object.create(i.prototype), i) o[N] = i[N];
1037
- o.prototype.initParameters = function() {
1038
- i.prototype.initParameters.call(this, arguments), this.totalIterations = 0, this.notAnimatedIterations = 0, this.useFRGridVariant = t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION, this.grid = [];
1039
- }, o.prototype.calcIdealEdgeLengths = function() {
1040
- for (var s, g, u, p, y, c, f = this.getGraphManager().getAllEdges(), T = 0; T < f.length; T++) s = f[T], s.idealLength = this.idealEdgeLength, s.isInterGraph && (u = s.getSource(), p = s.getTarget(), y = s.getSourceInLca().getEstimatedSize(), c = s.getTargetInLca().getEstimatedSize(), this.useSmartIdealEdgeLengthCalculation && (s.idealLength += y + c - 2 * e.SIMPLE_NODE_SIZE), g = s.getLca().getInclusionTreeDepth(), s.idealLength += t.DEFAULT_EDGE_LENGTH * t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (u.getInclusionTreeDepth() + p.getInclusionTreeDepth() - 2 * g));
1041
- }, o.prototype.initSpringEmbedder = function() {
1042
- var s = this.getAllNodes().length;
1043
- this.incremental ? (s > t.ADAPTATION_LOWER_NODE_LIMIT && (this.coolingFactor = Math.max(this.coolingFactor * t.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (s - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - t.COOLING_ADAPTATION_FACTOR))), this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT_INCREMENTAL) : (this.coolingFactor = s > t.ADAPTATION_LOWER_NODE_LIMIT ? Math.max(t.COOLING_ADAPTATION_FACTOR, 1 - (s - t.ADAPTATION_LOWER_NODE_LIMIT) / (t.ADAPTATION_UPPER_NODE_LIMIT - t.ADAPTATION_LOWER_NODE_LIMIT) * (1 - t.COOLING_ADAPTATION_FACTOR)) : 1, this.initialCoolingFactor = this.coolingFactor, this.maxNodeDisplacement = t.MAX_NODE_DISPLACEMENT), this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations), this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length, this.repulsionRange = this.calcRepulsionRange();
1044
- }, o.prototype.calcSpringForces = function() {
1045
- for (var s = this.getAllEdges(), g, u = 0; u < s.length; u++) g = s[u], this.calcSpringForce(g, g.idealLength);
1046
- }, o.prototype.calcRepulsionForces = function() {
1047
- var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, g = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], u, p, y, c, f = this.getAllNodes(), T;
1048
- if (this.useFRGridVariant) for (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && s && this.updateGrid(), T = /* @__PURE__ */ new Set(), u = 0; u < f.length; u++) y = f[u], this.calculateRepulsionForceOfANode(y, T, s, g), T.add(y);
1049
- else for (u = 0; u < f.length; u++) for (y = f[u], p = u + 1; p < f.length; p++) c = f[p], y.getOwner() == c.getOwner() && this.calcRepulsionForce(y, c);
1050
- }, o.prototype.calcGravitationalForces = function() {
1051
- for (var s, g = this.getAllNodesToApplyGravitation(), u = 0; u < g.length; u++) s = g[u], this.calcGravitationalForce(s);
1052
- }, o.prototype.moveNodes = function() {
1053
- for (var s = this.getAllNodes(), g, u = 0; u < s.length; u++) g = s[u], g.move();
1054
- }, o.prototype.calcSpringForce = function(s, g) {
1055
- var u = s.getSource(), p = s.getTarget(), y, c, f, T;
1056
- if (this.uniformLeafNodeSizes && u.getChild() == null && p.getChild() == null) s.updateLengthSimple();
1057
- else if (s.updateLength(), s.isOverlapingSourceAndTarget) return;
1058
- y = s.getLength(), y != 0 && (c = this.springConstant * (y - g), f = c * (s.lengthX / y), T = c * (s.lengthY / y), u.springForceX += f, u.springForceY += T, p.springForceX -= f, p.springForceY -= T);
1059
- }, o.prototype.calcRepulsionForce = function(s, g) {
1060
- var u = s.getRect(), p = g.getRect(), y = [, ,], c = [
1061
- ,
1062
- ,
1063
- ,
1064
- ,
1065
- ], f, T, E, O, a, d, l;
1066
- if (u.intersects(p)) {
1067
- r.calcSeparationAmount(u, p, y, t.DEFAULT_EDGE_LENGTH / 2), d = 2 * y[0], l = 2 * y[1];
1068
- var v = s.noOfChildren * g.noOfChildren / (s.noOfChildren + g.noOfChildren);
1069
- s.repulsionForceX -= v * d, s.repulsionForceY -= v * l, g.repulsionForceX += v * d, g.repulsionForceY += v * l;
1070
- } else this.uniformLeafNodeSizes && s.getChild() == null && g.getChild() == null ? (f = p.getCenterX() - u.getCenterX(), T = p.getCenterY() - u.getCenterY()) : (r.getIntersection(u, p, c), f = c[2] - c[0], T = c[3] - c[1]), Math.abs(f) < t.MIN_REPULSION_DIST && (f = h.sign(f) * t.MIN_REPULSION_DIST), Math.abs(T) < t.MIN_REPULSION_DIST && (T = h.sign(T) * t.MIN_REPULSION_DIST), E = f * f + T * T, O = Math.sqrt(E), a = this.repulsionConstant * s.noOfChildren * g.noOfChildren / E, d = a * f / O, l = a * T / O, s.repulsionForceX -= d, s.repulsionForceY -= l, g.repulsionForceX += d, g.repulsionForceY += l;
1071
- }, o.prototype.calcGravitationalForce = function(s) {
1072
- var g = s.getOwner(), u = (g.getRight() + g.getLeft()) / 2, p = (g.getTop() + g.getBottom()) / 2, y = s.getCenterX() - u, c = s.getCenterY() - p, f = Math.abs(y) + s.getWidth() / 2, T = Math.abs(c) + s.getHeight() / 2, E;
1073
- s.getOwner() == this.graphManager.getRoot() ? (E = g.getEstimatedSize() * this.gravityRangeFactor, (f > E || T > E) && (s.gravitationForceX = -this.gravityConstant * y, s.gravitationForceY = -this.gravityConstant * c)) : (E = g.getEstimatedSize() * this.compoundGravityRangeFactor, (f > E || T > E) && (s.gravitationForceX = -this.gravityConstant * y * this.compoundGravityConstant, s.gravitationForceY = -this.gravityConstant * c * this.compoundGravityConstant));
1074
- }, o.prototype.isConverged = function() {
1075
- var s, g = !1;
1076
- return this.totalIterations > this.maxIterations / 3 && (g = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2), s = this.totalDisplacement < this.totalDisplacementThreshold, this.oldTotalDisplacement = this.totalDisplacement, s || g;
1077
- }, o.prototype.animate = function() {
1078
- this.animationDuringLayout && !this.isSubLayout && (this.notAnimatedIterations == this.animationPeriod ? (this.update(), this.notAnimatedIterations = 0) : this.notAnimatedIterations++);
1079
- }, o.prototype.calcNoOfChildrenForAllNodes = function() {
1080
- for (var s, g = this.graphManager.getAllNodes(), u = 0; u < g.length; u++) s = g[u], s.noOfChildren = s.getNoOfChildren();
1081
- }, o.prototype.calcGrid = function(s) {
1082
- var g = 0, u = 0;
1083
- g = parseInt(Math.ceil((s.getRight() - s.getLeft()) / this.repulsionRange)), u = parseInt(Math.ceil((s.getBottom() - s.getTop()) / this.repulsionRange));
1084
- for (var p = Array(g), y = 0; y < g; y++) p[y] = Array(u);
1085
- for (var y = 0; y < g; y++) for (var c = 0; c < u; c++) p[y][c] = [];
1086
- return p;
1087
- }, o.prototype.addNodeToGrid = function(s, g, u) {
1088
- var p = 0, y = 0, c = 0, f = 0;
1089
- p = parseInt(Math.floor((s.getRect().x - g) / this.repulsionRange)), y = parseInt(Math.floor((s.getRect().width + s.getRect().x - g) / this.repulsionRange)), c = parseInt(Math.floor((s.getRect().y - u) / this.repulsionRange)), f = parseInt(Math.floor((s.getRect().height + s.getRect().y - u) / this.repulsionRange));
1090
- for (var T = p; T <= y; T++) for (var E = c; E <= f; E++) this.grid[T][E].push(s), s.setGridCoordinates(p, y, c, f);
1091
- }, o.prototype.updateGrid = function() {
1092
- var s, g, u = this.getAllNodes();
1093
- for (this.grid = this.calcGrid(this.graphManager.getRoot()), s = 0; s < u.length; s++) g = u[s], this.addNodeToGrid(g, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());
1094
- }, o.prototype.calculateRepulsionForceOfANode = function(s, g, u, p) {
1095
- if (this.totalIterations % t.GRID_CALCULATION_CHECK_PERIOD == 1 && u || p) {
1096
- var y = /* @__PURE__ */ new Set();
1097
- s.surrounding = [];
1098
- for (var c, f = this.grid, T = s.startX - 1; T < s.finishX + 2; T++) for (var E = s.startY - 1; E < s.finishY + 2; E++) if (!(T < 0 || E < 0 || T >= f.length || E >= f[0].length)) {
1099
- for (var O = 0; O < f[T][E].length; O++) if (c = f[T][E][O], s.getOwner() == c.getOwner() && s != c && !g.has(c) && !y.has(c)) {
1100
- var a = Math.abs(s.getCenterX() - c.getCenterX()) - (s.getWidth() / 2 + c.getWidth() / 2), d = Math.abs(s.getCenterY() - c.getCenterY()) - (s.getHeight() / 2 + c.getHeight() / 2);
1101
- a <= this.repulsionRange && d <= this.repulsionRange && y.add(c);
1102
- }
1103
- }
1104
- s.surrounding = [].concat(n(y));
1105
- }
1106
- for (T = 0; T < s.surrounding.length; T++) this.calcRepulsionForce(s, s.surrounding[T]);
1107
- }, o.prototype.calcRepulsionRange = function() {
1108
- return 0;
1109
- }, m.exports = o;
1110
- }),
1111
- (function(m, L, A) {
1112
- var n = A(1), i = A(7);
1113
- function t(r, h, o) {
1114
- n.call(this, r, h, o), this.idealLength = i.DEFAULT_EDGE_LENGTH;
1115
- }
1116
- for (var e in t.prototype = Object.create(n.prototype), n) t[e] = n[e];
1117
- m.exports = t;
1118
- }),
1119
- (function(m, L, A) {
1120
- var n = A(3);
1121
- function i(e, r, h, o) {
1122
- n.call(this, e, r, h, o), 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 = [];
1123
- }
1124
- for (var t in i.prototype = Object.create(n.prototype), n) i[t] = n[t];
1125
- i.prototype.setGridCoordinates = function(e, r, h, o) {
1126
- this.startX = e, this.finishX = r, this.startY = h, this.finishY = o;
1127
- }, m.exports = i;
1128
- }),
1129
- (function(m, L, A) {
1130
- function n(i, t) {
1131
- this.width = 0, this.height = 0, i !== null && t !== null && (this.height = t, this.width = i);
1132
- }
1133
- n.prototype.getWidth = function() {
1134
- return this.width;
1135
- }, n.prototype.setWidth = function(i) {
1136
- this.width = i;
1137
- }, n.prototype.getHeight = function() {
1138
- return this.height;
1139
- }, n.prototype.setHeight = function(i) {
1140
- this.height = i;
1141
- }, m.exports = n;
1142
- }),
1143
- (function(m, L, A) {
1144
- var n = A(14);
1145
- function i() {
1146
- this.map = {}, this.keys = [];
1147
- }
1148
- i.prototype.put = function(t, e) {
1149
- var r = n.createID(t);
1150
- this.contains(r) || (this.map[r] = e, this.keys.push(t));
1151
- }, i.prototype.contains = function(t) {
1152
- return n.createID(t), this.map[t] != null;
1153
- }, i.prototype.get = function(t) {
1154
- var e = n.createID(t);
1155
- return this.map[e];
1156
- }, i.prototype.keySet = function() {
1157
- return this.keys;
1158
- }, m.exports = i;
1159
- }),
1160
- (function(m, L, A) {
1161
- var n = A(14);
1162
- function i() {
1163
- this.set = {};
1164
- }
1165
- i.prototype.add = function(t) {
1166
- var e = n.createID(t);
1167
- this.contains(e) || (this.set[e] = t);
1168
- }, i.prototype.remove = function(t) {
1169
- delete this.set[n.createID(t)];
1170
- }, i.prototype.clear = function() {
1171
- this.set = {};
1172
- }, i.prototype.contains = function(t) {
1173
- return this.set[n.createID(t)] == t;
1174
- }, i.prototype.isEmpty = function() {
1175
- return this.size() === 0;
1176
- }, i.prototype.size = function() {
1177
- return Object.keys(this.set).length;
1178
- }, i.prototype.addAllTo = function(t) {
1179
- for (var e = Object.keys(this.set), r = e.length, h = 0; h < r; h++) t.push(this.set[e[h]]);
1180
- }, i.prototype.size = function() {
1181
- return Object.keys(this.set).length;
1182
- }, i.prototype.addAll = function(t) {
1183
- for (var e = t.length, r = 0; r < e; r++) {
1184
- var h = t[r];
1185
- this.add(h);
1186
- }
1187
- }, m.exports = i;
1188
- }),
1189
- (function(m, L, A) {
1190
- var n = /* @__PURE__ */ (function() {
1191
- function e(r, h) {
1192
- for (var o = 0; o < h.length; o++) {
1193
- var N = h[o];
1194
- N.enumerable = N.enumerable || !1, N.configurable = !0, "value" in N && (N.writable = !0), Object.defineProperty(r, N.key, N);
1195
- }
1196
- }
1197
- return function(r, h, o) {
1198
- return h && e(r.prototype, h), o && e(r, o), r;
1199
- };
1200
- })();
1201
- function i(e, r) {
1202
- if (!(e instanceof r)) throw TypeError("Cannot call a class as a function");
1203
- }
1204
- var t = A(11);
1205
- m.exports = (function() {
1206
- function e(r, h) {
1207
- i(this, e), (h !== null || h !== void 0) && (this.compareFunction = this._defaultCompareFunction);
1208
- var o = void 0;
1209
- o = r instanceof t ? r.size() : r.length, this._quicksort(r, 0, o - 1);
1210
- }
1211
- return n(e, [
1212
- {
1213
- key: "_quicksort",
1214
- value: function(r, h, o) {
1215
- if (h < o) {
1216
- var N = this._partition(r, h, o);
1217
- this._quicksort(r, h, N), this._quicksort(r, N + 1, o);
1218
- }
1219
- }
1220
- },
1221
- {
1222
- key: "_partition",
1223
- value: function(r, h, o) {
1224
- for (var N = this._get(r, h), s = h, g = o; ; ) {
1225
- for (; this.compareFunction(N, this._get(r, g)); ) g--;
1226
- for (; this.compareFunction(this._get(r, s), N); ) s++;
1227
- if (s < g) this._swap(r, s, g), s++, g--;
1228
- else return g;
1229
- }
1230
- }
1231
- },
1232
- {
1233
- key: "_get",
1234
- value: function(r, h) {
1235
- return r instanceof t ? r.get_object_at(h) : r[h];
1236
- }
1237
- },
1238
- {
1239
- key: "_set",
1240
- value: function(r, h, o) {
1241
- r instanceof t ? r.set_object_at(h, o) : r[h] = o;
1242
- }
1243
- },
1244
- {
1245
- key: "_swap",
1246
- value: function(r, h, o) {
1247
- var N = this._get(r, h);
1248
- this._set(r, h, this._get(r, o)), this._set(r, o, N);
1249
- }
1250
- },
1251
- {
1252
- key: "_defaultCompareFunction",
1253
- value: function(r, h) {
1254
- return h > r;
1255
- }
1256
- }
1257
- ]), e;
1258
- })();
1259
- }),
1260
- (function(m, L, A) {
1261
- var n = /* @__PURE__ */ (function() {
1262
- function t(e, r) {
1263
- for (var h = 0; h < r.length; h++) {
1264
- var o = r[h];
1265
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
1266
- }
1267
- }
1268
- return function(e, r, h) {
1269
- return r && t(e.prototype, r), h && t(e, h), e;
1270
- };
1271
- })();
1272
- function i(t, e) {
1273
- if (!(t instanceof e)) throw TypeError("Cannot call a class as a function");
1274
- }
1275
- m.exports = (function() {
1276
- function t(e, r) {
1277
- var h = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : -1, N = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : -1;
1278
- i(this, t), this.sequence1 = e, this.sequence2 = r, this.match_score = h, this.mismatch_penalty = o, this.gap_penalty = N, this.iMax = e.length + 1, this.jMax = r.length + 1, this.grid = Array(this.iMax);
1279
- for (var s = 0; s < this.iMax; s++) {
1280
- this.grid[s] = Array(this.jMax);
1281
- for (var g = 0; g < this.jMax; g++) this.grid[s][g] = 0;
1282
- }
1283
- this.tracebackGrid = Array(this.iMax);
1284
- for (var u = 0; u < this.iMax; u++) {
1285
- this.tracebackGrid[u] = Array(this.jMax);
1286
- for (var p = 0; p < this.jMax; p++) this.tracebackGrid[u][p] = [
1287
- null,
1288
- null,
1289
- null
1290
- ];
1291
- }
1292
- this.alignments = [], this.score = -1, this.computeGrids();
1293
- }
1294
- return n(t, [
1295
- {
1296
- key: "getScore",
1297
- value: function() {
1298
- return this.score;
1299
- }
1300
- },
1301
- {
1302
- key: "getAlignments",
1303
- value: function() {
1304
- return this.alignments;
1305
- }
1306
- },
1307
- {
1308
- key: "computeGrids",
1309
- value: function() {
1310
- for (var e = 1; e < this.jMax; e++) this.grid[0][e] = this.grid[0][e - 1] + this.gap_penalty, this.tracebackGrid[0][e] = [
1311
- !1,
1312
- !1,
1313
- !0
1314
- ];
1315
- for (var r = 1; r < this.iMax; r++) this.grid[r][0] = this.grid[r - 1][0] + this.gap_penalty, this.tracebackGrid[r][0] = [
1316
- !1,
1317
- !0,
1318
- !1
1319
- ];
1320
- for (var h = 1; h < this.iMax; h++) for (var o = 1; o < this.jMax; o++) {
1321
- var N = void 0;
1322
- N = this.sequence1[h - 1] === this.sequence2[o - 1] ? this.grid[h - 1][o - 1] + this.match_score : this.grid[h - 1][o - 1] + this.mismatch_penalty;
1323
- var s = this.grid[h - 1][o] + this.gap_penalty, g = this.grid[h][o - 1] + this.gap_penalty, u = [
1324
- N,
1325
- s,
1326
- g
1327
- ], p = this.arrayAllMaxIndexes(u);
1328
- this.grid[h][o] = u[p[0]], this.tracebackGrid[h][o] = [
1329
- p.includes(0),
1330
- p.includes(1),
1331
- p.includes(2)
1332
- ];
1333
- }
1334
- this.score = this.grid[this.iMax - 1][this.jMax - 1];
1335
- }
1336
- },
1337
- {
1338
- key: "alignmentTraceback",
1339
- value: function() {
1340
- var e = [];
1341
- for (e.push({
1342
- pos: [this.sequence1.length, this.sequence2.length],
1343
- seq1: "",
1344
- seq2: ""
1345
- }); e[0]; ) {
1346
- var r = e[0], h = this.tracebackGrid[r.pos[0]][r.pos[1]];
1347
- h[0] && e.push({
1348
- pos: [r.pos[0] - 1, r.pos[1] - 1],
1349
- seq1: this.sequence1[r.pos[0] - 1] + r.seq1,
1350
- seq2: this.sequence2[r.pos[1] - 1] + r.seq2
1351
- }), h[1] && e.push({
1352
- pos: [r.pos[0] - 1, r.pos[1]],
1353
- seq1: this.sequence1[r.pos[0] - 1] + r.seq1,
1354
- seq2: "-" + r.seq2
1355
- }), h[2] && e.push({
1356
- pos: [r.pos[0], r.pos[1] - 1],
1357
- seq1: "-" + r.seq1,
1358
- seq2: this.sequence2[r.pos[1] - 1] + r.seq2
1359
- }), r.pos[0] === 0 && r.pos[1] === 0 && this.alignments.push({
1360
- sequence1: r.seq1,
1361
- sequence2: r.seq2
1362
- }), e.shift();
1363
- }
1364
- return this.alignments;
1365
- }
1366
- },
1367
- {
1368
- key: "getAllIndexes",
1369
- value: function(e, r) {
1370
- for (var h = [], o = -1; (o = e.indexOf(r, o + 1)) !== -1; ) h.push(o);
1371
- return h;
1372
- }
1373
- },
1374
- {
1375
- key: "arrayAllMaxIndexes",
1376
- value: function(e) {
1377
- return this.getAllIndexes(e, Math.max.apply(null, e));
1378
- }
1379
- }
1380
- ]), t;
1381
- })();
1382
- }),
1383
- (function(m, L, A) {
1384
- var n = function() {
1385
- };
1386
- n.FDLayout = A(18), n.FDLayoutConstants = A(7), n.FDLayoutEdge = A(19), n.FDLayoutNode = A(20), n.DimensionD = A(21), n.HashMap = A(22), n.HashSet = A(23), n.IGeometry = A(8), n.IMath = A(9), n.Integer = A(10), n.Point = A(12), n.PointD = A(4), n.RandomSeed = A(16), n.RectangleD = A(13), n.Transform = A(17), n.UniqueIDGeneretor = A(14), n.Quicksort = A(24), n.LinkedList = A(11), n.LGraphObject = A(2), n.LGraph = A(5), n.LEdge = A(1), n.LGraphManager = A(6), n.LNode = A(3), n.Layout = A(15), n.LayoutConstants = A(0), n.NeedlemanWunsch = A(25), m.exports = n;
1387
- }),
1388
- (function(m, L, A) {
1389
- function n() {
1390
- this.listeners = [];
1391
- }
1392
- var i = n.prototype;
1393
- i.addListener = function(t, e) {
1394
- this.listeners.push({
1395
- event: t,
1396
- callback: e
1397
- });
1398
- }, i.removeListener = function(t, e) {
1399
- for (var r = this.listeners.length; r >= 0; r--) {
1400
- var h = this.listeners[r];
1401
- h.event === t && h.callback === e && this.listeners.splice(r, 1);
1402
- }
1403
- }, i.emit = function(t, e) {
1404
- for (var r = 0; r < this.listeners.length; r++) {
1405
- var h = this.listeners[r];
1406
- t === h.event && h.callback(e);
1407
- }
1408
- }, m.exports = n;
1409
- })
1410
- ]);
1411
- });
1412
- })), Z = /* @__PURE__ */ V(((C, P) => {
1413
- (function(m, L) {
1414
- typeof C == "object" && typeof P == "object" ? P.exports = L(z()) : typeof define == "function" && define.amd ? define(["layout-base"], L) : typeof C == "object" ? C.coseBase = L(z()) : m.coseBase = L(m.layoutBase);
1415
- })(C, function(m) {
1416
- return (function(L) {
1417
- var A = {};
1418
- function n(i) {
1419
- if (A[i]) return A[i].exports;
1420
- var t = A[i] = {
1421
- i,
1422
- l: !1,
1423
- exports: {}
1424
- };
1425
- return L[i].call(t.exports, t, t.exports, n), t.l = !0, t.exports;
1426
- }
1427
- return n.m = L, n.c = A, n.i = function(i) {
1428
- return i;
1429
- }, n.d = function(i, t, e) {
1430
- n.o(i, t) || Object.defineProperty(i, t, {
1431
- configurable: !1,
1432
- enumerable: !0,
1433
- get: e
1434
- });
1435
- }, n.n = function(i) {
1436
- var t = i && i.__esModule ? function() {
1437
- return i.default;
1438
- } : function() {
1439
- return i;
1440
- };
1441
- return n.d(t, "a", t), t;
1442
- }, n.o = function(i, t) {
1443
- return Object.prototype.hasOwnProperty.call(i, t);
1444
- }, n.p = "", n(n.s = 7);
1445
- })([
1446
- (function(L, A) {
1447
- L.exports = m;
1448
- }),
1449
- (function(L, A, n) {
1450
- var i = n(0).FDLayoutConstants;
1451
- function t() {
1452
- }
1453
- for (var e in i) t[e] = i[e];
1454
- t.DEFAULT_USE_MULTI_LEVEL_SCALING = !1, t.DEFAULT_RADIAL_SEPARATION = i.DEFAULT_EDGE_LENGTH, t.DEFAULT_COMPONENT_SEPERATION = 60, t.TILE = !0, t.TILING_PADDING_VERTICAL = 10, t.TILING_PADDING_HORIZONTAL = 10, t.TREE_REDUCTION_ON_INCREMENTAL = !1, L.exports = t;
1455
- }),
1456
- (function(L, A, n) {
1457
- var i = n(0).FDLayoutEdge;
1458
- function t(r, h, o) {
1459
- i.call(this, r, h, o);
1460
- }
1461
- for (var e in t.prototype = Object.create(i.prototype), i) t[e] = i[e];
1462
- L.exports = t;
1463
- }),
1464
- (function(L, A, n) {
1465
- var i = n(0).LGraph;
1466
- function t(r, h, o) {
1467
- i.call(this, r, h, o);
1468
- }
1469
- for (var e in t.prototype = Object.create(i.prototype), i) t[e] = i[e];
1470
- L.exports = t;
1471
- }),
1472
- (function(L, A, n) {
1473
- var i = n(0).LGraphManager;
1474
- function t(r) {
1475
- i.call(this, r);
1476
- }
1477
- for (var e in t.prototype = Object.create(i.prototype), i) t[e] = i[e];
1478
- L.exports = t;
1479
- }),
1480
- (function(L, A, n) {
1481
- var i = n(0).FDLayoutNode, t = n(0).IMath;
1482
- function e(h, o, N, s) {
1483
- i.call(this, h, o, N, s);
1484
- }
1485
- for (var r in e.prototype = Object.create(i.prototype), i) e[r] = i[r];
1486
- e.prototype.move = function() {
1487
- var h = this.graphManager.getLayout();
1488
- this.displacementX = h.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren, this.displacementY = h.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren, Math.abs(this.displacementX) > h.coolingFactor * h.maxNodeDisplacement && (this.displacementX = h.coolingFactor * h.maxNodeDisplacement * t.sign(this.displacementX)), Math.abs(this.displacementY) > h.coolingFactor * h.maxNodeDisplacement && (this.displacementY = h.coolingFactor * h.maxNodeDisplacement * t.sign(this.displacementY)), this.child == null || this.child.getNodes().length == 0 ? this.moveBy(this.displacementX, this.displacementY) : this.propogateDisplacementToChildren(this.displacementX, this.displacementY), h.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;
1489
- }, e.prototype.propogateDisplacementToChildren = function(h, o) {
1490
- for (var N = this.getChild().getNodes(), s, g = 0; g < N.length; g++) s = N[g], s.getChild() == null ? (s.moveBy(h, o), s.displacementX += h, s.displacementY += o) : s.propogateDisplacementToChildren(h, o);
1491
- }, e.prototype.setPred1 = function(h) {
1492
- this.pred1 = h;
1493
- }, e.prototype.getPred1 = function() {
1494
- return pred1;
1495
- }, e.prototype.getPred2 = function() {
1496
- return pred2;
1497
- }, e.prototype.setNext = function(h) {
1498
- this.next = h;
1499
- }, e.prototype.getNext = function() {
1500
- return next;
1501
- }, e.prototype.setProcessed = function(h) {
1502
- this.processed = h;
1503
- }, e.prototype.isProcessed = function() {
1504
- return processed;
1505
- }, L.exports = e;
1506
- }),
1507
- (function(L, A, n) {
1508
- var i = n(0).FDLayout, t = n(4), e = n(3), r = n(5), h = n(2), o = n(1), N = n(0).FDLayoutConstants, s = n(0).LayoutConstants, g = n(0).Point, u = n(0).PointD, p = n(0).Layout, y = n(0).Integer, c = n(0).IGeometry, f = n(0).LGraph, T = n(0).Transform;
1509
- function E() {
1510
- i.call(this), this.toBeTiled = {};
1511
- }
1512
- for (var O in E.prototype = Object.create(i.prototype), i) E[O] = i[O];
1513
- E.prototype.newGraphManager = function() {
1514
- var a = new t(this);
1515
- return this.graphManager = a, a;
1516
- }, E.prototype.newGraph = function(a) {
1517
- return new e(null, this.graphManager, a);
1518
- }, E.prototype.newNode = function(a) {
1519
- return new r(this.graphManager, a);
1520
- }, E.prototype.newEdge = function(a) {
1521
- return new h(null, null, a);
1522
- }, E.prototype.initParameters = function() {
1523
- i.prototype.initParameters.call(this, arguments), this.isSubLayout || (this.idealEdgeLength = o.DEFAULT_EDGE_LENGTH < 10 ? 10 : o.DEFAULT_EDGE_LENGTH, this.useSmartIdealEdgeLengthCalculation = o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION, this.springConstant = N.DEFAULT_SPRING_STRENGTH, this.repulsionConstant = N.DEFAULT_REPULSION_STRENGTH, this.gravityConstant = N.DEFAULT_GRAVITY_STRENGTH, this.compoundGravityConstant = N.DEFAULT_COMPOUND_GRAVITY_STRENGTH, this.gravityRangeFactor = N.DEFAULT_GRAVITY_RANGE_FACTOR, this.compoundGravityRangeFactor = N.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR, this.prunedNodesAll = [], this.growTreeIterations = 0, this.afterGrowthIterations = 0, this.isTreeGrowing = !1, this.isGrowthFinished = !1, this.coolingCycle = 0, this.maxCoolingCycle = this.maxIterations / N.CONVERGENCE_CHECK_PERIOD, this.finalTemperature = N.CONVERGENCE_CHECK_PERIOD / this.maxIterations, this.coolingAdjuster = 1);
1524
- }, E.prototype.layout = function() {
1525
- return s.DEFAULT_CREATE_BENDS_AS_NEEDED && (this.createBendpoints(), this.graphManager.resetAllEdges()), this.level = 0, this.classicLayout();
1526
- }, E.prototype.classicLayout = function() {
1527
- 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) {
1528
- var a = this.getFlatForest();
1529
- if (a.length > 0) this.positionNodesRadially(a);
1530
- else {
1531
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1532
- var d = new Set(this.getAllNodes()), l = this.nodesWithGravity.filter(function(v) {
1533
- return d.has(v);
1534
- });
1535
- this.graphManager.setAllNodesToApplyGravitation(l), this.positionNodesRandomly();
1536
- }
1537
- } else if (o.TREE_REDUCTION_ON_INCREMENTAL) {
1538
- this.reduceTrees(), this.graphManager.resetAllNodesToApplyGravitation();
1539
- var d = new Set(this.getAllNodes()), l = this.nodesWithGravity.filter(function(D) {
1540
- return d.has(D);
1541
- });
1542
- this.graphManager.setAllNodesToApplyGravitation(l);
1543
- }
1544
- return this.initSpringEmbedder(), this.runSpringEmbedder(), !0;
1545
- }, E.prototype.tick = function() {
1546
- if (this.totalIterations++, this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished)
1547
- if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1548
- else return !0;
1549
- if (this.totalIterations % N.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {
1550
- if (this.isConverged())
1551
- if (this.prunedNodesAll.length > 0) this.isTreeGrowing = !0;
1552
- else return !0;
1553
- this.coolingCycle++, this.layoutQuality == 0 ? this.coolingAdjuster = this.coolingCycle : this.layoutQuality == 1 && (this.coolingAdjuster = this.coolingCycle / 3), this.coolingFactor = Math.max(this.initialCoolingFactor - 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));
1554
- }
1555
- if (this.isTreeGrowing) {
1556
- if (this.growTreeIterations % 10 == 0)
1557
- if (this.prunedNodesAll.length > 0) {
1558
- this.graphManager.updateBounds(), this.updateGrid(), this.growTree(this.prunedNodesAll), this.graphManager.resetAllNodesToApplyGravitation();
1559
- var a = new Set(this.getAllNodes()), d = this.nodesWithGravity.filter(function(_) {
1560
- return a.has(_);
1561
- });
1562
- this.graphManager.setAllNodesToApplyGravitation(d), this.graphManager.updateBounds(), this.updateGrid(), this.coolingFactor = N.DEFAULT_COOLING_FACTOR_INCREMENTAL;
1563
- } else this.isTreeGrowing = !1, this.isGrowthFinished = !0;
1564
- this.growTreeIterations++;
1565
- }
1566
- if (this.isGrowthFinished) {
1567
- if (this.isConverged()) return !0;
1568
- this.afterGrowthIterations % 10 == 0 && (this.graphManager.updateBounds(), this.updateGrid()), this.coolingFactor = N.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100), this.afterGrowthIterations++;
1569
- }
1570
- var l = !this.isTreeGrowing && !this.isGrowthFinished, v = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;
1571
- return this.totalDisplacement = 0, this.graphManager.updateBounds(), this.calcSpringForces(), this.calcRepulsionForces(l, v), this.calcGravitationalForces(), this.moveNodes(), this.animate(), !1;
1572
- }, E.prototype.getPositionsData = function() {
1573
- for (var a = this.graphManager.getAllNodes(), d = {}, l = 0; l < a.length; l++) {
1574
- var v = a[l].rect, _ = a[l].id;
1575
- d[_] = {
1576
- id: _,
1577
- x: v.getCenterX(),
1578
- y: v.getCenterY(),
1579
- w: v.width,
1580
- h: v.height
1581
- };
1582
- }
1583
- return d;
1584
- }, E.prototype.runSpringEmbedder = function() {
1585
- this.initialAnimationPeriod = 25, this.animationPeriod = this.initialAnimationPeriod;
1586
- var a = !1;
1587
- if (N.ANIMATE === "during") this.emit("layoutstarted");
1588
- else {
1589
- for (; !a; ) a = this.tick();
1590
- this.graphManager.updateBounds();
1591
- }
1592
- }, E.prototype.calculateNodesToApplyGravitationTo = function() {
1593
- for (var a = [], d, l = this.graphManager.getGraphs(), v = l.length, _ = 0; _ < v; _++) d = l[_], d.updateConnected(), d.isConnected || (a = a.concat(d.getNodes()));
1594
- return a;
1595
- }, E.prototype.createBendpoints = function() {
1596
- var a = [];
1597
- a = a.concat(this.graphManager.getAllEdges());
1598
- for (var d = /* @__PURE__ */ new Set(), l = 0; l < a.length; l++) {
1599
- var v = a[l];
1600
- if (!d.has(v)) {
1601
- var _ = v.getSource(), D = v.getTarget();
1602
- if (_ == D) v.getBendpoints().push(new u()), v.getBendpoints().push(new u()), this.createDummyNodesForBendpoints(v), d.add(v);
1603
- else {
1604
- var I = [];
1605
- if (I = I.concat(_.getEdgeListToNode(D)), I = I.concat(D.getEdgeListToNode(_)), !d.has(I[0])) {
1606
- if (I.length > 1) for (var w = 0; w < I.length; w++) {
1607
- var R = I[w];
1608
- R.getBendpoints().push(new u()), this.createDummyNodesForBendpoints(R);
1609
- }
1610
- I.forEach(function(G) {
1611
- d.add(G);
1612
- });
1613
- }
1614
- }
1615
- }
1616
- if (d.size == a.length) break;
1617
- }
1618
- }, E.prototype.positionNodesRadially = function(a) {
1619
- for (var d = new g(0, 0), l = Math.ceil(Math.sqrt(a.length)), v = 0, _ = 0, D = 0, I = new u(0, 0), w = 0; w < a.length; w++) {
1620
- w % l == 0 && (D = 0, _ = v, w != 0 && (_ += o.DEFAULT_COMPONENT_SEPERATION), v = 0);
1621
- var R = a[w], G = p.findCenterOfTree(R);
1622
- d.x = D, d.y = _, I = E.radialLayout(R, G, d), I.y > v && (v = Math.floor(I.y)), D = Math.floor(I.x + o.DEFAULT_COMPONENT_SEPERATION);
1623
- }
1624
- this.transform(new u(s.WORLD_CENTER_X - I.x / 2, s.WORLD_CENTER_Y - I.y / 2));
1625
- }, E.radialLayout = function(a, d, l) {
1626
- var v = Math.max(this.maxDiagonalInTree(a), o.DEFAULT_RADIAL_SEPARATION);
1627
- E.branchRadialLayout(d, null, 0, 359, 0, v);
1628
- var _ = f.calculateBounds(a), D = new T();
1629
- D.setDeviceOrgX(_.getMinX()), D.setDeviceOrgY(_.getMinY()), D.setWorldOrgX(l.x), D.setWorldOrgY(l.y);
1630
- for (var I = 0; I < a.length; I++) a[I].transform(D);
1631
- var w = new u(_.getMaxX(), _.getMaxY());
1632
- return D.inverseTransformPoint(w);
1633
- }, E.branchRadialLayout = function(a, d, l, v, _, D) {
1634
- var I = (v - l + 1) / 2;
1635
- I < 0 && (I += 180);
1636
- var w = (I + l) % 360 * c.TWO_PI / 360, R = _ * Math.cos(w), G = _ * Math.sin(w);
1637
- a.setCenter(R, G);
1638
- var x = [];
1639
- x = x.concat(a.getEdges());
1640
- var M = x.length;
1641
- d != null && M--;
1642
- for (var U = 0, b = x.length, F, S = a.getEdgesBetween(d); S.length > 1; ) {
1643
- var Y = S[0];
1644
- S.splice(0, 1);
1645
- var X = x.indexOf(Y);
1646
- X >= 0 && x.splice(X, 1), b--, M--;
1647
- }
1648
- F = d == null ? 0 : (x.indexOf(S[0]) + 1) % b;
1649
- for (var W = Math.abs(v - l) / M, B = F; U != M; B = ++B % b) {
1650
- var H = x[B].getOtherEnd(a);
1651
- if (H != d) {
1652
- var q = (l + U * W) % 360, ot = (q + W) % 360;
1653
- E.branchRadialLayout(H, a, q, ot, _ + D, D), U++;
1654
- }
1655
- }
1656
- }, E.maxDiagonalInTree = function(a) {
1657
- for (var d = y.MIN_VALUE, l = 0; l < a.length; l++) {
1658
- var v = a[l].getDiagonal();
1659
- v > d && (d = v);
1660
- }
1661
- return d;
1662
- }, E.prototype.calcRepulsionRange = function() {
1663
- return 2 * (this.level + 1) * this.idealEdgeLength;
1664
- }, E.prototype.groupZeroDegreeMembers = function() {
1665
- var a = this, d = {};
1666
- this.memberGroups = {}, this.idToDummyNode = {};
1667
- for (var l = [], v = this.graphManager.getAllNodes(), _ = 0; _ < v.length; _++) {
1668
- var D = v[_], I = D.getParent();
1669
- this.getNodeDegreeWithChildren(D) === 0 && (I.id == null || !this.getToBeTiled(I)) && l.push(D);
1670
- }
1671
- for (var _ = 0; _ < l.length; _++) {
1672
- var D = l[_], w = D.getParent().id;
1673
- d[w] === void 0 && (d[w] = []), d[w] = d[w].concat(D);
1674
- }
1675
- Object.keys(d).forEach(function(R) {
1676
- if (d[R].length > 1) {
1677
- var G = "DummyCompound_" + R;
1678
- a.memberGroups[G] = d[R];
1679
- var x = d[R][0].getParent(), M = new r(a.graphManager);
1680
- M.id = G, M.paddingLeft = x.paddingLeft || 0, M.paddingRight = x.paddingRight || 0, M.paddingBottom = x.paddingBottom || 0, M.paddingTop = x.paddingTop || 0, a.idToDummyNode[G] = M;
1681
- var U = a.getGraphManager().add(a.newGraph(), M), b = x.getChild();
1682
- b.add(M);
1683
- for (var F = 0; F < d[R].length; F++) {
1684
- var S = d[R][F];
1685
- b.remove(S), U.add(S);
1686
- }
1687
- }
1688
- });
1689
- }, E.prototype.clearCompounds = function() {
1690
- var a = {}, d = {};
1691
- this.performDFSOnCompounds();
1692
- for (var l = 0; l < this.compoundOrder.length; l++) d[this.compoundOrder[l].id] = this.compoundOrder[l], a[this.compoundOrder[l].id] = [].concat(this.compoundOrder[l].getChild().getNodes()), this.graphManager.remove(this.compoundOrder[l].getChild()), this.compoundOrder[l].child = null;
1693
- this.graphManager.resetAllNodes(), this.tileCompoundMembers(a, d);
1694
- }, E.prototype.clearZeroDegreeMembers = function() {
1695
- var a = this, d = this.tiledZeroDegreePack = [];
1696
- Object.keys(this.memberGroups).forEach(function(l) {
1697
- var v = a.idToDummyNode[l];
1698
- d[l] = a.tileNodes(a.memberGroups[l], v.paddingLeft + v.paddingRight), v.rect.width = d[l].width, v.rect.height = d[l].height;
1699
- });
1700
- }, E.prototype.repopulateCompounds = function() {
1701
- for (var a = this.compoundOrder.length - 1; a >= 0; a--) {
1702
- var d = this.compoundOrder[a], l = d.id, v = d.paddingLeft, _ = d.paddingTop;
1703
- this.adjustLocations(this.tiledMemberPack[l], d.rect.x, d.rect.y, v, _);
1704
- }
1705
- }, E.prototype.repopulateZeroDegreeMembers = function() {
1706
- var a = this, d = this.tiledZeroDegreePack;
1707
- Object.keys(d).forEach(function(l) {
1708
- var v = a.idToDummyNode[l], _ = v.paddingLeft, D = v.paddingTop;
1709
- a.adjustLocations(d[l], v.rect.x, v.rect.y, _, D);
1710
- });
1711
- }, E.prototype.getToBeTiled = function(a) {
1712
- var d = a.id;
1713
- if (this.toBeTiled[d] != null) return this.toBeTiled[d];
1714
- var l = a.getChild();
1715
- if (l == null) return this.toBeTiled[d] = !1, !1;
1716
- for (var v = l.getNodes(), _ = 0; _ < v.length; _++) {
1717
- var D = v[_];
1718
- if (this.getNodeDegree(D) > 0) return this.toBeTiled[d] = !1, !1;
1719
- if (D.getChild() == null) {
1720
- this.toBeTiled[D.id] = !1;
1721
- continue;
1722
- }
1723
- if (!this.getToBeTiled(D)) return this.toBeTiled[d] = !1, !1;
1724
- }
1725
- return this.toBeTiled[d] = !0, !0;
1726
- }, E.prototype.getNodeDegree = function(a) {
1727
- a.id;
1728
- for (var d = a.getEdges(), l = 0, v = 0; v < d.length; v++) {
1729
- var _ = d[v];
1730
- _.getSource().id !== _.getTarget().id && (l += 1);
1731
- }
1732
- return l;
1733
- }, E.prototype.getNodeDegreeWithChildren = function(a) {
1734
- var d = this.getNodeDegree(a);
1735
- if (a.getChild() == null) return d;
1736
- for (var l = a.getChild().getNodes(), v = 0; v < l.length; v++) {
1737
- var _ = l[v];
1738
- d += this.getNodeDegreeWithChildren(_);
1739
- }
1740
- return d;
1741
- }, E.prototype.performDFSOnCompounds = function() {
1742
- this.compoundOrder = [], this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());
1743
- }, E.prototype.fillCompexOrderByDFS = function(a) {
1744
- for (var d = 0; d < a.length; d++) {
1745
- var l = a[d];
1746
- l.getChild() != null && this.fillCompexOrderByDFS(l.getChild().getNodes()), this.getToBeTiled(l) && this.compoundOrder.push(l);
1747
- }
1748
- }, E.prototype.adjustLocations = function(a, d, l, v, _) {
1749
- d += v, l += _;
1750
- for (var D = d, I = 0; I < a.rows.length; I++) {
1751
- var w = a.rows[I];
1752
- d = D;
1753
- for (var R = 0, G = 0; G < w.length; G++) {
1754
- var x = w[G];
1755
- x.rect.x = d, x.rect.y = l, d += x.rect.width + a.horizontalPadding, x.rect.height > R && (R = x.rect.height);
1756
- }
1757
- l += R + a.verticalPadding;
1758
- }
1759
- }, E.prototype.tileCompoundMembers = function(a, d) {
1760
- var l = this;
1761
- this.tiledMemberPack = [], Object.keys(a).forEach(function(v) {
1762
- var _ = d[v];
1763
- l.tiledMemberPack[v] = l.tileNodes(a[v], _.paddingLeft + _.paddingRight), _.rect.width = l.tiledMemberPack[v].width, _.rect.height = l.tiledMemberPack[v].height;
1764
- });
1765
- }, E.prototype.tileNodes = function(a, d) {
1766
- var l = {
1767
- rows: [],
1768
- rowWidth: [],
1769
- rowHeight: [],
1770
- width: 0,
1771
- height: d,
1772
- verticalPadding: o.TILING_PADDING_VERTICAL,
1773
- horizontalPadding: o.TILING_PADDING_HORIZONTAL
1774
- };
1775
- a.sort(function(D, I) {
1776
- return D.rect.width * D.rect.height > I.rect.width * I.rect.height ? -1 : +(D.rect.width * D.rect.height < I.rect.width * I.rect.height);
1777
- });
1778
- for (var v = 0; v < a.length; v++) {
1779
- var _ = a[v];
1780
- l.rows.length == 0 ? this.insertNodeToRow(l, _, 0, d) : this.canAddHorizontal(l, _.rect.width, _.rect.height) ? this.insertNodeToRow(l, _, this.getShortestRowIndex(l), d) : this.insertNodeToRow(l, _, l.rows.length, d), this.shiftToLastRow(l);
1781
- }
1782
- return l;
1783
- }, E.prototype.insertNodeToRow = function(a, d, l, v) {
1784
- var _ = v;
1785
- l == a.rows.length && (a.rows.push([]), a.rowWidth.push(_), a.rowHeight.push(0));
1786
- var D = a.rowWidth[l] + d.rect.width;
1787
- a.rows[l].length > 0 && (D += a.horizontalPadding), a.rowWidth[l] = D, a.width < D && (a.width = D);
1788
- var I = d.rect.height;
1789
- l > 0 && (I += a.verticalPadding);
1790
- var w = 0;
1791
- I > a.rowHeight[l] && (w = a.rowHeight[l], a.rowHeight[l] = I, w = a.rowHeight[l] - w), a.height += w, a.rows[l].push(d);
1792
- }, E.prototype.getShortestRowIndex = function(a) {
1793
- for (var d = -1, l = Number.MAX_VALUE, v = 0; v < a.rows.length; v++) a.rowWidth[v] < l && (d = v, l = a.rowWidth[v]);
1794
- return d;
1795
- }, E.prototype.getLongestRowIndex = function(a) {
1796
- for (var d = -1, l = Number.MIN_VALUE, v = 0; v < a.rows.length; v++) a.rowWidth[v] > l && (d = v, l = a.rowWidth[v]);
1797
- return d;
1798
- }, E.prototype.canAddHorizontal = function(a, d, l) {
1799
- var v = this.getShortestRowIndex(a);
1800
- if (v < 0) return !0;
1801
- var _ = a.rowWidth[v];
1802
- if (_ + a.horizontalPadding + d <= a.width) return !0;
1803
- var D = 0;
1804
- a.rowHeight[v] < l && v > 0 && (D = l + a.verticalPadding - a.rowHeight[v]);
1805
- var I = a.width - _ >= d + a.horizontalPadding ? (a.height + D) / (_ + d + a.horizontalPadding) : (a.height + D) / a.width;
1806
- D = l + a.verticalPadding;
1807
- var w = a.width < d ? (a.height + D) / d : (a.height + D) / a.width;
1808
- return w < 1 && (w = 1 / w), I < 1 && (I = 1 / I), I < w;
1809
- }, E.prototype.shiftToLastRow = function(a) {
1810
- var d = this.getLongestRowIndex(a), l = a.rowWidth.length - 1, v = a.rows[d], _ = v[v.length - 1], D = _.width + a.horizontalPadding;
1811
- if (a.width - a.rowWidth[l] > D && d != l) {
1812
- v.splice(-1, 1), a.rows[l].push(_), a.rowWidth[d] = a.rowWidth[d] - D, a.rowWidth[l] = a.rowWidth[l] + D, a.width = a.rowWidth[instance.getLongestRowIndex(a)];
1813
- for (var I = Number.MIN_VALUE, w = 0; w < v.length; w++) v[w].height > I && (I = v[w].height);
1814
- d > 0 && (I += a.verticalPadding);
1815
- var R = a.rowHeight[d] + a.rowHeight[l];
1816
- a.rowHeight[d] = I, a.rowHeight[l] < _.height + a.verticalPadding && (a.rowHeight[l] = _.height + a.verticalPadding);
1817
- var G = a.rowHeight[d] + a.rowHeight[l];
1818
- a.height += G - R, this.shiftToLastRow(a);
1819
- }
1820
- }, E.prototype.tilingPreLayout = function() {
1821
- o.TILE && (this.groupZeroDegreeMembers(), this.clearCompounds(), this.clearZeroDegreeMembers());
1822
- }, E.prototype.tilingPostLayout = function() {
1823
- o.TILE && (this.repopulateZeroDegreeMembers(), this.repopulateCompounds());
1824
- }, E.prototype.reduceTrees = function() {
1825
- for (var a = [], d = !0, l; d; ) {
1826
- var v = this.graphManager.getAllNodes(), _ = [];
1827
- d = !1;
1828
- for (var D = 0; D < v.length; D++) l = v[D], l.getEdges().length == 1 && !l.getEdges()[0].isInterGraph && l.getChild() == null && (_.push([
1829
- l,
1830
- l.getEdges()[0],
1831
- l.getOwner()
1832
- ]), d = !0);
1833
- if (d == 1) {
1834
- for (var I = [], w = 0; w < _.length; w++) _[w][0].getEdges().length == 1 && (I.push(_[w]), _[w][0].getOwner().remove(_[w][0]));
1835
- a.push(I), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
1836
- }
1837
- }
1838
- this.prunedNodesAll = a;
1839
- }, E.prototype.growTree = function(a) {
1840
- for (var d = a[a.length - 1], l, v = 0; v < d.length; v++) l = d[v], this.findPlaceforPrunedNode(l), l[2].add(l[0]), l[2].add(l[1], l[1].source, l[1].target);
1841
- a.splice(a.length - 1, 1), this.graphManager.resetAllNodes(), this.graphManager.resetAllEdges();
1842
- }, E.prototype.findPlaceforPrunedNode = function(a) {
1843
- var d, l, v = a[0];
1844
- l = v == a[1].source ? a[1].target : a[1].source;
1845
- var _ = l.startX, D = l.finishX, I = l.startY, w = l.finishY, R = [
1846
- 0,
1847
- 0,
1848
- 0,
1849
- 0
1850
- ];
1851
- if (I > 0) for (var G = _; G <= D; G++) R[0] += this.grid[G][I - 1].length + this.grid[G][I].length - 1;
1852
- if (D < this.grid.length - 1) for (var G = I; G <= w; G++) R[1] += this.grid[D + 1][G].length + this.grid[D][G].length - 1;
1853
- if (w < this.grid[0].length - 1) for (var G = _; G <= D; G++) R[2] += this.grid[G][w + 1].length + this.grid[G][w].length - 1;
1854
- if (_ > 0) for (var G = I; G <= w; G++) R[3] += this.grid[_ - 1][G].length + this.grid[_][G].length - 1;
1855
- for (var x = y.MAX_VALUE, M, U, b = 0; b < R.length; b++) R[b] < x ? (x = R[b], M = 1, U = b) : R[b] == x && M++;
1856
- if (M == 3 && x == 0) R[0] == 0 && R[1] == 0 && R[2] == 0 ? d = 1 : R[0] == 0 && R[1] == 0 && R[3] == 0 ? d = 0 : R[0] == 0 && R[2] == 0 && R[3] == 0 ? d = 3 : R[1] == 0 && R[2] == 0 && R[3] == 0 && (d = 2);
1857
- else if (M == 2 && x == 0) {
1858
- var F = Math.floor(Math.random() * 2);
1859
- d = R[0] == 0 && R[1] == 0 ? F == 0 ? 0 : 1 : R[0] == 0 && R[2] == 0 ? F == 0 ? 0 : 2 : R[0] == 0 && R[3] == 0 ? F == 0 ? 0 : 3 : R[1] == 0 && R[2] == 0 ? F == 0 ? 1 : 2 : R[1] == 0 && R[3] == 0 ? F == 0 ? 1 : 3 : F == 0 ? 2 : 3;
1860
- } else if (M == 4 && x == 0) {
1861
- var F = Math.floor(Math.random() * 4);
1862
- d = F;
1863
- } else d = U;
1864
- d == 0 ? v.setCenter(l.getCenterX(), l.getCenterY() - l.getHeight() / 2 - N.DEFAULT_EDGE_LENGTH - v.getHeight() / 2) : d == 1 ? v.setCenter(l.getCenterX() + l.getWidth() / 2 + N.DEFAULT_EDGE_LENGTH + v.getWidth() / 2, l.getCenterY()) : d == 2 ? v.setCenter(l.getCenterX(), l.getCenterY() + l.getHeight() / 2 + N.DEFAULT_EDGE_LENGTH + v.getHeight() / 2) : v.setCenter(l.getCenterX() - l.getWidth() / 2 - N.DEFAULT_EDGE_LENGTH - v.getWidth() / 2, l.getCenterY());
1865
- }, L.exports = E;
1866
- }),
1867
- (function(L, A, n) {
1868
- var i = {};
1869
- i.layoutBase = n(0), i.CoSEConstants = n(1), i.CoSEEdge = n(2), i.CoSEGraph = n(3), i.CoSEGraphManager = n(4), i.CoSELayout = n(6), i.CoSENode = n(5), L.exports = i;
1870
- })
1871
- ]);
1872
- });
1873
- })), at = /* @__PURE__ */ st((/* @__PURE__ */ V(((C, P) => {
1874
- (function(m, L) {
1875
- typeof C == "object" && typeof P == "object" ? P.exports = L(Z()) : typeof define == "function" && define.amd ? define(["cose-base"], L) : typeof C == "object" ? C.cytoscapeCoseBilkent = L(Z()) : m.cytoscapeCoseBilkent = L(m.coseBase);
1876
- })(C, function(m) {
1877
- return (function(L) {
1878
- var A = {};
1879
- function n(i) {
1880
- if (A[i]) return A[i].exports;
1881
- var t = A[i] = {
1882
- i,
1883
- l: !1,
1884
- exports: {}
1885
- };
1886
- return L[i].call(t.exports, t, t.exports, n), t.l = !0, t.exports;
1887
- }
1888
- return n.m = L, n.c = A, n.i = function(i) {
1889
- return i;
1890
- }, n.d = function(i, t, e) {
1891
- n.o(i, t) || Object.defineProperty(i, t, {
1892
- configurable: !1,
1893
- enumerable: !0,
1894
- get: e
1895
- });
1896
- }, n.n = function(i) {
1897
- var t = i && i.__esModule ? function() {
1898
- return i.default;
1899
- } : function() {
1900
- return i;
1901
- };
1902
- return n.d(t, "a", t), t;
1903
- }, n.o = function(i, t) {
1904
- return Object.prototype.hasOwnProperty.call(i, t);
1905
- }, n.p = "", n(n.s = 1);
1906
- })([(function(L, A) {
1907
- L.exports = m;
1908
- }), (function(L, A, n) {
1909
- var i = n(0).layoutBase.LayoutConstants, t = n(0).layoutBase.FDLayoutConstants, e = n(0).CoSEConstants, r = n(0).CoSELayout, h = n(0).CoSENode, o = n(0).layoutBase.PointD, N = n(0).layoutBase.DimensionD, s = {
1910
- ready: function() {
1911
- },
1912
- stop: function() {
1913
- },
1914
- quality: "default",
1915
- nodeDimensionsIncludeLabels: !1,
1916
- refresh: 30,
1917
- fit: !0,
1918
- padding: 10,
1919
- randomize: !0,
1920
- nodeRepulsion: 4500,
1921
- idealEdgeLength: 50,
1922
- edgeElasticity: 0.45,
1923
- nestingFactor: 0.1,
1924
- gravity: 0.25,
1925
- numIter: 2500,
1926
- tile: !0,
1927
- animate: "end",
1928
- animationDuration: 500,
1929
- tilingPaddingVertical: 10,
1930
- tilingPaddingHorizontal: 10,
1931
- gravityRangeCompound: 1.5,
1932
- gravityCompound: 1,
1933
- gravityRange: 3.8,
1934
- initialEnergyOnIncremental: 0.5
1935
- };
1936
- function g(c, f) {
1937
- var T = {};
1938
- for (var E in c) T[E] = c[E];
1939
- for (var E in f) T[E] = f[E];
1940
- return T;
1941
- }
1942
- function u(c) {
1943
- this.options = g(s, c), p(this.options);
1944
- }
1945
- var p = function(c) {
1946
- c.nodeRepulsion != null && (e.DEFAULT_REPULSION_STRENGTH = t.DEFAULT_REPULSION_STRENGTH = c.nodeRepulsion), c.idealEdgeLength != null && (e.DEFAULT_EDGE_LENGTH = t.DEFAULT_EDGE_LENGTH = c.idealEdgeLength), c.edgeElasticity != null && (e.DEFAULT_SPRING_STRENGTH = t.DEFAULT_SPRING_STRENGTH = c.edgeElasticity), c.nestingFactor != null && (e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = c.nestingFactor), c.gravity != null && (e.DEFAULT_GRAVITY_STRENGTH = t.DEFAULT_GRAVITY_STRENGTH = c.gravity), c.numIter != null && (e.MAX_ITERATIONS = t.MAX_ITERATIONS = c.numIter), c.gravityRange != null && (e.DEFAULT_GRAVITY_RANGE_FACTOR = t.DEFAULT_GRAVITY_RANGE_FACTOR = c.gravityRange), c.gravityCompound != null && (e.DEFAULT_COMPOUND_GRAVITY_STRENGTH = t.DEFAULT_COMPOUND_GRAVITY_STRENGTH = c.gravityCompound), c.gravityRangeCompound != null && (e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = c.gravityRangeCompound), c.initialEnergyOnIncremental != null && (e.DEFAULT_COOLING_FACTOR_INCREMENTAL = t.DEFAULT_COOLING_FACTOR_INCREMENTAL = c.initialEnergyOnIncremental), i.QUALITY = c.quality == "draft" ? 0 : c.quality == "proof" ? 2 : 1, e.NODE_DIMENSIONS_INCLUDE_LABELS = t.NODE_DIMENSIONS_INCLUDE_LABELS = i.NODE_DIMENSIONS_INCLUDE_LABELS = c.nodeDimensionsIncludeLabels, e.DEFAULT_INCREMENTAL = t.DEFAULT_INCREMENTAL = i.DEFAULT_INCREMENTAL = !c.randomize, e.ANIMATE = t.ANIMATE = i.ANIMATE = c.animate, e.TILE = c.tile, e.TILING_PADDING_VERTICAL = typeof c.tilingPaddingVertical == "function" ? c.tilingPaddingVertical.call() : c.tilingPaddingVertical, e.TILING_PADDING_HORIZONTAL = typeof c.tilingPaddingHorizontal == "function" ? c.tilingPaddingHorizontal.call() : c.tilingPaddingHorizontal;
1947
- };
1948
- u.prototype.run = function() {
1949
- var c, f, T = this.options;
1950
- this.idToLNode = {};
1951
- var E = this.layout = new r(), O = this;
1952
- O.stopped = !1, this.cy = this.options.cy, this.cy.trigger({
1953
- type: "layoutstart",
1954
- layout: this
1955
- });
1956
- var a = E.newGraphManager();
1957
- this.gm = a;
1958
- var d = this.options.eles.nodes(), l = this.options.eles.edges();
1959
- this.root = a.addRoot(), this.processChildrenList(this.root, this.getTopMostNodes(d), E);
1960
- for (var v = 0; v < l.length; v++) {
1961
- var _ = l[v], D = this.idToLNode[_.data("source")], I = this.idToLNode[_.data("target")];
1962
- if (D !== I && D.getEdgesBetween(I).length == 0) {
1963
- var w = a.add(E.newEdge(), D, I);
1964
- w.id = _.id();
1965
- }
1966
- }
1967
- var R = function(x, M) {
1968
- typeof x == "number" && (x = M);
1969
- var U = x.data("id"), b = O.idToLNode[U];
1970
- return {
1971
- x: b.getRect().getCenterX(),
1972
- y: b.getRect().getCenterY()
1973
- };
1974
- }, G = function x() {
1975
- for (var M = function() {
1976
- T.fit && T.cy.fit(T.eles, T.padding), c || (c = !0, O.cy.one("layoutready", T.ready), O.cy.trigger({
1977
- type: "layoutready",
1978
- layout: O
1979
- }));
1980
- }, U = O.options.refresh, b, F = 0; F < U && !b; F++) b = O.stopped || O.layout.tick();
1981
- if (b) {
1982
- E.checkLayoutSuccess() && !E.isSubLayout && E.doPostLayout(), E.tilingPostLayout && E.tilingPostLayout(), E.isLayoutFinished = !0, O.options.eles.nodes().positions(R), M(), O.cy.one("layoutstop", O.options.stop), O.cy.trigger({
1983
- type: "layoutstop",
1984
- layout: O
1985
- }), f && cancelAnimationFrame(f), c = !1;
1986
- return;
1987
- }
1988
- var S = O.layout.getPositionsData();
1989
- T.eles.nodes().positions(function(Y, X) {
1990
- if (typeof Y == "number" && (Y = X), !Y.isParent()) {
1991
- for (var W = Y.id(), B = S[W], H = Y; B == null && (B = S[H.data("parent")] || S["DummyCompound_" + H.data("parent")], S[W] = B, H = H.parent()[0], H != null); ) ;
1992
- return B == null ? {
1993
- x: Y.position("x"),
1994
- y: Y.position("y")
1995
- } : {
1996
- x: B.x,
1997
- y: B.y
1998
- };
1999
- }
2000
- }), M(), f = requestAnimationFrame(x);
2001
- };
2002
- return E.addListener("layoutstarted", function() {
2003
- O.options.animate === "during" && (f = requestAnimationFrame(G));
2004
- }), E.runLayout(), this.options.animate !== "during" && (O.options.eles.nodes().not(":parent").layoutPositions(O, O.options, R), c = !1), this;
2005
- }, u.prototype.getTopMostNodes = function(c) {
2006
- for (var f = {}, T = 0; T < c.length; T++) f[c[T].id()] = !0;
2007
- return c.filter(function(E, O) {
2008
- typeof E == "number" && (E = O);
2009
- for (var a = E.parent()[0]; a != null; ) {
2010
- if (f[a.id()]) return !1;
2011
- a = a.parent()[0];
2012
- }
2013
- return !0;
2014
- });
2015
- }, u.prototype.processChildrenList = function(c, f, T) {
2016
- for (var E = f.length, O = 0; O < E; O++) {
2017
- var a = f[O], d = a.children(), l, v = a.layoutDimensions({ nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels });
2018
- if (l = a.outerWidth() != null && a.outerHeight() != null ? c.add(new h(T.graphManager, new o(a.position("x") - v.w / 2, a.position("y") - v.h / 2), new N(parseFloat(v.w), parseFloat(v.h)))) : c.add(new h(this.graphManager)), l.id = a.data("id"), l.paddingLeft = parseInt(a.css("padding")), l.paddingTop = parseInt(a.css("padding")), l.paddingRight = parseInt(a.css("padding")), l.paddingBottom = parseInt(a.css("padding")), this.options.nodeDimensionsIncludeLabels && a.isParent()) {
2019
- var _ = a.boundingBox({
2020
- includeLabels: !0,
2021
- includeNodes: !1
2022
- }).w, D = a.boundingBox({
2023
- includeLabels: !0,
2024
- includeNodes: !1
2025
- }).h, I = a.css("text-halign");
2026
- l.labelWidth = _, l.labelHeight = D, l.labelPos = I;
2027
- }
2028
- if (this.idToLNode[a.data("id")] = l, isNaN(l.rect.x) && (l.rect.x = 0), isNaN(l.rect.y) && (l.rect.y = 0), d != null && d.length > 0) {
2029
- var w = T.getGraphManager().add(T.newGraph(), l);
2030
- this.processChildrenList(w, d, T);
2031
- }
2032
- }
2033
- }, u.prototype.stop = function() {
2034
- return this.stopped = !0, this;
2035
- };
2036
- var y = function(c) {
2037
- c("layout", "cose-bilkent", u);
2038
- };
2039
- typeof cytoscape < "u" && y(cytoscape), L.exports = y;
2040
- })]);
2041
- });
2042
- })))());
2043
- $.use(at.default);
2044
- function Q(C, P) {
2045
- C.forEach((m) => {
2046
- let L = {
2047
- id: m.id,
2048
- labelText: m.label,
2049
- height: m.height,
2050
- width: m.width,
2051
- padding: m.padding ?? 0
2052
- };
2053
- Object.keys(m).forEach((A) => {
2054
- [
2055
- "id",
2056
- "label",
2057
- "height",
2058
- "width",
2059
- "padding",
2060
- "x",
2061
- "y"
2062
- ].includes(A) || (L[A] = m[A]);
2063
- }), P.add({
2064
- group: "nodes",
2065
- data: L,
2066
- position: {
2067
- x: m.x ?? 0,
2068
- y: m.y ?? 0
2069
- }
2070
- });
2071
- });
2072
- }
2073
- k(Q, "addNodes");
2074
- function K(C, P) {
2075
- C.forEach((m) => {
2076
- let L = {
2077
- id: m.id,
2078
- source: m.start,
2079
- target: m.end
2080
- };
2081
- Object.keys(m).forEach((A) => {
2082
- [
2083
- "id",
2084
- "start",
2085
- "end"
2086
- ].includes(A) || (L[A] = m[A]);
2087
- }), P.add({
2088
- group: "edges",
2089
- data: L
2090
- });
2091
- });
2092
- }
2093
- k(K, "addEdges");
2094
- function J(C) {
2095
- return new Promise((P) => {
2096
- let m = nt("body").append("div").attr("id", "cy").attr("style", "display:none"), L = $({
2097
- container: document.getElementById("cy"),
2098
- style: [{
2099
- selector: "edge",
2100
- style: { "curve-style": "bezier" }
2101
- }]
2102
- });
2103
- m.remove(), Q(C.nodes, L), K(C.edges, L), L.nodes().forEach(function(A) {
2104
- A.layoutDimensions = () => {
2105
- let n = A.data();
2106
- return {
2107
- w: n.width,
2108
- h: n.height
2109
- };
2110
- };
2111
- }), L.layout({
2112
- name: "cose-bilkent",
2113
- quality: "proof",
2114
- styleEnabled: !1,
2115
- animate: !1
2116
- }).run(), L.ready((A) => {
2117
- j.info("Cytoscape ready", A), P(L);
2118
- });
2119
- });
2120
- }
2121
- k(J, "createCytoscapeInstance");
2122
- function tt(C) {
2123
- return C.nodes().map((P) => {
2124
- let m = P.data(), L = P.position(), A = {
2125
- id: m.id,
2126
- x: L.x,
2127
- y: L.y
2128
- };
2129
- return Object.keys(m).forEach((n) => {
2130
- n !== "id" && (A[n] = m[n]);
2131
- }), A;
2132
- });
2133
- }
2134
- k(tt, "extractPositionedNodes");
2135
- function et(C) {
2136
- return C.edges().map((P) => {
2137
- let m = P.data(), L = P._private.rscratch, A = {
2138
- id: m.id,
2139
- source: m.source,
2140
- target: m.target,
2141
- startX: L.startX,
2142
- startY: L.startY,
2143
- midX: L.midX,
2144
- midY: L.midY,
2145
- endX: L.endX,
2146
- endY: L.endY
2147
- };
2148
- return Object.keys(m).forEach((n) => {
2149
- [
2150
- "id",
2151
- "source",
2152
- "target"
2153
- ].includes(n) || (A[n] = m[n]);
2154
- }), A;
2155
- });
2156
- }
2157
- k(et, "extractPositionedEdges");
2158
- async function it(C, P) {
2159
- j.debug("Starting cose-bilkent layout algorithm");
2160
- try {
2161
- rt(C);
2162
- let m = await J(C), L = tt(m), A = et(m);
2163
- return j.debug(`Layout completed: ${L.length} nodes, ${A.length} edges`), {
2164
- nodes: L,
2165
- edges: A
2166
- };
2167
- } catch (m) {
2168
- throw j.error("Error in cose-bilkent layout algorithm:", m), m;
2169
- }
2170
- }
2171
- k(it, "executeCoseBilkentLayout");
2172
- function rt(C) {
2173
- if (!C) throw Error("Layout data is required");
2174
- if (!C.config) throw Error("Configuration is required in layout data");
2175
- if (!C.rootNode) throw Error("Root node is required");
2176
- if (!C.nodes || !Array.isArray(C.nodes)) throw Error("No nodes found in layout data");
2177
- if (!Array.isArray(C.edges)) throw Error("Edges array is required in layout data");
2178
- return !0;
2179
- }
2180
- k(rt, "validateLayoutData");
2181
- var gt = /* @__PURE__ */ k(async (C, P, { insertCluster: m, insertEdge: L, insertEdgeLabel: A, insertMarkers: n, insertNode: i, log: t, positionEdgeLabel: e }, { algorithm: r }) => {
2182
- let h = {}, o = {}, N = P.select("g");
2183
- n(N, C.markers, C.type, C.diagramId);
2184
- let s = N.insert("g").attr("class", "subgraphs"), g = N.insert("g").attr("class", "edgePaths"), u = N.insert("g").attr("class", "edgeLabels"), p = N.insert("g").attr("class", "nodes");
2185
- t.debug("Inserting nodes into DOM for dimension calculation"), await Promise.all(C.nodes.map(async (c) => {
2186
- if (c.isGroup) {
2187
- let f = { ...c };
2188
- o[c.id] = f, h[c.id] = f, await m(s, c);
2189
- } else {
2190
- let f = { ...c };
2191
- h[c.id] = f;
2192
- let T = await i(p, c, {
2193
- config: C.config,
2194
- dir: C.direction || "TB"
2195
- }), E = T.node().getBBox();
2196
- f.width = E.width, f.height = E.height, f.domId = T, t.debug(`Node ${c.id} dimensions: ${E.width}x${E.height}`);
2197
- }
2198
- })), t.debug("Running cose-bilkent layout algorithm");
2199
- let y = await it({
2200
- ...C,
2201
- nodes: C.nodes.map((c) => {
2202
- let f = h[c.id];
2203
- return {
2204
- ...c,
2205
- width: f.width,
2206
- height: f.height
2207
- };
2208
- })
2209
- }, C.config);
2210
- t.debug("Positioning nodes based on layout results"), y.nodes.forEach((c) => {
2211
- let f = h[c.id];
2212
- f?.domId && (f.domId.attr("transform", `translate(${c.x}, ${c.y})`), f.x = c.x, f.y = c.y, t.debug(`Positioned node ${f.id} at center (${c.x}, ${c.y})`));
2213
- }), y.edges.forEach((c) => {
2214
- let f = C.edges.find((T) => T.id === c.id);
2215
- f && (f.points = [
2216
- {
2217
- x: c.startX,
2218
- y: c.startY
2219
- },
2220
- {
2221
- x: c.midX,
2222
- y: c.midY
2223
- },
2224
- {
2225
- x: c.endX,
2226
- y: c.endY
2227
- }
2228
- ]);
2229
- }), t.debug("Inserting and positioning edges"), await Promise.all(C.edges.map(async (c) => {
2230
- await A(u, c);
2231
- let f = h[c.start ?? ""], T = h[c.end ?? ""];
2232
- if (f && T) {
2233
- let E = y.edges.find((O) => O.id === c.id);
2234
- if (E) {
2235
- t.debug("APA01 positionedEdge", E);
2236
- let O = { ...c };
2237
- e(O, L(g, O, o, C.type, f, T, C.diagramId));
2238
- } else {
2239
- let O = {
2240
- ...c,
2241
- points: [{
2242
- x: f.x || 0,
2243
- y: f.y || 0
2244
- }, {
2245
- x: T.x || 0,
2246
- y: T.y || 0
2247
- }]
2248
- };
2249
- e(O, L(g, O, o, C.type, f, T, C.diagramId));
2250
- }
2251
- }
2252
- })), t.debug("Cose-bilkent rendering completed");
2253
- }, "render");
2254
- export {
2255
- gt as render
2256
- };