@bkm016/basalt 0.0.0-stage → 0.1.1

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 (256) hide show
  1. package/README.md +275 -2
  2. package/chunk-09vr609h.js +2 -0
  3. package/chunk-0hbjv3y6.js +11 -0
  4. package/chunk-0qqb6v41.js +3753 -0
  5. package/chunk-0szjy61m.js +2 -0
  6. package/chunk-0yytz0r1.js +59 -0
  7. package/chunk-1aspj1hn.js +3 -0
  8. package/chunk-1b7gbe8g.js +10 -0
  9. package/chunk-1v7st27a.js +25 -0
  10. package/chunk-1yzt0qm0.js +2 -0
  11. package/chunk-2bb01ddq.js +16 -0
  12. package/chunk-2wkaw73s.js +9 -0
  13. package/chunk-2zqny2sy.js +2 -0
  14. package/chunk-32at88hc.js +3 -0
  15. package/chunk-3m7qwfm3.js +7 -0
  16. package/chunk-44ek81ad.js +3 -0
  17. package/chunk-45cz26ap.js +39 -0
  18. package/chunk-501zkf9b.js +3 -0
  19. package/chunk-58vz2qsq.js +2 -0
  20. package/chunk-6e49xsf5.js +3 -0
  21. package/chunk-6qertm2t.js +3 -0
  22. package/chunk-8dxzqwq3.js +2 -0
  23. package/chunk-9mmz6wt3.js +2 -0
  24. package/chunk-a3tqx584.js +10 -0
  25. package/chunk-a6r4z44b.js +2 -0
  26. package/chunk-a8nyk4k9.js +2 -0
  27. package/chunk-agntrqs9.js +2 -0
  28. package/chunk-bhqyxyap.js +3 -0
  29. package/chunk-bpw6q7g0.js +3 -0
  30. package/chunk-c25s4w6a.js +5 -0
  31. package/chunk-cv5wsd9m.js +8 -0
  32. package/chunk-d48bfd2e.js +3 -0
  33. package/chunk-dakrpbe6.js +3 -0
  34. package/chunk-dhm42y04.js +7 -0
  35. package/chunk-exnn1867.js +2 -0
  36. package/chunk-f7egr55n.js +31 -0
  37. package/chunk-g2t6t8fk.js +3 -0
  38. package/chunk-h6sw8fbt.js +5 -0
  39. package/chunk-hat3s3pr.js +3 -0
  40. package/chunk-hcn9cf6v.js +2 -0
  41. package/chunk-jhd54p1b.js +3 -0
  42. package/chunk-k7w7ac9q.js +18 -0
  43. package/chunk-kf8hq21a.js +25 -0
  44. package/chunk-kfq8wyd3.js +3 -0
  45. package/chunk-n6e43rvk.js +3 -0
  46. package/chunk-nt2gntad.js +2 -0
  47. package/chunk-pmc3y1z8.js +2 -0
  48. package/chunk-pvncysbb.js +3 -0
  49. package/chunk-q8zx3kt6.js +2 -0
  50. package/chunk-qczbfccb.js +12 -0
  51. package/chunk-qnr1f5pj.js +3 -0
  52. package/chunk-qx0m82rw.js +2 -0
  53. package/chunk-r9aatvwm.js +3 -0
  54. package/chunk-rm3kcxq9.js +20 -0
  55. package/chunk-rv06x0kn.js +7 -0
  56. package/chunk-ry0z4ev6.js +2 -0
  57. package/chunk-s37s3k24.js +12 -0
  58. package/chunk-sh74qzvt.js +5 -0
  59. package/chunk-szat3vp4.js +3 -0
  60. package/chunk-t057xfrt.js +5 -0
  61. package/chunk-tvm4zmgj.js +3 -0
  62. package/chunk-v9fea96h.js +3 -0
  63. package/chunk-vgvq3q12.js +3 -0
  64. package/chunk-vkkj4awb.js +2 -0
  65. package/chunk-vv7fp27r.js +3 -0
  66. package/chunk-wjd9fr23.js +2 -0
  67. package/chunk-wx7kdf0b.js +2 -0
  68. package/chunk-x3dnb9sz.js +3 -0
  69. package/chunk-xsbxykr4.js +2 -0
  70. package/chunk-xysny0ve.js +3 -0
  71. package/chunk-y69ewdn2.js +3 -0
  72. package/chunk-yskm0hsy.js +2 -0
  73. package/chunk-zef13k3h.js +471 -0
  74. package/cli.js +89 -0
  75. package/compiled.js +23 -0
  76. package/icon-dp9pmcvp.png +0 -0
  77. package/package.json +21 -4
  78. package/ui-test-worker.js +226 -0
  79. package/web/KaTeX_AMS-Regular-n7eqehx2.woff2 +0 -0
  80. package/web/KaTeX_Caligraphic-Bold-20r3b6fv.woff2 +0 -0
  81. package/web/KaTeX_Caligraphic-Regular-kkjm8f18.woff2 +0 -0
  82. package/web/KaTeX_Fraktur-Bold-pz5vg4t0.woff2 +0 -0
  83. package/web/KaTeX_Fraktur-Regular-a1e9wkwk.woff2 +0 -0
  84. package/web/KaTeX_Main-Bold-mcp098h8.woff2 +0 -0
  85. package/web/KaTeX_Main-BoldItalic-fy74z249.woff2 +0 -0
  86. package/web/KaTeX_Main-Italic-hw2gxy7f.woff2 +0 -0
  87. package/web/KaTeX_Main-Regular-xvp1b75c.woff2 +0 -0
  88. package/web/KaTeX_Math-BoldItalic-mf5nf33d.woff2 +0 -0
  89. package/web/KaTeX_Math-Italic-ap60jrna.woff2 +0 -0
  90. package/web/KaTeX_SansSerif-Bold-we3bymb6.woff2 +0 -0
  91. package/web/KaTeX_SansSerif-Italic-ent92bjx.woff2 +0 -0
  92. package/web/KaTeX_SansSerif-Regular-0573pbz9.woff2 +0 -0
  93. package/web/KaTeX_Script-Regular-z2rtj6vq.woff2 +0 -0
  94. package/web/KaTeX_Size1-Regular-dfr3w1hv.woff2 +0 -0
  95. package/web/KaTeX_Size2-Regular-kted78zb.woff2 +0 -0
  96. package/web/KaTeX_Size3-Regular-e6k1k5jk.woff2 +0 -0
  97. package/web/KaTeX_Size4-Regular-abedc1pd.woff2 +0 -0
  98. package/web/KaTeX_Typewriter-Regular-scw9zx1z.woff2 +0 -0
  99. package/web/apple-touch-icon-7dkm33qp.png +0 -0
  100. package/web/apple-touch-icon.png +0 -0
  101. package/web/chunk-05w4fyzc.js +1 -0
  102. package/web/chunk-0mrkjnte.js +1 -0
  103. package/web/chunk-0pbjgdgp.js +2 -0
  104. package/web/chunk-0s80zw00.js +1 -0
  105. package/web/chunk-0vt9fg48.js +2 -0
  106. package/web/chunk-20q90epj.js +2 -0
  107. package/web/chunk-22a4ety5.js +1 -0
  108. package/web/chunk-24mfx6w1.js +2 -0
  109. package/web/chunk-2j4m0bh1.js +2 -0
  110. package/web/chunk-2m12wyrb.js +16 -0
  111. package/web/chunk-2msj52w6.js +1 -0
  112. package/web/chunk-2ps6mepk.js +120 -0
  113. package/web/chunk-2pver6r4.js +1 -0
  114. package/web/chunk-2scce33n.js +1 -0
  115. package/web/chunk-37ajk6zg.js +2 -0
  116. package/web/chunk-3ee04tmm.js +200 -0
  117. package/web/chunk-3jhyzmnf.js +292 -0
  118. package/web/chunk-45fzdcgz.js +30 -0
  119. package/web/chunk-4gavbw65.js +1 -0
  120. package/web/chunk-4ks96e4r.js +1 -0
  121. package/web/chunk-4rm1vy7w.js +1 -0
  122. package/web/chunk-4v8en1yw.js +40 -0
  123. package/web/chunk-4wd9r73y.js +1 -0
  124. package/web/chunk-4wkm9fda.js +1 -0
  125. package/web/chunk-54thej0t.js +2 -0
  126. package/web/chunk-59kqahb3.js +1 -0
  127. package/web/chunk-5vw9rs4r.js +4 -0
  128. package/web/chunk-6beqrmtq.js +1 -0
  129. package/web/chunk-6m69hczt.js +2 -0
  130. package/web/chunk-70qwwwak.js +2 -0
  131. package/web/chunk-74j07k8k.js +2 -0
  132. package/web/chunk-8g239029.js +1 -0
  133. package/web/chunk-8p4tc9f4.js +70 -0
  134. package/web/chunk-90kp4pnz.js +2 -0
  135. package/web/chunk-9an7cjd9.js +291 -0
  136. package/web/chunk-9dxjafp2.js +78 -0
  137. package/web/chunk-9p12mgs6.js +2 -0
  138. package/web/chunk-9v1f6yc8.js +1 -0
  139. package/web/chunk-9yakxvjb.js +2 -0
  140. package/web/chunk-a1z5qx1r.js +36 -0
  141. package/web/chunk-a3verqw9.js +214 -0
  142. package/web/chunk-a5x2zveg.js +7 -0
  143. package/web/chunk-ad6x47yy.js +1 -0
  144. package/web/chunk-amzgyy1k.js +1 -0
  145. package/web/chunk-b1pe46zz.js +2 -0
  146. package/web/chunk-b4wbk7vc.js +217 -0
  147. package/web/chunk-bc78qf1m.js +7 -0
  148. package/web/chunk-bgnnrpna.js +89 -0
  149. package/web/chunk-bj90t5gh.js +99 -0
  150. package/web/chunk-bjkc94mv.js +1 -0
  151. package/web/chunk-ca682sm6.js +370 -0
  152. package/web/chunk-cff5hcm8.js +8 -0
  153. package/web/chunk-cg3jterp.js +2 -0
  154. package/web/chunk-d18r4m14.js +141 -0
  155. package/web/chunk-dmqtdeb4.js +1 -0
  156. package/web/chunk-dt462hk9.js +332 -0
  157. package/web/chunk-dy2gm1fs.js +1 -0
  158. package/web/chunk-dzwxgqgm.js +39 -0
  159. package/web/chunk-e32y85kx.js +1 -0
  160. package/web/chunk-e53wfgb8.js +1 -0
  161. package/web/chunk-e6jxqbv7.js +3 -0
  162. package/web/chunk-esp1mmgr.js +1 -0
  163. package/web/chunk-ew3cgdtd.js +1 -0
  164. package/web/chunk-f26smjjf.js +2 -0
  165. package/web/chunk-f91wzwtk.js +1 -0
  166. package/web/chunk-fk0dh93x.js +89 -0
  167. package/web/chunk-fm2ybfj5.js +98 -0
  168. package/web/chunk-fscafg24.js +34 -0
  169. package/web/chunk-fz06t6km.js +55 -0
  170. package/web/chunk-g1ev11wx.js +1 -0
  171. package/web/chunk-g4azyef7.js +106 -0
  172. package/web/chunk-gjq1pxw3.js +1 -0
  173. package/web/chunk-gqw3f02j.js +140 -0
  174. package/web/chunk-h5ejbf6e.js +1 -0
  175. package/web/chunk-hev4hq89.js +2 -0
  176. package/web/chunk-hfaffkrh.js +1 -0
  177. package/web/chunk-hp167dbv.js +1 -0
  178. package/web/chunk-j2vt8c8v.js +1 -0
  179. package/web/chunk-jjh5jvva.js +1 -0
  180. package/web/chunk-jrcyc9s9.js +38 -0
  181. package/web/chunk-jwzd9tzk.js +24 -0
  182. package/web/chunk-k5btcvbg.js +1 -0
  183. package/web/chunk-ka3q31t1.js +1 -0
  184. package/web/chunk-kdyjnwdx.js +2 -0
  185. package/web/chunk-kpvgecwy.js +1 -0
  186. package/web/chunk-kq40ss39.js +1 -0
  187. package/web/chunk-m2d1sp30.js +1 -0
  188. package/web/chunk-n1dmrz44.js +2 -0
  189. package/web/chunk-n90cqdvg.js +2 -0
  190. package/web/chunk-nj0cv1cq.js +257 -0
  191. package/web/chunk-nzey7cpv.js +1 -0
  192. package/web/chunk-p3b9crsa.js +2 -0
  193. package/web/chunk-pf2ab8p8.js +1 -0
  194. package/web/chunk-pxe3vna4.js +1 -0
  195. package/web/chunk-q0p5xqe1.js +84 -0
  196. package/web/chunk-q5ke7a33.js +24 -0
  197. package/web/chunk-q7dsnvpf.js +1 -0
  198. package/web/chunk-qd8bxxdj.js +1 -0
  199. package/web/chunk-qefasa1j.js +2 -0
  200. package/web/chunk-qh7265qw.js +4 -0
  201. package/web/chunk-qnaqf0cr.js +1 -0
  202. package/web/chunk-r1dnh0s8.js +1 -0
  203. package/web/chunk-r5eakmw6.js +1 -0
  204. package/web/chunk-rg426vkf.js +1 -0
  205. package/web/chunk-rpmpttbk.js +12 -0
  206. package/web/chunk-rtf2zzzv.js +1 -0
  207. package/web/chunk-ry9256r7.js +1 -0
  208. package/web/chunk-rykfak98.js +2 -0
  209. package/web/chunk-scpwc9ev.js +1 -0
  210. package/web/chunk-srrfphes.js +1 -0
  211. package/web/chunk-ss1bcb0n.js +2 -0
  212. package/web/chunk-ssy07dd2.js +1 -0
  213. package/web/chunk-t6agpn2z.js +1 -0
  214. package/web/chunk-taynqrgq.js +142 -0
  215. package/web/chunk-tgpbhzn9.js +1 -0
  216. package/web/chunk-tmvakq7n.js +19 -0
  217. package/web/chunk-tqmwd9qp.js +139 -0
  218. package/web/chunk-ts7zrf5b.js +2 -0
  219. package/web/chunk-ttg6tbwx.js +2 -0
  220. package/web/chunk-v28fx2nd.js +1 -0
  221. package/web/chunk-v5cnt7c8.js +1 -0
  222. package/web/chunk-vt40e1kp.js +1136 -0
  223. package/web/chunk-w53rba6g.js +1 -0
  224. package/web/chunk-w86n42dy.js +1 -0
  225. package/web/chunk-w880psmw.js +1 -0
  226. package/web/chunk-wptv8atc.js +2 -0
  227. package/web/chunk-wtawdeej.css +1 -0
  228. package/web/chunk-xbty0rv7.js +41 -0
  229. package/web/chunk-xet1jjy9.js +1 -0
  230. package/web/chunk-xjxv8dg8.js +169 -0
  231. package/web/chunk-xrxne80b.js +62 -0
  232. package/web/chunk-xzp7jf7e.js +2 -0
  233. package/web/chunk-y0m8hrwz.js +303 -0
  234. package/web/chunk-y49fhfda.js +7 -0
  235. package/web/chunk-yd46jhqv.js +1 -0
  236. package/web/chunk-ydtrc1ay.js +2 -0
  237. package/web/chunk-z09emmrb.js +1 -0
  238. package/web/chunk-z7dcbxws.js +1 -0
  239. package/web/chunk-zbj1trar.js +2 -0
  240. package/web/chunk-zde7mj43.js +1 -0
  241. package/web/icon-192.png +0 -0
  242. package/web/icon-512.png +0 -0
  243. package/web/icon-maskable-512.png +0 -0
  244. package/web/icon-yx2p2pye.svg +13 -0
  245. package/web/icon.svg +13 -0
  246. package/web/index.html +23 -0
  247. package/web/install.ps1 +91 -0
  248. package/web/install.sh +177 -0
  249. package/web/inter-latin-wght-normal-an0py913.woff2 +0 -0
  250. package/web/jetbrains-mono-latin-wght-normal-hj2e42wt.woff2 +0 -0
  251. package/web/manifest-txf6vfbq.webmanifest +35 -0
  252. package/web/manifest.webmanifest +35 -0
  253. package/web/source-serif-4-latin-wght-italic-ta5tqqvz.woff2 +0 -0
  254. package/web/source-serif-4-latin-wght-normal-1yyvbhsz.woff2 +0 -0
  255. package/web/sw.js +90 -0
  256. package/worker.js +2 -0
@@ -0,0 +1 @@
1
+ var n=Object.freeze(JSON.parse('{"displayName":"TOML","fileTypes":["toml"],"name":"toml","patterns":[{"include":"#comments"},{"include":"#groups"},{"include":"#key_pair"},{"include":"#invalid"}],"repository":{"comments":{"begin":"(^[\\\\t ]+)?(?=#)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.toml"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.toml"}},"end":"\\\\n","name":"comment.line.number-sign.toml"}]},"groups":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.section.begin.toml"},"2":{"patterns":[{"match":"[^.\\\\s]+","name":"entity.name.section.toml"}]},"3":{"name":"punctuation.definition.section.begin.toml"}},"match":"^\\\\s*(\\\\[)([^]\\\\[]*)(])","name":"meta.group.toml"},{"captures":{"1":{"name":"punctuation.definition.section.begin.toml"},"2":{"patterns":[{"match":"[^.\\\\s]+","name":"entity.name.section.toml"}]},"3":{"name":"punctuation.definition.section.begin.toml"}},"match":"^\\\\s*(\\\\[\\\\[)([^]\\\\[]*)(]])","name":"meta.group.double.toml"}]},"invalid":{"match":"\\\\S+(\\\\s*(?=\\\\S))?","name":"invalid.illegal.not-allowed-here.toml"},"key_pair":{"patterns":[{"begin":"([-0-9A-Z_a-z]+)\\\\s*(=)\\\\s*","captures":{"1":{"name":"variable.other.key.toml"},"2":{"name":"punctuation.separator.key-value.toml"}},"end":"(?<=\\\\S)(?<!=)|$","patterns":[{"include":"#primatives"}]},{"begin":"((\\")(.*?)(\\"))\\\\s*(=)\\\\s*","captures":{"1":{"name":"variable.other.key.toml"},"2":{"name":"punctuation.definition.variable.begin.toml"},"3":{"patterns":[{"match":"\\\\\\\\([\\"\\\\\\\\bfnrt]|u\\\\h{4}|U\\\\h{8})","name":"constant.character.escape.toml"},{"match":"\\\\\\\\[^\\"\\\\\\\\bfnrt]","name":"invalid.illegal.escape.toml"},{"match":"\\"","name":"invalid.illegal.not-allowed-here.toml"}]},"4":{"name":"punctuation.definition.variable.end.toml"},"5":{"name":"punctuation.separator.key-value.toml"}},"end":"(?<=\\\\S)(?<!=)|$","patterns":[{"include":"#primatives"}]},{"begin":"((\')([^\']*)(\'))\\\\s*(=)\\\\s*","captures":{"1":{"name":"variable.other.key.toml"},"2":{"name":"punctuation.definition.variable.begin.toml"},"4":{"name":"punctuation.definition.variable.end.toml"},"5":{"name":"punctuation.separator.key-value.toml"}},"end":"(?<=\\\\S)(?<!=)|$","patterns":[{"include":"#primatives"}]},{"begin":"(((?:[-0-9A-Z_a-z]+|\\"(?:[^\\"\\\\\\\\]|\\\\\\\\.)*\\"|\'[^\']*\')(?:\\\\s*\\\\.\\\\s*|(?=\\\\s*=))){2,})\\\\s*(=)\\\\s*","captures":{"1":{"name":"variable.other.key.toml","patterns":[{"match":"\\\\.","name":"punctuation.separator.variable.toml"},{"captures":{"1":{"name":"punctuation.definition.variable.begin.toml"},"2":{"patterns":[{"match":"\\\\\\\\([\\"\\\\\\\\bfnrt]|u\\\\h{4}|U\\\\h{8})","name":"constant.character.escape.toml"},{"match":"\\\\\\\\[^\\"\\\\\\\\bfnrt]","name":"invalid.illegal.escape.toml"}]},"3":{"name":"punctuation.definition.variable.end.toml"}},"match":"(\\")((?:[^\\"\\\\\\\\]|\\\\\\\\.)*)(\\")"},{"captures":{"1":{"name":"punctuation.definition.variable.begin.toml"},"2":{"name":"punctuation.definition.variable.end.toml"}},"match":"(\')[^\']*(\')"}]},"3":{"name":"punctuation.separator.key-value.toml"}},"end":"(?<=\\\\S)(?<!=)|$","patterns":[{"include":"#primatives"}]}]},"primatives":{"patterns":[{"begin":"\\\\G\\"\\"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.toml"}},"end":"\\"{3,5}","endCaptures":{"0":{"name":"punctuation.definition.string.end.toml"}},"name":"string.quoted.triple.double.toml","patterns":[{"match":"\\\\\\\\([\\"\\\\\\\\bfnrt]|u\\\\h{4}|U\\\\h{8})","name":"constant.character.escape.toml"},{"match":"\\\\\\\\[^\\\\n\\"\\\\\\\\bfnrt]","name":"invalid.illegal.escape.toml"}]},{"begin":"\\\\G\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.toml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.toml"}},"name":"string.quoted.double.toml","patterns":[{"match":"\\\\\\\\([\\"\\\\\\\\bfnrt]|u\\\\h{4}|U\\\\h{8})","name":"constant.character.escape.toml"},{"match":"\\\\\\\\[^\\"\\\\\\\\bfnrt]","name":"invalid.illegal.escape.toml"}]},{"begin":"\\\\G\'\'\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.toml"}},"end":"\'{3,5}","endCaptures":{"0":{"name":"punctuation.definition.string.end.toml"}},"name":"string.quoted.triple.single.toml"},{"begin":"\\\\G\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.toml"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.toml"}},"name":"string.quoted.single.toml"},{"match":"\\\\G[0-9]{4}-(0[1-9]|1[012])-(?!00|3[2-9])[0-3][0-9]([ Tt](?!2[5-9])[012][0-9]:[0-5][0-9]:(?!6[1-9])[0-6][0-9](\\\\.[0-9]+)?(Z|[-+](?!2[5-9])[012][0-9]:[0-5][0-9])?)?","name":"constant.other.date.toml"},{"match":"\\\\G(?!2[5-9])[012][0-9]:[0-5][0-9]:(?!6[1-9])[0-6][0-9](\\\\.[0-9]+)?","name":"constant.other.time.toml"},{"match":"\\\\G(true|false)","name":"constant.language.boolean.toml"},{"match":"\\\\G0x\\\\h(_??\\\\h)*","name":"constant.numeric.hex.toml"},{"match":"\\\\G0o[0-7]([0-7]|_[0-7])*","name":"constant.numeric.octal.toml"},{"match":"\\\\G0b[01]([01]|_[01])*","name":"constant.numeric.binary.toml"},{"match":"\\\\G[-+]?(inf|nan)","name":"constant.numeric.toml"},{"match":"\\\\G([-+]?(0|([1-9](([0-9]|_[0-9])+)?)))(?=[.Ee])(\\\\.([0-9](([0-9]|_[0-9])+)?))?([Ee]([-+]?[0-9](([0-9]|_[0-9])+)?))?","name":"constant.numeric.float.toml"},{"match":"\\\\G([-+]?(0|([1-9](([0-9]|_[0-9])+)?)))","name":"constant.numeric.integer.toml"},{"begin":"\\\\G\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.array.begin.toml"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.array.end.toml"}},"name":"meta.array.toml","patterns":[{"begin":"(?=[\\"\']|[-+]?[0-9]|[-+]?(inf|nan)|true|false|[\\\\[{])","end":",|(?=])","endCaptures":{"0":{"name":"punctuation.separator.array.toml"}},"patterns":[{"include":"#primatives"},{"include":"#comments"},{"include":"#invalid"}]},{"include":"#comments"},{"include":"#invalid"}]},{"begin":"\\\\G\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.inline-table.begin.toml"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.inline-table.end.toml"}},"name":"meta.inline-table.toml","patterns":[{"begin":"(?=\\\\S)","end":",|(?=})","endCaptures":{"0":{"name":"punctuation.separator.inline-table.toml"}},"patterns":[{"include":"#key_pair"}]},{"include":"#comments"}]}]}},"scopeName":"source.toml"}')),e=[n];export{e as default};
@@ -0,0 +1,2 @@
1
+ import{e,Bn,p,Gn}from"./chunk-y0m8hrwz.js";import{Ce}from"./chunk-vt40e1kp.js";var o=Ce(Gn(),1);var nn=e((s,t)=>{let r=s.append("rect");if(r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),t.name)r.attr("name",t.name);if(t.rx)r.attr("rx",t.rx);if(t.ry)r.attr("ry",t.ry);if(t.attrs!==void 0)for(let a in t.attrs)r.attr(a,t.attrs[a]);if(t.class)r.attr("class",t.class);return r},"drawRect"),Br=e((s,t)=>{let r={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};nn(s,r).lower()},"drawBackgroundRect"),Xi=e((s,t)=>{let r=t.text.replace(Bn," "),a=s.append("text");if(a.attr("x",t.x),a.attr("y",t.y),a.attr("class","legend"),a.style("text-anchor",t.anchor),t.class)a.attr("class",t.class);let i=a.append("tspan");return i.attr("x",t.x+t.textMargin*2),i.text(r),a},"drawText"),aa=e((s,t,r,a)=>{let i=s.append("image");i.attr("x",t),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",n)},"drawImage"),ia=e((s,t,r,a)=>{let i=s.append("use");i.attr("x",t),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),Ke=e(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),oa=e(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Mt=e(()=>{let s=p(".mermaidTooltip");if(s.empty())s=p("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100");return s},"createTooltip");
2
+ export{nn,Br,Xi,aa,ia,Ke,oa,Mt};
@@ -0,0 +1 @@
1
+ import{e,r,Ne}from"./chunk-y0m8hrwz.js";import"./chunk-kdyjnwdx.js";import{lr}from"./chunk-wptv8atc.js";var Un=5,zn=0.00001,Rr=2,Tr=0.6,Vn=0.000001;function jn(t){let n=[];for(let o=0;o<t.length-1;o++)n.push({a:t[o],b:t[o+1]});return n}e(jn,"buildSegmentList");function Bo(t,n,o,s){let i=n.x-t.x,c=n.y-t.y,a=s.x-o.x,u=s.y-o.y,h=i*u-c*a;if(h===0)return null;let d=o.x-t.x,m=o.y-t.y,p=(d*u-m*a)/h,I=(d*c-m*i)/h;if(p<=Vn||p>=1-Vn||I<=Vn||I>=1-Vn)return null;return{point:{x:t.x+p*i,y:t.y+p*c},tA:p,tB:I}}e(Bo,"segmentIntersection");function Se(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}e(Se,"isHorizontalSeg");function Ce(t,n,o){if(t.curve!=="rounded")return!1;let s=t.points,i=s[n],c=s[n+1];if(!i||!c)return!1;let a=Math.hypot(c.x-i.x,c.y-i.y),u=o*a,h=n>0?Pn(s[n-1],i,c,Un):null;if(h&&u<h.cutLen)return!0;let d=n+2<s.length?Pn(i,c,s[n+2],Un):null;return d!==null&&a-u<d.cutLen}e(Ce,"crossingSitsInRoundedCorner");function Fo(t){let n=[];for(let o=0;o<t.length;o++){let s=t[o],i=jn(s.points);for(let c=o+1;c<t.length;c++){let a=t[c],u=jn(a.points);for(let[h,d]of i.entries())for(let[m,p]of u.entries()){let I=Bo(d.a,d.b,p.a,p.b);if(!I)continue;if(Ce(s,h,I.tA)||Ce(a,m,I.tB))continue;let y=Se(d),g=Se(p);if(y!==g?y:!1)n.push({jumpEdgeId:s.id,otherEdgeId:a.id,segIndex:h,t:I.tA,point:I.point});else n.push({jumpEdgeId:a.id,otherEdgeId:s.id,segIndex:m,t:I.tB,point:I.point})}}}return n}e(Fo,"findEdgeIntersections");function cn(t){let n=Math.round(t*1000)/1000;return Number.isInteger(n)?`${n}`:`${n}`}e(cn,"fmt");function wn(t){return`${cn(t.x)},${cn(t.y)}`}e(wn,"pointToString");function Po(t){let n=t.b.x-t.a.x,o=t.b.y-t.a.y;if(Math.abs(n)>=Math.abs(o))return n>=0?1:0;return o>=0?1:0}e(Po,"getArcSweepFlag");function ko(t,n){if(t.length<2)return t.map((c)=>({...c}));let o=t.map((c)=>({...c})),s=n.arrowTypeStart&&Ne[n.arrowTypeStart];if(s){let c=t[0],a=t[1],u=Math.atan2(a.y-c.y,a.x-c.x);o[0].x=c.x+s*Math.cos(u),o[0].y=c.y+s*Math.sin(u)}let i=n.arrowTypeEnd&&Ne[n.arrowTypeEnd];if(i){let c=t.length,a=t[c-2],u=t[c-1],h=Math.atan2(u.y-a.y,u.x-a.x);o[c-1].x=u.x-i*Math.cos(h),o[c-1].y=u.y-i*Math.sin(h)}return o}e(ko,"applyMarkerOffsets");function _o(t,n,o,s,i){let c=t.point.x,a=t.point.y,u={x:c-n*t.r,y:a-o*t.r},h={x:c+n*t.r,y:a+o*t.r},d=[`L${wn(u)}`];if(i==="arc")d.push(`A${cn(t.r)},${cn(t.r)} 0 0 ${s} ${wn(h)}`);else d.push(`M${wn(h)}`);return d}e(_o,"emitJump");function Pn(t,n,o,s){let i=n.x-t.x,c=n.y-t.y,a=o.x-n.x,u=o.y-n.y,h=Math.hypot(i,c),d=Math.hypot(a,u);if(h<zn||d<zn)return null;let m=i/h,p=c/h,I=a/d,y=u/d,g=m*I+p*y,l=Math.max(-1,Math.min(1,g)),x=Math.acos(l);if(x<zn||Math.abs(Math.PI-x)<zn)return null;let L=Math.min(s/Math.sin(x/2),h/2,d/2);return{startX:n.x-m*L,startY:n.y-p*L,endX:n.x+I*L,endY:n.y+y*L,ctrlX:n.x,ctrlY:n.y,cutLen:L}}e(Pn,"computeRoundedCorner");function Ho(t,n,o){let s=t.points;if(s.length<2)return"";let i=ko(s,t),c=t.curve==="rounded",a=jn(i),u=new Map;for(let d of n){let m=a[d.segIndex];if(!m)continue;let p=Math.hypot(m.b.x-m.a.x,m.b.y-m.a.y),I=u.get(d.segIndex)??[];I.push({t:d.t,point:d.point,d:d.t*p,r:o.jumpRadius}),u.set(d.segIndex,I)}let h=[`M${wn(i[0])}`];for(let d=0;d<a.length;d++){let m=a[d],p=Math.hypot(m.b.x-m.a.x,m.b.y-m.a.y),I=p===0?0:(m.b.x-m.a.x)/p,y=p===0?0:(m.b.y-m.a.y)/p,g=Po(m),l=0;if(c&&d>0){let w=Pn(i[d-1],i[d],i[d+1]??i[d],Un);if(w)l=w.cutLen}let x=p,L=null;if(c&&d<a.length-1){if(L=Pn(i[d],i[d+1],i[d+2]??i[d+1],Un),L)x=p-L.cutLen}let S=o.jumpRadius*Tr,E=[...u.get(d)??[]].sort((w,C)=>w.t-C.t).filter((w)=>{let C=Math.min(w.d-l,x-w.d)-Rr;return w.r=Math.min(w.r,C),w.r>=S});for(let w=0;w<E.length-1;w++){let C=E[w+1].d-E[w].d;if(E[w].r+E[w+1].r>C){let b=C/2;E[w].r=Math.min(E[w].r,b),E[w+1].r=Math.min(E[w+1].r,b)}}for(let w of E){if(w.r<S)continue;h.push(..._o(w,I,y,g,o.jumpStyle))}if(c&&L)h.push(`L${cn(L.startX)},${cn(L.startY)}`),h.push(`Q${cn(L.ctrlX)},${cn(L.ctrlY)} ${cn(L.endX)},${cn(L.endY)}`);else h.push(`L${wn(m.b)}`)}return h.join(" ")}e(Ho,"rewriteEdgePath");function Do(t){return/^[\d\s+,.LMelm-]*$/.test(t)}e(Do,"isStraightPath");function Xo(t){if(!t)return!0;return t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter"}e(Xo,"curveSupportsLineHops");function Yo(t){if(!t)return null;try{let n=typeof atob==="function"?atob(t):Buffer.from(t,"base64").toString(),o=JSON.parse(n);if(!Array.isArray(o))return null;let s=[];for(let i of o)if(i&&typeof i.x==="number"&&typeof i.y==="number")s.push({x:i.x,y:i.y});return s.length>=2?s:null}catch{return null}}e(Yo,"decodeDataPoints");function ve(t,n,o){if(!o.enabled)return;let s=t.node();if(!s)return;let i=new Map;for(let d of n)i.set(d.id,d);let c=new Map;for(let d of s.querySelectorAll("path[data-id]")){let m=d.getAttribute("data-id");if(m!==null&&!c.has(m))c.set(m,d)}let a=[];for(let d of n){let m=c.get(d.id);if(!m)continue;let I=Yo(m.getAttribute("data-points"))??d.points;a.push({...d,points:I})}let u=Fo(a);if(u.length===0)return;let h=new Map;for(let d of u){let m=h.get(d.jumpEdgeId)??[];m.push(d),h.set(d.jumpEdgeId,m)}for(let d of a){let m=h.get(d.id);if(!m||m.length===0)continue;let I=i.get(d.id)?.curve;if(I!==void 0&&!Xo(I))continue;let y=c.get(d.id);if(!y)continue;if(I===void 0){let E=y.getAttribute("d")??"";if(!Do(E))continue}let g=y.getAttribute("style")??"",l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(g),x=l?Number.parseFloat(l[1]):null,L=l?Number.parseFloat(l[2]):null,S=Ho(d,m,o);if(y.setAttribute("d",S),x!==null&&L!==null&&typeof y.getTotalLength==="function"){let E=y.getTotalLength(),w=Math.max(0,E-x-L),C=`0 ${x} ${w} ${L}`,b=g.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${C};`).replace(/;\s*;+/g,";");y.setAttribute("style",b)}}}e(ve,"applyLineJumpsToSvg");function jo(t,{measure:n}){let o=t.config?.swimlane?.lineHops;if(o===!1)return;let s=o==="gap"?"gap":"arc",i=t.edges.filter((c)=>Array.isArray(c.points)&&c.points.length>=2).map((c)=>({id:c.id,points:c.points,curve:c.curve,arrowTypeStart:c.arrowTypeStart,arrowTypeEnd:c.arrowTypeEnd}));ve(n.groups.edgePaths,i,{enabled:!0,jumpRadius:6,jumpStyle:s})}e(jo,"applySwimlaneLineJumps");var Le="__swimlane_default__",wr=21,Go=20;function Te(t){return Math.max(t.padding??Go,Go)}e(Te,"topLaneHorizontalPadding");function Wo(t){let{x:n,y:o,width:s,height:i}=t,c=t.swimlaneContentTop;if(typeof n!=="number"||typeof o!=="number"||typeof s!=="number"||typeof i!=="number"||typeof c!=="number"||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(s)||!Number.isFinite(i)||!Number.isFinite(c)||s<=0||i<=0){delete t.groupTitleRect;return}let a=o-i/2,u=Math.min(c,o+i/2),h=Math.min(wr,Math.max(0,u-a)),d=a+h;if(d<=a){delete t.groupTitleRect;return}t.groupTitleRect={left:n-s/2,right:n+s/2,top:a,bottom:d}}e(Wo,"assignTopLaneTitleRect");function Ko(t){let n=t.direction,o=t.nodes??=[];for(let c of t.nodes??[])if(c.isGroup&&!c.parentId){if(c.shape="swimlane",n)c.direction=n}let s=o.filter((c)=>!c.isGroup&&!c.parentId);if(s.length===0)return;let i=o.find((c)=>c.id===Le);if(!i)i={id:Le,label:"",isGroup:!0,shape:"swimlane",padding:20,look:t.config?.look,colorIndex:o.reduce((c,a)=>Math.max(c,a.colorIndex??-1),-1)+1,...n?{direction:n}:{}},o.push(i);else if(i.isGroup){if(i.shape="swimlane",n)i.direction=n}for(let c of s)c.parentId=Le}e(Ko,"prepareLayoutForSwimlanes");function qo(t){let n=new Map;for(let h of t.nodes??[])n.set(h.id,h);let o=[];for(let h of t.edges??[]){let d=typeof h.start==="string"?h.start:void 0,m=typeof h.end==="string"?h.end:void 0;if(!d||!m)continue;if(h.labelNodeId)continue;o.push({id:h.id,src:d,dst:m,ref:h})}let s=t.nodes??[],i=s.filter((h)=>h.isGroup),c=s.filter((h)=>!h.isGroup);return{nodes:[...[...i].reverse(),...c].map((h)=>h.id),edges:o,layout:t,nodeById:n}}e(qo,"toGraphView");function Jo(t,n,o,s){let{layout:i}=t,c=t.nodeById,a=s?.layerGap??100,u=s?.nodeGap??40,h=0;for(let I of n.layers){let y=0;for(let g of I){let l=c.get(g);if(!l){y++;continue}l.layer=h,l.order=y;let x=o.x[g]??y*u,L=o.y[g]??h*a;l.x=x,l.y=L,y++}h++}let d=i.nodes??[],m=new Map,p=[];for(let I of d){if(!I?.isGroup)continue;if(!I.parentId)p.push(I);let y=d.filter((S)=>S.parentId===I.id),g=1/0,l=-1/0,x=1/0,L=-1/0;for(let S of y){let E=S.x??o.x[S.id],w=S.y??o.y[S.id],C=S.width??0,b=S.height??0;if(E!=null&&w!=null)g=Math.min(g,E-C/2),l=Math.max(l,E+C/2),x=Math.min(x,w-b/2),L=Math.max(L,w+b/2)}if(g===1/0||x===1/0)I.x=I.x??0,I.y=I.y??0,I.width=I.width??0,I.height=I.height??0;else{let S=I.padding??20,E=I.parentId?S:2*Te(I),w=S,C=Math.max(0,l-g)+E,b=Math.max(0,L-x)+w,R=(g+l)/2,O=(x+L)/2;I.x=R,I.y=O,I.width=C,I.height=b,m.set(I.id,{minX:g,maxX:l,minY:x,maxY:L})}}if(p.length>0&&m.size>0){let I=1/0,y=-1/0,g=0;for(let l of p){let x=l.padding??20;if(x>g)g=x;let L=m.get(l.id);if(!L)continue;I=Math.min(I,L.minY),y=Math.max(y,L.maxY)}if(I!==1/0&&y!==-1/0){let l=Math.max(0,y-I),x=36,L=Math.max(g,36),S=l+2*L,E=(I+y)/2;for(let P of p)P.y=E,P.height=S,P.swimlaneContentTop=I;let w=[...p].sort((P,N)=>{let H=P.x??0,_=N.x??0;return H-_}),C=[],b=[],R=[];for(let P of w){let N=m.get(P.id);if(!N)continue;let H=Math.max(0,N.maxX-N.minX)+2*Te(P),_=(N.minX+N.maxX)/2;C.push(P.id),b.push(_),R.push(H)}let O=C.length;if(O>0){let P=new Map;if(O===1)P.set(C[0],R[0]);else{let N=[];for(let V=0;V<O-1;V++)N.push(b[V+1]-b[V]);let H=Array(O);H[0]=0;for(let V=0;V<O-1;V++)H[V+1]=2*N[V]-H[V];let _=0,F=Number.POSITIVE_INFINITY;for(let V=0;V<O;V++){let J=R[V];if(V%2===0)_=Math.max(_,J-H[V]);else F=Math.min(F,H[V]-J)}let Y=_;if(_<=F)Y=(_+F)/2;else Y=_;for(let V=0;V<O;V++){let J=H[V]+(V%2===0?Y:-Y),lt=Math.max(R[V],J);P.set(C[V],lt)}}for(let N of p){let H=P.get(N.id);if(H!=null)N.width=H;Wo(N)}}}}}e(Jo,"writeBackToLayoutData");var Nr="[EdgeLabelNodes]";function Zo(t){let n=[],o=[],s=new Map;for(let a of t.nodes)s.set(a.id,a);for(let a of t.edges){if(!a.label||a.label.length===0)continue;if(a.isLayoutOnly)continue;if(a.labelNodeId)continue;let u=a.start?s.get(a.start):void 0,h=a.end?s.get(a.end):void 0;if(!u||!h){r.warn(Nr,`Edge ${a.id} has missing source or target node`);continue}let d=`edge-label-${a.start}-${a.end}-${a.id}`,p=u.parentId!==h.parentId?h.parentId:u.parentId,I={id:d,label:a.label,edgeStart:a.start??"",edgeEnd:a.end??"",shape:"labelRect",width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:p,isGroup:!1,labelStyle:Array.isArray(a.labelStyle)?a.labelStyle[0]:a.labelStyle??"",...u.dir?{dir:u.dir}:{}};n.push(I),a.labelNodeId=d,a.label=void 0,a.text=void 0;let y={id:`${a.id}-to-label`,start:a.start,end:d,type:"normal",isLayoutOnly:!0},g={id:`${a.id}-from-label`,start:d,end:a.end,type:"normal",isLayoutOnly:!0};o.push(y,g)}let i=[...t.nodes,...n],c=[...t.edges,...o];return{...t,nodes:i,edges:c}}e(Zo,"createEdgeLabelNodes");var Dt=0.001;function ao(t){let n=t.x??0,o=t.y??0,s=t.width??0,i=t.height??0;return s>0&&i>0?{cx:n,cy:o,rect:On(n,o,s,i)}:void 0}e(ao,"measuredNodeRect");function lo(t){if(t.isGroup)return;let n=ao(t);if(!n)return;return{id:String(t.id??""),cx:n.cx,cy:n.cy,rect:n.rect}}e(lo,"nodeBoundsInfoFor");function rn(t,n,o=Dt){return Math.abs(t.x-n.x)<o&&Math.abs(t.y-n.y)<o}e(rn,"samePoint");function ht(t,n,o=Dt){return Math.abs(t.x-n.x)<o}e(ht,"sameX");function pt(t,n,o=Dt){return Math.abs(t.y-n.y)<o}e(pt,"sameY");function Tt(t,n,o=Dt){return pt(t,n,o)&&Math.abs(t.x-n.x)>o}e(Tt,"isHorizontalSegment");function wt(t,n,o=Dt){return ht(t,n,o)&&Math.abs(t.y-n.y)>o}e(wt,"isVerticalSegment");function Ut(t,n,o,s){return Math.max(0,Math.min(Math.max(t,n),Math.max(o,s))-Math.max(Math.min(t,n),Math.min(o,s)))}e(Ut,"overlapLength");function fn(t,n,o=Dt){if(t.horizontal&&n.horizontal&&pt(t.a,n.a,o))return Ut(t.a.x,t.b.x,n.a.x,n.b.x);if(t.vertical&&n.vertical&&ht(t.a,n.a,o))return Ut(t.a.y,t.b.y,n.a.y,n.b.y);return 0}e(fn,"sameAxisSegmentOverlapLength");function Bn(t,n=Dt){let o=[];for(let s=0;s<t.length-1;s++){let i=t[s],c=t[s+1],a=Tt(i,c,n),u=wt(i,c,n);if(a||u)o.push({index:s,a:i,b:c,horizontal:a,vertical:u})}return o}e(Bn,"orthogonalSegmentsForPoints");function nn(t,n=Dt){let o=Bn(t,n),s=0;for(let i=1;i<o.length;i++)if(o[i-1].horizontal!==o[i].horizontal)s++;return s}e(nn,"countOrthogonalBends");function yt(t,n=Dt){let o=[];for(let s of t){let i=o.length>0?o[o.length-1]:void 0;if(!i||!rn(i,s,n))o.push({x:s.x,y:s.y})}return o}e(yt,"dedupeConsecutivePoints");function fo(t,n=Dt){if(!t||t.length!==4)return;let[o,s,i,c]=t;if(Tt(o,s,n)&&wt(s,i,n)&&Tt(i,c,n))return{kind:"HVH",p0:o,p1:s,p2:i,p3:c};return wt(o,s,n)&&Tt(s,i,n)&&wt(i,c,n)?{kind:"VHV",p0:o,p1:s,p2:i,p3:c}:void 0}e(fo,"classifyThreeSegmentRoute");function ae(t,n,o,s=0){let i=Math.min(t.x,n.x),c=Math.max(t.x,n.x),a=Math.min(t.y,n.y),u=Math.max(t.y,n.y);return c>o.left-s&&i<o.right+s&&u>o.top-s&&a<o.bottom+s}e(ae,"segmentBoundsOverlapRect");function uo(t,n,o=0){return t.x>n.left+o&&t.x<n.right-o&&t.y>n.top+o&&t.y<n.bottom-o}e(uo,"pointInsideRect");function Qo(t,n){return t.left<=n.left&&t.right>=n.right&&t.top<=n.top&&t.bottom>=n.bottom}e(Qo,"rectContainsRect");function Qn(t,n){return t.left<n.right&&t.right>n.left&&t.top<n.bottom&&t.bottom>n.top}e(Qn,"rectsOverlap");function we(t,n){return{left:t.left-n,right:t.right+n,top:t.top-n,bottom:t.bottom+n}}e(we,"inflateRect");function On(t,n,o,s){return{left:t-o/2,right:t+o/2,top:n-s/2,bottom:n+s/2}}e(On,"rectFromCenterSize");function Zt(t){return ao(t)?.rect}e(Zt,"rectOfNodeBounds");function vn(t,n){switch(n){case"top":return{x:t.cx,y:t.rect.top};case"bottom":return{x:t.cx,y:t.rect.bottom};case"left":return{x:t.rect.left,y:t.cy};case"right":return{x:t.rect.right,y:t.cy}}}e(vn,"portForRectSide");function ho(t,n,o,s,i,c=Dt){let a=n==="left"||n==="right",u=s==="left"||s==="right";if(a&&u){if(n==="right"&&s==="left"&&t.x<o.x||n==="left"&&s==="right"&&t.x>o.x){if(pt(t,o,c))return[t,o];let p=(t.x+o.x)/2;return[t,{x:p,y:t.y},{x:p,y:o.y},o]}if(n===s){if(pt(t,o,c))return;let p=n==="left"?Math.min(t.x,o.x)-i:Math.max(t.x,o.x)+i;return[t,{x:p,y:t.y},{x:p,y:o.y},o]}return}if(!a&&!u){if(n===s){if(ht(t,o,c))return;let I=n==="top"?Math.min(t.y,o.y)-i:Math.max(t.y,o.y)+i;return[t,{x:t.x,y:I},{x:o.x,y:I},o]}if(!(n==="bottom"&&s==="top"&&t.y<o.y||n==="top"&&s==="bottom"&&t.y>o.y))return;if(ht(t,o,c))return[t,o];let p=(t.y+o.y)/2;return[t,{x:t.x,y:p},{x:o.x,y:p},o]}if(a&&!u){let m=n==="right"&&o.x>t.x||n==="left"&&o.x<t.x,p=s==="top"&&t.y<o.y||s==="bottom"&&t.y>o.y;return m&&p?[t,{x:o.x,y:t.y},o]:void 0}let h=n==="bottom"&&o.y>t.y||n==="top"&&o.y<t.y,d=s==="left"&&t.x<o.x||s==="right"&&t.x>o.x;return h&&d?[t,{x:t.x,y:o.y},o]:void 0}e(ho,"buildOrthogonalPortPath");function go(t,n,o,s){return n==="left"||n==="right"?[t,{x:s,y:t.y},{x:s,y:o.y},o]:[t,{x:t.x,y:s},{x:o.x,y:s},o]}e(go,"buildSameSideTrackPath");function le(t){let n=new Map,o=[];for(let s of t){if(s.isEdgeLabel)continue;let i=lo(s);if(!i)continue;n.set(i.id,i),o.push({id:i.id,rect:i.rect})}return{nodeInfoById:n,realNodeRects:o}}e(le,"collectRealNodeBounds");function bn(t){let n=[],o=[];for(let s of t){let i=lo(s);if(!i)continue;let c={id:i.id,rect:i.rect};if(s.isEdgeLabel)o.push(c);else n.push(c)}return{realNodeRects:n,labelNodeRects:o}}e(bn,"collectNodeRectEntries");function ts(t,{includeEdgeLabels:n=!0}={}){let o=[];for(let s of t){if(s.isGroup||!n&&s.isEdgeLabel)continue;let i=s.x??0,c=s.y??0,a=s.width??0,u=s.height??0;o.push({nodeId:s.id,...On(i,c,a,u)})}return o}e(ts,"collectLayoutNodeRects");function po(t,n,o=Dt){let{start:s,end:i}=t;if(!s||!i)return;let c=n.get(s),a=n.get(i);if(!c||!a)return;return{srcId:s,dstId:i,srcInfo:c,dstInfo:a,collinearX:Math.abs(c.cx-a.cx)<o,collinearY:Math.abs(c.cy-a.cy)<o}}e(po,"getNodePairGeometry");function Nt(t,n,o,s=[],i=0){for(let c of o){if(s.includes(c.id))continue;if(ae(t,n,c.rect,-i))return!0}return!1}e(Nt,"segmentHitsAnyRect");function mo(t,n,o,s,i=Dt,c=0.000001){let a=pt(t,n,i),u=ht(t,n,i),h=pt(o,s,i),d=ht(o,s,i);if(a&&h||u&&d)return!1;if(!(a||u)||!(h||d))return!1;let m=a?{a:t,b:n}:{a:o,b:s},p=u?{a:t,b:n}:{a:o,b:s},I=m.a.y,y=Math.min(m.a.x,m.b.x),g=Math.max(m.a.x,m.b.x),l=p.a.x,x=Math.min(p.a.y,p.b.y),L=Math.max(p.a.y,p.b.y);if(l<y||l>g||I<x||I>L)return!1;let S=Math.abs(l-m.a.x)<c&&Math.abs(I-m.a.y)<c||Math.abs(l-m.b.x)<c&&Math.abs(I-m.b.y)<c,E=Math.abs(l-p.a.x)<c&&Math.abs(I-p.a.y)<c||Math.abs(l-p.b.x)<c&&Math.abs(I-p.b.y)<c;return!(S&&E)}e(mo,"orthogonalSegmentsCross");function ns(t,n,o,s,i=Dt){let c=pt(t,n,i),a=ht(t,n,i),u=pt(o,s,i),h=ht(o,s,i);if(a&&h&&ht(t,o,i))return Ut(t.y,n.y,o.y,s.y)>i;if(c&&u&&pt(t,o,i))return Ut(t.x,n.x,o.x,s.x)>i;return!1}e(ns,"sameAxisSegmentsOverlap");function te(t,n,o,s,{epsilon:i=Dt,skipDegenerateOther:c=!1}={}){for(let a of o){if(a===s||a.isLayoutOnly)continue;let u=a.points;if(!u||u.length<2)continue;for(let h=0;h<u.length-1;h++){let d=u[h],m=u[h+1];if(c&&rn(d,m,i))continue;if(mo(t,n,d,m,i)||ns(t,n,d,m,i))return!0}}return!1}e(te,"segmentConflictsWithAnyEdge");function un(t,n,o,s,i=Dt){let c=pt(t,n,i),a=ht(t,n,i),u=pt(o,s,i),h=ht(o,s,i);if(!(c&&h||a&&u))return!1;let d=c?{a:t,b:n}:{a:o,b:s},m=c?{a:o,b:s}:{a:t,b:n},p=d.a.y,I=Math.min(d.a.x,d.b.x),y=Math.max(d.a.x,d.b.x),g=m.a.x,l=Math.min(m.a.y,m.b.y),x=Math.max(m.a.y,m.b.y);return g>I+i&&g<y-i&&p>l+i&&p<x-i}e(un,"orthogonalSegmentsStrictlyCross");function Oe(t,n,o){let s=Math.min(n,o),i=Math.max(n,o);return t>s+Dt&&t<i-Dt}e(Oe,"strictlyBetween");function es(t,n,o){if(ht(t,n)&&ht(n,o))return Oe(n.y,t.y,o.y);if(pt(t,n)&&pt(n,o))return Oe(n.x,t.x,o.x);return!1}e(es,"isCollinearIntermediate");function os(t){let n=!1,o=[];for(let s=0;s<t.length;s++){let i=o[o.length-1],c=t[s],a=s+1<t.length?t[s+1]:void 0;if(i&&a){if(rn(i,a)){s++,n=!0;continue}if(es(i,c,a)){n=!0;continue}}o.push(c)}return{points:o,changed:n}}e(os,"simplifyPolylineOnce");function ne(t){let n=[t[0]];for(let s=1;s<t.length;s++){let i=n[n.length-1],c=t[s];if(!ht(i,c)&&!pt(i,c)){let a=n.length>=2?n[n.length-2]:void 0,h=(a?ht(a,i):!1)?{x:i.x,y:c.y}:{x:c.x,y:i.y};n.push(h)}n.push(c)}let o=[];for(let s of n){let i=o[o.length-1];if(!i||!rn(i,s))o.push(s)}return o}e(ne,"orthogonalizePolyline");function dn(t){if(t.length<3)return t;let n=[...t];for(let o=0;o<32;o++){let s=os(n);if(n=s.points,!s.changed)break}return n}e(dn,"simplifyPolyline");var st=0.001,Or=0.5,$o=4;function yo(t,n,o){let s=t;if(s.isLayoutOnly||!s.points||s.points.length<o)return;let i=s.start?n.get(s.start):void 0,c=s.end?n.get(s.end):void 0;return{edge:s,points:s.points,srcRect:i?Zt(i):void 0,dstRect:c?Zt(c):void 0}}e(yo,"endpointContextFor");function ss(t,n,o){if(pt(t,n,st))return{x:t.x<o.left?o.left:o.right,y:t.y};if(ht(t,n,st)){let s=t.y<o.top?o.top:o.bottom;return{x:t.x,y:s}}return{x:Math.min(o.right,Math.max(o.left,t.x)),y:Math.min(o.bottom,Math.max(o.top,t.y))}}e(ss,"segmentEnterPoint");function Be(t,n,o){let s=o?1:-1,i=o?0:t.length-1;while(i>=0&&i<t.length&&uo(t[i],n,Or))i+=s;if(i<0||i>=t.length)return t;let c=i-s;if(c<0||c>=t.length)return t;let a=ss(t[i],t[c],n);return o?[a,...t.slice(i)]:[...t.slice(0,i+1),a]}e(Be,"clipEndpoint");function rs(t,n){for(let o of t){let s=yo(o,n,2);if(!s)continue;let i=[...s.points];if(s.srcRect)i=Be(i,s.srcRect,!0);if(s.dstRect)i=Be(i,s.dstRect,!1);i=dn(ne(i)),i=xo(i,s.srcRect,s.dstRect),s.edge.points=dn(ne(i))}}e(rs,"clipEdgeEndpointsToNodeBoundaries");function Fe(t,n,o,s=!1){if(pt(t,n,st)){if(n.y<o.top-st||n.y>o.bottom+st)return n;if(s){if(t.x<o.left-st)return{x:o.left,y:t.y};if(t.x>o.right+st)return{x:o.right,y:t.y}}return{x:Math.abs(n.x-o.left)<=Math.abs(n.x-o.right)?o.left:o.right,y:t.y}}if(ht(t,n,st)){if(n.x<o.left-st||n.x>o.right+st)return n;if(s){if(t.y<o.top-st)return{x:t.x,y:o.top};if(t.y>o.bottom+st)return{x:t.x,y:o.bottom}}let i=Math.abs(n.y-o.top)<=Math.abs(n.y-o.bottom);return{x:t.x,y:i?o.top:o.bottom}}return n}e(Fe,"snapEndpointToBoundary");function ee(t,n,o){let s=t[n];for(let i=n+o;i>=0&&i<t.length;i+=o){let c=t[i];if(!rn(c,s,st))return c}return t[n+o]}e(ee,"firstDistinctAdjacent");function oe(t,n){let o=t+$o,s=n-$o;return o<=s?{lo:o,hi:s}:{lo:(t+n)/2,hi:(t+n)/2}}e(oe,"cornerClearanceRange");function Pe(t,n,o){let{lo:s,hi:i}=oe(n,o);return Math.min(i,Math.max(s,t))}e(Pe,"clampToCornerClearance");function is(t){let n=Math.max(...t.map((s)=>s.lo)),o=Math.min(...t.map((s)=>s.hi));if(n>o)return;return{lo:n,hi:o}}e(is,"intersectRanges");function ke(t,n){return n==="left"||n==="right"?oe(t.top,t.bottom):oe(t.left,t.right)}e(ke,"clearanceRangeForSide");function se(t,n,o){let s=t.y>=o.top-st&&t.y<=o.bottom+st,i=t.x>=o.left-st&&t.x<=o.right+st;if(pt(t,n,st)&&s){if(Math.abs(t.x-o.left)<st)return"left";if(Math.abs(t.x-o.right)<st)return"right"}if(ht(t,n,st)&&i){if(Math.abs(t.y-o.top)<st)return"top";if(Math.abs(t.y-o.bottom)<st)return"bottom"}return}e(se,"terminalSideForSegment");function kn(t){return t==="left"||t==="right"}e(kn,"isHorizontalSide");function cs(t,n,o,s,i){let c=[],a=o?se(t,n,o):void 0,u=s?se(n,t,s):void 0;if(o&&a&&kn(a)===i)c.push(ke(o,a));if(s&&u&&kn(u)===i)c.push(ke(s,u));return c.length>0?is(c):void 0}e(cs,"straightClearanceRange");function _e(t,n,o,s,i){let c=cs(t,n,o,s,i);if(!c)return;let a=i?t.y:t.x,u=Math.min(c.hi,Math.max(c.lo,a));if(Math.abs(u-a)<st)return;return i?[{x:t.x,y:u},{x:n.x,y:u}]:[{x:u,y:t.y},{x:u,y:n.y}]}e(_e,"clearStraightEndpointCornerAxis");function xo(t,n,o){if(t.length!==2)return t;let[s,i]=t;if(pt(s,i,st))return _e(s,i,n,o,!0)??t;if(ht(s,i,st))return _e(s,i,n,o,!1)??t;return t}e(xo,"clearStraightEndpointCornerConnections");function as(t,n,o){return kn(o)?{x:t.x,y:Pe(t.y,n.top,n.bottom)}:{x:Pe(t.x,n.left,n.right),y:t.y}}e(as,"cornerClearedEndpoint");function ls(t,n,o,s,i,c){let a=t.map((u)=>({...u}));for(let u=n;u>=0&&u<t.length;u+=o){let h=t[u];if(c&&!pt(h,s,st))break;if(!c&&!ht(h,s,st))break;if(c)a[u].y=i.y;else a[u].x=i.x}return a}e(ls,"moveCollinearEndpointRun");function He(t,n,o){if(t.length<2)return t;let s=o?0:t.length-1,i=o?1:-1,c=t[s],a=ee(t,s,i);if(!a)return t;let u=se(c,a,n);if(!u)return t;let h=kn(u),d=as(c,n,u);if(rn(c,d,st))return t;return ls(t,s,i,c,d,h)}e(He,"clearEndpointCornerConnection");function De(t,n,o){let s=Math.min(t.x,n.x)>=o.left-st&&Math.max(t.x,n.x)<=o.right+st,i=Math.min(t.y,n.y)>=o.top-st&&Math.max(t.y,n.y)<=o.bottom+st;if(Math.abs(t.y-o.top)<st&&Math.abs(n.y-o.top)<st&&s)return"top";if(Math.abs(t.y-o.bottom)<st&&Math.abs(n.y-o.bottom)<st&&s)return"bottom";if(Math.abs(t.x-o.left)<st&&Math.abs(n.x-o.left)<st&&i)return"left";if(Math.abs(t.x-o.right)<st&&Math.abs(n.x-o.right)<st&&i)return"right";return}e(De,"borderSideForSegment");function Xe(t,n,o,s){switch(t){case"top":return ht(n,o,st)&&o.y<s.top-st;case"bottom":return ht(n,o,st)&&o.y>s.bottom+st;case"left":return pt(n,o,st)&&o.x<s.left-st;case"right":return pt(n,o,st)&&o.x>s.right+st}}e(Xe,"leavesOutward");function Ye(t,n,o){if(t.length<3)return t;if(o){let c=De(t[0],t[1],n);if(c&&Xe(c,t[1],t[2],n))return t.slice(1);return t}let s=t.length-1,i=De(t[s-1],t[s],n);if(i&&Xe(i,t[s-1],t[s-2],n))return t.slice(0,s);return t}e(Ye,"collapseOwnBorderStub");function fs(t,n,o){let s=t;if(n){let c=ee(s,0,1);if(c){let a=Fe(c,s[0],n);if(a!==s[0])s=[a,...s.slice(1)]}s=Ye(s,n,!0)}if(o){let c=s.length-1,a=ee(s,c,-1);if(a){let u=Fe(a,s[c],o,!0);if(u!==s[c])s=[...s.slice(0,c),u]}s=Ye(s,o,!1)}let i=xo(s,n,o);if(i!==s||s.length===2)return i;if(n)s=He(s,n,!0);if(o)s=He(s,o,!1);return s}e(fs,"snapAndCollapseEndpoints");function Ge(t,n){for(let o of t){let s=yo(o,n,2);if(!s)continue;let i=yt(s.points,st),c=fs(i,s.srcRect,s.dstRect);if(c.length<3){s.edge.points=c;continue}let a=[c[0],{...c[0]},...c.slice(1,-1),c[c.length-1],{...c[c.length-1]}];s.edge.points=a}}e(Ge,"prepareEdgeEndpointsForRenderer");function bo(t){return new Map(t.map((n)=>[n.id,n]))}e(bo,"buildNodeMap");function ds(t,n){let o=t.parentId,s=null;while(o){let i=n.get(o);if(!i?.isGroup)break;s=i.id,o=i.parentId}return s}e(ds,"resolveTopLevelGroupId");function $e(t,n){let o=0,s=t.parentId;while(s){let i=n.get(s);if(!i?.isGroup)break;o++,s=i.parentId}return o}e($e,"groupDepth");function Mo(t){let n=1/0,o=-1/0,s=1/0,i=-1/0;for(let c of t){let{x:a,y:u}=c;if(typeof a!=="number"||typeof u!=="number")continue;let h=c.width??0,d=c.height??0;n=Math.min(n,a-h/2),o=Math.max(o,a+h/2),s=Math.min(s,u-d/2),i=Math.max(i,u+d/2)}if(n===1/0||s===1/0)return null;return{minX:n,maxX:o,minY:s,maxY:i}}e(Mo,"boundsForChildren");function us(t,n){let o=t.padding??20;t.x=(n.minX+n.maxX)/2,t.y=(n.minY+n.maxY)/2,t.width=Math.max(0,n.maxX-n.minX)+o,t.height=Math.max(0,n.maxY-n.minY)+o}e(us,"applyGroupBounds");function hs(t){let n=bo(t),o=t.filter((s)=>s.isGroup&&s.parentId).sort((s,i)=>$e(i,n)-$e(s,n));for(let s of o){let i=t.filter((a)=>a.parentId===s.id),c=Mo(i);if(c)us(s,c)}}e(hs,"recomputeNestedGroupBounds");function re(t,n){let o=t.nodes??[],s=t.edges??[],i=o.filter((h)=>!h.isGroup),c=1/0,a=-1/0;for(let h of i){let d=h[n];if(typeof d!=="number")continue;c=Math.min(c,d),a=Math.max(a,d)}if(!Number.isFinite(c)||!Number.isFinite(a))return!1;let u=e((h)=>c+a-h,"mirror");for(let h of o){let d=h[n];if(typeof d==="number")h[n]=u(d);let m=h.groupTitleRect;if(m)h.groupTitleRect=n==="x"?{...m,left:u(m.right),right:u(m.left)}:{...m,top:u(m.bottom),bottom:u(m.top)}}for(let h of s)for(let d of h.points??[])d[n]=u(d[n]);return!0}e(re,"mirrorAxis");function gs(t){if(!(t.nodes??[]).some((o)=>!o.isGroup))return!0;return re(t,"y")}e(gs,"applyBtDirectionTransform");function ps(t,n="LR"){let o=t.nodes??[],s=t.edges??[],i=o.filter((F)=>!F.isGroup),c=1/0,a=1/0;for(let F of i){let Y=F.x??0,V=F.y??0;if(Y<c)c=Y;if(V<a)a=V}if(!Number.isFinite(c)||!Number.isFinite(a))return!1;let u=36,h=0,d=0;for(let F of i)h+=F.width??0,d+=F.height??0;let m=h/i.length,p=d/i.length,I=p>0?Math.max(1,m/p):1;for(let F of i){let Y=F.x??0,J=((F.y??0)-a)*I+u,lt=Y-c;F.x=J,F.y=lt}for(let F of s){if(!F.points)continue;for(let Y of F.points){let V=Y.x,lt=(Y.y-a)*I+u,xt=V-c;Y.x=lt,Y.y=xt}}hs(o);let y=o.filter((F)=>F.isGroup&&!F.parentId);if(y.length===0){if(n==="RL")re(t,"x");return!0}let g=bo(o),l=new Map;for(let F of o){if(F.isGroup)continue;let Y=ds(F,g);if(!Y)continue;let V=l.get(Y)??[];V.push(F),l.set(Y,V)}let x=0;for(let F of y){let Y=F.padding??0;if(Y>x)x=Y}let L=[],S=1/0,E=-1/0;for(let F of y){let Y=l.get(F.id)??[],V=Mo(Y);if(!V)continue;S=Math.min(S,V.minX),E=Math.max(E,V.maxX),L.push({lane:F,contentTop:V.minY,contentBottom:V.maxY,centerY:(V.minY+V.maxY)/2})}if(S===1/0||E===-1/0)return!0;let w=Math.max(0,E-S),C=Math.max(x,10),b=w+2*C,R=u+b,N=(S+E)/2-b/2-u,H=N+R/2,_=Math.max(x,u);L.sort((F,Y)=>F.centerY-Y.centerY);for(let F=0;F<L.length;F++){let Y=L[F],V,J;if(F===0)V=Y.contentTop-_;else V=(L[F-1].contentBottom+Y.contentTop)/2;if(F===L.length-1)J=Y.contentBottom+_;else{let Ot=L[F+1];J=(Y.contentBottom+Ot.contentTop)/2}let lt=Math.max(0,J-V),xt=(V+J)/2;Y.lane.x=H,Y.lane.y=xt,Y.lane.width=R,Y.lane.height=lt,Y.lane.swimlaneContentTop=Y.contentTop,Y.lane.groupTitleRect={left:N,right:N+u,top:V,bottom:J}}if(n==="RL")re(t,"x");return!0}e(ps,"applyLrDirectionTransform");var an=0.000001,Br=8,Wn=Br,Fr=[0,Wn,-Wn,2*Wn,-2*Wn];function ms(t,n){let{nodeInfoById:o,realNodeRects:s}=le(n);for(let i of t){if(i.isLayoutOnly)continue;let c=i.points;if(!c||c.length<4)continue;let a=fo(yt(c,an),an);if(!a)continue;let{p3:u}=a,h=a.kind==="HVH",d=po(i,o,an);if(!d)continue;let{srcId:m,dstId:p,srcInfo:I,dstInfo:y,collinearX:g,collinearY:l}=d;if(g||l)continue;let x,L=I.rect;for(let S of Fr){let E,w,C;if(h){let H=y.cy>I.cy?L.bottom:L.top,_=I.cx+S;if(_<=L.left+an||_>=L.right-an)continue;E={x:_,y:H},w={x:_,y:u.y},C={x:u.x,y:u.y}}else{let H=y.cx>I.cx?L.right:L.left,_=I.cy+S;if(_<=L.top+an||_>=L.bottom-an)continue;E={x:H,y:_},w={x:u.x,y:_},C={x:u.x,y:u.y}}let b=rn(E,w,an),R=rn(w,C,an);if(b&&R)continue;if(!b&&Nt(E,w,s,[m],1))continue;if(!R&&Nt(w,C,s,[p],1))continue;let O=!b&&te(E,w,t,i,{epsilon:an,skipDegenerateOther:!0}),P=!R&&te(w,C,t,i,{epsilon:an,skipDegenerateOther:!0});if(O||P)continue;if(b)x=[w,C];else if(R)x=[E,w];else x=[E,w,C];break}if(x)i.points=x}}e(ms,"portSwapToLShape");function ys(t,n){let{realNodeRects:c,labelNodeRects:a}=bn(n.values());for(let u of t){if(u.isLayoutOnly)continue;let h=u.points;if(!h||h.length<4)continue;let d=yt(h,0.001);if(d.length<4)continue;let m=d.length-1,p=d[m],I=d[m-1],y=d[m-2],g=p.x-I.x,l=p.y-I.y,x=Math.hypot(g,l);if(x>=10||x<0.001)continue;let L=I.x-y.x,S=I.y-y.y;if(Math.hypot(L,S)<0.001)continue;let w=Tt(I,p,0.001),C=wt(I,p,0.001),b=Tt(y,I,0.001),R=wt(y,I,0.001);if(!(w&&R||C&&b))continue;let{end:O,start:P}=u,N=O?n.get(O):void 0;if(!N)continue;let H=N.x??0,_=N.y??0,F=Zt(N);if(!F)continue;let Y,V;if(R){let q=S<0;Y={x:H,y:y.y},V={x:H,y:q?F.bottom:F.top}}else{let q=L>0;Y={x:y.x,y:_},V={x:q?F.right:F.left,y:_}}if(Nt(Y,V,c,O?[O]:[],-2))continue;if(Nt(Y,V,a,[],-2))continue;if(P){let q=n.get(P),ot=q?Zt(q):void 0;if(ot&&uo(Y,ot,2))continue}let J=e((q,ot)=>`${q.x.toFixed(3)},${q.y.toFixed(3)}|${ot.x.toFixed(3)},${ot.y.toFixed(3)}`,"ownSegmentKey"),lt=new Set;for(let q=0;q<d.length-1;q++)lt.add(J(d[q],d[q+1]));let xt=e((q,ot)=>{for(let dt of t){if(dt===u)continue;if(dt.isLayoutOnly)continue;let mt=dt.points;if(!mt||mt.length<2)continue;for(let Mt=0;Mt<mt.length-1;Mt++){let Et=mt[Mt],jt=mt[Mt+1];if(lt.has(J(Et,jt)))continue;if(un(q,ot,Et,jt,0.001))return!0}}return!1},"segmentCrossesOtherEdge");if(xt(Y,V))continue;if(m-3>=0){let q=d[m-3],ot=[P,O].filter((dt)=>Boolean(dt));if(Nt(q,Y,c,ot,-2))continue;if(xt(q,Y))continue}let kt=[...d.slice(0,m-2),Y,V];u.points=kt;let nt=u.labelNodeId;if(nt){let q=n.get(nt);if(q){let ot=q.width??0,dt=q.height??0;if(ot>0&&dt>0){let mt,Mt,Et=-1;for(let jt=0;jt<kt.length-1;jt++){let Wt=kt[jt],Kt=kt[jt+1],en=Math.hypot(Kt.x-Wt.x,Kt.y-Wt.y),Ln=pt(Wt,Kt,0.001),gn=ht(Wt,Kt,0.001);if(!(Ln&&en>=ot+2||gn&&en>=dt+2))continue;if(en>Et)Et=en,mt=(Wt.x+Kt.x)/2,Mt=(Wt.y+Kt.y)/2}if(mt!==void 0&&Mt!==void 0)q.x=mt,q.y=Mt}}}}}e(ys,"collapseShortTerminalStub");var tt=0.001,Ht=8,xs=e((t)=>typeof t==="string"?t.toUpperCase():"","upperCaseDirection"),at=Bn,Ee=e((t,n)=>ht(t,n,tt)||pt(t,n,tt),"orthogonallyAligned");function ze(t,n){let i=e((y,g)=>{let l=y.x??0,x=y.y??0,L=g.x-l,S=g.y-x,E=(y.width??0)/2,w=(y.height??0)/2;if(Math.abs(S)*E>Math.abs(L)*w){if(S<0)w=-w;return{x:l+(S===0?0:w*L/S),y:x+w}}if(L<0)E=-E;return{x:l+E,y:x+(L===0?0:E*S/L)}},"rectIntersect"),c=e((y,g)=>{let l=yt(y.points??[]);if(l.length<2)return;let x=g?y.start:y.end,L=x?n.get(x):void 0,S=L?Zt(L):void 0;if(!L||!x||!S)return;let E=g?l[0]:l[l.length-1],w=g?l[1]:l[l.length-2],C=i(L,E),b=E;if(Ee(w,C))b=w;if(ht(C,b,tt))return{edge:y,edgeId:String(y.id??""),nodeId:x,atStart:g,orientation:"V",coord:C.x,min:Math.min(C.y,b.y),max:Math.max(C.y,b.y),boundary:C,railEnd:b,rect:S};if(pt(C,b,tt))return{edge:y,edgeId:String(y.id??""),nodeId:x,atStart:g,orientation:"H",coord:C.y,min:Math.min(C.x,b.x),max:Math.max(C.x,b.x),boundary:C,railEnd:b,rect:S};return},"terminalLaneFor"),a=e((y,g)=>Math.max(0,Math.min(y.max,g.max)-Math.max(y.min,g.min)),"projectedOverlapLength"),u=e((y,g)=>{if(y.nodeId!==g.nodeId||y.orientation!==g.orientation)return!1;if(y.orientation==="H")return(Math.abs(y.boundary.x-y.rect.left)<1||Math.abs(y.boundary.x-y.rect.right)<1)&&ht(y.boundary,g.boundary,1);return(Math.abs(y.boundary.y-y.rect.top)<1||Math.abs(y.boundary.y-y.rect.bottom)<1)&&pt(y.boundary,g.boundary,1)},"sameTerminalFace"),h=e((y,g)=>{if(y.nodeId!==g.nodeId||y.orientation!==g.orientation)return!1;return a(y,g)>=Ht&&Math.abs(y.coord-g.coord)<0.5},"exactTerminalLaneConflict"),d=e((y,g)=>{if(y.nodeId!==g.nodeId||y.orientation!==g.orientation||y.orientation!=="H"||y.atStart===g.atStart)return!1;let l=a(y,g);if(l<Ht)return!1;let x=y.rect.bottom-y.rect.top;if(l<x||l>2*x)return!1;return u(y,g)&&Math.abs(y.coord-g.coord)<16},"nearTerminalLaneConflict"),m=e((y,g)=>{let l=yt(y.edge.points??[]);if(l.length<2)return;let x=y.orientation==="V"?{x:y.boundary.x+g,y:y.boundary.y}:{x:y.boundary.x,y:y.boundary.y+g},L=y.orientation==="V"?{x:y.railEnd.x+g,y:y.railEnd.y}:{x:y.railEnd.x,y:y.railEnd.y+g};if(!e(()=>{if(Math.abs(y.boundary.y-y.rect.top)<1||Math.abs(y.boundary.y-y.rect.bottom)<1)return pt(x,y.boundary,tt)&&x.x>=y.rect.left+1&&x.x<=y.rect.right-1;if(Math.abs(y.boundary.x-y.rect.left)<1||Math.abs(y.boundary.x-y.rect.right)<1)return ht(x,y.boundary,tt)&&x.y>=y.rect.top+1&&x.y<=y.rect.bottom-1;return!1},"boundaryStaysOnSameFace")())return;if(y.atStart){let b=l.length>1&&rn(l[1],y.railEnd,tt),R=l.slice(b?2:1),O=R[0];if(O&&!Ee(O,L))return;return[x,L,...R]}let E=l.length>1&&rn(l[l.length-2],y.railEnd,tt),w=l.slice(0,E?-2:-1),C=w[w.length-1];if(C&&!Ee(C,L))return;return[...w,L,x]},"shiftedCandidate"),p=e((y)=>{let g=y.edge,l=yt(g.points??[]);if(l.length!==2)return!1;let{start:x,end:L}=g,S=x?n.get(x):void 0,E=L?n.get(L):void 0;if(!S||!E)return!1;let w=S.x??0,C=S.y??0,b=E.x??0,R=E.y??0,[O,P]=l;return pt(O,P,tt)&&Math.abs(C-R)<1&&Math.abs(w-b)>1||ht(O,P,tt)&&Math.abs(w-b)<1&&Math.abs(C-R)>1},"laneIsStraightCollinearConnector"),I=[-7,7,-14,14,-21,21];for(let y=0;y<8;y++){let g=t.filter((x)=>!x.isLayoutOnly).flatMap((x)=>[c(x,!0),c(x,!1)]).filter((x)=>Boolean(x)),l=!1;for(let x=0;x<g.length&&!l;x++)for(let L=x+1;L<g.length&&!l;L++){let S=g[x],E=g[L];if(S.edge===E.edge||!(h(S,E)||d(S,E)))continue;let w=!h(S,E),C=[S,E].sort((b,R)=>{let O=p(b),P=p(R);if(O!==P)return Number(O)-Number(P);return Number(!R.atStart)-Number(!b.atStart)});for(let b of C){for(let R of I){let O=m(b,R);if(!O)continue;let P=c({...b.edge,points:O},b.atStart);if(!P||g.some((N)=>N.edge!==b.edge&&(h(P,N)||w&&d(P,N))))continue;b.edge.points=O,l=!0;break}if(l)break}}if(!l)return}}e(ze,"separateSharedRenderedTerminalLanes");function bs(t,n){let{realNodeRects:i,labelNodeRects:c}=bn(n.values()),a=e((h,d)=>{let{start:m,end:p}=h,I=at(d);if(I.length!==d.length-1)return!1;let y=[m,p].filter((g)=>Boolean(g));for(let g of I){if(Nt(g.a,g.b,i,y,-2))return!1;if(Nt(g.a,g.b,c,[],-2))return!1}for(let g of t){if(g===h||g.isLayoutOnly)continue;let l=g.points;if(!l||l.length<2)continue;for(let x of I)for(let L of at(yt(l))){if(fn(x,L,0.5)>=Ht)return!1;if(un(x.a,x.b,L.a,L.b,tt))return!1}}return!0},"candidateIsSafe"),u=e((h,d)=>{if(d+4>=h.length)return;let m=h[d],p=h[d+1],I=h[d+2],y=h[d+3],g=h[d+4],l=Tt(m,p)&&wt(p,I)&&Tt(I,y)&&wt(y,g)&&ht(m,y,tt)&&ht(m,g,tt)&&ht(p,I,tt)&&(p.x-m.x)*(y.x-I.x)<0,x=wt(m,p)&&Tt(p,I)&&wt(I,y)&&Tt(y,g)&&pt(m,y,tt)&&pt(m,g,tt)&&pt(p,I,tt)&&(p.y-m.y)*(y.y-I.y)<0;if(l||x)return yt([...h.slice(0,d+1),g,...h.slice(d+5)]);if(d+5>=h.length)return;let L=h[d+5],S=wt(m,p)&&Tt(p,I)&&wt(I,y)&&Tt(y,g)&&wt(g,L)&&ht(m,g,tt)&&ht(m,L,tt)&&ht(I,y,tt)&&(I.x-p.x)*(g.x-y.x)<0,E=Tt(m,p)&&wt(p,I)&&Tt(I,y)&&wt(y,g)&&Tt(g,L)&&pt(m,g,tt)&&pt(m,L,tt)&&pt(I,y,tt)&&(I.y-p.y)*(g.y-y.y)<0;if(!S&&!E)return;return yt([...h.slice(0,d+1),L,...h.slice(d+6)])},"withoutDogleg");for(let h=0;h<8;h++){let d=!1;for(let m of t){if(m.isLayoutOnly)continue;let p=yt(m.points??[]);for(let I=0;I<=p.length-5;I++){let y=u(p,I);if(!y||!a(m,y))continue;m.points=y,d=!0;break}if(d)break}if(!d)return}}e(bs,"collapseRedundantRectangularDoglegs");function Ve(t,n){let{realNodeRects:c,labelNodeRects:a}=bn(n.values()),u=t.filter((g)=>!g.isLayoutOnly),h=e((g,l,x)=>yt(g===l?x??[]:g.points??[]),"pointsFor"),d=e((g,l)=>{let x=0;for(let L=0;L<u.length;L++){let S=at(h(u[L],g,l));for(let E=L+1;E<u.length;E++){let w=at(h(u[E],g,l));for(let C of S)for(let b of w)if(un(C.a,C.b,b.a,b.b,tt))x++}}return x},"strictCrossingCount"),m=e((g)=>{let l=at(g);if(l.length!==3)return;let x=l[1];if(l[0].horizontal===x.horizontal||l[2].horizontal===x.horizontal)return;return{index:x.index,horizontal:x.horizontal,vertical:x.vertical,segment:x}},"middleRail"),p=e((g,l)=>{let x=[g.start,g.end].filter((L)=>Boolean(L));return c.filter((L)=>{if(x.includes(L.id))return!1;let S=L.rect;if(l.horizontal)return Ut(l.a.x,l.b.x,S.left,S.right)>=Ht&&l.a.y>=S.top-2&&l.a.y<=S.bottom+2;return Ut(l.a.y,l.b.y,S.top,S.bottom)>=Ht&&l.a.x>=S.left-2&&l.a.x<=S.right+2})},"blockingRectsFor"),I=e((g,l,x)=>{let L=g.map((E)=>({...E}));if(l.horizontal)L[l.index].y=x,L[l.index+1].y=x;else if(l.vertical)L[l.index].x=x,L[l.index+1].x=x;else return;let S=dn(yt(L));return at(S).length===S.length-1?S:void 0},"candidateByMovingRail"),y=e((g,l,x)=>{let L=[g.start,g.end].filter((E)=>Boolean(E)),S=at(l);if(S.length!==l.length-1)return!1;for(let E of S){if(Nt(E.a,E.b,c,L,-2))return!1;if(Nt(E.a,E.b,a,[],-2))return!1}for(let E of u){if(E===g)continue;for(let w of S)for(let C of at(h(E)))if(fn(w,C,0.5)>=Ht)return!1}return d(g,l)<=x},"candidateIsSafe");for(let g=0;g<8;g++){let l=d(),x=!1;for(let L of u){let S=h(L),E=m(S);if(!E)continue;let w=p(L,E.segment);if(w.length===0)continue;let C=E.horizontal?[Math.min(...w.map((b)=>b.rect.top))-20,Math.max(...w.map((b)=>b.rect.bottom))+20]:[Math.min(...w.map((b)=>b.rect.left))-20,Math.max(...w.map((b)=>b.rect.right))+20];for(let b of C){let R=I(S,E.segment,b);if(!R||!y(L,R,l))continue;L.points=R,x=!0;break}if(x)break}if(!x)return}}e(Ve,"liftObstacleHuggingSameSideRails");function Ue(t,n,o){let i=e((d)=>{let m=d.groupTitleRect;if(!m||typeof m.left!=="number"||typeof m.right!=="number"||typeof m.top!=="number"||typeof m.bottom!=="number"||!Number.isFinite(m.left)||!Number.isFinite(m.right)||!Number.isFinite(m.top)||!Number.isFinite(m.bottom)||m.right<=m.left||m.bottom<=m.top)return;return{left:m.left,right:m.right,top:m.top,bottom:m.bottom}},"validTitleRect"),c=e((d)=>{if(!d.isGroup||d.parentId)return;let m=xs(d.direction??o);if(m==="LR"||m==="RL"||m==="BT")return;let p=i(d),{y:I,height:y}=d;if(!p||typeof I!=="number"||typeof y!=="number"||!Number.isFinite(I)||!Number.isFinite(y)||y<=0)return;let g=p.right-p.left,l=p.bottom-p.top;if(l<=0||g<l)return;return{node:d,rect:p}},"topLaneTitleFor"),a=e((d,m)=>{if(!d.horizontal)return!1;let p=d.a.y;if(p<m.top-tt||p>m.bottom+tt)return!1;return Ut(d.a.x,d.b.x,m.left,m.right)>=Ht},"horizontalSegmentIntersectsTitle"),u=[...n.values()].map(c).filter((d)=>Boolean(d));if(u.length===0)return;let h=0;for(let d of t){if(d.isLayoutOnly)continue;let m=yt(d.points??[]);for(let p of at(m))for(let I of u){if(!a(p,I.rect))continue;h=Math.max(h,I.rect.bottom-p.a.y+4)}}if(h<=tt)return;for(let d of u){let m=d.node.y,p=d.node.height;if(typeof m!=="number"||typeof p!=="number"||!Number.isFinite(m)||!Number.isFinite(p)||p<=0)continue;d.node.y=m-h/2,d.node.height=p+h,d.node.groupTitleRect={...d.rect,top:d.rect.top-h,bottom:d.rect.bottom-h}}}e(Ue,"liftTopLaneTitleBandsAboveRails");function je(t,n,o){let i=e((m)=>{let p=m.groupTitleRect;if(!p||typeof p.left!=="number"||typeof p.right!=="number"||typeof p.top!=="number"||typeof p.bottom!=="number"||!Number.isFinite(p.left)||!Number.isFinite(p.right)||!Number.isFinite(p.top)||!Number.isFinite(p.bottom)||p.right<=p.left||p.bottom<=p.top)return;return{left:p.left,right:p.right,top:p.top,bottom:p.bottom}},"validTitleRect"),c=e((m)=>{if(!m.isGroup||m.parentId)return;if(xs(m.direction??o)!=="LR")return;let I=i(m),{x:y,width:g}=m;if(!I||typeof y!=="number"||typeof g!=="number"||!Number.isFinite(y)||!Number.isFinite(g)||g<=0)return;let l=I.right-I.left,x=I.bottom-I.top;if(l<=0||x<l)return;return{node:m,rect:I}},"leftLaneTitleFor"),a=e((m,p)=>{if(!m.vertical)return!1;let I=m.a.x;if(I<p.left-tt||I>p.right+tt)return!1;return Ut(m.a.y,m.b.y,p.top,p.bottom)>=Ht},"verticalSegmentIntersectsTitle"),u=e((m,p)=>{if(!m.horizontal)return!1;let I=m.a.y;if(I<p.top-tt||I>p.bottom+tt)return!1;return Ut(m.a.x,m.b.x,p.left,p.right)>=Ht},"horizontalSegmentIntersectsTitle"),h=[...n.values()].map(c).filter((m)=>Boolean(m));if(h.length===0)return;let d=0;for(let m of t){if(m.isLayoutOnly)continue;let p=yt(m.points??[]);for(let I of at(p))for(let y of h)if(a(I,y.rect))d=Math.max(d,y.rect.right-I.a.x+4);else if(u(I,y.rect)){let g=Math.min(I.a.x,I.b.x);d=Math.max(d,y.rect.right-g+4)}}if(d<=tt)return;for(let m of h){let p=m.node.x,I=m.node.width;if(typeof p!=="number"||typeof I!=="number"||!Number.isFinite(p)||!Number.isFinite(I)||I<=0)continue;m.node.x=p-d/2,m.node.width=I+d,m.node.groupTitleRect={...m.rect,left:m.rect.left-d,right:m.rect.right-d}}}e(je,"shiftLeftLaneTitleBandsLeftOfRails");function Ms(t,n){let{realNodeRects:i}=bn(n.values()),c=t.filter((l)=>!l.isLayoutOnly),a=e((l,x=new Map)=>yt(x.get(l)??l.points??[]),"replacementPointsFor"),u=e((l=new Map)=>{let x=0;for(let L=0;L<c.length;L++){let S=at(a(c[L],l));for(let E=L+1;E<c.length;E++){let w=at(a(c[E],l));for(let C of S)for(let b of w)if(un(C.a,C.b,b.a,b.b,tt))x++}}return x},"crossingCount"),h=e((l=new Map)=>c.reduce((x,L)=>x+nn(a(L,l)),0),"totalBends"),d=e((l)=>{let x=a(l);if(x.length<4)return;let L=x[x.length-2],S=x[x.length-1];if(!Tt(L,S,tt)&&!wt(L,S,tt))return;return{tailStart:L,terminal:S}},"terminalTailFor"),m=e((l,x)=>{let L=a(l);if(L.length<3)return;let S=L[0],E=L[1],w;if(Tt(S,E,tt))w={x:E.x,y:x.tailStart.y};else if(wt(S,E,tt))w={x:x.tailStart.x,y:E.y};else return;let C=dn(yt([S,E,w,x.tailStart,x.terminal]));return at(C).length===C.length-1?C:void 0},"candidateWithDestinationTail"),p=e((l,x)=>{let L=[l.start,l.end].filter((S)=>Boolean(S));for(let S of at(x))if(Nt(S.a,S.b,i,L,-2))return!0;return!1},"pathHasNodeHit"),I=e((l,x,L)=>{for(let S of c){if(S===l)continue;for(let E of at(x))for(let w of at(a(S,L)))if(fn(E,w,0.5)>=Ht)return!0}return!1},"pathHasSharedTrack"),y=e((l,x,L)=>!p(l,x)&&!I(l,x,L),"candidateIsSafe"),g=e(()=>{let l=new Map;for(let x of c){let L=x.end;if(!L||!n.has(L))continue;if(a(x).length<4)continue;let E=l.get(L)??[];E.push(x),l.set(L,E)}return l},"edgesByDestination");for(let l=0;l<4;l++){let x=u();if(x===0)return;let L=h(),S,E=x,w=L;for(let C of g().values())for(let b=0;b<C.length;b++)for(let R=b+1;R<C.length;R++){let O=C[b],P=C[R],N=d(O),H=d(P);if(!N||!H)continue;let _=m(O,H),F=m(P,N);if(!_||!F)continue;let Y=new Map([[O,_],[P,F]]);if(!y(O,_,Y)||!y(P,F,Y))continue;let V=u(Y),J=h(Y);if(V>=x)continue;if(V>E||V===E&&J>=w)continue;S=Y,E=V,w=J}if(!S)return;for(let[C,b]of S)C.points=b}}e(Ms,"swapDestinationTerminalTailsToReduceCrossings");function Is(t,n){let{realNodeRects:a,labelNodeRects:u}=bn(n.values()),h=t.filter((C)=>!C.isLayoutOnly),d=e((C,b=new Map)=>yt(b.get(C)??C.points??[]),"replacementPointsFor"),m=e((C=new Map)=>{let b=0;for(let R=0;R<h.length;R++){let O=at(d(h[R],C));for(let P=R+1;P<h.length;P++){let N=at(d(h[P],C));for(let H of O)for(let _ of N)if(un(H.a,H.b,_.a,_.b,tt))b++}}return b},"strictCrossingCount"),p=e((C=new Map)=>h.reduce((b,R)=>b+nn(d(R,C)),0),"totalBends"),I=e((C)=>{let{start:b,end:R}=C,O=b?n.get(b):void 0,P=R?n.get(R):void 0,N=O?Zt(O):void 0,H=P?Zt(P):void 0;return N&&H?{src:N,dst:H}:void 0},"endpointRectsFor"),y=e((C,b,R)=>{if(R.index<=0||R.index+1>=b.length-1)return;let O=I(C);if(!O)return;if(R.vertical){let P=R.a.x,N=Math.min(O.src.left,O.dst.left),H=Math.max(O.src.right,O.dst.right),_=P<N-tt?"left":P>H+tt?"right":void 0;if(!_)return;return{edge:C,points:b,segmentIndex:R.index,axis:"vertical",side:_,coord:P,min:Math.min(R.a.y,R.b.y),max:Math.max(R.a.y,R.b.y)}}if(R.horizontal){let P=R.a.y,N=Math.min(O.src.top,O.dst.top),H=Math.max(O.src.bottom,O.dst.bottom),_=P<N-tt?"top":P>H+tt?"bottom":void 0;if(!_)return;return{edge:C,points:b,segmentIndex:R.index,axis:"horizontal",side:_,coord:P,min:Math.min(R.a.x,R.b.x),max:Math.max(R.a.x,R.b.x)}}return},"externalRailForSegment"),g=e(()=>{let C=[];for(let b of h){let R=d(b);for(let O of at(R)){let P=y(b,R,O);if(P)C.push(P)}}return C},"collectExternalRails"),l=e((C,b)=>C.edge!==b.edge&&C.axis===b.axis&&C.side===b.side&&Ut(C.min,C.max,b.min,b.max)>=Ht,"railsInteract"),x=e((C)=>{let b=[],R=new Set;for(let O of C){if(R.has(O))continue;let P=[O],N=[];R.add(O);while(P.length>0){let H=P.pop();N.push(H);for(let _ of C)if(!R.has(_)&&l(H,_))R.add(_),P.push(_)}if(N.length>1)b.push(N)}return b},"connectedComponents"),L=e((C)=>{let b=[];for(let R of C)if(!b.some((O)=>Math.abs(O-R.coord)<tt))b.push(R.coord);while(b.length<C.length){let R=Math.min(...b),O=Math.max(...b),P=C[0].side;b.push(P==="left"||P==="top"?R-12*(C.length-b.length):O+12*(C.length-b.length))}return b},"uniqueCoordsFor"),S=e((C)=>{let b=C.map((P)=>P.coord),R=L(C),O=[];if(C.length<=6){let P=Array(R.length).fill(!1),N=[],H=e(()=>{if(N.length===C.length){if(N.some((_,F)=>Math.abs(_-b[F])>=tt))O.push([...N]);return}for(let[_,F]of R.entries()){if(P[_])continue;P[_]=!0,N.push(F),H(),N.pop(),P[_]=!1}},"visit");return H(),O}for(let P=0;P<b.length;P++)for(let N=P+1;N<b.length;N++){let H=[...b];[H[P],H[N]]=[H[N],H[P]],O.push(H)}return O},"coordinateAssignmentsFor"),E=e((C,b)=>{let R=new Map;for(let[P,N]of C.entries()){let H=b[P],_=R.get(N.edge)??N.points.map((F)=>({x:F.x,y:F.y}));if(N.axis==="vertical")_[N.segmentIndex].x=H,_[N.segmentIndex+1].x=H;else _[N.segmentIndex].y=H,_[N.segmentIndex+1].y=H;R.set(N.edge,_)}let O=new Map;for(let[P,N]of R){let H=dn(yt(N));if(at(H).length!==H.length-1)return;O.set(P,H)}return O},"replacementsForAssignment"),w=e((C)=>{for(let[b,R]of C){let O=[b.start,b.end].filter((P)=>Boolean(P));for(let P of at(R)){if(Nt(P.a,P.b,a,O,-2))return!1;if(Nt(P.a,P.b,u,[],-2))return!1}}for(let b=0;b<h.length;b++){let R=h[b],O=C.has(R),P=at(d(R,C));for(let N=b+1;N<h.length;N++){let H=h[N];if(!O&&!C.has(H))continue;let _=at(d(H,C));for(let F of P)for(let Y of _)if(fn(F,Y,0.5)>=Ht)return!1}}return!0},"candidateIsSafe");for(let C=0;C<4;C++){let b=m();if(b===0)return;let R,O=b,P=p(),N=Number.POSITIVE_INFINITY;for(let H of x(g()))for(let _ of S(H)){let F=E(H,_);if(!F||!w(F))continue;let Y=m(F);if(Y>=b)continue;let V=p(F),J=H.reduce((lt,xt,Ot)=>lt+Math.abs(_[Ot]-xt.coord),0);if(Y>O||Y===O&&(V>P||V===P&&J>=N))continue;R=F,O=Y,P=V,N=J}if(!R)return;for(let[H,_]of R)H.points=_}}e(Is,"reassignCrossingExternalRailChannels");function Ss(t,n){let{realNodeRects:i,labelNodeRects:c}=bn(n.values()),a=t.filter((g)=>!g.isLayoutOnly),u=e((g,l,x)=>yt(g===l?x??[]:g.points??[]),"pointsFor"),h=e((g)=>at(g).reduce((l,x)=>{let L=x.a.x-x.b.x,S=x.a.y-x.b.y;return l+Math.hypot(L,S)},0),"pathLength"),d=e((g,l)=>{let x=0;for(let L=0;L<a.length;L++){let S=at(u(a[L],g,l));for(let E=L+1;E<a.length;E++){let w=at(u(a[E],g,l));for(let C of S)for(let b of w)if(un(C.a,C.b,b.a,b.b,tt))x++}}return x},"strictCrossingCount"),m=e((g,l)=>{if(g.horizontal){let x=g.a.y;return(Math.abs(x-l.top)<1||Math.abs(x-l.bottom)<1)&&Ut(g.a.x,g.b.x,l.left,l.right)>=Ht}if(g.vertical){let x=g.a.x;return(Math.abs(x-l.left)<1||Math.abs(x-l.right)<1)&&Ut(g.a.y,g.b.y,l.top,l.bottom)>=Ht}return!1},"segmentRunsAlongRectBorder"),p=e((g)=>{let l=[g.start,g.end].filter((L)=>Boolean(L)),x=[];for(let L of l){let S=n.get(L),E=S?Zt(S):void 0;if(E)x.push(E)}return x},"endpointRectsFor"),I=e((g,l)=>{if(l+3>=g.length)return[];let x=g[l],L=g[l+1],S=g[l+2],E=g[l+3],w=Tt(x,L,tt)&&wt(L,S,tt)&&Tt(S,E,tt),C=wt(x,L,tt)&&Tt(L,S,tt)&&wt(S,E,tt);if(!w&&!C)return[];if(!(w?Math.sign(L.x-x.x)!==Math.sign(E.x-S.x):Math.sign(L.y-x.y)!==Math.sign(E.y-S.y)))return[];let R=ht(x,E,tt)||pt(x,E,tt)?[]:[{x:x.x,y:E.y},{x:E.x,y:x.y}],O=R.length===0?[[...g.slice(0,l+1),...g.slice(l+3)]]:R.map((N)=>[...g.slice(0,l+1),N,...g.slice(l+3)]),P=new Set;return O.map((N)=>dn(yt(N))).filter((N)=>{if(at(N).length!==N.length-1)return!1;if(!N.some((_)=>rn(_,E,tt)))return!1;let H=N.map((_)=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");if(P.has(H))return!1;return P.add(H),!0})},"shortcutCandidatesAt"),y=e((g,l,x)=>{let L=[g.start,g.end].filter((E)=>Boolean(E)),S=p(g);for(let E of at(l)){if(Nt(E.a,E.b,i,L,-2))return!1;if(Nt(E.a,E.b,c,[],-2))return!1;if(S.some((w)=>m(E,w)))return!1}for(let E of a){if(E===g)continue;for(let w of at(l))for(let C of at(u(E)))if(fn(w,C,0.5)>=Ht)return!1}return d(g,l)<=x},"candidateIsSafe");for(let g=0;g<8;g++){let l=d(),x,L,S=l,{POSITIVE_INFINITY:E,POSITIVE_INFINITY:w}=Number;for(let C of a){let b=u(C),R=nn(b,tt),O=h(b);for(let P=0;P<=b.length-4;P++)for(let N of I(b,P)){let H=nn(N,tt),_=h(N);if(!(H<R||H===R&&_<O-tt)||!y(C,N,l))continue;let Y=d(C,N);if(Y>S||Y===S&&(H>E||H===E&&_>=w))continue;x=C,L=N,S=Y,E=H,w=_}}if(!x||!L)return;x.points=L}}e(Ss,"shortcutRedundantOrthogonalJogs");function Cs(t,n){let a=[];for(let B of n.values()){if(B.isGroup||B.isEdgeLabel)continue;let D=B.x??0,X=B.y??0,W=Zt(B);if(!W)continue;a.push({id:String(B.id??""),cx:D,cy:X,rect:W})}if(a.length===0)return;let u=new Map(a.map((B)=>[B.id,B])),h=a.map((B)=>({id:B.id,rect:B.rect})),d=["top","bottom","left","right"],m={top:Math.min(...a.map((B)=>B.rect.top))-20,bottom:Math.max(...a.map((B)=>B.rect.bottom))+20,left:Math.min(...a.map((B)=>B.rect.left))-20,right:Math.max(...a.map((B)=>B.rect.right))+20},p=t.filter((B)=>!B.isLayoutOnly),I=new Map(p.map((B,D)=>[B,D])),y=e((B)=>{let D=B==="left"||B==="top"?-1:1,X=[];for(let W=0;W<=2;W++)X.push(m[B]+D*20*W);return X},"outwardTracksForSide"),g=e((B,D=new Map)=>yt(D.get(B)??B.points??[]),"replacementPointsFor"),l=e((B,D)=>{let X=0;for(let W of B)for(let f of D)if(un(W.a,W.b,f.a,f.b,tt))X++;return X},"crossingCountBetweenSegments"),x=e((B,D)=>l(at(B),at(D)),"crossingCountBetweenPaths"),L=e((B=new Map)=>{let D=0,X=[],W=new Set,f=[],M=e((v)=>{if(!W.has(v))W.add(v),f.push(v)},"addEdge");for(let v=0;v<p.length;v++){let A=p[v],T=g(A,B);for(let k=v+1;k<p.length;k++){let K=p[k],Q=x(T,g(K,B));if(Q>0)D+=Q,X.push({first:A,second:K,count:Q}),M(A),M(K)}}return f.sort((v,A)=>(I.get(v)??0)-(I.get(A)??0)),{count:D,pairs:X,edgeSet:W,edges:f}},"crossingSnapshot"),S=e((B,D)=>{let X=new Set(D.keys());if(X.size===0)return B.count;let W=0;for(let M of B.pairs)if(X.has(M.first)||X.has(M.second))W+=M.count;let f=0;for(let M=0;M<p.length;M++){let v=p[M],A=X.has(v),T=g(v,D);for(let k=M+1;k<p.length;k++){let K=p[k];if(!A&&!X.has(K))continue;f+=x(T,g(K,D))}}return B.count-W+f},"crossingCountWithReplacements"),E=e((B)=>{let D=new Map;for(let f of B.pairs){let M=D.get(f.first)??new Set;M.add(f.second),D.set(f.first,M);let v=D.get(f.second)??new Set;v.add(f.first),D.set(f.second,v)}let X=[],W=new Set;for(let f of B.edges){if(W.has(f))continue;let M=[f],v=[];W.add(f);while(M.length>0){let A=M.pop();v.push(A);for(let T of D.get(A)??[])if(!W.has(T))W.add(T),M.push(T)}if(v.sort((A,T)=>(I.get(A)??0)-(I.get(T)??0)),v.length>1)X.push(v)}return X},"crossingComponents"),w=e((B)=>[B.start,B.end].filter((D)=>Boolean(D)),"endpointIdsFor"),C=e((B)=>{let D=[];for(let X of E(B)){let W=new Set(X),f=new Set(X.flatMap((v)=>w(v))),M=[...X];for(let v of p){if(W.has(v))continue;if(w(v).some((A)=>f.has(A)))M.push(v)}M.sort((v,A)=>(I.get(v)??0)-(I.get(A)??0)),D.push(M)}return D},"pairSearchGroups"),b=e((B,D,X)=>S(B,new Map([[D,X]])),"crossingCountWithSingleReplacement"),R=e((B)=>{let D=new Map;for(let X of B.pairs)D.set(X.first,(D.get(X.first)??0)+X.count),D.set(X.second,(D.get(X.second)??0)+X.count);return D},"currentCrossingsByEdge"),O=e((B)=>B.slice(1).reduce((D,X,W)=>{let f=B[W];return D+Math.abs(X.x-f.x)+Math.abs(X.y-f.y)},0),"pathLength"),P=e((B=new Map)=>p.reduce((D,X)=>D+nn(g(X,B)),0),"totalBends"),N=e((B=new Map)=>p.reduce((D,X)=>D+O(g(X,B)),0),"totalLength"),H=e((B,D,X=new Map)=>{let W=at(D);for(let f of p){if(f===B)continue;for(let M of W)for(let v of at(g(f,X)))if(fn(M,v,0.5)>=Ht)return!0}return!1},"pathHasSegmentConflict"),_=e((B,D)=>{let X=[B.start,B.end].filter((W)=>Boolean(W));for(let W of at(D))if(Nt(W.a,W.b,h,X,-2))return!0;return!1},"pathHitsNode"),F=e((B,D)=>{let X=dn(yt(D));if(at(X).length===X.length-1)B.push(X)},"pushOrthogonalCandidate"),Y=e((B)=>B==="left"||B==="right","sideIsHorizontal"),V=e((B,D,X)=>{switch(D){case"left":return Math.min(B.x,X.x)-20;case"right":return Math.max(B.x,X.x)+20;case"top":return Math.min(B.y,X.y)-20;case"bottom":return Math.max(B.y,X.y)+20}},"localTrackForSameSide"),J=e((B,D,X,W)=>{let f=X==="left"||X==="top"?-1:1,M=[V(D,X,W),m[X]];for(let v of M)for(let A=0;A<=2;A++)F(B,go(D,X,W,v+f*20*A))},"addSameSideCandidates"),lt=e((B,D,X,W,f)=>{for(let M of y(X))for(let v of y(f))F(B,[D,{x:M,y:D.y},{x:M,y:v},{x:W.x,y:v},W])},"addHorizontalToVerticalCandidates"),xt=e((B,D,X,W,f)=>{for(let M of y(X))for(let v of y(f))F(B,[D,{x:D.x,y:M},{x:v,y:M},{x:v,y:W.y},W])},"addVerticalToHorizontalCandidates"),Ot=e((B,D,X,W,f)=>{let M=[...y("top"),...y("bottom")];for(let v of y(X))for(let A of y(f))for(let T of M)F(B,[D,{x:v,y:D.y},{x:v,y:T},{x:A,y:T},{x:A,y:W.y},W])},"addHorizontalPairCandidates"),kt=e((B,D,X,W,f)=>{let M=[...y("left"),...y("right")];for(let v of y(X))for(let A of y(f))for(let T of M)F(B,[D,{x:D.x,y:v},{x:T,y:v},{x:T,y:A},{x:W.x,y:A},W])},"addVerticalPairCandidates"),nt=e((B)=>{let D=new Set;return B.map((X)=>yt(X)).filter((X)=>{let W=X.map((f)=>`${f.x.toFixed(3)},${f.y.toFixed(3)}`).join("|");if(D.has(W)||X.length<2)return!1;return D.add(W),!0})},"dedupeCandidatePaths"),q=e((B,D,X,W)=>{let f=[],M=ho(B,D,X,W,20,tt);if(M)F(f,M);if(D===W)J(f,B,D,X);let v=Y(D),A=Y(W);if(v&&!A)lt(f,B,D,X,W);else if(!v&&A)xt(f,B,D,X,W);else if(v)Ot(f,B,D,X,W);else kt(f,B,D,X,W);return nt(f)},"buildCandidatesForSides"),ot=e((B,D,X,W)=>{let f=[...y("left"),...y("right")],M=[...y("top"),...y("bottom")];for(let v of d){let A=vn(W,v),T=v==="top"||v==="bottom"?y(v):M;for(let k of f){F(B,[D,X,{x:k,y:X.y},{x:k,y:A.y},A]);for(let K of T)F(B,[D,X,{x:k,y:X.y},{x:k,y:K},{x:A.x,y:K},A])}}},"addVerticalDepartureOuterTrackCandidates"),dt=e((B,D,X,W)=>{let f=[...y("left"),...y("right")],M=[...y("top"),...y("bottom")];for(let v of d){let A=vn(W,v),T=v==="left"||v==="right"?y(v):f;for(let k of M){F(B,[D,X,{x:X.x,y:k},{x:A.x,y:k},A]);for(let K of T)F(B,[D,X,{x:X.x,y:k},{x:K,y:k},{x:K,y:A.y},A])}}},"addHorizontalDepartureOuterTrackCandidates"),mt=e((B)=>{let{start:D,end:X}=B,W=X?u.get(X):void 0;if(!D||!W)return[];let f=yt(B.points??[]);if(f.length<4)return[];let M=f[0],v=f[1],A=[];if(wt(M,v,tt))ot(A,M,v,W);else if(Tt(M,v,tt))dt(A,M,v,W);return A},"terminalPreservingOuterTrackCandidates"),Mt=e((B)=>{let{start:D,end:X}=B,W=D?u.get(D):void 0,f=X?u.get(X):void 0;if(!W||!f)return[];let M=[];for(let v of d){let A=vn(W,v);for(let T of d)M.push(...q(A,v,vn(f,T),T))}return M.push(...mt(B)),M},"candidatePathsFor"),Et=e(()=>new Map(p.map((B)=>[B,at(g(B))])),"currentSegmentsByEdge"),jt=e((B,D,X)=>{let W=new Set;for(let f of p){if(f===B)continue;let M=X.get(f)??at(g(f));if(D.some((v)=>M.some((A)=>fn(v,A,0.5)>=Ht)))W.add(f)}return W},"sharedTrackConflictsFor"),Wt=e((B,D,X,W)=>{let f=new Set;return Mt(B).map((v)=>dn(yt(v))).filter((v)=>{if(_(B,v))return!1;let A=v.map((T)=>`${T.x.toFixed(3)},${T.y.toFixed(3)}`).join("|");if(f.has(A)||v.length<2)return!1;return f.add(A),!0}).map((v)=>{let A=at(v),T=0;for(let k of p){if(k===B)continue;T+=l(A,X.get(k)??at(g(k)))}return{candidate:v,candidateSegments:A,crossings:D.count-(W.get(B)??0)+T,bends:nn(v,tt),totalBends:nn(v),length:O(v)}}).filter(({crossings:v})=>v<=D.count).sort((v,A)=>v.crossings-A.crossings||v.bends-A.bends||v.length-A.length).slice(0,48).map((v)=>({path:v.candidate,segments:v.candidateSegments,sharedTrackConflicts:jt(B,v.candidateSegments,X),totalBends:v.totalBends,length:v.length}))},"pairCandidatesFor"),Kt=e((B,D,X,W,f,M)=>{let v=0;for(let T of B.pairs)if(T.first===D||T.second===D||T.first===W||T.second===W)v+=T.count;let A=l(X.segments,f.segments);for(let T of p){if(T===D||T===W)continue;let k=M.get(T)??at(g(T));A+=l(X.segments,k)+l(f.segments,k)}return B.count-v+A},"pairCrossingCount"),en=e((B,D)=>{for(let X of B.sharedTrackConflicts)if(X!==D)return!1;return!0},"conflictsOnlyWith"),Ln=e((B,D)=>B.segments.some((X)=>D.segments.some((W)=>fn(X,W,0.5)>=Ht)),"candidatesShareTrack"),gn=e((B,D,X,W)=>en(D,X.edge)&&en(W,B.edge)&&!Ln(D,W),"pairCandidatesAreCompatible"),En=e((B,D,X,W,f)=>{let M=Kt(B.current,D.edge,X,W.edge,f,B.baseSegments);if(M>=B.current.count)return;return{replacements:new Map([[D.edge,X.path],[W.edge,f.path]]),crossings:M,bends:B.currentBends-(B.baseBendsByEdge.get(D.edge)??0)-(B.baseBendsByEdge.get(W.edge)??0)+X.totalBends+f.totalBends,length:B.currentLength-(B.baseLengthByEdge.get(D.edge)??0)-(B.baseLengthByEdge.get(W.edge)??0)+X.length+f.length}},"scorePairReplacement"),he=e((B,D)=>B.crossings<D.crossings||B.crossings===D.crossings&&(B.bends<D.bends||B.bends===D.bends&&B.length<D.length),"pairScoreIsBetter"),ge=e((B,D,X,W)=>{let f=W;for(let M of D.candidates)for(let v of X.candidates){if(!gn(D,M,X,v))continue;let A=En(B,D,M,X,v);if(A&&he(A,f))f=A}return f},"bestScoreForOptionPair"),pe=e((B)=>{let D=P(),X=N(),W=Et(),f=R(B),M=new Map(p.map((Q)=>[Q,nn(g(Q))])),v=new Map(p.map((Q)=>[Q,O(g(Q))])),A=new Map,T=C(B);for(let Q of T)for(let j of Q){if(A.has(j))continue;let z=Wt(j,B,W,f);if(z.length>0)A.set(j,{edge:j,candidates:z})}let k={replacements:new Map,crossings:B.count,bends:D,length:X},K={current:B,currentBends:D,currentLength:X,baseBendsByEdge:M,baseLengthByEdge:v,baseSegments:W};for(let Q of T){let j=new Set(Q.filter((rt)=>B.edgeSet.has(rt))),z=Q.map((rt)=>A.get(rt)).filter((rt)=>Boolean(rt));for(let rt=0;rt<z.length;rt++){let ct=z[rt];for(let it=rt+1;it<z.length;it++){let et=z[it];if(!j.has(ct.edge)&&!j.has(et.edge))continue;k=ge(K,ct,et,k)}}}return k.replacements.size>0?k.replacements:void 0},"bestPairedReplacement");for(let B=0;B<4;B++){let D=L(),X=D.count;if(X===0)return;let W,f,M=X,v=Number.POSITIVE_INFINITY;for(let T of D.edges){let k=nn(g(T),tt);for(let K of Mt(T)){let Q=_(T,K),j=!Q&&H(T,K),z=b(D,T,K),rt=nn(K,tt);if(Q||j)continue;if(!(z<X||z===X&&rt<k))continue;if(z>M||z===M&&rt>=v)continue;W=T,f=K,M=z,v=rt}}if(W&&f){W.points=f;continue}let A=pe(D);if(!A)return;for(let[T,k]of A)T.points=k}}e(Cs,"resolveRenderedOrthogonalCrossings");var xn=0.001,Pr=8;function vs(t,n){let{nodeInfoById:o,realNodeRects:s}=le(n),i=["top","bottom","left","right"],c=20,a={top:Math.min(...s.map((l)=>l.rect.top))-20,bottom:Math.max(...s.map((l)=>l.rect.bottom))+20,left:Math.min(...s.map((l)=>l.rect.left))-20,right:Math.max(...s.map((l)=>l.rect.right))+20},u=e((l,x,L,S)=>{let E=[],w=ho(l,x,L,S,20,xn);if(w)E.push(w);if(x===S)E.push(go(l,x,L,a[x]));return E},"buildOrthogonalPathCandidates"),h=e((l,x)=>{for(let L=0;L<l.length-1;L++){let S=l[L],E=l[L+1];if(Nt(S,E,s,x,1))return!0}return!1},"pathHitsNode"),d=e((l,x,L=!1)=>{let S=0,E=Bn(l,xn),{start:w,end:C}=x;for(let b of t){if(b===x||b.isLayoutOnly)continue;let{start:R,end:O}=b;if(!L&&w&&C&&(R===w||R===C||O===w||O===C))continue;let P=b.points;if(!P||P.length<2)continue;for(let N of E)for(let H of Bn(P,xn)){if(mo(N.a,N.b,H.a,H.b,xn,xn)){S++;continue}if(fn(N,H,xn)>=Pr)S++}}return S},"pathConflictCount"),m=4,p=e((l,x)=>{let L=Math.abs(l.y-x.rect.top),S=Math.abs(l.y-x.rect.bottom),E=Math.abs(l.x-x.rect.left),w=Math.abs(l.x-x.rect.right),C="top",b=L;if(S<b)C="bottom",b=S;if(E<b)C="left",b=E;if(w<b)C="right",b=w;return C},"nearestSideOfRect"),I=new Map,y=e((l,x,L)=>{let S=I.get(l)??[];S.push({side:x,edgeId:L}),I.set(l,S)},"addFaceClaim");for(let l of t){if(l.isLayoutOnly)continue;let x=l.points??[];if(x.length<1)continue;let L=l.id??"",{start:S,end:E}=l;if(S){let w=o.get(S);if(w)y(S,p(x[0],w),L)}if(E){let w=o.get(E);if(w)y(E,p(x[x.length-1],w),L)}}let g=e((l,x,L)=>I.get(l)?.some((S)=>S.edgeId!==L&&S.side===x)??!1,"faceIsClaimed");for(let l of t){if(l.isLayoutOnly)continue;let x=l.points;if(!x||x.length<2)continue;let L=nn(x,xn);if(L<4)continue;let{start:S,end:E}=l;if(!S||!E)continue;let w=o.get(S),C=o.get(E);if(!w||!C)continue;let b=l.id??"",R=d(x,l,!0),O=d(x,l),P,N=R,H=L;for(let _ of i){if(g(S,_,b))continue;let F=vn(w,_);for(let Y of i){if(g(E,Y,b))continue;let V=vn(C,Y);for(let J of u(F,_,V,Y)){if(h(J,[S,E]))continue;let lt=nn(J,xn);if(R>0){let xt=d(J,l,!0);if(xt>N||xt===N&&lt>=H)continue;N=xt,H=lt,P=J;continue}if(d(J,l)>O)continue;if(lt<H)H=lt,P=J}}}if(P){l.points=P;let _=I.get(S);if(_)I.set(S,_.filter((Y)=>Y.edgeId!==b));let F=I.get(E);if(F)I.set(E,F.filter((Y)=>Y.edgeId!==b));y(S,p(P[0],w),b),y(E,p(P[P.length-1],C),b)}}}e(vs,"simplifyDetouredEdges");var Jt=0.001,zo=10,Kn=7;function We(t,n){let o=n?0:t.length-1,s=n?1:-1,i=t[o],c=t[o+s];if(!i||!c)return;let a=c.x-i.x,u=c.y-i.y;if(Math.abs(a)+Math.abs(u)<Jt)return;if(Math.abs(u)<=Jt){let d=i.x+Math.sign(a)*zo;return{left:Math.min(i.x,d),right:Math.max(i.x,d),top:i.y-Kn,bottom:i.y+Kn}}if(Math.abs(a)<=Jt){let d=i.y+Math.sign(u)*zo;return{left:i.x-Kn,right:i.x+Kn,top:Math.min(i.y,d),bottom:Math.max(i.y,d)}}return{left:Math.min(i.x,c.x),right:Math.max(i.x,c.x),top:Math.min(i.y,c.y),bottom:Math.max(i.y,c.y)}}e(We,"markerClearanceRectFor");function Ls(t){return{left:Math.min(t.left,t.right),right:Math.max(t.left,t.right),top:Math.min(t.top,t.bottom),bottom:Math.max(t.top,t.bottom)}}e(Ls,"normalizeRect");function Ke(t,n){let o=yt(n),s=We(o,!0),i=We(o,!1);return[s,i].some((c)=>c&&Qn(t,Ls(c)))}e(Ke,"labelOverlapsOwnMarker");function Jn(t,n){let o=[];for(let g of t){if(g.isLayoutOnly)continue;let l=g.points;if(!l||l.length<2)continue;for(let x=0;x<l.length-1;x++)o.push({edgeId:g.id,p1:l[x],p2:l[x+1]})}let s=[],i=[];for(let g of n.values()){let{isGroup:l,parentId:x}=g;if(l&&!x){let S=Zt(g);if(S)i.push({id:g.id,rect:S});continue}if(l)continue;if(g.isEdgeLabel)continue;let L=Zt(g);if(!L)continue;s.push({nodeId:g.id,rect:L})}let c=3,a=1,u=12,h=e((g,l)=>{let x=we(l,c);for(let{nodeId:L,rect:S}of s){if(L===g)continue;if(Qn(x,S))return!0}return!1},"labelOverlapsForeignNode"),d=e((g,l)=>{let x=we(l,c);for(let L of o){if(L.edgeId===g)continue;if(ae(L.p1,L.p2,x))return!0}return!1},"labelOverlapsForeignEdge"),m=e((g,l,x)=>h(g,x)||d(l,x),"labelOverlapsAnything"),p=[],I=e((g)=>{for(let{id:l,rect:x}of i)if(Qo(x,g))return l;return},"findContainingLane"),y=e((g,l)=>p.some((x)=>x.labelId!==g&&Qn(l,x.rect)),"overlapsPlacedLabel");for(let g of t){if(g.isLayoutOnly)continue;let l=g.labelNodeId;if(!l)continue;let x=n.get(l);if(!x)continue;let L=g.points;if(!L||L.length<2)continue;let S=x.width??0,E=x.height??0;if(S<=0||E<=0)continue;let w=[];for(let nt=0;nt<L.length-1;nt++){let q=L[nt],ot=L[nt+1],dt=Math.abs(q.x-ot.x),mt=Math.abs(q.y-ot.y);if(dt<Jt&&mt<Jt)continue;if(dt>=Jt&&mt>=Jt)continue;w.push({idx:nt,length:dt+mt,orientation:dt>=Jt?"horizontal":"vertical",midX:(q.x+ot.x)/2,midY:(q.y+ot.y)/2})}if(w.length===0)continue;let C=w.length>=3?w.filter((nt)=>nt.idx>0&&nt.idx<w.length-1):w,b=C.length>0?C:w,R=S>=E?"horizontal":"vertical",O=e((nt)=>[...nt].sort((q,ot)=>{let dt=q.orientation===R,mt=ot.orientation===R;if(dt!==mt)return dt?-1:1;let Mt=q.length>=(q.orientation==="horizontal"?S:E)+2,Et=ot.length>=(ot.orientation==="horizontal"?S:E)+2;if(Mt!==Et)return Mt?-1:1;return ot.length-q.length}),"rankSegments"),P=w[0],N=w[w.length-1],H=[0.5,0.25,0.75,0.05,0.95,0.15,0.85,0.1,0.9],_=e((nt,q)=>{let ot=L[nt.idx],dt=L[nt.idx+1];return{midX:ot.x+(dt.x-ot.x)*q,midY:ot.y+(dt.y-ot.y)*q}},"anchorAtT"),F=e((nt,q,ot)=>Math.min(ot,Math.max(q,nt)),"clamp"),Y=e((nt,q)=>nt.midX>=q.left-Jt&&nt.midX<=q.right+Jt&&nt.midY>=q.top-Jt&&nt.midY<=q.bottom+Jt,"pointInsideRectInclusive"),V=e((nt)=>{let q=On(nt.midX,nt.midY,S,E),ot=I(q);if(ot)return{laneId:ot,anchor:nt,rect:q};let dt=i.find(({rect:en})=>Y(nt,en));if(!dt)return;let mt=dt.rect.left+S/2+a,Mt=dt.rect.right-S/2-a,Et=dt.rect.top+E/2+a,jt=dt.rect.bottom-E/2-a;if(mt>Mt||Et>jt)return;let Wt={midX:F(nt.midX,mt,Mt),midY:F(nt.midY,Et,jt)},Kt=On(Wt.midX,Wt.midY,S,E);return Y(nt,Kt)?{laneId:dt.id,anchor:Wt,rect:Kt}:void 0},"placementForAnchor"),J=e((nt,q,ot)=>nt.orientation==="horizontal"?Math.abs(q.midX-ot.x):Math.abs(q.midY-ot.y),"distanceAlongSegment"),lt=e((nt,q)=>{let dt=(nt.orientation==="horizontal"?S/2:E/2)+u;if(nt===P){let mt=L[nt.idx];if(J(nt,q,mt)+Jt<dt)return!1}if(nt===N){let mt=L[nt.idx+1];if(J(nt,q,mt)+Jt<dt)return!1}return!0},"labelClearsTerminalEndpoints"),xt=e((nt)=>{let q=O(nt);for(let ot of q)for(let dt of H){let mt=_(ot,dt);if(!lt(ot,mt))continue;let Mt=V(mt);if(!Mt)continue;if(Ke(Mt.rect,L))continue;if(y(l,Mt.rect))continue;if(!m(l,g.id,Mt.rect))return{laneId:Mt.laneId,anchor:Mt.anchor}}return},"tryPool"),Ot=e((nt,q,ot=!1)=>{let dt=O(nt);for(let mt of dt){let Mt={midX:mt.midX,midY:mt.midY};if(q&&!lt(mt,Mt))continue;let Et=V(Mt);if(Et&&!Ke(Et.rect,L)&&!y(l,Et.rect)&&!h(l,Et.rect)&&(ot||!d(g.id,Et.rect)))return{laneId:Et.laneId,anchor:Et.anchor}}return},"findLaneContainingFallback"),kt=xt(b)??(b.length<w.length?xt(w):void 0)??Ot(w,!0)??Ot(w,!1)??Ot(w,!1,!0);if(kt){x.x=kt.anchor.midX,x.y=kt.anchor.midY,x.parentId=kt.laneId;let nt=On(kt.anchor.midX,kt.anchor.midY,S,E),q=p.findIndex((ot)=>ot.labelId===l);if(q>=0)p[q]={labelId:l,rect:nt};else p.push({labelId:l,rect:nt})}}}e(Jn,"anchorLabelsToPolyline");var Ae=0.000001,kr=8,Vo=kr/2,_r=3;function qe(t,n){return t<n?`${t}::${n}`:`${n}::${t}`}e(qe,"pairKey");function Es(t,n){let{nodeInfoById:o,realNodeRects:s}=le(n),i=new Map;for(let a of n){let u=a.id;if(a.isGroup)continue;if(a.isEdgeLabel){i.set(u,{w:a.width??0,h:a.height??0});continue}}let c=e((a,u,h,d)=>{let m=qe(u,h),p=0,I=e((y)=>{if(!y)return;let g=i.get(y);if(!g)return;let l=d==="x"?g.w/2:g.h/2;if(l>p)p=l},"consider");I(a.labelNodeId);for(let y of t){if(y===a)continue;if(y.isLayoutOnly)continue;let{start:g,end:l}=y;if(!g||!l)continue;if(qe(g,l)!==m)continue;I(y.labelNodeId)}return p>0?p+_r:0},"labelClearanceFor");for(let a of t){if(a.isLayoutOnly)continue;let u=a.points;if(!fo(u,Ae))continue;let h=po(a,o,Ae);if(!h)continue;let{srcId:d,dstId:m,srcInfo:p,dstInfo:I,collinearX:y,collinearY:g}=h;if(y===g)continue;let l,x;if(y){let C=I.cy>p.cy;l={x:p.cx,y:C?p.rect.bottom:p.rect.top},x={x:I.cx,y:C?I.rect.top:I.rect.bottom}}else{let C=I.cx>p.cx;l={x:C?p.rect.right:p.rect.left,y:p.cy},x={x:C?I.rect.left:I.rect.right,y:I.cy}}if(Nt(l,x,s,[d,m],1))continue;let S=c(a,d,m,y?"x":"y"),E=S>Vo?S:Vo,w=[0,E,-E];for(let C of w){let b={...l},R={...x};if(y){if(b.x+=C,R.x+=C,b.x<=p.rect.left||b.x>=p.rect.right)continue;if(R.x<=I.rect.left||R.x>=I.rect.right)continue}else{if(b.y+=C,R.y+=C,b.y<=p.rect.top||b.y>=p.rect.bottom)continue;if(R.y<=I.rect.top||R.y>=I.rect.bottom)continue}if(Nt(b,R,s,[d,m],1))continue;if(te(b,R,t,a,{epsilon:Ae}))continue;a.points=[b,R];break}}}e(Es,"straightenCollinearSiblingDetours");function Je(t,n){let{realNodeRects:d,labelNodeRects:m}=bn(n.values()),p=e((b,R)=>Bn(R,0.001).map((O)=>({...O,edge:b,interior:O.index>=1&&O.index<=R.length-3})),"segmentsFor"),I=e(()=>{let b=[];for(let R of t){if(R.isLayoutOnly)continue;let O=R.points;if(!O||O.length<2)continue;b.push(...p(R,yt(O)))}return b},"allSegments"),y=e((b,R)=>{if(b.horizontal&&R.horizontal)return Ut(b.a.x,b.b.x,R.a.x,R.b.x)>=8&&Math.abs(b.a.y-R.a.y)<7;if(b.vertical&&R.vertical)return Ut(b.a.y,b.b.y,R.a.y,R.b.y)>=8&&Math.abs(b.a.x-R.a.x)<7;return!1},"hasCrowdedParallelTrack"),g=e((b,R)=>{let{start:O,end:P}=b,N=p(b,R);if(N.length!==R.length-1)return!1;let H=[O,P].filter((F)=>Boolean(F)),_=b.labelNodeId?[b.labelNodeId]:[];for(let F of N){if(Nt(F.a,F.b,d,H,-2))return!1;if(Nt(F.a,F.b,m,_,-2))return!1}for(let F of t){if(F===b||F.isLayoutOnly)continue;let Y=F.points;if(!Y||Y.length<2)continue;for(let V of N)for(let J of p(F,yt(Y))){if(y(V,J))return!1;if(un(V.a,V.b,J.a,J.b,0.001))return!1}}return!0},"candidateIsSafe"),l=e((b,R)=>{let O=yt(b.edge.points??[]);if(O.length<4||b.index>=O.length-1)return;let P=O.map((N)=>({...N}));if(b.horizontal)P[b.index].y+=R,P[b.index+1].y+=R;else if(b.vertical)P[b.index].x+=R,P[b.index+1].x+=R;else return;return p(b.edge,P).length===P.length-1?P:void 0},"shiftedCandidate"),x=e((b,R)=>({x:b.x??(R.left+R.right)/2,y:b.y??(R.top+R.bottom)/2}),"nodeCenter"),L=e((b)=>{let R=b.edge,O=yt(R.points??[]);if(O.length!==4||b.index!==1)return;let P=R.start?n.get(R.start):void 0,N=R.end?n.get(R.end):void 0,H=P?Zt(P):void 0,_=N?Zt(N):void 0,F=O.slice(b.index+2);if(!P||!N||!H||!_||F.length===0)return;return{sourceCenter:x(P,H),targetCenter:x(N,_),sourceRect:H,tail:F}},"sourceDetourContextFor"),S=e((b,R,O,P,N,H)=>{let _=P.y>=O.y,F=_?N.bottom:N.top,Y=F+(_?20:-20);if(_&&b.b.y<=Y+0.001||!_&&b.b.y>=Y-0.001)return;let V=b.a.x+R;return yt([{x:O.x,y:F},{x:O.x,y:Y},{x:V,y:Y},{x:V,y:b.b.y},...H],0.001)},"verticalSourceDetour"),E=e((b,R,O,P,N,H)=>{let _=P.x>=O.x,F=_?N.right:N.left,Y=F+(_?20:-20);if(_&&b.b.x<=Y+0.001||!_&&b.b.x>=Y-0.001)return;let V=b.a.y+R;return yt([{x:F,y:O.y},{x:Y,y:O.y},{x:Y,y:V},{x:b.b.x,y:V},...H],0.001)},"horizontalSourceDetour"),w=e((b,R)=>{let O=L(b);if(!O)return;if(b.vertical)return S(b,R,O.sourceCenter,O.targetCenter,O.sourceRect,O.tail);if(b.horizontal)return E(b,R,O.sourceCenter,O.targetCenter,O.sourceRect,O.tail);return},"sourceDetourCandidate"),C=[-7,7,-14,14,-21,21];for(let b=0;b<12;b++){let R=I(),O=!1;for(let P=0;P<R.length&&!O;P++)for(let N=P+1;N<R.length&&!O;N++){let H=R[P],_=R[N];if(H.edge===_.edge||!y(H,_))continue;let F=[H,_].filter((Y)=>Y.interior);for(let Y of F){for(let V of C){let J=l(Y,V);if(J&&g(Y.edge,J)){Y.edge.points=J,O=!0;break}let lt=w(Y,V);if(lt&&g(Y.edge,lt)){Y.edge.points=lt,O=!0;break}}if(O)break}}if(!O)return}}e(Je,"nudgeSharedInteriorSubpaths");function As(t,n,o,s){let i=n.x-t.x,c=n.y-t.y,a=s.x-o.x,u=s.y-o.y,h=i*u-c*a;if(Math.abs(h)<0.0000000001)return!1;let d=o.x-t.x,m=o.y-t.y,p=(d*u-m*a)/h,I=(d*c-m*i)/h,y=0.01;return p>y&&p<1-y&&I>y&&I<1-y}e(As,"segmentsIntersect");function Rs(t){let n=t.nodes??[],o=t.edges??[],s=[];if(!o.length||!n.length)return s;let i=ts(n),c=1,a=[];for(let h of o){if(h.isLayoutOnly)continue;let d=h.points;if(!d||d.length<2)continue;let{start:m,end:p,labelNodeId:I}=h,y=h.id??`${m}->${p}`;for(let g of i){if(g.nodeId===m||g.nodeId===p)continue;if(I&&g.nodeId===I)continue;for(let l=0;l<d.length-1;l++)if(ae(d[l],d[l+1],g,-c)){s.push({type:"edge-node-overlap",edgeId:y,targetId:g.nodeId,detail:`segment ${l} passes through node "${g.nodeId}"`});break}}for(let g=0;g<d.length-1;g++)a.push({edgeId:y,start:m,end:p,p1:d[g],p2:d[g+1]})}let u=new Set;for(let h=0;h<a.length;h++)for(let d=h+1;d<a.length;d++){let m=a[h],p=a[d];if(m.edgeId===p.edgeId)continue;if(m.start===p.start||m.start===p.end||m.end===p.start||m.end===p.end)continue;if(As(m.p1,m.p2,p.p1,p.p2)){let I=m.edgeId<p.edgeId?`${m.edgeId}|${p.edgeId}`:`${p.edgeId}|${m.edgeId}`;if(!u.has(I))u.add(I),s.push({type:"edge-edge-crossing",edgeId:m.edgeId,targetId:p.edgeId,detail:`edges "${m.edgeId}" and "${p.edgeId}" cross`})}}if(s.length>0){let h=s.filter((m)=>m.type==="edge-node-overlap").length,d=s.filter((m)=>m.type==="edge-edge-crossing").length;r.warn(`[SWIMLANE_VALIDATE] ${s.length} issue(s) detected: ${h} edge-node overlap(s), ${d} edge crossing(s)`);for(let m of s)r.warn(`[SWIMLANE_VALIDATE] ${m.type}: ${m.detail}`)}return s}e(Rs,"validateSwimlanesLayout");function Ts(t,n){let o=t.nodes??[],s=t.edges??[],i=o.filter((u)=>!u.isGroup);if((n==="LR"||n==="RL")&&i.length>0&&!ps(t,n))return;if(n==="BT"&&i.length>0&&!gs(t))return;for(let u of s){if(u.isLayoutOnly)continue;let h=u.points;if(!h||h.length<2)continue;u.points=dn(ne(h))}vs(s,o),Es(s,o),ms(s,o);let c=new Map;for(let u of o)c.set(String(u.id),u);Jn(s,c),rs(s,c),ys(s,c),Je(s,c),ze(s,c),bs(s,c),Ve(s,c),Ms(s,c);let a=e(()=>{Cs(s,c),ze(s,c),Is(s,c),Ss(s,c),Jn(s,c),Ge(s,c),Ve(s,c),Jn(s,c),Ge(s,c)},"finalizeRenderedEdges");a(),Je(s,c),a(),Ue(s,c,n),je(s,c,n),Ue(s,c,n),je(s,c,n)}e(Ts,"postProcessSwimlaneLayout");function Mn(t){let n=new Map(t.nodeById),o=new Set,s=[];for(let c of t.edges){if(!n.has(c.src)||!n.has(c.dst))continue;let a=`${c.id}:${c.src}->${c.dst}`;if(o.has(a))continue;o.add(a),s.push(c)}return{nodes:[...n.keys()],edges:s,layout:t.layout,nodeById:n}}e(Mn,"normalizeGraph");function Io(t,n){return t.edges.filter((o)=>o.dst===n)}e(Io,"incoming");function ws(t){let n=new Map;for(let o of t.nodes)n.set(o,[]);for(let o of t.edges)n.get(o.src).push(o.dst);return n}e(ws,"buildSuccessorMap");function So(t){let n=ws(t);for(let o of n.values())o.sort((s,i)=>s.localeCompare(i));return n}e(So,"buildSortedSuccessorMap");function fe(t){let n=new Map;for(let o of t.nodes)n.set(o,0);for(let o of t.edges)n.set(o.dst,(n.get(o.dst)??0)+1);return n}e(fe,"buildInDegreeMap");function Co(t,n){let o=[...n.entries()].filter(([,u])=>u===0).map(([u])=>u).sort((u,h)=>u.localeCompare(h)),s=new Set(t.edges.flatMap((u)=>[u.src,u.dst])),i=e((u)=>!s.has(u)&&!t.nodeById.get(u)?.isGroup,"isUnconnected"),c=[...n.keys()].filter((u)=>n.get(u)===0&&i(u)),a=0;return o.map((u)=>i(u)?c[a++]:u)}e(Co,"sortedZeroInDegreeNodes");function de(t,n=()=>!0){let o=new Map,s=new Map;for(let i of t.nodes)o.set(i,[]),s.set(i,[]);for(let i of t.edges){if(!n(i))continue;s.get(i.src).push(i.dst),o.get(i.dst).push(i.src)}return{preds:o,succs:s}}e(de,"buildPredecessorSuccessorMaps");function vo(t,n,o,s){let i=0;for(let a of t.nodes){if(s?.skipGroups&&t.nodeById.get(a)?.isGroup)continue;i=Math.max(i,o[a]??0)}let c=Array.from({length:i+1},()=>[]);for(let a of n){if(s?.skipGroups&&t.nodeById.get(a)?.isGroup)continue;c[Math.max(0,o[a]??0)].push(a)}return c}e(vo,"buildLayersFromRanks");function _n(t){let n=fe(t),o=Co(t,n),s=[],i=So(t);while(o.length){let c=o.shift();s.push(c);for(let a of i.get(c)??[])if(n.set(a,(n.get(a)??0)-1),(n.get(a)??0)===0){let u=0;while(u<o.length&&o[u]<a)u++;o.splice(u,0,a)}}return s.length===t.nodes.length?s:null}e(_n,"topoSortIfAcyclic");function Fn(t){let n=new Map,o=0;for(let s of t)n.set(s,o),o++;return n}e(Fn,"buildLayerIndex");function Lo(t){let n=Array(t.length),o=e((s,i)=>{if(i-s<=1)return 0;let c=s+i>>1,a=o(s,c)+o(c,i),u=s,h=c,d=s;while(u<c||h<i)if(h>=i||u<c&&t[u]<=t[h])n[d++]=t[u++];else n[d++]=t[h++],a+=c-u;for(let m=s;m<i;m++)t[m]=n[m];return a},"count");return o(0,t.length)}e(Lo,"countInversions");function Ns(t){let n=Mn(t),o=new Map;for(let p of n.nodes)o.set(p,[]);for(let p of n.edges)o.get(p.src).push(p);for(let p of o.values())p.sort((I,y)=>I.dst===y.dst?I.id.localeCompare(y.id):I.dst.localeCompare(y.dst));let s=Object.create(null);for(let p of n.nodes)s[p]=0;let i=[],c=e((p)=>{s[p]=1;for(let I of o.get(p)??[]){let y=I.dst;if(s[y]===0)c(y);else if(s[y]===1)i.push(I)}s[p]=2},"dfs"),a=fe(n),u=[...n.nodes.filter((p)=>(a.get(p)??0)===0),...n.nodes.filter((p)=>(a.get(p)??0)!==0)];for(let p of u)if(s[p]===0)c(p);let h=new Set(i.map((p)=>`${p.id}:${p.src}->${p.dst}`)),d=n.edges.map((p)=>h.has(`${p.id}:${p.src}->${p.dst}`)?{id:p.id,src:p.dst,dst:p.src,weight:p.weight,ref:p.ref}:p);return{acyclic:{nodes:[...n.nodes],edges:d,layout:n.layout,nodeById:new Map(n.nodeById)},reversed:i}}e(Ns,"removeCycles_DFS");function Os(t){let n=new Map,o=e((s)=>{if(n.has(s))return n.get(s);let i=t.nodeById.get(s);if(!i)return n.set(s,null),null;let c=i.parentId;if(!c)return n.set(s,null),null;let u=o(c)??c;return n.set(s,u),u},"resolve");for(let s of t.nodes)o(s);return n}e(Os,"buildTopLaneMap");function hn(t){let n=Os(t);return(o)=>n.get(o)??null}e(hn,"createTopLaneResolver");function ue(t){let n=[];for(let o of t.layout.nodes??[])if(o.isGroup&&!o.parentId)n.push(o.id);return[...new Set(n)].reverse()}e(ue,"buildTopLaneOrder");function Eo(t,n){let o=ue(t);if(!n||n.length===0)return o;let s=new Set(o),i=new Set,c=[];for(let a of n){if(!s.has(a)||i.has(a))continue;i.add(a),c.push(a)}for(let a of o){if(i.has(a))continue;c.push(a)}return c}e(Eo,"resolveTopLaneOrder");var Hr={EPSILON:0.000001},ie={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},Uo={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Bs(t,n){let o=Mn(t),s=n?.laneOf??(()=>null),i=n?.rankHint,{preds:c}=de(o);for(let C of c.values())C.sort((b,R)=>b.localeCompare(R));let a=_n(o)??[...o.nodes].sort((C,b)=>C.localeCompare(b)),u=new Map;for(let[C,b]of a.entries())u.set(b,C);let h=new Map,d=new Map;for(let C of o.nodes)d.set(C,[]);for(let C of a){let b=(c.get(C)??[]).filter((R)=>h.has(R));if(b.length>0){let R=Fs(C,b,{laneOf:s,rankHint:i,topoIndex:u});h.set(C,R),d.get(R).push(C)}else if(!h.has(C))h.set(C,null)}for(let C of o.nodes)if(!h.has(C))h.set(C,null);let m=new Set;for(let C of o.nodes)if((h.get(C)??null)===null)m.add(C);let p=[...m].sort((C,b)=>{let R=u.get(C)??0,O=u.get(b)??0;if(R===O)return C.localeCompare(b);return R-O}),I=Ps(o),y=new Map;for(let[C,b]of I.entries())y.set(C,[...b].sort((R,O)=>R.localeCompare(O)));let g=ks(y),l=_s(y),x=new Map;for(let C of o.nodes)x.set(C,[]);for(let C of l)for(let b of C.nodes){let R=x.get(b);if(R)R.push(C.id);else x.set(b,[C.id])}let L=[],S=[],E=new Set,w=e((C)=>{if(E.has(C))return;E.add(C),L.push(C);for(let b of d.get(C)??[])w(b);S.push(C)},"walk");for(let C of p)w(C);for(let C of a)w(C);return{parent:h,children:d,roots:p,componentOf:g,blocks:l,nodeBlocks:x,adjacency:y,preorder:L,postorder:S,topologicalOrder:a}}e(Bs,"buildDrivingTree");function Fs(t,n,o){let s=o.laneOf(t);return[...n].sort((c,a)=>{let u=o.laneOf(c),h=o.laneOf(a),d=u!=null&&u===s,m=h!=null&&h===s;if(d!==m)return d?-1:1;let p=o.rankHint?.[c],I=o.rankHint?.[a];if(p!=null&&I!=null&&p!==I)return I-p;let y=o.topoIndex.get(c)??0,g=o.topoIndex.get(a)??0;if(y!==g)return y-g;return c.localeCompare(a)})[0]}e(Fs,"chooseParent");function Ps(t){let n=new Map;for(let o of t.nodes)n.set(o,new Set);for(let o of t.edges)n.get(o.src).add(o.dst),n.get(o.dst).add(o.src);return n}e(Ps,"buildAdjacency");function ks(t){let n=new Map,o=0;for(let s of t.keys()){if(n.has(s))continue;let i=[s];while(i.length>0){let c=i.pop();if(n.has(c))continue;n.set(c,o);for(let a of t.get(c)??[])if(!n.has(a))i.push(a)}o++}return n}e(ks,"assignComponents");function _s(t){let n=new Map,o=new Map,s=[],i=[],c=0,a=e((u,h)=>{n.set(u,++c),o.set(u,c);for(let d of t.get(u)??[]){if(d===h)continue;if(!n.has(d)){if(s.push([u,d]),a(d,u),o.set(u,Math.min(o.get(u)??c,o.get(d)??c)),(o.get(d)??0)>=(n.get(u)??0))i.push(Hs(u,d,s,i.length))}else if((n.get(d)??0)<(n.get(u)??0))s.push([u,d]),o.set(u,Math.min(o.get(u)??c,n.get(d)??c))}},"visit");for(let u of t.keys())if(!n.has(u))a(u,null);return i}e(_s,"computeBlocks");function Hs(t,n,o,s){let i=[],c=new Set;while(o.length>0){let a=o.pop();if(i.push(a),c.add(a[0]),c.add(a[1]),a[0]===t&&a[1]===n||a[0]===n&&a[1]===t)break}return{id:s,edges:i,nodes:[...c]}}e(Hs,"popBlock");function Ds(t,n,o){let s=[...t.nodes],i=new Map;for(let[S,E]of s.entries())i.set(E,S);let c=s.length,a=Array(c).fill(-1),u=Array(c).fill(0),h=[],d=new Set;for(let S of s){let E=o.parent.get(S)??null,w=i.get(S);if(w==null)continue;if(E==null){if(a[w]=-1,u[w]=0,!d.has(S))d.add(S),h.push(S)}}while(h.length>0){let S=h.shift(),E=i.get(S);if(E==null)continue;let w=o.children.get(S)??[];for(let C of w){if(d.has(C))continue;let b=i.get(C);if(b==null)continue;a[b]=E,u[b]=u[E]+1,d.add(C),h.push(C)}}for(let S of s){if(d.has(S))continue;let E=i.get(S);if(E==null)continue;a[E]=-1,u[E]=0,d.add(S)}let m=Math.max(1,Math.ceil(Math.log2(Math.max(1,c)))+1),p=Array.from({length:m},()=>Array(c).fill(-1));for(let S=0;S<c;S++)p[0][S]=a[S];for(let S=1;S<m;S++)for(let E=0;E<c;E++){let w=p[S-1][E];p[S][E]=w===-1?-1:p[S-1][w]}let I=e((S,E)=>{if(S===-1||E===-1)return-1;if(u[S]<u[E])[S,E]=[E,S];let w=u[S]-u[E];for(let C=0;C<m;C++)if(w>>C&1){if(S=p[C][S],S===-1)return-1}if(S===E)return S;for(let C=m-1;C>=0;C--){let b=p[C][S],R=p[C][E];if(b===-1||R===-1)continue;if(b!==R)S=b,E=R}return p[0][S]},"lcaIndex"),y=Array.from({length:c},()=>new Map);for(let S of t.edges){let{src:E,dst:w}=S,C=n[E],b=n[w];if(C==null||b==null)continue;if(C>b)[E,w]=[w,E],[C,b]=[b,C];if(C==null||b==null||C===b)continue;let R=i.get(E),O=i.get(w);if(R==null||O==null)continue;let P=I(R,O);if(P===-1)continue;let N=y[P];for(let H=C;H<b;H++)N.set(H,(N.get(H)??0)+1)}let g=new Map,l=e((S,E)=>{if(E.size===0)return;for(let[w,C]of E)S.set(w,(S.get(w)??0)+C)},"mergeInto"),x=new Set,L=e((S)=>{let E=i.get(S);x.add(S);let w=E==null?void 0:y[E],C=w?new Map(w):new Map,b=o.children.get(S)??[];for(let R of b){let O=L(R),P=n[S];if(P!=null){let N=g.get(S);if(!N)N=new Map,g.set(S,N);let H=O.get(P)??0,_=n[R];if(_!=null&&_>P)H+=1;N.set(R,H)}l(C,O)}return C},"dfs");for(let S of o.roots)if(!x.has(S))L(S);for(let S of s)if(!x.has(S))L(S);return g}e(Ds,"computeSubtreeCrossCounts");function Xs(t,n,o){let s=new Map,i=e((c)=>{let a=o[c]??0,u=[...n.get(c)??[]];u.sort(Ao(o));for(let h of u){i(h);let d=s.get(h);if(d!=null)a=Math.min(a,d)}s.set(c,a)},"annotate");for(let c of t)i(c);return s}e(Xs,"annotateMinimumLayers");function Ao(t){return(n,o)=>{let s=t[n]??0,i=t[o]??0;return s===i?n.localeCompare(o):s-i}}e(Ao,"compareByRankThenId");function Ys(t,n,o,s){let i=0;for(let h of n){let d=o[h]??0;if(d>i)i=d}let c=Array.from({length:i+1},()=>[]),a=new Set,u=e((h)=>{if(a.has(h))return;a.add(h);let d=o[h]??0;if(!c[d])c[d]=[];c[d].push(h);for(let m of s(h))u(m)},"emit");for(let h of t)u(h);for(let h of n)if(!a.has(h)){let d=o[h]??0;if(!c[d])c[d]=[];c[d].push(h),a.add(h)}return c}e(Ys,"emitNodesInTreeOrder");function Gs(t){let n=[];for(let o of t){let s=new Set,i=[];for(let c of o){if(s.has(c))continue;s.add(c),i.push(c)}n.push(i)}return n}e(Gs,"deduplicateLayers");function $s(t,n,o,s){return(i)=>{let c=t.get(i)??[];if(c.length===0)return[];let a=n[i]??0,u=[],h=[],d=o.get(i);for(let m of c){let p=s.get(m)??a;if(p>a)u.push({child:m,min:p});else h.push(m)}return u.sort((m,p)=>{if(m.min===p.min)return m.child.localeCompare(p.child);return m.min-p.min}),h.sort((m,p)=>{let I=d?.get(m)??0,y=d?.get(p)??0;if(I!==y)return I-y;let g=s.get(m)??a,l=s.get(p)??a;if(g!==l)return g-l;return m.localeCompare(p)}),[...u.map((m)=>m.child),...h]}}e($s,"createChildOrderer");function ce(t,n,o){let s=Bs(t,{rankHint:n,laneOf:o}),{children:i,roots:c}=s;for(let p of t.nodes)if(!i.has(p))i.set(p,[]);let a=Ds(t,n,s),u=[...c].sort(Ao(n)),h=Xs(u,i,n),d=$s(i,n,a,h),m=Ys(u,t.nodes,n,d);return m=Gs(m),m}e(ce,"buildMultitreeLayerOrder");function zs(t,n,o){let s=new Set(t),i=new Set(n),c=Fn(n),a=[];for(let u of o)if(s.has(u.src)&&i.has(u.dst))a.push(c.get(u.dst));return Lo(a)}e(zs,"countCrossingsBetweenAdjacent");function Ze(t,n,o){let s=[];for(let c of n){let a=o[c.src],u=o[c.dst];if(a==null||u==null||a===u)continue;let{src:h,dst:d}=c,m=a,p=u;if(a>u)h=c.dst,d=c.src,m=u,p=a;for(let I=m;I<p;I++)s.push({id:`${c.id}@${I}`,src:h,dst:d,ref:c.ref})}let i=0;for(let c=0;c+1<t.length;c++)i+=zs(t[c],t[c+1],s);return i}e(Ze,"totalCrossings");function Vs(t,n){let o={...n},{preds:s}=de(t),i=hn(t),c=ce(t,o,i),a=Ze(c,t.edges,o),u=ie.MAX_CROSSING_OPTIMIZATION_PASSES;for(let h=0;h<u;h++){let d=!1,m=[...t.nodes].sort((p,I)=>(o[I]??0)-(o[p]??0));for(let p of m){let I=o[p]??0;if(I===0)continue;let y=0;for(let L of s.get(p)??[])y=Math.max(y,(o[L]??0)+1);if(y>=I)continue;let g=I;o[p]=y;let l=ce(t,o,i),x=Ze(l,t.edges,o);if(x<a)a=x,d=!0;else o[p]=g}if(!d)break}return o}e(Vs,"optimizeRanksByCrossings");function Us(t,n){let o=hn(t),s=[...t.nodes].sort((i,c)=>(n[i]??0)-(n[c]??0)||i.localeCompare(c));for(let i of s){let c=o(i);if(!c)continue;let a=t.edges.filter((l)=>l.src===i);if(a.length===0)continue;let u=!1,h=0;for(let l of a){let x=o(l.dst);if(x==null||x===c)u=!0;else h++}if(h===0||u)continue;let d=0,m=!1;for(let l of t.edges){if(l.dst!==i)continue;let x=o(l.src);if(!x)continue;if(x===c)m=!0;else d++}if(d>0||!m)continue;let p=n[i]??0,I=p+h,y=0;for(let l of t.edges)if(l.dst===i)y=Math.max(y,(n[l.src]??0)+1);let g=Math.max(p,y,I);if(g!==p)n[i]=g}}e(Us,"adjustCrossLaneSources");function js(t,n){let o=Mn(t),s=_n(o)??[...o.nodes].sort(),i=n?.compactSingleInput??!1,c=hn(o),a=Object.create(null);for(let h of s){let d=Io(o,h),m=n?.ignoreCrossLaneEdges?d.filter((p)=>{let I=c(p.src),y=c(h);if(!I||!y)return!0;return I===y}):d;if(m.length===0)a[h]=0;else if(i&&m.length===1){let p=m[0].src,I=c(p),y=c(h);if(I!==y)a[h]=a[p]??0;else a[h]=(a[p]??0)+1}else{let p=-1/0;for(let I of m)p=Math.max(p,(a[I.src]??0)+1);a[h]=p===-1/0?0:p}}if(n?.optimizeRanksByCrossings??!1)a=Vs(o,a);if(n?.ignoreCrossLaneEdges)Us(o,a);return{layers:ce(o,a,c),rankOf:a,dummy:new Set}}e(js,"assignLayers_LongestPath");function Ws(t,n){let o=Mn(t),i={...js(o,{compactSingleInput:n?.compactSingleInput,ignoreCrossLaneEdges:n?.ignoreCrossLaneEdges,optimizeRanksByCrossings:n?.optimizeRanksByCrossings}).rankOf},c=hn(o),{preds:a,succs:u}=de(o,(g)=>{if(n?.ignoreCrossLaneEdges){let l=c(g.src),x=c(g.dst);if(l&&x&&l!==x)return!1}return!0}),h=_n(o)??[...o.nodes],d=[...h].reverse(),m=e((g,l)=>{let x=0;for(let E of a.get(g)??[])x=Math.max(x,(i[E]??0)+1);let L=Number.POSITIVE_INFINITY,S=u.get(g)??[];if(S.length>0)L=Math.min(...S.map((E)=>(i[E]??0)-1));if(!Number.isFinite(L))L=Math.max(x,l);return Math.min(Math.max(l,x),L)},"clampFeasible"),p=ie.GRAVITY_ITERATIONS,I=e((g)=>{let l=!1;for(let x of g){let L=a.get(x)??[],S=u.get(x)??[];if(L.length===0&&S.length===0)continue;let E=L.length>0?L.reduce((R,O)=>R+(i[O]??0)+1,0)/L.length:i[x]??0,w=S.length>0?S.reduce((R,O)=>R+(i[O]??0)-1,0)/S.length:i[x]??0,C=Math.round((E+w)/2),b=m(x,C);if(b!==i[x])i[x]=b,l=!0}return l},"relaxOrder");for(let g=0;g<p;g++){let l=I(h),x=I(d);if(!l&&!x)break}for(let g of h){let l=0;for(let x of a.get(g)??[])l=Math.max(l,(i[x]??0)+1);if((i[g]??0)<l)i[g]=l}for(let g of d){let l=u.get(g)??[];if(l.length>0){let x=Math.min(...l.map((L)=>(i[L]??0)-1));if((i[g]??0)>x)i[g]=x}}return{layers:vo(o,h,i),rankOf:i,dummy:new Set}}e(Ws,"assignLayers_Gravity");function Ks(t){let n=fe(t),o=So(t),s=Co(t,n),i=[];while(s.length>0){let c=[];for(let a of s){i.push(a);for(let u of o.get(a)??[])if(n.set(u,(n.get(u)??0)-1),(n.get(u)??0)===0)c.push(u)}s=c.sort((a,u)=>a.localeCompare(u))}return i.length===t.nodes.length?i:null}e(Ks,"topoSortByGenerationIfAcyclic");function qs(t,n){let o=Mn(t),s=n?.direction==="LR"?Ks(o)??[...o.nodes].sort():_n(o)??[...o.nodes].sort(),i=hn(o),c=e((m)=>i(m)??m,"laneOf"),a=Object.create(null),u=new Map,h=e((m,p)=>{if(n?.ignoreCrossLaneEdges??!0)return c(m)===c(p)?1:0;return 1},"edgeWeight");for(let m of s){if(o.nodeById.get(m)?.isGroup)continue;let I=Io(o,m),y=0;if(I.length>0)for(let L of I){let S=L.src,E=a[S]??0;y=Math.max(y,E+h(S,m))}let g=c(m),l=u.get(g)??0,x=Math.max(y,l);a[m]=x,u.set(g,x+1)}return{layers:vo(o,s,a,{skipGroups:!0}),rankOf:a,dummy:new Set}}e(qs,"assignLayers_LaneAwareCompact");function Js(t,n){let o=Mn(n),{rankOf:s}=t,i=t.layers.map((y)=>[...y]),c=new Set(t.dummy?[...t.dummy]:[]),a=0,u=new Map(o.nodeById),h=e((y)=>{let g=`placeholder-${a++}`,l={id:g,isGroup:!1,isDummy:!0,width:0,height:0};u.set(g,l),c.add(g);while(i.length<=y)i.push([]);return i[y].push(g),s[g]=y,g},"addDummyAt"),d=[...o.edges].sort((y,g)=>y.id===g.id?y.src===g.src?y.dst.localeCompare(g.dst):y.src.localeCompare(g.src):y.id.localeCompare(g.id)),m=[];for(let y of d){let g=s[y.src]??0,l=s[y.dst]??0;if(l-g<=1){m.push(y);continue}let x=y.src;for(let S=g+1,E=0;S<l;S++,E++){let w=h(S);m.push({id:`${y.id}#${E}`,src:x,dst:w,weight:y.weight,ref:y.ref}),x=w}let L=l-g-2;m.push({id:`${y.id}#${Math.max(L+1,0)}`,src:x,dst:y.dst,weight:y.weight,ref:y.ref})}let I={nodes:[...o.nodes,...[...c].filter((y)=>!o.nodes.includes(y))],edges:m,layout:o.layout,nodeById:u};return{layering:{layers:i,rankOf:s,dummy:c},graphWithDummies:I}}e(Js,"makeProperLayering");function Qe(t){let n=t.length;if(n===0)return Number.POSITIVE_INFINITY;let o=[...t].sort((s,i)=>s-i);if(n%2===1)return o[(n-1)/2];return 0.5*(o[n/2-1]+o[n/2])}e(Qe,"median");function to(t){if(t.length===0)return Number.POSITIVE_INFINITY;return t.reduce((o,s)=>o+s,0)/t.length}e(to,"barycenter");function Zs(t,n,o,s){let i=new Map;for(let c of t)i.set(c,[]);for(let c of o)if(s==="down"){if(n.has(c.src)&&i.has(c.dst))i.get(c.dst).push(n.get(c.src))}else if(n.has(c.dst)&&i.has(c.src))i.get(c.src).push(n.get(c.dst));return i}e(Zs,"neighborPositionsFor");function Qs(t,n,o){let s=o.get(t)??0,i=o.get(n)??0;return s!==i?s-i:t.localeCompare(n)}e(Qs,"currentOrderTieBreak");function no(t,n,o){let s=new Set(t),i=new Set(n),c=Fn(t),a=Fn(n),u=[];for(let d of o)if(s.has(d.src)&&i.has(d.dst))u.push({u:c.get(d.src),v:a.get(d.dst)});u.sort((d,m)=>d.u===m.u?d.v-m.v:d.u-m.u);let h=u.map((d)=>d.v);return Lo(h)}e(no,"countCrossingsBetweenAdjacent");function Zn(t,n,o){return[...t].sort((s,i)=>{let c=Qe(n.get(s)??[]),a=Qe(n.get(i)??[]);if(c===a)return Qs(s,i,o);if(!isFinite(c))return 1;if(!isFinite(a))return-1;return c-a})}e(Zn,"sortByHeuristic");function eo(t,n,o,s,i,c){let a=Fn(t),u=Fn(n),h=Zs(n,a,o,s);if(!i||!c||c.length===0)return Zn(n,h,u);let d=new Map;for(let I of n){let y=i(I),g=d.get(y)??[];g.push(I),d.set(y,g)}let m=[];for(let I of c){let y=d.get(I);if(!y||y.length===0)continue;let g=Zn(y,h,u);m.push(...g)}let p=d.get(null);if(p&&p.length>0){let I=Zn(p,h,u);for(let y of I){let g=to(h.get(y)??[]),l=m.length;if(isFinite(g))for(let[x,L]of m.entries()){let S=to(h.get(L)??[]);if(g<S){l=x;break}}m.splice(l,0,y)}}return m}e(eo,"reorderLayer");function oo(t,n,o,s,i){let c=[...n],a=new Set(t),u=new Set(n),h=s?new Set(s):null,d=o.filter((l)=>a.has(l.src)&&u.has(l.dst)),m=h?o.filter((l)=>u.has(l.src)&&h.has(l.dst)):void 0,p=e((l)=>{let x=no(t,l,d);if(m&&s)x+=no(l,s,m);return x},"crossingScore"),I=i?new Map:null;if(i&&I)for(let l of n)I.set(l,i(l));let y=!0,g=p(c);while(y){y=!1;for(let l=0;l+1<c.length;l++){if(I){let S=I.get(c[l]),E=I.get(c[l+1]);if(S!==E)continue}let x=g;[c[l],c[l+1]]=[c[l+1],c[l]];let L=p(c);if(L<x)g=L,y=!0;else[c[l],c[l+1]]=[c[l+1],c[l]]}}return c}e(oo,"transposeImprove");function tr(t,n,o){let s=t.layers.map((u)=>[...u]),i=n.edges,c=hn(n),a=Eo(n,o?.laneOrder);for(let u=0;u<3;u++){for(let h=1;h<s.length;h++)s[h]=eo(s[h-1],s[h],i,"down",c,a),s[h]=oo(s[h-1],s[h],i,s[h+1],c);for(let h=s.length-2;h>=0;h--)s[h]=eo(s[h+1],s[h],i,"up",c,a),s[h]=oo(s[h+1],s[h],i,s[h-1],c)}return{layers:s}}e(tr,"orderLayers");function nr(t,n,o){let s=o?.layerGap??Uo.DEFAULT_LAYER_GAP,i=o?.nodeGap??Uo.DEFAULT_NODE_GAP,c=o?.laneGap??i*2,a=o?.direction??"TB",u=a==="LR"||a==="RL",h=t.layers,d=Object.create(null),m=Object.create(null),p=e((N)=>n.nodeById.get(N),"getNode"),I=e((N)=>p(N)?.width??0,"getWidth"),y=e((N)=>p(N)?.height??0,"getHeight"),g=hn(n),l=Eo(n,o?.laneOrder),x=h.map((N)=>N.reduce((H,_)=>Math.max(H,y(_)),0)),L=[];if(u)for(let N=0;N+1<h.length;N++){let H=h[N].reduce((xt,Ot)=>Math.max(xt,I(Ot)),0),_=h[N+1].reduce((xt,Ot)=>Math.max(xt,I(Ot)),0),F=x[N],Y=x[N+1],V=F/2+Y/2,J=(H+_)/2,lt=Math.max(0,J-V-s);L.push(lt)}let S=new Set;for(let N of h)for(let H of N)S.add(g(H));let E=S.has(null),w=l.filter((N)=>S.has(N)),C=[...E?[null]:[],...w],b=Object.create(null);for(let N of w)b[N]=0;if(E)b.null=0;for(let N of h){let H=Object.create(null),_=[];for(let F of N){let Y=g(F);if(Y===null)_.push(F);else(H[Y]||=[]).push(F)}for(let[F,Y]of Object.entries(H)){let V=Y.reduce((J,lt)=>J+I(lt),0)+i*Math.max(0,Y.length-1);b[F]=Math.max(b[F]??0,V)}if(E&&_.length){let F=_.reduce((Y,V)=>Y+I(V),0)+i*Math.max(0,_.length-1);b.null=Math.max(b.null??0,F)}}let R=new Map;{let N=C.map((F)=>(F===null?b.null:b[F])??0),_=-(N.reduce((F,Y)=>F+Y,0)+c*Math.max(0,C.length-1))/2;for(let F=0;F<C.length;F++){let Y=C[F],V=N[F]??0,J=_+V/2;if(R.set(Y,J),_+=V,F<C.length-1)_+=c}}let O=0;for(let[N,H]of h.entries()){let _=x[N]??0,F=new Map;for(let V of H){let J=g(V),lt=F.get(J)??[];lt.push(V),F.set(J,lt)}for(let V of C){let J=F.get(V)??[];if(J.length===0)continue;let lt=R.get(V);if(J.length===1){let xt=J[0];d[xt]=lt,m[xt]=O+_/2}else{let xt=J.map((nt)=>I(nt)),Ot=xt.reduce((nt,q)=>nt+q,0)+i*(J.length-1),kt=lt-Ot/2;for(let[nt,q]of J.entries()){let ot=xt[nt];d[q]=kt+ot/2,m[q]=O+_/2,kt+=ot+i}}}let Y=L[N]??0;O+=_+s+Y}let P=new Map;for(let N of n.edges){let H=N.ref.id;if(!P.has(H))P.set(H,[]);P.get(H).push(N)}for(let[,N]of P){if(N.length===0)continue;let H=N[0].ref,{start:_,end:F}=H;if(_==null||F==null)continue;let Y=Math.round(((d[_]??0)+(d[F]??0))/2),V=new Set;for(let J of N)V.add(J.src),V.add(J.dst);for(let J of V){if(J===_||J===F)continue;if(n.nodeById.get(J)?.isDummy)d[J]=Y}}return{x:d,y:m}}e(nr,"assignCoordinates");var er=8;function or(t){let n=2166136261;for(let o=0;o<t.length;o++)n^=t.charCodeAt(o),n=Math.imul(n,16777619);return n>>>0}e(or,"hashString");function sr(t){let n=t>>>0;return()=>{n+=1831565813;let o=n;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}}e(sr,"mulberry32");function rr(t,n){let o=[...t],s=sr(n);for(let i=o.length-1;i>0;i--){let c=Math.floor(s()*(i+1));[o[i],o[c]]=[o[c],o[i]]}return o}e(rr,"deterministicShuffle");function ir(t,n){let o=0;for(let[s,i]of t.entries())o+=Math.abs(s-(n.get(i)??s));return o}e(ir,"sourceDistance");function so(t,n){let o=new Map;for(let[i,c]of t.entries())o.set(c,i);let s=0;for(let{a:i,b:c,weight:a}of n){let u=o.get(i),h=o.get(c);if(u==null||h==null)continue;s+=a*Math.abs(u-h)}return s}e(so,"laneArrangementCost");function cr(t){let n=ue(t);if(n.length<2)return[];let o=new Map(n.map((c,a)=>[c,a])),s=hn(t),i=new Map;for(let c of t.layout.edges??[]){if(c.isLayoutOnly)continue;let a=typeof c.start==="string"?c.start:void 0,u=typeof c.end==="string"?c.end:void 0;if(!a||!u||!t.nodeById.has(a)||!t.nodeById.has(u))continue;let h=s(a),d=s(u);if(!h||!d||h===d)continue;let m=o.get(h),p=o.get(d);if(m==null||p==null)continue;let[I,y]=m<=p?[h,d]:[d,h],g=`${I}\x00${y}`,l=i.get(g);if(l)l.weight++;else i.set(g,{a:I,b:y,weight:1})}return[...i.values()]}e(cr,"buildWeightedLaneEdges");function ro(t,n,o){let s=[...t],i=so(s,n),c=!0,a=0,u=Math.max(1,s.length);while(c&&a<u){c=!1,a++;for(let h=0;h+1<s.length;h++){[s[h],s[h+1]]=[s[h+1],s[h]];let d=so(s,n);if(d<i)i=d,c=!0;else[s[h],s[h+1]]=[s[h+1],s[h]]}}return{order:s,cost:i,sourceDistance:ir(s,o)}}e(ro,"greedySwitch");function ar(t,n){if(t.cost!==n.cost)return t.cost<n.cost;return t.sourceDistance<n.sourceDistance}e(ar,"isBetterCandidate");function fr(t,n,o){let s=[...n].sort((i,c)=>i.a===c.a?i.b.localeCompare(c.b):i.a.localeCompare(c.a)).map(({a:i,b:c,weight:a})=>`${i}:${c}:${a}`).join("|");return or(`${t.join("|")}#${s}#${o}`)}e(fr,"seedForRestart");function dr(t,n={}){let o=ue(t);if(o.length<2)return o;let s=cr(t);if(s.length===0)return o;let i=new Map(o.map((u,h)=>[u,h])),c=ro(o,s,i),a=Math.max(0,n.restarts??er);for(let u=0;u<a;u++){let h=fr(o,s,u),d=rr(o,h),m=ro(d,s,i);if(ar(m,c))c=m}return c.order}e(dr,"optimizeTopLaneOrder");function ur(t,n){let o=n?.ignoreCrossLaneEdges??!0,s=n?.optimizeRanksByCrossings??!0,i=Mn(t),c=n?.automaticLaneOrdering?dr(i,{restarts:er}):void 0,a=Ns(i),u=a.acyclic,h=o?qs(u,{compactSingleInput:n?.compactSingleInput??ie.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:n?.direction}):Ws(u,{compactSingleInput:n?.compactSingleInput??ie.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:s}),{layering:d,graphWithDummies:m}=Js(h,u),p=tr(d,m,{laneOrder:c}),I=nr(p,m,{layerGap:n?.layerGap,nodeGap:n?.nodeGap,direction:n?.direction,laneOrder:c});return{acyclic:u,reversed:a.reversed,layering:d,ordered:p,coordinates:I}}e(ur,"sugiyamaLayout");var ft=Hr.EPSILON,Dr=8,Sn=15,Nn=15,qn=25,sn=20,Re=10;function io(t,n,o){let s=t.x??0,i=t.y??0,c=n.x-s,a=n.y-i,u=Math.abs(c),h=Math.abs(a);if(u<ft&&h<ft)return o;let d=3;if(h>ft&&h*d>=u)return a>0?"bottom":"top";if(u>ft)return c>0?"right":"left";return o}e(io,"chooseOrthogonalSide");function co(t,n){return Math.abs(t.to-n.from)<ft||Math.abs(t.to-n.to)<ft?t.to:t.from}e(co,"sharedLineEndpointCoord");function Cn(t,n){return t.orient==="vertical"?{x:t.coord,y:n}:{x:n,y:t.coord}}e(Cn,"pointOnLine");function hr(t,n){let o=t.nodes??[],s=t.edges??[],i=[];for(let f of s){if(f.isLayoutOnly)continue;i.push({...f,__originalEdge:f})}let c=new Map,a=new Map,u=[],h=n==="LR";for(let f of o)c.set(f.id,f);let d=o.filter((f)=>f.isGroup&&!f.parentId);for(let f of d){let M={id:f.id},v=e((A)=>{a.set(A.id,M),o.filter((T)=>T.parentId===A.id).forEach(v)},"assignLane");v(f)}let m=o.filter((f)=>!f.isGroup&&!f.isEdgeLabel).map((f)=>{let M=f.width??10,v=f.height??10,A=f.x??0,T=f.y??0,k=Dr;return{nodeId:f.id,minX:A-M/2-k,maxX:A+M/2+k,minY:T-v/2-k,maxY:T+v/2+k,visualXHalfExtent:h?v/2+k:M/2+k}}),p=e((f,M,v,A)=>{let T=u.find((k)=>k.orientation===f&&Math.abs(k.coord-M)<1);if(!T)T={id:`pipe-${f}-${M.toFixed(0)}`,orientation:f,coord:M,spanMin:v,spanMax:A,tracks:[]},u.push(T);return T.spanMin=Math.min(T.spanMin,v),T.spanMax=Math.max(T.spanMax,A),T},"getOrAddPipe"),I=e((f,M)=>{let v=f.width??10,A=f.height??10,T=f.x??0,k=f.y??0;switch(M){case"top":return{x:T,y:k-A/2};case"bottom":return{x:T,y:k+A/2};case"left":return{x:T-v/2,y:k};case"right":return{x:T+v/2,y:k}}},"portForSide"),y=e((f,M,v)=>I(f,io(f,M,v?"bottom":"top")),"getOrthogonalPort"),g=[],l=[],x=new Set,L=1000,S=e((f,M,v)=>{if(g.length===0)return 0;let A=Math.abs(M.y-v.y)<ft,T=Math.abs(M.x-v.x)<ft;if(!A&&!T)return 0;let k=0;if(A){let K=M.y,Q=Math.min(M.x,v.x)-ft,j=Math.max(M.x,v.x)+ft;if(j<=Q)return 0;for(let z of g){if(z.edgeIndex===f||z.orientation!=="vertical")continue;if(z.pipe.coord<Q||z.pipe.coord>j)continue;if(z.from-ft<=K&&z.to+ft>=K)k+=L}}else if(T){let K=M.x,Q=Math.min(M.y,v.y)-ft,j=Math.max(M.y,v.y)+ft;if(j<=Q)return 0;for(let z of g){if(z.edgeIndex===f||z.orientation!=="horizontal")continue;if(z.pipe.coord<Q||z.pipe.coord>j)continue;if(z.from-ft<=K&&z.to+ft>=K)k+=L}}return k},"crossingPenalty"),E=i.map((f,M)=>{if(!f.start||!f.end)return{idx:M,crossLane:0,dx:0,dy:0};let v=c.get(f.start),A=c.get(f.end),T=a.get(f.start),k=a.get(f.end),K=T&&k&&T.id!==k.id?1:0,Q=v&&A?Math.abs((A.x??0)-(v.x??0)):0,j=v&&A?Math.abs((A.y??0)-(v.y??0)):0;return{idx:M,crossLane:K,dx:Q,dy:j}}).sort((f,M)=>{if(f.crossLane!==M.crossLane)return M.crossLane-f.crossLane;let v=f.dx+f.dy,A=M.dx+M.dy;if(Math.abs(v-A)>1)return v-A;return f.idx-M.idx}).map((f)=>f.idx),w=e((f,M,v,A)=>{let T=Math.min(f.x,M.x),k=Math.max(f.x,M.x),K=Math.min(f.y,M.y),Q=Math.max(f.y,M.y);return!!m.find((z)=>{if(v&&z.nodeId===v)return!1;if(A&&z.nodeId===A)return!1;if(Math.abs(f.x-M.x)>ft)return z.minY<f.y&&z.maxY>f.y&&z.maxX>T&&z.minX<k;else return z.minX<f.x&&z.maxX>f.x&&z.maxY>K&&z.minY<Q})},"isSegmentBlocked"),C=new Map,b=new Map;for(let f of i){if(!f.start||!f.end||f.start===f.end)continue;b.set(f.start,(b.get(f.start)??0)+1),b.set(f.end,(b.get(f.end)??0)+1)}let R=e((f,M)=>io(f,M,"bottom"),"determineSide"),O=new Map;for(let[f,M]of i.entries()){if(!M.start||!M.end||M.start===M.end)continue;if(M.points&&M.points.length>0)continue;let v=c.get(M.start),A=c.get(M.end);if(!v||!A)continue;let T=(A.x??0)-(v.x??0),k=(A.y??0)-(v.y??0);O.set(f,{edgeIdx:f,srcId:M.start,dstId:M.end,srcSide:R(v,{x:A.x??0,y:A.y??0}),dstSide:R(A,{x:v.x??0,y:v.y??0}),absDx:Math.abs(T),absDy:Math.abs(k),dxSign:Math.sign(T),dySign:Math.sign(k)})}let P=e((f)=>{if(f.srcSide==="top"||f.srcSide==="bottom")return f.absDx===0?1/0:f.absDy/f.absDx;return f.absDy===0?1/0:f.absDx/f.absDy},"preferenceStrength"),N=e((f)=>{if(f.srcSide==="top"||f.srcSide==="bottom")return f.dxSign>=0?"right":"left";return f.dySign>=0?"bottom":"top"},"secondarySide"),H=new Map;for(let f of O.values()){let M=`${f.srcId}:${f.srcSide}`;if(!H.has(M))H.set(M,[]);H.get(M).push(f)}let _=new Map,F=e((f,M)=>`${f}:${M}`,"loadKey");for(let f of O.values())_.set(F(f.srcId,f.srcSide),(_.get(F(f.srcId,f.srcSide))??0)+1),_.set(F(f.dstId,f.dstSide),(_.get(F(f.dstId,f.dstSide))??0)+1);for(let f of H.values()){if(f.length<2)continue;f.sort((M,v)=>{let A=P(M),T=P(v);if(Math.abs(A-T)>0.000000001)return T-A;return M.edgeIdx-v.edgeIdx});for(let M=1;M<f.length;M++){let v=f[M],A=N(v),T=_.get(F(v.srcId,v.srcSide))??0,k=_.get(F(v.srcId,A))??0;if(k>=T)continue;_.set(F(v.srcId,v.srcSide),T-1),_.set(F(v.srcId,A),k+1),v.srcSide=A}}let Y=e((f)=>{let M=f?.shape;return M==="question"||M==="diamond"},"isDiamondNode"),V=new Map;for(let f of O.values()){if(!V.has(f.dstId))V.set(f.dstId,new Set);V.get(f.dstId).add(f.dstSide)}for(let f of O.values()){if(!Y(c.get(f.srcId)))continue;let M=V.get(f.srcId);if(!M?.has(f.srcSide))continue;let v=N(f);if(M.has(v)||(_.get(F(f.srcId,v))??0)>0)continue;let A=_.get(F(f.srcId,f.srcSide))??0;_.set(F(f.srcId,f.srcSide),Math.max(0,A-1)),_.set(F(f.srcId,v),1),f.srcSide=v}for(let f of O.values()){let{edgeIdx:M,srcId:v,dstId:A,srcSide:T,dstSide:k}=f,K=c.get(v),Q=c.get(A),j=`${v}:${T}:src`,z=T==="top"||T==="bottom"?Q.x??0:Q.y??0;if(!C.has(j))C.set(j,[]);C.get(j).push({edgeIdx:M,oppositeCoord:z});let rt=`${A}:${k}:dst`,ct=k==="top"||k==="bottom"?K.x??0:K.y??0;if(!C.has(rt))C.set(rt,[]);C.get(rt).push({edgeIdx:M,oppositeCoord:ct})}let J=new Map,lt=8;for(let[f,M]of C){if(M.length<2)continue;M.sort((At,Xt)=>At.oppositeCoord-Xt.oppositeCoord);let v=f.split(":"),A=v.slice(0,-2).join(":"),T=v[v.length-2],k=v[v.length-1],K=c.get(A);if(!K)continue;let j=T==="left"||T==="right"?K.height??10:K.width??10,z=K.shape,ct=z==="question"||z==="diamond"?j*0.3:j,et=Math.min(20,Math.max(lt,ct/(M.length+1))),Bt=-(et*(M.length-1))/2;for(let[At,Xt]of M.entries()){let Qt=Bt+At*et,me=`${Xt.edgeIdx}:${k}`;J.set(me,Qt)}}let xt=e((f)=>Boolean(i[f]?.labelNodeId),"edgeHasLabelNode"),Ot=e((f,M)=>{if(!f)return!1;return(C.get(`${f}:${M}:src`)??[]).some(({edgeIdx:v})=>xt(v))||(C.get(`${f}:${M}:dst`)??[]).some(({edgeIdx:v})=>xt(v))},"faceHasLabelNode"),kt=e((f,M,v)=>{if(M==="top"||M==="bottom")return{x:f.x+v,y:f.y};else return{x:f.x,y:f.y+v}},"applyPortOffset"),nt=e((f,M,v)=>{let A=O.get(f),T={x:v.x??0,y:v.y??0},k={x:M.x??0,y:M.y??0},K=A?.srcSide??R(M,T),Q=A?.dstSide??R(v,k),j=A?I(M,A.srcSide):y(M,T,!0),z=A?I(v,A.dstSide):y(v,k,!1),rt=J.get(`${f}:src`),ct=J.get(`${f}:dst`);if(rt!==void 0)j=kt(j,K,rt);if(ct!==void 0)z=kt(z,Q,ct);return{pSrcPort:j,pDstPort:z,srcSide:K,dstSide:Q}},"portsForEdge");for(let f of E){let M=i[f];if(l[f]=[],!M.start||!M.end)continue;if(M.points&&M.points.length>0)continue;if(M.start===M.end)continue;let v=c.get(M.start),A=c.get(M.end);if(!v||!A)continue;let{pSrcPort:T,pDstPort:k,srcSide:K,dstSide:Q}=nt(f,v,A),j={...T},z={...k},rt=K==="top"||K==="bottom",ct=Q==="top"||Q==="bottom";if(rt){let G=T.y>(v.y??0);j.y=G?T.y+sn:T.y-sn}else{let G=T.x>(v.x??0);j.x=G?T.x+sn:T.x-sn}if(ct){let G=k.y>(A.y??0);z.y=G?k.y+sn:k.y-sn}else{let G=k.x>(A.x??0);z.x=G?k.x+sn:k.x-sn}let it=e((G,U)=>{for(let Z of m){if(U.includes(Z.nodeId))continue;if(G.x>Z.minX&&G.x<Z.maxX&&G.y>Z.minY&&G.y<Z.maxY)return{inside:!0,obstacle:Z}}return{inside:!1}},"isPointInObstacle"),et=e((G,U,Z,ut,Lt)=>{if(Lt){let Ft=G.y>(U.y??0);return{x:(Z.x??0)>=G.x?ut.maxX+Sn:ut.minX-Sn,y:Ft?ut.maxY+Nn:ut.minY-Nn,leavesPositiveSide:Ft}}let It=G.x>(U.x??0),Rt=(Z.y??0)>=G.y;return{x:It?ut.maxX+Sn:ut.minX-Sn,y:Rt?ut.maxY+Nn:ut.minY-Nn,leavesPositiveSide:It}},"obstacleDetour"),bt=[],Bt=[M.start,M.end],At=it(j,Bt);if(At.inside&&At.obstacle){let G=At.obstacle;if(rt){let U=et(T,v,A,G,!0);j.x=U.x,j.y=U.y;let Z=U.leavesPositiveSide?Math.min(G.minY-2,T.y+sn):Math.max(G.maxY+2,T.y-sn);bt=[{x:T.x,y:Z},{x:U.x,y:Z},{x:U.x,y:U.y}]}else{let U=et(T,v,A,G,!1),Z=U.leavesPositiveSide?Math.min(G.minX-2,T.x+sn):Math.max(G.maxX+2,T.x-sn);j.x=U.x,j.y=U.y,bt=[{x:Z,y:T.y},{x:Z,y:U.y},{x:U.x,y:U.y}]}}let Xt=[],Qt=it(z,Bt);if(Qt.inside&&Qt.obstacle){let G=Qt.obstacle;if(ct){let U=et(k,A,v,G,!0);z.x=U.x,z.y=U.y,Xt=[{x:U.x,y:U.y},{x:k.x,y:U.y}]}else{let U=et(k,A,v,G,!1);z.x=U.x,z.y=U.y,Xt=[{x:U.x,y:U.y},{x:U.x,y:k.y}]}}if(bt.length===0&&Xt.length===0){let G=Sn,U=Math.abs(j.x-z.x)<G,Z=Math.abs(j.y-z.y)<G,ut=J.get(`${f}:src`)!==void 0||J.get(`${f}:dst`)!==void 0,Lt=(C.get(`${M.start??""}:${K}:src`)?.length??0)+(C.get(`${M.start??""}:${K}:dst`)?.length??0),It=(C.get(`${M.end??""}:${Q}:src`)?.length??0)+(C.get(`${M.end??""}:${Q}:dst`)?.length??0),Rt=Lt>1||It>1,Ft=b.get(M.start??"")??0,gt=b.get(M.end??"")??0,$t=Lt>1&&Ot(M.start,K)||It>1&&Ot(M.end,Q),on=Lt<=1||Ft<=2,_t=It<=1||gt<=2;if((U||Z)&&!ut&&(!Rt||Rt&&!$t&&on&&_t)){if(!w(T,k,M.start,M.end)){M.points=[{...T},{...j},{...z},{...k}],x.add(f);let St=Z?"horizontal":"vertical",Vt=Z?T.y:T.x,Ct=Z?Math.min(T.x,k.x):Math.min(T.y,k.y),vt=Z?Math.max(T.x,k.x):Math.max(T.y,k.y),qt={id:`fast-path-${St}-${Vt.toFixed(0)}-${f}`,orientation:St,coord:Vt,spanMin:Ct,spanMax:vt,tracks:[]};g.push({edgeIndex:f,segmentIndex:0,orientation:St,pipe:qt,trackIndex:0,from:Ct,to:vt});continue}}}let me=p("vertical",j.x,j.y,j.y);j.x=me.coord;let yr=p("vertical",z.x,z.y,z.y);z.x=yr.coord;let pn=Math.min(j.x,z.x)-50,mn=Math.max(j.x,z.x)+50,An=Math.min(j.y,z.y)-50,Rn=Math.max(j.y,z.y)+50;for(let G of m){let U=Math.min(j.x,z.x),Z=Math.max(j.x,z.x),ut=Math.min(j.y,z.y),Lt=Math.max(j.y,z.y);if(G.minX<Z&&G.maxX>U&&G.minY<Lt&&G.maxY>ut)pn=Math.min(pn,G.minX-qn),mn=Math.max(mn,G.maxX+qn),An=Math.min(An,G.minY-qn),Rn=Math.max(Rn,G.maxY+qn)}for(let G of m){if(G.maxX<pn||G.minX>mn||G.maxY<An||G.minY>Rn)continue;let U=Sn;p("horizontal",G.minY-U,pn,mn),p("horizontal",G.maxY+U,pn,mn);let Z=Nn;p("vertical",G.minX-Z,An,Rn),p("vertical",G.maxX+Z,An,Rn)}p("horizontal",j.y,pn,mn),p("horizontal",z.y,pn,mn);let xr=u.filter((G)=>G.orientation==="horizontal"&&G.coord>=An&&G.coord<=Rn),br=u.filter((G)=>G.orientation==="vertical"&&G.coord>=pn&&G.coord<=mn),Hn=e((G,U)=>`${G.toFixed(1)},${U.toFixed(1)}`,"getKey"),Dn=Hn(j.x,j.y),Ro=Hn(z.x,z.y),Xn=new Map,ye=new Map,xe=new Map,Yn=new Set,In=[];Xn.set(Dn,0),xe.set(Dn,"n"),In.push({key:Dn,f:Math.hypot(z.x-j.x,z.y-j.y),pt:j}),Yn.add(Dn);let Yt=[],yn=e((G,U)=>w(G,U,M.start,M.end),"checkSegmentBlocked"),be={x:z.x,y:j.y},Mr=yn(j,be),Ir=yn(be,z),Sr=Mr||Ir,Me={x:j.x,y:z.y},Cr=yn(j,Me),vr=yn(Me,z),Lr=Cr||vr;if(!Sr)if(Math.abs(j.y-z.y)<ft||Math.abs(j.x-z.x)<ft)Yt=[j,z];else Yt=[j,be,z];else if(!Lr)if(Math.abs(j.x-z.x)<ft)Yt=[j,z];else Yt=[j,Me,z];if(Yt.length===0)while(In.length>0){In.sort((gt,$t)=>gt.f-$t.f);let G=In.shift();if(Yn.delete(G.key),G.key===Ro){let gt=Ro,$t=z;Yt=[$t];while(ye.has(gt)){let on=ye.get(gt);Yt.unshift(on),$t=on,gt=Hn(on.x,on.y)}break}let U=G.pt.x,Z=G.pt.y,ut=br.sort((gt,$t)=>gt.coord-$t.coord),Lt=ut.findIndex((gt)=>Math.abs(gt.coord-U)<1),It=xr.sort((gt,$t)=>gt.coord-$t.coord),Rt=It.findIndex((gt)=>Math.abs(gt.coord-Z)<1),Ft=[];if(Lt>0)Ft.push({x:ut[Lt-1].coord,y:Z});if(Lt>=0&&Lt<ut.length-1)Ft.push({x:ut[Lt+1].coord,y:Z});if(Rt>0)Ft.push({x:U,y:It[Rt-1].coord});if(Rt>=0&&Rt<It.length-1)Ft.push({x:U,y:It[Rt+1].coord});for(let gt of Ft){let $t=Math.min(U,gt.x),on=Math.max(U,gt.x),_t=Math.min(Z,gt.y),zt=Math.max(Z,gt.y);if(m.some((tn)=>{if(tn.nodeId===M.start||tn.nodeId===M.end)return!1;if($t!==on)return tn.minY<Z&&tn.maxY>Z&&tn.maxX>$t&&tn.minX<on;else return tn.minX<U&&tn.maxX>U&&tn.maxY>_t&&tn.minY<zt}))continue;let St=Hn(gt.x,gt.y),Vt=Math.abs(gt.x-U)+Math.abs(gt.y-Z),Ct=S(f,G.pt,gt),vt=0,qt=z.x-j.x,Tn=z.y-j.y,Gn=gt.x-U,Ie=gt.y-Z;if(Tn>10&&Ie<-5||Tn<-10&&Ie>5)vt=Math.abs(Ie)*100;if(qt>10&&Gn<-5||qt<-10&&Gn>5)vt+=Math.abs(Gn)*50;let To=0,wo=xe.get(G.key)??"n",No=Math.abs(Gn)>ft?"h":"v";if(wo!=="n"&&wo!==No)To=50;let Er=Vt+Ct+vt+To,$n=(Xn.get(G.key)??1/0)+Er,Oo=Math.abs(z.x-gt.x)+Math.abs(z.y-gt.y);if($n<(Xn.get(St)??1/0))if(ye.set(St,G.pt),Xn.set(St,$n),xe.set(St,No),!Yn.has(St))In.push({key:St,f:$n+Oo,pt:gt}),Yn.add(St);else{let tn=In.findIndex((Ar)=>Ar.key===St);if(tn!==-1)In[tn].f=$n+Oo}}}if(Yt.length===0)Yt=[j,{x:j.x,y:z.y},z];if(Yt.length>4){let G=Yt[0],U=Yt[Yt.length-1],Z=Math.min(G.x,U.x),ut=Math.max(G.x,U.x),Lt=Math.min(G.y,U.y),It=Math.max(G.y,U.y);for(let _t of Yt)Z=Math.min(Z,_t.x),ut=Math.max(ut,_t.x),Lt=Math.min(Lt,_t.y),It=Math.max(It,_t.y);let Rt=ut>Math.max(G.x,U.x),Ft=Z<Math.min(G.x,U.x);if(h){let _t=Nn;if(Rt){let zt=Math.max(G.x,U.x),Pt=Math.min(G.y,U.y),St=Math.max(G.y,U.y),Vt=m.filter((Ct)=>Ct.minX<zt&&Ct.maxX>zt&&Ct.minY<St&&Ct.maxY>Pt);if(Vt.length>0){let Ct=Math.max(G.x,U.x);for(let vt of Vt){let qt=(vt.minX+vt.maxX)/2;if(vt.visualXHalfExtent===void 0||isNaN(vt.visualXHalfExtent))continue;let Tn=qt+vt.visualXHalfExtent+_t;Ct=Math.max(Ct,Tn)}if(!isNaN(Ct))ut=Ct}}if(Ft){let zt=m.filter((Pt)=>Pt.minX<Math.min(G.x,U.x)+_t&&Pt.minY<Math.max(G.y,U.y)&&Pt.maxY>Math.min(G.y,U.y));if(zt.length>0){let Pt=Math.min(G.x,U.x);for(let St of zt){let Ct=(St.minX+St.maxX)/2-St.visualXHalfExtent-_t;Pt=Math.min(Pt,Ct)}Z=Pt}}}let gt=e((_t)=>{let zt=U.y>G.y,Pt=m.filter((Ct)=>{let vt=Math.min(G.x,U.x)<Ct.maxX&&Math.max(G.x,U.x)>Ct.minX,qt=Math.min(G.y,U.y)<Ct.maxY&&Math.max(G.y,U.y)>Ct.minY;return vt&&qt}),St=Pt;if(h&&Pt.length>0){let Ct=Pt.filter((vt)=>vt.minX<_t&&vt.maxX>_t);if(Ct.length>0)St=Ct}if(St.length===0)return U.y;let Vt=Sn;if(zt){let vt=Math.max(...St.map((qt)=>qt.maxY))+Vt;if(vt<U.y-ft)return vt}else{let vt=Math.min(...St.map((qt)=>qt.minY))-Vt;if(vt>U.y+ft)return vt}return U.y},"findBestReturnY"),$t=e((_t)=>{let zt=gt(_t),Pt={x:_t,y:G.y},St={x:_t,y:zt},Vt={x:U.x,y:zt},Ct=yn(G,Pt),vt=yn(Pt,St),qt=yn(St,Vt),Tn=zt!==U.y?yn(Vt,U):!1;if(!Ct&&!vt&&!qt&&!Tn){if(Math.abs(zt-U.y)<ft)return[G,Pt,St,U];return[G,Pt,St,Vt,U]}return null},"trySimplifyWithDetourX"),on=Rt&&!Ft?$t(ut):Ft&&!Rt?$t(Z):null;if(on)Yt=on}let Gt=[T,...bt,...Yt,...Xt.reverse(),k];if(Gt.length>=3){let G=Gt[Gt.length-1],U=Gt[Gt.length-2],Z=Gt[Gt.length-3],ut=Math.abs(Z.y-U.y)<ft&&Math.abs(U.y-G.y)<ft,Lt=Math.abs(Z.x-U.x)<ft&&Math.abs(U.x-G.x)<ft;if(ut){let It=Math.sign(U.x-Z.x),Rt=Math.sign(G.x-Z.x);if(It!==0&&It===Rt&&Math.abs(U.x-Z.x)>Math.abs(G.x-Z.x))Gt.splice(-2,1)}else if(Lt){let It=Math.sign(U.y-Z.y),Rt=Math.sign(G.y-Z.y);if(It!==0&&It===Rt&&Math.abs(U.y-Z.y)>Math.abs(G.y-Z.y))Gt.splice(-2,1)}}let ln=[Gt[0]];for(let G=1;G<Gt.length-1;G++){if(G===1){ln.push(Gt[G]);continue}let U=ln[ln.length-1],Z=Gt[G],ut=Gt[G+1];if(Math.abs(U.y-Z.y)<ft&&Math.abs(Z.y-ut.y)<ft){let Lt=Z.x>U.x,It=ut.x>Z.x;if(Lt!==It){ln.push(Z);continue}continue}if(Math.abs(U.x-Z.x)<ft&&Math.abs(Z.x-ut.x)<ft){let Lt=Z.y>U.y,It=ut.y>Z.y;if(Lt!==It){ln.push(Z);continue}continue}ln.push(Z)}ln.push(Gt[Gt.length-1]);for(let G=0;G<ln.length-1;G++){let U=ln[G],Z=ln[G+1],ut=Math.abs(U.x-Z.x)<ft?"vertical":"horizontal",Lt=ut==="vertical"?U.x:U.y,It=ut==="vertical"?Math.min(U.y,Z.y):Math.min(U.x,Z.x),Rt=ut==="vertical"?Math.max(U.y,Z.y):Math.max(U.x,Z.x),Ft=p(ut,Lt,It,Rt),gt={edgeIndex:f,segmentIndex:G,orientation:ut,pipe:Ft,trackIndex:0,from:It,to:Rt};if(g.push(gt),l[f].push(g.length-1),!Ft.tracks[0])Ft.tracks[0]={index:0,coord:Ft.coord,segments:[]};Ft.tracks[0].segments.push({edgeIndex:f,segmentIndex:G,from:It,to:Rt})}}let q=e((f,M)=>f.from<M.to&&M.from<f.to,"segmentsOverlap"),ot=e((f,M,v,A)=>{let T=!A.segments.some((K)=>(K.edgeIndex!==M.edgeIndex||K.segmentIndex!==M.segmentIndex)&&q(K,f)),k=!v.segments.some((K)=>(K.edgeIndex!==f.edgeIndex||K.segmentIndex!==f.segmentIndex)&&q(K,M));if(T&&k)return f.trackIndex=A.index,M.trackIndex=v.index,v.segments=[...v.segments.filter((K)=>K.edgeIndex!==f.edgeIndex||K.segmentIndex!==f.segmentIndex),{edgeIndex:M.edgeIndex,segmentIndex:M.segmentIndex,from:M.from,to:M.to}],A.segments=[...A.segments.filter((K)=>K.edgeIndex!==M.edgeIndex||K.segmentIndex!==M.segmentIndex),{edgeIndex:f.edgeIndex,segmentIndex:f.segmentIndex,from:f.from,to:f.to}],!0;return!1},"trySwapSegmentsAcrossTracks"),dt=e((f)=>{let M=f.tracks.length;return f.tracks[M]={index:M,coord:f.coord,segments:[]},M},"createNewTrack"),mt=e((f,M)=>{let v=f.pipe.tracks[f.trackIndex];v.segments=v.segments.filter((T)=>T.edgeIndex!==f.edgeIndex||T.segmentIndex!==f.segmentIndex),f.trackIndex=M,f.pipe.tracks[M].segments.push({edgeIndex:f.edgeIndex,segmentIndex:f.segmentIndex,from:f.from,to:f.to})},"moveSegmentToTrack"),Mt=e((f,M)=>{let v=l[f.edgeIndex];for(let A of v){let T=g[A];if(T.pipe===f.pipe)mt(T,M)}},"moveSegmentChainToTrack"),Et=e((f)=>{let M=l[f.edgeIndex],v=M.indexOf(g.indexOf(f)),A=[];if(v>0)A.push(g[M[v-1]]);if(v<M.length-1)A.push(g[M[v+1]]);return A},"getAdjacentSegmentsAlongEdge"),jt=e((f,M)=>{if(f.orientation===M.orientation)return!1;let v=f.orientation==="horizontal"?f:M,A=f.orientation==="horizontal"?M:f;return A.pipe.coord>v.from&&A.pipe.coord<v.to&&v.pipe.coord>A.from&&v.pipe.coord<A.to},"haveAnyCrossing"),Wt=e((f,M)=>{for(let v of f.tracks)if(!v.segments.some((T)=>(T.edgeIndex!==M.edgeIndex||T.segmentIndex!==M.segmentIndex)&&q(T,M)))return v.index;return-1},"findAvailableTrack"),Kt=e((f,M)=>{if(f.trackIndex===M.trackIndex)return q(f,M);let v=Et(f),A=Et(M);return v.some((T)=>A.some((k)=>jt(T,k)))},"segmentsConflict"),en=e((f,M,v)=>{if(ot(f,M,f.pipe.tracks[f.trackIndex],M.pipe.tracks[M.trackIndex]))return;let A=Wt(f.pipe,M);v(M,A!==-1?A:dt(f.pipe))},"resolveTrackConflict"),Ln=e((f)=>{let M=0;for(let v=0;v<f.length;v++)for(let A=v+1;A<f.length;A++){let T=f[v],k=f[A];if(T.pipe!==k.pipe)continue;if(Kt(T,k))M++,en(T,k,Mt)}return M},"resolveHandleConflicts"),gn=new Map,En=e((f)=>{if(gn.has(f))return gn.get(f);let M=l[f];if(M.length===0){let Q={dest:0,deviation:0,base:0,delta:0};return gn.set(f,Q),Q}let A=g[M[0]].pipe.coord,T=A;for(let Q=1;Q<M.length;Q++){let j=g[M[Q]];if(j.orientation==="horizontal"){let{from:z,to:rt}=j;T=Math.abs(z-A)>Math.abs(rt-A)?z:rt;break}}let k=Math.abs(T-A),K={dest:T,deviation:k,base:A,delta:T-A};return gn.set(f,K),K},"getDestInfo"),he=e(()=>{let f=0,M=new Map;for(let[A,T]of i.entries()){if(l[A].length===0)continue;if(!T.start)continue;if(!M.has(T.start))M.set(T.start,[]);M.get(T.start).push(A)}let v=e((A)=>{let T=i[A];if(!T.start||!T.end)return 0;let k=c.get(T.start),K=c.get(T.end);if(!k||!K)return 0;let Q=(K.x??0)-(k.x??0),j=(K.y??0)-(k.y??0);return Math.abs(Q)+Math.abs(j)},"getEdgeDistance");for(let A of M.values()){A.sort((k,K)=>{let Q=En(k),j=En(K);if(Math.abs(Q.deviation-j.deviation)>1)return Q.deviation-j.deviation;if(Math.abs(Q.dest-j.dest)>1)return Q.dest-j.dest;let z=v(k),rt=v(K);if(Math.abs(z-rt)>1)return rt-z;let ct=l[k].length,it=l[K].length;if(ct!==it)return ct-it;if(ct===1){let et=l[k][0],bt=l[K][0];if(g[et]&&g[bt]){let Bt=g[et],At=g[bt],Xt=Math.abs(Bt.to-Bt.from),Qt=Math.abs(At.to-At.from);if(Math.abs(Xt-Qt)>1)return Xt-Qt}}return 0});let T=A.map((k)=>g[l[k][0]]);f+=Ln(T)}return f},"fixSourceHandleCrossings"),ge=e(()=>{let f=0,M=new Map;for(let[v,A]of i.entries()){if(l[v].length===0)continue;if(!A.end)continue;if(!M.has(A.end))M.set(A.end,[]);M.get(A.end).push(v)}for(let v of M.values()){v.sort((T,k)=>{let K=e((z)=>{let rt=l[z];if(rt.length<2)return 0;let ct=g[rt[rt.length-2]];return Math.abs(ct.to-ct.from)},"getDist"),Q=K(T),j=K(k);if(Math.abs(Q-j)>0.1)return Q-j;return T-k});let A=v.map((T)=>g[l[T][l[T].length-1]]);f+=Ln(A)}return f},"fixTargetHandleCrossings"),pe=e(()=>{let f=0;for(let M of u){let v=[];for(let A of M.tracks)for(let T of A.segments){let k=l[T.edgeIndex].find((K)=>g[K].segmentIndex===T.segmentIndex);if(k!==void 0)v.push(g[k])}v.sort((A,T)=>A.edgeIndex-T.edgeIndex||A.segmentIndex-T.segmentIndex);for(let A=0;A<v.length;A++)for(let T=A+1;T<v.length;T++){let k=v[A],K=v[T];if(Kt(k,K))f++,en(k,K,mt)}}return f},"fixPipeCrossings"),B=0,D=10;while(B<D){let f=0;if(f+=he(),f+=ge(),f+=pe(),f===0)break;B++}let X=new Map;for(let f of u){let M=[];f.tracks.forEach((A)=>{A.segments.forEach((T)=>{M.push({edgeIndex:T.edgeIndex,segmentIndex:T.segmentIndex,trackIndex:A.index,from:T.from,to:T.to})})}),M.sort((A,T)=>A.from-T.from);let v=[];if(M.length>0){let A=[M[0]],T=M[0].to;for(let k=1;k<M.length;k++){let K=M[k];if(K.from<T)A.push(K),T=Math.max(T,K.to);else v.push(A),A=[K],T=K.to}v.push(A)}for(let A of v){let T=new Set;A.forEach((et)=>T.add(et.trackIndex));let k=new Map;A.forEach((et)=>{let bt=En(et.edgeIndex);k.set(et.trackIndex,(k.get(et.trackIndex)??0)+bt.delta)});let K=[...T].filter((et)=>(k.get(et)??0)<-1),Q=[...T].filter((et)=>(k.get(et)??0)>1),j=[...T].filter((et)=>Math.abs(k.get(et)??0)<=1);K.sort((et,bt)=>(k.get(bt)??0)-(k.get(et)??0)),Q.sort((et,bt)=>(k.get(et)??0)-(k.get(bt)??0));let z=e((et,bt)=>{A.filter((Bt)=>Bt.trackIndex===et).forEach((Bt)=>{let At=x.has(Bt.edgeIndex)?f.coord:bt;X.set(`${Bt.edgeIndex}-${Bt.segmentIndex}`,At)})},"assignCoord"),rt=0;for(let et of K)rt++,z(et,f.coord-rt*Re);if(j.length===0&&T.size>0){let et=[...T].sort((At,Xt)=>Math.abs(k.get(At)??0)-Math.abs(k.get(Xt)??0))[0],bt=K.indexOf(et);if(bt!==-1)K.splice(bt,1);let Bt=Q.indexOf(et);if(Bt!==-1)Q.splice(Bt,1);j.push(et)}let ct=0;for(let et of j){if(ct===0)z(et,f.coord);else{let bt=ct%2===1?1:-1,Bt=Math.ceil(ct/2);z(et,f.coord+bt*Bt*Re*0.5)}ct++}let it=0;for(let et of Q)it++,z(et,f.coord+it*Re)}}for(let[f,M]of i.entries()){let v=l[f]??[];if(v.length===0)continue;let A=[],T=c.get(M.start),k=c.get(M.end),{pSrcPort:K,pDstPort:Q}=nt(f,T,k),j=v.map((ct)=>{let it=g[ct],et=X.get(`${it.edgeIndex}-${it.segmentIndex}`)??it.pipe.coord;return{orient:it.orientation,coord:et,from:it.from,to:it.to}});A.push(K);for(let ct=0;ct<j.length;ct++){let it=j[ct],et=A[A.length-1],bt=it.orient==="vertical"?et.y:et.x,Bt=it.orient==="vertical"?et.x:et.y,At=j[ct+1],Xt=ct<j.length-1;if(Math.abs(Bt-it.coord)>ft)A.push(Cn(it,bt));if(Xt&&At.orient===it.orient){if(Math.abs(it.coord-At.coord)>ft){let Qt=it.orient==="vertical"?(bt+At.from)/2:co(it,At);A.push(Cn(it,Qt),Cn(At,Qt))}else if(ct===0||ct===j.length-2)A.push(Cn(it,co(it,At)))}else if(Xt)A.push(Cn(it,At.coord));else{let Qt=Math.abs(it.from-bt)<Math.abs(it.to-bt)?it.to:it.from;A.push(Cn(it,Qt))}}let z=A[A.length-1];if(Math.abs(z.x-Q.x)>ft||Math.abs(z.y-Q.y)>ft)A.push(Q);let rt=[];if(A.length>0)rt.push(A[0]);for(let ct=1;ct<A.length;ct++){let it=A[ct],et=rt[rt.length-1];if(Math.abs(it.x-et.x)>ft||Math.abs(it.y-et.y)>ft)rt.push(it)}M.points=rt}for(let f of i){let M=f.__originalEdge;if(M&&f.points)M.points=f.points}t.edges=(t.edges??[]).filter((f)=>!f.isLayoutOnly);let W=e((f,M)=>{let v=M.x??0,A=M.y??0,T=M.width??0,k=M.height??0;if(T<=0||k<=0)return f;let K=v-T/2,Q=v+T/2,j=A-k/2,z=A+k/2;if(f.x<K||f.x>Q||f.y<j||f.y>z)return f;let rt=f.x-K,ct=Q-f.x,it=f.y-j,et=z-f.y,bt=Math.min(rt,ct,it,et);if(bt===rt)return{x:K,y:f.y};if(bt===ct)return{x:Q,y:f.y};if(bt===it)return{x:f.x,y:j};return{x:f.x,y:z}},"nodeBoundaryClamp");for(let f of t.edges){let M=f.points;if(!M||M.length<2)continue;let{start:v,end:A}=f,T=v?c.get(v):void 0,k=A?c.get(A):void 0;if(T)M[0]=W(M[0],T);if(k)M[M.length-1]=W(M[M.length-1],k)}return t}e(hr,"routeEdgesOrthogonal");function gr(t){return t.direction??"TB"}e(gr,"getSwimlaneDirection");function pr(t){let n=qo(t),o=t.config.flowchart?.nodeSpacing??40,s=t.config.flowchart?.rankSpacing??100,i=t.config.swimlane?.ignoreCrossLaneEdges??!0,c=t.config.swimlane?.optimizeRanksByCrossings??!0,a=t.config.swimlane?.automaticLaneOrdering??!1,u=gr(t),{ordered:h,coordinates:d}=ur(n,{nodeGap:o,layerGap:s,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:c,automaticLaneOrdering:a,direction:u});Jo(n,h,d,{nodeGap:o,layerGap:s});for(let m of t.edges??[])delete m.points;hr(t,u);for(let m of t.edges??[])if(!m.curve||m.curve==="basis")m.curve="rounded";return Ts(t,u),Rs(t),u}e(pr,"runSwimlaneLayoutCore");function mr(t){Ko(t);let n=Zo(t);t.nodes=n.nodes,t.edges=n.edges}e(mr,"prepareSwimlaneLayout");var oi=lr({prepareLayout:mr,runLayoutCore:pr,afterPaint:jo});export{oi as render};
@@ -0,0 +1 @@
1
+ import{st}from"./chunk-2j4m0bh1.js";export{st as default};
@@ -0,0 +1,84 @@
1
+ import{e,Yt,r,b,C,S,E,T,A,I,L,s,N,le,ae,ie,ft,he,ge}from"./chunk-y0m8hrwz.js";import{fe}from"./chunk-ss1bcb0n.js";import{oe}from"./chunk-hev4hq89.js";var He=function(){var t=e(function(X,l,o,h){for(o=o||{},h=X.length;h--;o[X[h]]=l);return o},"o"),d=[1,3],f=[1,4],m=[1,5],a=[1,6],u=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],q=[1,22],w=[2,7],R=[1,26],V=[1,27],v=[1,28],F=[1,29],P=[1,33],U=[1,34],Y=[1,35],B=[1,36],Q=[1,37],H=[1,38],K=[1,24],W=[1,31],j=[1,32],G=[1,30],g=[1,39],y=[1,40],k=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],J=[1,61],pe=[89,90],Ke=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],xe=[27,29],We=[1,70],je=[1,71],Ge=[1,72],ze=[1,73],Xe=[1,74],Je=[1,75],Ze=[1,76],be=[1,83],Z=[1,80],Re=[1,84],ke=[1,85],ye=[1,86],_e=[1,87],Se=[1,88],Ie=[1,89],Te=[1,90],Ne=[1,91],qe=[1,92],we=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],ee=[63,64],et=[1,101],tt=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],D=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],te=[1,110],se=[1,106],re=[1,107],ne=[1,108],ce=[1,109],ue=[1,111],Ce=[1,116],Ae=[1,117],Ve=[1,114],ve=[1,115],$e={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:e(function(l,o,h,n,p,i,Le){var c=i.length-1;switch(p){case 4:this.$=i[c].trim(),n.setAccTitle(this.$);break;case 5:case 6:this.$=i[c].trim(),n.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:n.setDirection("TB");break;case 18:n.setDirection("BT");break;case 19:n.setDirection("RL");break;case 20:n.setDirection("LR");break;case 21:n.addRequirement(i[c-3],i[c-4]);break;case 22:n.addRequirement(i[c-5],i[c-6]),n.setClass([i[c-5]],i[c-3]);break;case 23:n.setNewReqId(i[c-2]);break;case 24:n.setNewReqText(i[c-2]);break;case 25:n.setNewReqRisk(i[c-2]);break;case 26:n.setNewReqVerifyMethod(i[c-2]);break;case 29:this.$=n.RequirementType.REQUIREMENT;break;case 30:this.$=n.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=n.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=n.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=n.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=n.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=n.RiskLevel.LOW_RISK;break;case 36:this.$=n.RiskLevel.MED_RISK;break;case 37:this.$=n.RiskLevel.HIGH_RISK;break;case 38:this.$=n.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=n.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=n.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=n.VerifyType.VERIFY_TEST;break;case 42:n.addElement(i[c-3]);break;case 43:n.addElement(i[c-5]),n.setClass([i[c-5]],i[c-3]);break;case 44:n.setNewElementType(i[c-2]);break;case 45:n.setNewElementDocRef(i[c-2]);break;case 48:n.addRelationship(i[c-2],i[c],i[c-4]);break;case 49:n.addRelationship(i[c-2],i[c-4],i[c]);break;case 50:this.$=n.Relationships.CONTAINS;break;case 51:this.$=n.Relationships.COPIES;break;case 52:this.$=n.Relationships.DERIVES;break;case 53:this.$=n.Relationships.SATISFIES;break;case 54:this.$=n.Relationships.VERIFIES;break;case 55:this.$=n.Relationships.REFINES;break;case 56:this.$=n.Relationships.TRACES;break;case 57:this.$=i[c-2],n.defineClass(i[c-1],i[c]);break;case 58:n.setClass(i[c-1],i[c]);break;case 59:n.setClass([i[c-2]],i[c]);break;case 60:case 62:this.$=[i[c]];break;case 61:case 63:this.$=i[c-2].concat([i[c]]);break;case 64:this.$=i[c-2],n.setCssStyle(i[c-1],i[c]);break;case 65:this.$=[i[c]];break;case 66:i[c-2].push(i[c]),this.$=i[c-2];break;case 68:this.$=i[c-1]+i[c];break}},"anonymous"),table:[{3:1,4:2,6:d,9:f,11:m,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:d,9:f,11:m,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(u,[2,6]),{3:12,4:2,6:d,9:f,11:m,13:a},{1:[2,2]},{4:17,5:q,7:13,8:w,9:f,11:m,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:R,22:V,23:v,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:g,90:y},t(u,[2,4]),t(u,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:q,7:42,8:w,9:f,11:m,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:R,22:V,23:v,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:g,90:y},{4:17,5:q,7:43,8:w,9:f,11:m,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:R,22:V,23:v,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:g,90:y},{4:17,5:q,7:44,8:w,9:f,11:m,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:R,22:V,23:v,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:g,90:y},{4:17,5:q,7:45,8:w,9:f,11:m,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:R,22:V,23:v,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:g,90:y},{4:17,5:q,7:46,8:w,9:f,11:m,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:R,22:V,23:v,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:g,90:y},{4:17,5:q,7:47,8:w,9:f,11:m,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:R,22:V,23:v,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:g,90:y},{4:17,5:q,7:48,8:w,9:f,11:m,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:R,22:V,23:v,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:g,90:y},{4:17,5:q,7:49,8:w,9:f,11:m,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:R,22:V,23:v,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:g,90:y},{4:17,5:q,7:50,8:w,9:f,11:m,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:R,22:V,23:v,24:F,25:23,33:25,41:P,42:U,43:Y,44:B,45:Q,46:H,54:K,72:W,74:j,77:G,89:g,90:y},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(k,[2,17]),t(k,[2,18]),t(k,[2,19]),t(k,[2,20]),{30:60,33:62,75:J,89:g,90:y},{30:63,33:62,75:J,89:g,90:y},{30:64,33:62,75:J,89:g,90:y},t(pe,[2,29]),t(pe,[2,30]),t(pe,[2,31]),t(pe,[2,32]),t(pe,[2,33]),t(pe,[2,34]),t(Ke,[2,81]),t(Ke,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(xe,[2,79]),t(xe,[2,80]),{27:[1,67],29:[1,68]},t(xe,[2,85]),t(xe,[2,86]),{62:69,65:We,66:je,67:Ge,68:ze,69:Xe,70:Je,71:Ze},{62:77,65:We,66:je,67:Ge,68:ze,69:Xe,70:Je,71:Ze},{30:78,33:62,75:J,89:g,90:y},{73:79,75:be,76:Z,78:81,79:82,80:Re,81:ke,82:ye,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe},t(we,[2,60]),t(we,[2,62]),{73:93,75:be,76:Z,78:81,79:82,80:Re,81:ke,82:ye,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe},{30:94,33:62,75:J,76:Z,89:g,90:y},{5:[1,95]},{30:96,33:62,75:J,89:g,90:y},{5:[1,97]},{30:98,33:62,75:J,89:g,90:y},{63:[1,99]},t(ee,[2,50]),t(ee,[2,51]),t(ee,[2,52]),t(ee,[2,53]),t(ee,[2,54]),t(ee,[2,55]),t(ee,[2,56]),{64:[1,100]},t(k,[2,59],{76:Z}),t(k,[2,64],{76:et}),{33:103,75:[1,102],89:g,90:y},t(tt,[2,65],{79:104,75:be,80:Re,81:ke,82:ye,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe}),t(D,[2,67]),t(D,[2,69]),t(D,[2,70]),t(D,[2,71]),t(D,[2,72]),t(D,[2,73]),t(D,[2,74]),t(D,[2,75]),t(D,[2,76]),t(D,[2,77]),t(D,[2,78]),t(k,[2,57],{76:et}),t(k,[2,58],{76:Z}),{5:te,28:105,31:se,34:re,36:ne,38:ce,40:ue},{27:[1,112],76:Z},{5:Ce,40:Ae,56:113,57:Ve,59:ve},{27:[1,118],76:Z},{33:119,89:g,90:y},{33:120,89:g,90:y},{75:be,78:121,79:82,80:Re,81:ke,82:ye,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe},t(we,[2,61]),t(we,[2,63]),t(D,[2,68]),t(k,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:te,28:126,31:se,34:re,36:ne,38:ce,40:ue},t(k,[2,28]),{5:[1,127]},t(k,[2,42]),{32:[1,128]},{32:[1,129]},{5:Ce,40:Ae,56:130,57:Ve,59:ve},t(k,[2,47]),{5:[1,131]},t(k,[2,48]),t(k,[2,49]),t(tt,[2,66],{79:104,75:be,80:Re,81:ke,82:ye,83:_e,84:Se,85:Ie,86:Te,87:Ne,88:qe}),{33:132,89:g,90:y},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(k,[2,27]),{5:te,28:145,31:se,34:re,36:ne,38:ce,40:ue},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(k,[2,46]),{5:Ce,40:Ae,56:152,57:Ve,59:ve},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(k,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(k,[2,43]),{5:te,28:159,31:se,34:re,36:ne,38:ce,40:ue},{5:te,28:160,31:se,34:re,36:ne,38:ce,40:ue},{5:te,28:161,31:se,34:re,36:ne,38:ce,40:ue},{5:te,28:162,31:se,34:re,36:ne,38:ce,40:ue},{5:Ce,40:Ae,56:163,57:Ve,59:ve},{5:Ce,40:Ae,56:164,57:Ve,59:ve},t(k,[2,23]),t(k,[2,24]),t(k,[2,25]),t(k,[2,26]),t(k,[2,44]),t(k,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:e(function(l,o){if(o.recoverable)this.trace(l);else{var h=Error(l);throw h.hash=o,h}},"parseError"),parse:e(function(l){var o=this,h=[0],n=[],p=[null],i=[],Le=this.table,c="",Oe=0,st=0,it=0,ct=2,rt=1,ht=i.slice.call(arguments,1),_=Object.create(this.lexer),me={yy:{}};for(var Pe in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Pe))me.yy[Pe]=this.yy[Pe];if(_.setInput(l,me.yy),me.yy.lexer=_,me.yy.parser=this,typeof _.yylloc>"u")_.yylloc={};var Ue=_.yylloc;i.push(Ue);var ut=_.options&&_.options.ranges;if(typeof me.yy.parseError==="function")this.parseError=me.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function mt(M){h.length=h.length-2*M,p.length=p.length-M,i.length=i.length-M}e(mt,"popStack");function nt(){var M=n.pop()||_.lex()||rt;if(typeof M!=="number"){if(M instanceof Array)n=M,M=n.pop();M=o.symbols_[M]||M}return M}e(nt,"lex");var x,Ye,de,O,gt,Be,Ee={},Me,z,at,Fe;while(!0){if(de=h[h.length-1],this.defaultActions[de])O=this.defaultActions[de];else{if(x===null||typeof x>"u")x=nt();O=Le[de]&&Le[de][x]}if(typeof O>"u"||!O.length||!O[0]){var Qe="";Fe=[];for(Me in Le[de])if(this.terminals_[Me]&&Me>ct)Fe.push("'"+this.terminals_[Me]+"'");if(_.showPosition)Qe="Parse error on line "+(Oe+1)+`:
2
+ `+_.showPosition()+`
3
+ Expecting `+Fe.join(", ")+", got '"+(this.terminals_[x]||x)+"'";else Qe="Parse error on line "+(Oe+1)+": Unexpected "+(x==rt?"end of input":"'"+(this.terminals_[x]||x)+"'");this.parseError(Qe,{text:_.match,token:this.terminals_[x]||x,line:_.yylineno,loc:Ue,expected:Fe})}if(O[0]instanceof Array&&O.length>1)throw Error("Parse Error: multiple actions possible at state: "+de+", token: "+x);switch(O[0]){case 1:if(h.push(x),p.push(_.yytext),i.push(_.yylloc),h.push(O[1]),x=null,!Ye){if(st=_.yyleng,c=_.yytext,Oe=_.yylineno,Ue=_.yylloc,it>0)it--}else x=Ye,Ye=null;break;case 2:if(z=this.productions_[O[1]][1],Ee.$=p[p.length-z],Ee._$={first_line:i[i.length-(z||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(z||1)].first_column,last_column:i[i.length-1].last_column},ut)Ee._$.range=[i[i.length-(z||1)].range[0],i[i.length-1].range[1]];if(Be=this.performAction.apply(Ee,[c,st,Oe,me.yy,O[1],p,i].concat(ht)),typeof Be<"u")return Be;if(z)h=h.slice(0,-1*z*2),p=p.slice(0,-1*z),i=i.slice(0,-1*z);h.push(this.productions_[O[1]][0]),p.push(Ee.$),i.push(Ee._$),at=Le[h[h.length-2]][h[h.length-1]],h.push(at);break;case 3:return!0}}return!0},"parse")},ot=function(){var X={EOF:1,parseError:e(function(o,h){if(this.yy.parser)this.yy.parser.parseError(o,h);else throw Error(o)},"parseError"),setInput:e(function(l,o){if(this.yy=o||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:e(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var o=l.match(/(?:\r\n?|\n).*/g);if(o)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),l},"input"),unput:e(function(l){var o=l.length,h=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var n=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1)this.yylineno-=h.length-1;var p=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===n.length?this.yylloc.first_column:0)+n[n.length-h.length].length-h[0].length:this.yylloc.first_column-o},this.options.ranges)this.yylloc.range=[p[0],p[0]+this.yyleng-o];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(l){this.unput(this.match.slice(l))},"less"),pastInput:e(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var l=this.match;if(l.length<20)l+=this._input.substr(0,20-l.length);return(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var l=this.pastInput(),o=Array(l.length+1).join("-");return l+this.upcomingInput()+`
5
+ `+o+"^"},"showPosition"),test_match:e(function(l,o){var h,n,p;if(this.options.backtrack_lexer){if(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)p.yylloc.range=this.yylloc.range.slice(0)}if(n=l[0].match(/(?:\r\n?|\n).*/g),n)this.yylineno+=n.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],h=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(h)return h;else if(this._backtrack){for(var i in p)this[i]=p[i];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var l,o,h,n;if(!this._more)this.yytext="",this.match="";var p=this._currentRules();for(var i=0;i<p.length;i++)if(h=this._input.match(this.rules[p[i]]),h&&(!o||h[0].length>o[0].length)){if(o=h,n=i,this.options.backtrack_lexer)if(l=this.test_match(h,p[i]),l!==!1)return l;else if(this._backtrack){o=!1;continue}else return!1;else if(!this.options.flex)break}if(o){if(l=this.test_match(o,p[n]),l!==!1)return l;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var o=this.next();if(o)return o;else return this.lex()},"lex"),begin:e(function(o){this.conditionStack.push(o)},"begin"),popState:e(function(){var o=this.conditionStack.length-1;if(o>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(o){if(o=this.conditionStack.length-1-Math.abs(o||0),o>=0)return this.conditionStack[o];else return"INITIAL"},"topState"),pushState:e(function(o){this.begin(o)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(o,h,n,p){var i=p;switch(n){case 0:return"title";case 1:return this.begin("acc_title"),9;break;case 2:return this.popState(),"acc_title_value";break;case 3:return this.begin("acc_descr"),11;break;case 4:return this.popState(),"acc_descr_value";break;case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;break;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;break;case 60:return this.begin("style"),74;break;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return h.yytext=h.yytext.trim(),89;break;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return X}();$e.lexer=ot;function De(){this.yy={}}return e(De,"Parser"),De.prototype=$e,$e.Parser=De,new De}();He.parser=He;var dt=He,pt=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=S,this.getAccTitle=E,this.setAccDescription=T,this.getAccDescription=A,this.setDiagramTitle=I,this.getDiagramTitle=L,this.getConfig=e(()=>s().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}static{e(this,"RequirementDB")}getDirection(){return this.direction}setDirection(t){this.direction=t}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(t,d){if(!this.requirements.has(t))this.requirements.set(t,{name:t,type:d,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]});return this.resetLatestRequirement(),this.requirements.get(t)}getRequirements(){return this.requirements}setNewReqId(t){if(this.latestRequirement!==void 0)this.latestRequirement.requirementId=t}setNewReqText(t){if(this.latestRequirement!==void 0)this.latestRequirement.text=t}setNewReqRisk(t){if(this.latestRequirement!==void 0)this.latestRequirement.risk=t}setNewReqVerifyMethod(t){if(this.latestRequirement!==void 0)this.latestRequirement.verifyMethod=t}addElement(t){if(!this.elements.has(t))this.elements.set(t,{name:t,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),r.info("Added new element: ",t);return this.resetLatestElement(),this.elements.get(t)}getElements(){return this.elements}setNewElementType(t){if(this.latestElement!==void 0)this.latestElement.type=t}setNewElementDocRef(t){if(this.latestElement!==void 0)this.latestElement.docRef=t}addRelationship(t,d,f){this.relations.push({type:t,src:d,dst:f})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,C()}setCssStyle(t,d){for(let f of t){let m=this.requirements.get(f)??this.elements.get(f);if(!d||!m)return;for(let a of d)if(a.includes(","))m.cssStyles.push(...a.split(","));else m.cssStyles.push(a)}}setClass(t,d){for(let f of t){let m=this.requirements.get(f)??this.elements.get(f);if(m)for(let a of d){m.classes.push(a);let u=this.classes.get(a)?.styles;if(u)m.cssStyles.push(...u)}}}defineClass(t,d){for(let f of t){let m=this.classes.get(f);if(m===void 0)m={id:f,styles:[],textStyles:[]},this.classes.set(f,m);if(d)d.forEach(function(a){if(/color/.exec(a)){let u=a.replace("fill","bgFill");m.textStyles.push(u)}m.styles.push(a)});this.requirements.forEach((a)=>{if(a.classes.includes(f))a.cssStyles.push(...d.flatMap((u)=>u.split(",")))}),this.elements.forEach((a)=>{if(a.classes.includes(f))a.cssStyles.push(...d.flatMap((u)=>u.split(",")))})}}getClasses(){return this.classes}getData(){let t=s(),d=[],f=[];for(let a of this.requirements.values()){let u=a;u.id=a.name,u.cssStyles=a.cssStyles,u.cssClasses=a.classes.join(" "),u.shape="requirementBox",u.look=t.look,u.colorIndex=d.length,d.push(u)}for(let a of this.elements.values()){let u=a;u.shape="requirementBox",u.look=t.look,u.id=a.name,u.cssStyles=a.cssStyles,u.cssClasses=a.classes.join(" "),u.colorIndex=d.length,d.push(u)}let m=0;for(let a of this.relations){let u=a.type===this.Relationships.CONTAINS,q={id:`${a.src}-${a.dst}-${m++}`,start:this.requirements.get(a.src)?.name??this.elements.get(a.src)?.name,end:this.requirements.get(a.dst)?.name??this.elements.get(a.dst)?.name,label:`&lt;&lt;${a.type}&gt;&gt;`,classes:"relationshipLine",style:["fill:none",u?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:u?"normal":"dashed",arrowTypeStart:u?"requirement_contains":"",arrowTypeEnd:u?"":"requirement_arrow",look:t.look,labelType:"markdown"};f.push(q)}return{nodes:d,edges:f,other:{},config:t,direction:this.getDirection()}}},Et=e(()=>{let t=b(),{theme:d,themeVariables:f}=t,{bkgColorArray:m,borderColorArray:a}=f;if(!ae(d,a))return"";let u=ie(t.look),q="",w=le(m);for(let R=0;R<ft(a);R++){let V=a[R],v=w?`fill: ${m[R%m.length]};`:"";q+=`
7
+
8
+ [data-look="${u}"][data-color-id="color-${R}"].node path {
9
+ stroke: ${V};
10
+ ${v}
11
+ }
12
+
13
+ [data-look="${u}"][data-color-id="color-${R}"].node rect {
14
+ stroke: ${V};
15
+ ${v}
16
+ }
17
+ `}return q},"genColor"),bt=e((t)=>{let d=b(),{look:f,themeVariables:m}=d,{requirementEdgeLabelBackground:a}=m;return`
18
+ ${Et()}
19
+ marker {
20
+ fill: ${t.relationColor};
21
+ stroke: ${t.relationColor};
22
+ }
23
+
24
+ marker.cross {
25
+ stroke: ${t.lineColor};
26
+ }
27
+
28
+ svg {
29
+ font-family: ${t.fontFamily};
30
+ font-size: ${t.fontSize};
31
+ }
32
+
33
+ .reqBox {
34
+ fill: ${t.requirementBackground};
35
+ fill-opacity: 1.0;
36
+ stroke: ${t.requirementBorderColor};
37
+ stroke-width: ${t.requirementBorderSize};
38
+ }
39
+
40
+ .reqTitle, .reqLabel{
41
+ fill: ${t.requirementTextColor};
42
+ }
43
+ .reqLabelBox {
44
+ fill: ${t.relationLabelBackground};
45
+ fill-opacity: 1.0;
46
+ }
47
+
48
+ .req-title-line {
49
+ stroke: ${t.requirementBorderColor};
50
+ stroke-width: ${t.requirementBorderSize};
51
+ }
52
+ .relationshipLine {
53
+ stroke: ${t.relationColor};
54
+ stroke-width: ${f==="neo"?t.strokeWidth:"1px"};
55
+ }
56
+ .relationshipLabel {
57
+ fill: ${t.relationLabelColor};
58
+ }
59
+ .edgeLabel {
60
+ background-color: ${t.edgeLabelBackground};
61
+ }
62
+ .edgeLabel .label rect {
63
+ fill: ${t.edgeLabelBackground};
64
+ }
65
+ .edgeLabel .label text {
66
+ fill: ${t.relationLabelColor};
67
+ }
68
+ .divider {
69
+ stroke: ${t.nodeBorder};
70
+ stroke-width: 1;
71
+ }
72
+ .label {
73
+ font-family: ${t.fontFamily};
74
+ color: ${t.nodeTextColor||t.textColor};
75
+ }
76
+ .label text,span {
77
+ fill: ${t.nodeTextColor||t.textColor};
78
+ color: ${t.nodeTextColor||t.textColor};
79
+ }
80
+ .labelBkg {
81
+ background-color: ${a??t.edgeLabelBackground};
82
+ }
83
+
84
+ `},"getStyles"),Rt=bt,lt={};Yt(lt,{draw:()=>kt});var kt=e(async function(t,d,f,m){r.info("REF0:"),r.info("Drawing requirement diagram (unified)",d);let{securityLevel:a,state:u,layout:q,look:w}=s(),R=m.db.getData(),V=fe(d,a);R.type=m.type,R.layoutAlgorithm=ge(q),R.nodeSpacing=u?.nodeSpacing??50,R.rankSpacing=u?.rankSpacing??50,R.markers=w==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],R.diagramId=d,await he(R,V);let v=8;N.insertTitle(V,"requirementDiagramTitleText",u?.titleTopMargin??25,m.db.getDiagramTitle()),oe(V,v,"requirementDiagram",u?.useMaxWidth??!0)},"draw"),Mt={parser:dt,get db(){return new pt},renderer:lt,styles:Rt};export{Mt as diagram};
@@ -0,0 +1,24 @@
1
+ import{W}from"./chunk-b1pe46zz.js";import{e,r,we,D,b,B,C,S,E,T,A,I,L,p,q,Wr,k,U}from"./chunk-y0m8hrwz.js";import{Dt}from"./chunk-0mrkjnte.js";import{X}from"./chunk-taynqrgq.js";import{Xe}from"./chunk-20q90epj.js";import{oe}from"./chunk-hev4hq89.js";function je(t){var n=0,l=t.children,o=l&&l.length;if(!o)n=1;else while(--o>=0)n+=l[o].value;t.value=n}function ge(){return this.eachAfter(je)}function ye(t,n){let l=-1;for(let o of this)t.call(n,o,++l,this);return this}function xe(t,n){var l=this,o=[l],s,d,f=-1;while(l=o.pop())if(t.call(n,l,++f,this),s=l.children)for(d=s.length-1;d>=0;--d)o.push(s[d]);return this}function Se(t,n){var l=this,o=[l],s=[],d,f,h,v=-1;while(l=o.pop())if(s.push(l),d=l.children)for(f=0,h=d.length;f<h;++f)o.push(d[f]);while(l=s.pop())t.call(n,l,++v,this);return this}function ve(t,n){let l=-1;for(let o of this)if(t.call(n,o,++l,this))return o}function be(t){return this.eachAfter(function(n){var l=+t(n.data)||0,o=n.children,s=o&&o.length;while(--s>=0)l+=o[s].value;n.value=l})}function Ce(t){return this.eachBefore(function(n){if(n.children)n.children.sort(t)})}function Te(t){var n=this,l=Ze(n,t),o=[n];while(n!==l)n=n.parent,o.push(n);var s=o.length;while(t!==l)o.splice(s,0,t),t=t.parent;return o}function Ze(t,n){if(t===n)return t;var l=t.ancestors(),o=n.ancestors(),s=null;t=l.pop(),n=o.pop();while(t===n)s=t,t=l.pop(),n=o.pop();return s}function Le(){var t=this,n=[t];while(t=t.parent)n.push(t);return n}function $e(){return Array.from(this)}function Ae(){var t=[];return this.eachBefore(function(n){if(!n.children)t.push(n)}),t}function Fe(){var t=this,n=[];return t.each(function(l){if(l!==t)n.push({source:l.parent,target:l})}),n}function*Ne(){var t=this,n,l=[t],o,s,d;do{n=l.reverse(),l=[];while(t=n.pop())if(yield t,o=t.children)for(s=0,d=o.length;s<d;++s)l.push(o[s])}while(l.length)}function re(t,n){if(t instanceof Map){if(t=[void 0,t],n===void 0)n=Ke}else if(n===void 0)n=Je;var l=new ce(t),o,s=[l],d,f,h,v;while(o=s.pop())if((f=n(o.data))&&(v=(f=Array.from(f)).length)){o.children=f;for(h=v-1;h>=0;--h)s.push(d=f[h]=new ce(f[h])),d.parent=o,d.depth=o.depth+1}return l.eachBefore(et)}function Ue(){return re(this).eachBefore(Qe)}function Je(t){return t.children}function Ke(t){return Array.isArray(t)?t[1]:null}function Qe(t){if(t.data.value!==void 0)t.value=t.data.value;t.data=t.data.data}function et(t){var n=0;do t.height=n;while((t=t.parent)&&t.height<++n)}function ce(t){this.data=t,this.depth=this.height=0,this.parent=null}ce.prototype=re.prototype={constructor:ce,count:ge,each:ye,eachAfter:Se,eachBefore:xe,find:ve,sum:be,sort:Ce,path:Te,ancestors:Le,descendants:$e,leaves:Ae,links:Fe,copy:Ue,[Symbol.iterator]:Ne};function Be(t){if(typeof t!=="function")throw Error();return t}function ne(){return 0}function Q(t){return function(){return t}}function ke(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Me(t,n,l,o,s){var d=t.children,f,h=-1,v=d.length,u=t.value&&(o-n)/t.value;while(++h<v)f=d[h],f.y0=l,f.y1=s,f.x0=n,f.x1=n+=f.value*u}function _e(t,n,l,o,s){var d=t.children,f,h=-1,v=d.length,u=t.value&&(s-l)/t.value;while(++h<v)f=d[h],f.x0=n,f.x1=o,f.y0=l,f.y1=l+=f.value*u}var tt=(1+Math.sqrt(5))/2;function at(t,n,l,o,s,d){var f=[],h=n.children,v,u,m=0,_=0,i=h.length,M,F,N=n.value,g,w,Y,O,ee,se,j;while(m<i){M=s-l,F=d-o;do g=h[_++].value;while(!g&&_<i);w=Y=g,se=Math.max(F/M,M/F)/(N*t),j=g*g*se,ee=Math.max(Y/j,j/w);for(;_<i;++_){if(g+=u=h[_].value,u<w)w=u;if(u>Y)Y=u;if(j=g*g*se,O=Math.max(Y/j,j/w),O>ee){g-=u;break}ee=O}if(f.push(v={value:g,dice:M<F,children:h.slice(m,_)}),v.dice)Me(v,l,o,s,N?o+=F*g/N:d);else _e(v,l,o,N?l+=M*g/N:s,d);N-=g,m=_}return f}var Ee=function t(n){function l(o,s,d,f,h){at(n,o,s,d,f,h)}return l.ratio=function(o){return t((o=+o)>1?o:1)},l}(tt);function fe(){var t=Ee,n=!1,l=1,o=1,s=[0],d=ne,f=ne,h=ne,v=ne,u=ne;function m(i){if(i.x0=i.y0=0,i.x1=l,i.y1=o,i.eachBefore(_),s=[0],n)i.eachBefore(ke);return i}function _(i){var M=s[i.depth],F=i.x0+M,N=i.y0+M,g=i.x1-M,w=i.y1-M;if(g<F)F=g=(F+g)/2;if(w<N)N=w=(N+w)/2;if(i.x0=F,i.y0=N,i.x1=g,i.y1=w,i.children){if(M=s[i.depth+1]=d(i)/2,F+=u(i)-M,N+=f(i)-M,g-=h(i)-M,w-=v(i)-M,g<F)F=g=(F+g)/2;if(w<N)N=w=(N+w)/2;t(i,F,N,g,w)}}return m.round=function(i){return arguments.length?(n=!!i,m):n},m.size=function(i){return arguments.length?(l=+i[0],o=+i[1],m):[l,o]},m.tile=function(i){return arguments.length?(t=Be(i),m):t},m.padding=function(i){return arguments.length?m.paddingInner(i).paddingOuter(i):m.paddingInner()},m.paddingInner=function(i){return arguments.length?(d=typeof i==="function"?i:Q(+i),m):d},m.paddingOuter=function(i){return arguments.length?m.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):m.paddingTop()},m.paddingTop=function(i){return arguments.length?(f=typeof i==="function"?i:Q(+i),m):f},m.paddingRight=function(i){return arguments.length?(h=typeof i==="function"?i:Q(+i),m):h},m.paddingBottom=function(i){return arguments.length?(v=typeof i==="function"?i:Q(+i),m):v},m.paddingLeft=function(i){return arguments.length?(u=typeof i==="function"?i:Q(+i),m):u},m}var Re=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=S,this.getAccTitle=E,this.setDiagramTitle=I,this.getDiagramTitle=L,this.getAccDescription=A,this.setAccDescription=T}static{e(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let t=D,n=b();return U({...t.treemap,...n.treemap??{}})}addNode(t,n){if(this.nodes.push(t),this.levels.set(t,n),n===0)this.outerNodes.push(t),this.root??=t}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,n){let l=this.classes.get(t)??{id:t,styles:[],textStyles:[]},o=n.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");if(o)o.forEach((s)=>{if(Wr(s))if(l?.textStyles)l.textStyles.push(s);else l.textStyles=[s];if(l?.styles)l.styles.push(s);else l.styles=[s]});this.classes.set(t,l)}getClasses(){return this.classes}getStylesForClass(t){return this.classes.get(t)?.styles??[]}clear(){C(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function We(t){if(!t.length)return[];let n=[],l=[];return t.forEach((o)=>{let s={name:o.name,children:o.type==="Leaf"?void 0:[]};if(s.classSelector=o?.classSelector,o?.cssCompiledStyles)s.cssCompiledStyles=o.cssCompiledStyles;if(o.type==="Leaf"&&o.value!==void 0)s.value=o.value;while(l.length>0&&l[l.length-1].level>=o.level)l.pop();if(l.length===0)n.push(s);else{let d=l[l.length-1].node;if(d.children)d.children.push(s);else d.children=[s]}if(o.type!=="Leaf")l.push({node:s,level:o.level})}),n}e(We,"buildHierarchy");var rt=e((t,n)=>{W(t,n);let l=[];for(let d of t.TreemapRows??[])if(d.$type==="ClassDefStatement")n.addClass(d.className??"",d.styleText??"");for(let d of t.TreemapRows??[]){let f=d.item;if(!f)continue;let h=d.indent?parseInt(d.indent):0,v=nt(f),u=f.classSelector?n.getStylesForClass(f.classSelector):[],m=u.length>0?u:void 0,_={level:h,name:v,type:f.$type,value:f.value,classSelector:f.classSelector,cssCompiledStyles:m};l.push(_)}let o=We(l),s=e((d,f)=>{for(let h of d)if(n.addNode(h,f),h.children&&h.children.length>0)s(h.children,f+1)},"addNodesRecursively");s(o,0)},"populate"),nt=e((t)=>t.name?String(t.name):"","getItemName"),He={parser:{yy:void 0},parse:e(async(t)=>{try{let l=await X("treemap",t);r.debug("Treemap AST:",l);let o=He.parser?.yy;if(!(o instanceof Re))throw Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");rt(l,o)}catch(n){throw r.error("Error parsing treemap:",n),n}},"parse")},lt=10,le=10,pe=25,ot=e((t,n,l,o)=>{let s=o.db,d=s.getConfig(),f=d.padding??lt,h=s.getDiagramTitle(),v=s.getRoot(),{themeVariables:u}=b();if(!v)return;let m=h?30:0,_=q(n),i=d.nodeWidth?d.nodeWidth*le:960,M=d.nodeHeight?d.nodeHeight*le:500,F=i,N=M+m;_.attr("viewBox",`0 0 ${F} ${N}`),B(_,N,F,d.useMaxWidth);let g;try{let a=d.valueFormat||",";if(a==="$0,0")g=e((c)=>"$"+Dt(",")(c),"valueFormat");else if(a.startsWith("$")&&a.includes(",")){let c=/\.\d+/.exec(a),y=c?c[0]:"";g=e((z)=>"$"+Dt(","+y)(z),"valueFormat")}else if(a.startsWith("$")){let c=a.substring(1);g=e((y)=>"$"+Dt(c||"")(y),"valueFormat")}else g=Dt(a)}catch(a){r.error("Error creating format function:",a),g=Dt(",")}let w=Xe().range(["transparent",u.cScale0,u.cScale1,u.cScale2,u.cScale3,u.cScale4,u.cScale5,u.cScale6,u.cScale7,u.cScale8,u.cScale9,u.cScale10,u.cScale11]),Y=Xe().range(["transparent",u.cScalePeer0,u.cScalePeer1,u.cScalePeer2,u.cScalePeer3,u.cScalePeer4,u.cScalePeer5,u.cScalePeer6,u.cScalePeer7,u.cScalePeer8,u.cScalePeer9,u.cScalePeer10,u.cScalePeer11]),O=Xe().range([u.cScaleLabel0,u.cScaleLabel1,u.cScaleLabel2,u.cScaleLabel3,u.cScaleLabel4,u.cScaleLabel5,u.cScaleLabel6,u.cScaleLabel7,u.cScaleLabel8,u.cScaleLabel9,u.cScaleLabel10,u.cScaleLabel11]);if(h)_.append("text").attr("x",F/2).attr("y",m/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);let ee=_.append("g").attr("transform",`translate(0, ${m})`).attr("class","treemapContainer"),se=re(v).sum((a)=>a.value??0).sort((a,c)=>(c.value??0)-(a.value??0)),ze=fe().size([i,M]).paddingTop((a)=>a.children&&a.children.length>0?pe+le:0).paddingInner(f).paddingLeft((a)=>a.children&&a.children.length>0?le:0).paddingRight((a)=>a.children&&a.children.length>0?le:0).paddingBottom((a)=>a.children&&a.children.length>0?le:0).round(!0)(se),Ie=ze.descendants().filter((a)=>a.children&&a.children.length>0),ie=ee.selectAll(".treemapSection").data(Ie).enter().append("g").attr("class","treemapSection").attr("transform",(a)=>`translate(${a.x0},${a.y0})`);if(ie.append("rect").attr("width",(a)=>a.x1-a.x0).attr("height",pe).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",0.6).attr("stroke-width",0.6).attr("style",(a)=>{if(a.depth===0)return"display: none;";return""}),ie.append("clipPath").attr("id",(a,c)=>`clip-section-${n}-${c}`).append("rect").attr("width",(a)=>Math.max(0,a.x1-a.x0-12)).attr("height",pe),ie.append("rect").attr("width",(a)=>a.x1-a.x0).attr("height",(a)=>a.y1-a.y0).attr("class",(a,c)=>`treemapSection section${c}`).attr("fill",(a)=>w(a.data.name)).attr("fill-opacity",0.6).attr("stroke",(a)=>Y(a.data.name)).attr("stroke-width",2).attr("stroke-opacity",0.4).attr("style",(a)=>{if(a.depth===0)return"display: none;";let c=k({cssCompiledStyles:a.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),ie.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",pe/2).attr("dominant-baseline","middle").text((a)=>a.depth===0?"":a.data.name).attr("font-weight","bold").attr("clip-path",(a,c)=>`url(#clip-section-${n}-${c})`).attr("style",(a)=>{if(a.depth===0)return"display: none;";let c="dominant-baseline: middle; font-size: 12px; fill:"+O(a.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",y=k({cssCompiledStyles:a.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).each(function(a){if(a.depth===0)return;let c=p(this),y=a.data.name;c.text(y);let z=a.x1-a.x0,P=6,V;if(d.showValues!==!1&&a.value){let H=z-10,K=30,Ge=10;V=H-30-10-P}else V=z-P-6;let x=Math.max(15,V),J=c.node();if(J.getComputedTextLength()>x){let K=y;while(K.length>0){if(K=y.substring(0,K.length-1),K.length===0){if(c.text("..."),J.getComputedTextLength()>x)c.text("");break}if(c.text(K+"..."),J.getComputedTextLength()<=x)break}}}),d.showValues!==!1)ie.append("text").attr("class","treemapSectionValue").attr("x",(a)=>a.x1-a.x0-10).attr("y",pe/2).attr("text-anchor","end").attr("dominant-baseline","middle").text((a)=>a.value?g(a.value):"").attr("font-style","italic").attr("style",(a)=>{if(a.depth===0)return"display: none;";let c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+O(a.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",y=k({cssCompiledStyles:a.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")});let De=ze.leaves(),G=De.length>20,Oe=G?16:38,de=G?14:28,te=G?4:8,ae=G?4:6,he=G?2:4,Ve=G?8:10,me=G?1:2,ue=ee.selectAll(".treemapLeafGroup").data(De).enter().append("g").attr("class",(a,c)=>`treemapNode treemapLeafGroup leaf${c}${a.data.classSelector?` ${a.data.classSelector}`:""}x`).attr("transform",(a)=>`translate(${a.x0},${a.y0})`);if(ue.append("rect").attr("width",(a)=>a.x1-a.x0).attr("height",(a)=>a.y1-a.y0).attr("class","treemapLeaf").attr("fill",(a)=>a.parent?w(a.parent.data.name):w(a.data.name)).attr("style",(a)=>k({cssCompiledStyles:a.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",0.3).attr("stroke",(a)=>a.parent?w(a.parent.data.name):w(a.data.name)).attr("stroke-width",3),ue.append("clipPath").attr("id",(a,c)=>`clip-${n}-${c}`).append("rect").attr("width",(a)=>Math.max(0,a.x1-a.x0-4)).attr("height",(a)=>Math.max(0,a.y1-a.y0-4)),ue.append("text").attr("class","treemapLabel").attr("x",(a)=>(a.x1-a.x0)/2).attr("y",(a)=>(a.y1-a.y0)/2).attr("style",(a)=>{let c=`text-anchor: middle; dominant-baseline: middle; font-size: ${Oe}px;fill:`+O(a.data.name)+";",y=k({cssCompiledStyles:a.data.cssCompiledStyles});return c+y.labelStyles.replace("color:","fill:")}).attr("clip-path",(a,c)=>`url(#clip-${n}-${c})`).text((a)=>a.data.name).each(function(a){let c=p(this),y=a.x1-a.x0,z=a.y1-a.y0,P=c.node(),V=y-2*he,Z=z-2*he;if(V<Ve||Z<Ve){c.style("display","none");return}let x=parseInt(c.style("font-size"),10),J=0.6;while(P.getComputedTextLength()>V&&x>te)x--,c.style("font-size",`${x}px`);let R=Math.max(ae,Math.min(de,Math.round(x*J))),H=x+me+R;while(H>Z&&x>te){if(x--,R=Math.max(ae,Math.min(de,Math.round(x*J))),R<ae&&x===te)break;if(c.style("font-size",`${x}px`),H=x+me+R,R<=ae&&H>Z);}if(c.style("font-size",`${x}px`),G){if(x<te||Z<te)c.style("display","none")}else if(P.getComputedTextLength()>V||x<te||Z<x)c.style("display","none")}),d.showValues!==!1)ue.append("text").attr("class","treemapValue").attr("x",(c)=>(c.x1-c.x0)/2).attr("y",function(c){return(c.y1-c.y0)/2}).attr("style",(c)=>{let y=`text-anchor: middle; dominant-baseline: hanging; font-size: ${de}px;fill:`+O(c.data.name)+";",z=k({cssCompiledStyles:c.data.cssCompiledStyles});return y+z.labelStyles.replace("color:","fill:")}).attr("clip-path",(c,y)=>`url(#clip-${n}-${y})`).text((c)=>c.value?g(c.value):"").each(function(c){let y=p(this),z=this.parentNode;if(!z){y.style("display","none");return}let P=p(z).select(".treemapLabel");if(P.empty()||P.style("display")==="none"){y.style("display","none");return}let V=parseFloat(P.style("font-size")),x=Math.max(ae,Math.min(de,Math.round(V*0.6)));y.style("font-size",`${x}px`);let R=(c.y1-c.y0)/2+V/2+me;y.attr("y",R);let H=c.x1-c.x0,Pe=c.y1-c.y0-4,Ye=H-2*he;if(y.node().getComputedTextLength()>Ye||R+x>Pe||x<ae)y.style("display","none");else y.style("display",null)});let qe=d.diagramPadding??8;oe(_,qe,"flowchart",d?.useMaxWidth||!1)},"draw"),st=e(function(t,n){return n.db.getClasses()},"getClasses"),it={draw:ot,getClasses:st},ct={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},pt=e(({treemap:t}={})=>{let n=we(),l=b(),o=U(n,l.themeVariables),s=U(ct,t),d=s.titleColor??o.titleColor,f=s.labelColor??o.textColor,h=s.valueColor??o.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${s.sectionStrokeColor};
4
+ stroke-width: ${s.sectionStrokeWidth};
5
+ fill: ${s.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${s.leafStrokeColor};
9
+ stroke-width: ${s.leafStrokeWidth};
10
+ fill: ${s.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${f};
14
+ font-size: ${s.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${h};
18
+ font-size: ${s.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${d};
22
+ font-size: ${s.titleFontSize};
23
+ }
24
+ `},"getStyles"),dt=pt,fa={parser:He,get db(){return new Re},renderer:it,styles:dt};export{fa as diagram};
@@ -0,0 +1 @@
1
+ import{_i}from"./chunk-taynqrgq.js";export{_i as createInfoServices};
@@ -0,0 +1 @@
1
+ import{e,r}from"./chunk-y0m8hrwz.js";import{K,Lt,It}from"./chunk-fk0dh93x.js";import{W}from"./chunk-b1pe46zz.js";import{ar,_t}from"./chunk-taynqrgq.js";var i=ar().RailroadEbnf.parser.LangiumParser,o=e((t)=>{let n=t.alternatives.map(m);if(n.length===1)return n[0];return{type:"choice",alternatives:n}},"transformChoice"),m=e((t)=>{let n=t.elements.map(p);if(n.length===1)return n[0];return{type:"sequence",elements:n}},"transformSequence"),s=e((t)=>{switch(t.$type){case"EbnfTerminal":return{type:"terminal",value:t.value};case"EbnfNonTerminal":return{type:"nonterminal",name:t.name};case"EbnfSpecial":return{type:"special",text:t.text};case"EbnfGroup":return o(t.element);case"EbnfOptional":return{type:"optional",element:o(t.element)};case"EbnfRepetition":return{type:"repetition",element:o(t.element),min:0,max:1/0};default:throw Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),l=e((t,n)=>{switch(n.$type){case"EbnfOptionalPostfix":return{type:"optional",element:t};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:t,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:t,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[t,{type:"terminal",value:"-"},s(n.except)]};default:throw Error(`Unsupported EBNF postfix node: ${n.$type}`)}},"transformPostfix"),p=e((t)=>t.postfixes.reduce((n,a)=>l(n,a),s(t.base)),"transformTerm"),f=e((t)=>({name:t.name,definition:o(t.definition)}),"transformRule"),u=e((t)=>{if(W(t,K),t.title)K.setTitle(t.title);t.rules.map((n)=>K.addRule(f(n)))},"populateDb"),c={parse:e((t)=>{K.clear(),r.debug("[EBNF Parser] Starting Langium parse");let n=i.parse(t);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new _t(n);let a=n.value;r.debug("[EBNF Parser] Parsed rules:",a.rules.length),u(a),r.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:K}},x={parser:c,db:K,renderer:It,styles:Lt};export{x as diagram};
@@ -0,0 +1,2 @@
1
+ import{J,Oi,Ve,Ln,co,La,Bt,zn,Be,Tr,Vr,Un,uo,$i,jn}from"./chunk-y0m8hrwz.js";function k(l){return l.innerRadius}function b(l){return l.outerRadius}function _(l){return l.startAngle}function nn(l){return l.endAngle}function en(l){return l&&l.padAngle}function rn(l,d,q,P,x,h,S,r){var D=q-l,a=P-d,n=S-x,y=r-h,u=y*D-n*a;if(u*u<Be)return;return u=(n*(d-h)-y*(l-x))/u,[l+u*D,d+u*a]}function M(l,d,q,P,x,h,S){var r=l-q,D=d-P,a=(S?h:-h)/zn(r*r+D*D),n=a*D,y=-a*r,u=l+n,s=d+y,t=q+n,f=P+y,j=(u+t)/2,o=(s+f)/2,g=t-u,c=f-s,v=g*g+c*c,A=x-h,R=u*f-t*s,E=(c<0?-1:1)*zn(co(0,A*A*v-R*R)),I=(R*c-g*E)/v,O=(-R*g-c*E)/v,T=(R*c+g*E)/v,m=(-R*g+c*E)/v,p=I-j,e=O-o,i=T-j,z=m-o;if(p*p+e*e>i*i+z*z)I=T,O=m;return{cx:I,cy:O,x01:-n,y01:-y,x11:I*(x/A-1),y11:O*(x/A-1)}}function bt(){var l=k,d=b,q=J(0),P=null,x=_,h=nn,S=en,r=null,D=jn(a);function a(){var n,y,u=+l.apply(this,arguments),s=+d.apply(this,arguments),t=x.apply(this,arguments)-Vr,f=h.apply(this,arguments)-Vr,j=Oi(f-t),o=f>t;if(!r)r=n=D();if(s<u)y=s,s=u,u=y;if(!(s>Be))r.moveTo(0,0);else if(j>Un-Be){if(r.moveTo(s*Ln(t),s*Bt(t)),r.arc(0,0,s,t,f,!o),u>Be)r.moveTo(u*Ln(f),u*Bt(f)),r.arc(0,0,u,f,t,o)}else{var g=t,c=f,v=t,A=f,R=j,E=j,I=S.apply(this,arguments)/2,O=I>Be&&(P?+P.apply(this,arguments):zn(u*u+s*s)),T=La(Oi(s-u)/2,+q.apply(this,arguments)),m=T,p=T,e,i;if(O>Be){var z=$i(O/u*Bt(I)),F=$i(O/s*Bt(I));if((R-=z*2)>Be)z*=o?1:-1,v+=z,A-=z;else R=0,v=A=(t+f)/2;if((E-=F*2)>Be)F*=o?1:-1,g+=F,c-=F;else E=0,g=c=(t+f)/2}var B=s*Ln(g),C=s*Bt(g),G=u*Ln(A),H=u*Bt(A);if(T>Be){var K=s*Ln(c),L=s*Bt(c),N=u*Ln(v),Q=u*Bt(v),w;if(j<Tr)if(w=rn(B,C,N,Q,K,L,G,H)){var U=B-w[0],V=C-w[1],W=K-w[0],X=L-w[1],Y=1/Bt(uo((U*W+V*X)/(zn(U*U+V*V)*zn(W*W+X*X)))/2),Z=zn(w[0]*w[0]+w[1]*w[1]);m=La(T,(u-Z)/(Y-1)),p=La(T,(s-Z)/(Y+1))}else m=p=0}if(!(E>Be))r.moveTo(B,C);else if(p>Be)if(e=M(N,Q,B,C,s,p,o),i=M(K,L,G,H,s,p,o),r.moveTo(e.cx+e.x01,e.cy+e.y01),p<T)r.arc(e.cx,e.cy,p,Ve(e.y01,e.x01),Ve(i.y01,i.x01),!o);else r.arc(e.cx,e.cy,p,Ve(e.y01,e.x01),Ve(e.y11,e.x11),!o),r.arc(0,0,s,Ve(e.cy+e.y11,e.cx+e.x11),Ve(i.cy+i.y11,i.cx+i.x11),!o),r.arc(i.cx,i.cy,p,Ve(i.y11,i.x11),Ve(i.y01,i.x01),!o);else r.moveTo(B,C),r.arc(0,0,s,g,c,!o);if(!(u>Be)||!(R>Be))r.lineTo(G,H);else if(m>Be)if(e=M(G,H,K,L,u,-m,o),i=M(B,C,N,Q,u,-m,o),r.lineTo(e.cx+e.x01,e.cy+e.y01),m<T)r.arc(e.cx,e.cy,m,Ve(e.y01,e.x01),Ve(i.y01,i.x01),!o);else r.arc(e.cx,e.cy,m,Ve(e.y01,e.x01),Ve(e.y11,e.x11),!o),r.arc(0,0,u,Ve(e.cy+e.y11,e.cx+e.x11),Ve(i.cy+i.y11,i.cx+i.x11),o),r.arc(i.cx,i.cy,m,Ve(i.y11,i.x11),Ve(i.y01,i.x01),!o);else r.arc(0,0,u,A,v,o)}if(r.closePath(),n)return r=null,n+""||null}return a.centroid=function(){var n=(+l.apply(this,arguments)+ +d.apply(this,arguments))/2,y=(+x.apply(this,arguments)+ +h.apply(this,arguments))/2-Tr/2;return[Ln(y)*n,Bt(y)*n]},a.innerRadius=function(n){return arguments.length?(l=typeof n==="function"?n:J(+n),a):l},a.outerRadius=function(n){return arguments.length?(d=typeof n==="function"?n:J(+n),a):d},a.cornerRadius=function(n){return arguments.length?(q=typeof n==="function"?n:J(+n),a):q},a.padRadius=function(n){return arguments.length?(P=n==null?null:typeof n==="function"?n:J(+n),a):P},a.startAngle=function(n){return arguments.length?(x=typeof n==="function"?n:J(+n),a):x},a.endAngle=function(n){return arguments.length?(h=typeof n==="function"?n:J(+n),a):h},a.padAngle=function(n){return arguments.length?(S=typeof n==="function"?n:J(+n),a):S},a.context=function(n){return arguments.length?(r=n==null?null:n,a):r},a}
2
+ export{bt};