@automattic/agenttic-ui 0.1.10 → 0.1.11

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