sparkdesign 0.4.6 → 0.4.7

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