@kabmo-labs/kabmo 0.39.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +363 -363
  3. package/dist/client/static/js/{CsvGrid-kfcp4sd6.js → CsvGrid-j9nvnhq1.js} +2 -2
  4. package/dist/client/static/js/{DocxView-atff5w38.js → DocxView-87gnpm81.js} +5 -5
  5. package/dist/client/static/js/{DrawioView-yfnq4c99.js → DrawioView-a351t8f8.js} +2 -2
  6. package/dist/client/static/js/ImageView-c139r891.js +1 -0
  7. package/dist/client/static/js/LayoutWrapper-08axzr3a.js +2 -0
  8. package/dist/client/static/js/{Modal-2xqd3sss.js → Modal-0weqfqvk.js} +17 -17
  9. package/dist/client/static/js/{PdfView-mk8paxt1.js → PdfView-n6bwcvc8.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-ner25qxn.js → SessionsView-awef8ehj.js} +1 -1
  11. package/dist/client/static/js/{SheetView-s6n3fawm.js → SheetView-k8ymr87w.js} +24 -24
  12. package/dist/client/static/js/{SvgPreview-8bxvz3ez.js → SvgPreview-5pcp444e.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-tvvz9fha.js → abnfDiagram-O67JEVCF-psav75bx.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-6rbq97t9.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-bybv3wg4.js → architectureDiagram-NJMV4G6O-9bk6ykn7.js} +3 -3
  16. package/dist/client/static/js/{astro-4ybhkc9b.js → astro-0rh34hha.js} +1 -1
  17. package/dist/client/static/js/bash-vv2ysp0a.js +1 -0
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-h3fs79x6.js → blockDiagram-BEXU5L5S-17xsf182.js} +5 -5
  19. package/dist/client/static/js/c-67jyc7sg.js +1 -0
  20. package/dist/client/static/js/{c4Diagram-YGBWAQC7-h8p3h54v.js → c4Diagram-YGBWAQC7-jn9j4n04.js} +2 -2
  21. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-q645r4q6.js → classDiagram-v2-NBCMYWYE-663z1g1r.js} +5 -5
  22. package/dist/client/static/js/{cose-bilkent-JH36ORCC-p4mm1zcv.js → cose-bilkent-JH36ORCC-vp4yvx8x.js} +1 -1
  23. package/dist/client/static/js/cpp-crfbnwv8.js +1 -0
  24. package/dist/client/static/js/css-983fbv00.js +1 -0
  25. package/dist/client/static/js/css-zj4qzw6r.js +1 -0
  26. package/dist/client/static/js/cynefin-OW5HDTMX-zafxcz2k.js +1 -0
  27. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-v2hbc3aq.js → cynefinDiagram-VND7K2PF-dagkrjbh.js} +1 -1
  28. package/dist/client/static/js/{dagre-6A5THRUB-4edpda33.js → dagre-6A5THRUB-8qgwpb5a.js} +2 -2
  29. package/dist/client/static/js/{diagram-22UHCM2B-b6gp813w.js → diagram-22UHCM2B-671xtp0d.js} +11 -11
  30. package/dist/client/static/js/{diagram-3UASUU5V-s1f3b0ng.js → diagram-3UASUU5V-8nn5fha8.js} +1 -1
  31. package/dist/client/static/js/{diagram-ATOU4E4O-ga06kjp5.js → diagram-ATOU4E4O-dnar0ktg.js} +3 -3
  32. package/dist/client/static/js/{diagram-CDSNMT55-wdbmv4td.js → diagram-CDSNMT55-bt0fhk7n.js} +3 -3
  33. package/dist/client/static/js/{diagram-MLGK6HIB-fkntefcq.js → diagram-MLGK6HIB-tp6dwxdb.js} +1 -1
  34. package/dist/client/static/js/{diagram-MPIPVDR6-k2zh7edp.js → diagram-MPIPVDR6-qgx8c8ee.js} +2 -2
  35. package/dist/client/static/js/{dockerfile-srcym0bs.js → dockerfile-hk0s4qaw.js} +1 -1
  36. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-4vc4vz9c.js → ebnfDiagram-ZINNZB2B-nmf9r33z.js} +1 -1
  37. package/dist/client/static/js/{elixir-v9bbxsgg.js → elixir-gpez1k9m.js} +1 -1
  38. package/dist/client/static/js/{elk-276RUBZZ-g2ppf1by.js → elk-276RUBZZ-dheh5ngz.js} +1 -1
  39. package/dist/client/static/js/{erDiagram-OPXOYQCR-rmnwkb5q.js → erDiagram-OPXOYQCR-8837mk18.js} +5 -5
  40. package/dist/client/static/js/{erlang-55r0skxa.js → erlang-w9gmf866.js} +1 -1
  41. package/dist/client/static/js/eventmodeling-NTZA5JFV-cq3dvz7e.js +1 -0
  42. package/dist/client/static/js/flowDiagram-KWPJA3E3-spzh2jxq.js +1 -0
  43. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-ptfvae64.js → ganttDiagram-FUAMR5RP-g68mvnje.js} +2 -2
  44. package/dist/client/static/js/{ghostty-web-2gt2tp72.js → ghostty-web-22pdvhta.js} +4 -4
  45. package/dist/client/static/js/gitGraph-4MIJSDKK-epgk26pj.js +1 -0
  46. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-ne9n3cyf.js → gitGraphDiagram-X574FWY7-ymk81cdj.js} +2 -2
  47. package/dist/client/static/js/graphql-dewsj5g1.js +1 -0
  48. package/dist/client/static/js/html-1cpe2xc8.js +1 -0
  49. package/dist/client/static/js/{index-dmd26a1y.js → index-018ehs1n.js} +1 -1
  50. package/dist/client/static/js/{index-442mbhwb.js → index-173x4bh0.js} +2 -2
  51. package/dist/client/static/js/{index-c1be3rva.js → index-2kg3r5jw.js} +2 -2
  52. package/dist/client/static/js/{index-gvkc9e32.js → index-4j1g7m8g.js} +1 -1
  53. package/dist/client/static/js/{index-7h5n5rz4.js → index-4j5jwb54.js} +2 -2
  54. package/dist/client/static/js/{index-8egjccbq.js → index-547h1b8j.js} +52 -52
  55. package/dist/client/static/js/{index-4pehdq5h.js → index-69xe17c1.js} +2 -2
  56. package/dist/client/static/js/{index-k5a6r25s.js → index-6wtx7a9x.js} +2 -2
  57. package/dist/client/static/js/{index-m3r0j562.js → index-8888hgj8.js} +5 -5
  58. package/dist/client/static/js/{index-8w2tx2k9.js → index-8ggxxp8c.js} +2 -2
  59. package/dist/client/static/js/{index-b08hx4tw.js → index-9wjnbb3q.js} +2 -2
  60. package/dist/client/static/js/{index-p89z1qmj.js → index-ag78jnva.js} +1 -1
  61. package/dist/client/static/js/{index-xrp2zv8z.js → index-agdbjh5k.js} +2 -2
  62. package/dist/client/static/js/index-aznkfx1z.js +2 -0
  63. package/dist/client/static/js/{index-cfnxda13.js → index-b612vske.js} +2 -2
  64. package/dist/client/static/js/{index-k3c3n69j.js → index-bdz08fe2.js} +12 -12
  65. package/dist/client/static/js/{index-ntx3bbmb.js → index-bgpcf3mr.js} +1 -1
  66. package/dist/client/static/js/index-bj3wn9je.js +1 -0
  67. package/dist/client/static/js/{index-7z63xr1s.js → index-c003wb3r.js} +1 -1
  68. package/dist/client/static/js/{index-5kvvb0zm.js → index-cccrappc.js} +2 -2
  69. package/dist/client/static/js/{index-k7sdsmgv.js → index-ce4vytm6.js} +2 -2
  70. package/dist/client/static/js/{index-2rs03vfy.js → index-d1vearmk.js} +2 -2
  71. package/dist/client/static/js/index-dhrp656p.js +1 -0
  72. package/dist/client/static/js/{index-k61tdd4a.js → index-dj7y2df7.js} +2 -2
  73. package/dist/client/static/js/{index-4wtr5wjp.js → index-ek4gwrm8.js} +2 -2
  74. package/dist/client/static/js/{index-mdxnhndy.js → index-ek7hqfp0.js} +2 -2
  75. package/dist/client/static/js/{index-drjtwfp5.js → index-fg965t62.js} +2 -2
  76. package/dist/client/static/js/{index-me7m3516.js → index-g10nr8m6.js} +5 -5
  77. package/dist/client/static/js/{index-4wvtar0v.js → index-gn92c6hp.js} +2 -2
  78. package/dist/client/static/js/{index-t6gznaxm.js → index-gx2xefdg.js} +2 -2
  79. package/dist/client/static/js/{index-q0bph5x0.js → index-haaz8t7e.js} +2 -2
  80. package/dist/client/static/js/{index-pr7gk5eq.js → index-harsfp4x.js} +10 -10
  81. package/dist/client/static/js/{index-3fw3sd10.js → index-j4ks5s41.js} +179 -179
  82. package/dist/client/static/js/{index-cst843zs.css → index-jqs23cc7.css} +1 -1
  83. package/dist/client/static/js/{index-ymp2wqtc.js → index-js81yrmy.js} +3 -3
  84. package/dist/client/static/js/{index-enmh3w27.js → index-jy91r3ap.js} +2 -2
  85. package/dist/client/static/js/{index-y2prm0xm.js → index-mxpgfj6p.js} +2 -2
  86. package/dist/client/static/js/{index-a7qccdq2.js → index-p2812ygk.js} +1 -1
  87. package/dist/client/static/js/index-pp6mss9b.js +3 -0
  88. package/dist/client/static/js/index-q1bqg4f6.js +1 -0
  89. package/dist/client/static/js/{index-v8vjh5jj.js → index-qnt118mp.js} +1 -1
  90. package/dist/client/static/js/index-qntpsp98.js +2 -0
  91. package/dist/client/static/js/{index-fjnkzk12.js → index-qsw5edtk.js} +5 -5
  92. package/dist/client/static/js/{index-ywpdhntc.js → index-qw5aqk2d.js} +1 -1
  93. package/dist/client/static/js/{index-9gepbvdt.js → index-r1fe56cn.js} +2 -2
  94. package/dist/client/static/js/{index-72289dgx.js → index-rc8wrs2a.js} +2 -2
  95. package/dist/client/static/js/index-rvjc19x7.js +2 -0
  96. package/dist/client/static/js/{index-9d6x1f3t.js → index-s78n0dtv.js} +2 -2
  97. package/dist/client/static/js/{index-c36pag9y.js → index-sj4y8kj2.js} +2 -2
  98. package/dist/client/static/js/{index-qsrw5c67.js → index-vv9ytx0t.js} +2 -2
  99. package/dist/client/static/js/{index-1sgad84m.js → index-vwc8pdy3.js} +2 -2
  100. package/dist/client/static/js/{index-8qgwj6m8.js → index-w130cs7d.js} +1 -1
  101. package/dist/client/static/js/{index-hh05xd1d.js → index-wsqgp9jw.js} +2 -2
  102. package/dist/client/static/js/{index-61qjr1k0.js → index-wv36ddd5.js} +48 -48
  103. package/dist/client/static/js/{index-56w8m083.js → index-wy05jt00.js} +2 -2
  104. package/dist/client/static/js/{index-0j518hqm.js → index-xf36nmbm.js} +2 -2
  105. package/dist/client/static/js/{index-xdqsqhnn.js → index-y5hxhr7q.js} +4 -4
  106. package/dist/client/static/js/{index-pzqsp5jw.js → index-y82bk3hr.js} +3 -3
  107. package/dist/client/static/js/{index-rj81xrvw.js → index-ys4t1am4.js} +2 -2
  108. package/dist/client/static/js/{index-y3qxrs90.js → index-yzg9mbsv.js} +2 -2
  109. package/dist/client/static/js/info-A6RAGUB7-0an46pag.js +1 -0
  110. package/dist/client/static/js/{infoDiagram-VRGFBTTK-ctfwcm3n.js → infoDiagram-VRGFBTTK-11trzn8c.js} +1 -1
  111. package/dist/client/static/js/ini-09e0scxh.js +1 -0
  112. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-b0b0pn4y.js → ishikawaDiagram-OU5B5YK6-8xnnymb5.js} +2 -2
  113. package/dist/client/static/js/java-vnaesxzs.js +1 -0
  114. package/dist/client/static/js/javascript-zegm06a1.js +1 -0
  115. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kdq12drs.js → journeyDiagram-ZHPQQLJL-wd47j0hy.js} +3 -3
  116. package/dist/client/static/js/json-g5ggnd94.js +1 -0
  117. package/dist/client/static/js/jsx-xz71aed4.js +1 -0
  118. package/dist/client/static/js/{julia-jhe2vd4f.js → julia-c2q0vwpd.js} +1 -1
  119. package/dist/client/static/js/{kanban-definition-PNTS6WVX-65x6xn2q.js → kanban-definition-PNTS6WVX-s5rgcp44.js} +4 -4
  120. package/dist/client/static/js/lua-e4wenyzt.js +1 -0
  121. package/dist/client/static/js/markdown-yv3p1p7m.js +1 -0
  122. package/dist/client/static/js/{mermaid.core-0fq63jpa.js → mermaid.core-9fxp8nt2.js} +7 -7
  123. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-p86myex3.js → mindmap-definition-NLK3R4M7-4fyewtst.js} +3 -3
  124. package/dist/client/static/js/one-dark-pro-ahch85zb.js +1 -0
  125. package/dist/client/static/js/one-light-9706jgqt.js +1 -0
  126. package/dist/client/static/js/packet-AYTQ26CC-5e397pav.js +1 -0
  127. package/dist/client/static/js/{pegDiagram-GJSIUBJH-p2hkk9xb.js → pegDiagram-GJSIUBJH-s2xe2e2k.js} +1 -1
  128. package/dist/client/static/js/{perl-qhj6tk7k.js → perl-6pa0tn3b.js} +1 -1
  129. package/dist/client/static/js/{php-arycc4w7.js → php-1zy994pz.js} +1 -1
  130. package/dist/client/static/js/pie-WAS4IAKB-0zzmzg64.js +1 -0
  131. package/dist/client/static/js/{pieDiagram-5QR66LMP-bza19wkx.js → pieDiagram-5QR66LMP-1szpjbzy.js} +2 -2
  132. package/dist/client/static/js/properties-0ag74bdj.js +1 -0
  133. package/dist/client/static/js/python-zsn5tdbj.js +1 -0
  134. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-bxqec9w1.js → quadrantDiagram-O4NWA36T-mv3ee2qa.js} +3 -3
  135. package/dist/client/static/js/r-mwtqhnw3.js +1 -0
  136. package/dist/client/static/js/radar-RG4KPBEZ-mtar9742.js +1 -0
  137. package/dist/client/static/js/railroad-74A4TZTK-d6a6j9fq.js +1 -0
  138. package/dist/client/static/js/railroad-abnf-HS5TGJTU-1257kd8x.js +1 -0
  139. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-v8b6qmas.js +1 -0
  140. package/dist/client/static/js/railroad-peg-WCYAUIDC-jxpbx410.js +1 -0
  141. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-1g3hx3sm.js → railroadDiagram-XR7U4H2S-hgdqjpm9.js} +1 -1
  142. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-qbjjm48v.js → requirementDiagram-PLB6GJNP-yrfjp9wx.js} +3 -3
  143. package/dist/client/static/js/{ruby-fb6zzevm.js → ruby-arvs7kz4.js} +1 -1
  144. package/dist/client/static/js/{rust-jatm47v6.js → rust-3ahjk339.js} +1 -1
  145. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-t2ythbh7.js → sankeyDiagram-IPEJSGJF-k7k871xa.js} +3 -3
  146. package/dist/client/static/js/{sass-fzs6a0kr.js → sass-cmkf7nwd.js} +1 -1
  147. package/dist/client/static/js/{scss-gdb52d0c.js → scss-x7ddw6gb.js} +1 -1
  148. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-mqsfek2j.js → sequenceDiagram-PO4LG4MO-gd80m0as.js} +7 -7
  149. package/dist/client/static/js/{sizeCapture-INFHLROL-xj67pgds.js → sizeCapture-INFHLROL-jv6p4834.js} +1 -1
  150. package/dist/client/static/js/sql-aczp05f2.js +1 -0
  151. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-gj4fezak.js → stateDiagram-v2-GCMORJYK-tvphxq2h.js} +3 -3
  152. package/dist/client/static/js/{svelte-8s3k6qjd.js → svelte-0hv6pak2.js} +1 -1
  153. package/dist/client/static/js/{swimlanes-2SLR337P-pgtdd1pk.js → swimlanes-2SLR337P-3dt7nxj2.js} +1 -1
  154. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-aqnh1hhp.js +8 -0
  155. package/dist/client/static/js/{timeline-definition-EJHVYXUP-q013vdd1.js → timeline-definition-EJHVYXUP-40vvf856.js} +4 -4
  156. package/dist/client/static/js/treeView-Q6P3EWNA-q3qr7ew7.js +1 -0
  157. package/dist/client/static/js/treemap-WGGIJYW6-zgbdydeq.js +1 -0
  158. package/dist/client/static/js/tsx-s1shkfg9.js +1 -0
  159. package/dist/client/static/js/typescript-htx9v6bf.js +1 -0
  160. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-7swsbqnq.js → usecaseDiagram-POWQR4AR-g1j5x0xh.js} +28 -28
  161. package/dist/client/static/js/{vennDiagram-UO4OBE2U-9dygxdxf.js → vennDiagram-UO4OBE2U-5b8789qk.js} +1 -1
  162. package/dist/client/static/js/{vue-k3f3chre.js → vue-zccj3qa5.js} +1 -1
  163. package/dist/client/static/js/wardley-WFR3VGLG-b230aajh.js +1 -0
  164. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-aaaa9kj3.js → wardleyDiagram-VNRHLVJA-c7x3za3w.js} +3 -3
  165. package/dist/client/static/js/xml-23y6pgvx.js +1 -0
  166. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-tamf39gx.js → xychartDiagram-PMCCYNJV-h0fy45tg.js} +3 -3
  167. package/dist/client/static/js/yaml-vrayja34.js +1 -0
  168. package/marketplace/plugins/command-runner/package.json +2 -2
  169. package/marketplace/plugins/command-runner/src/panel/Custom.test.tsx +1 -0
  170. package/marketplace/plugins/command-runner/src/panel/Groups.test.tsx +10 -0
  171. package/marketplace/plugins/command-runner/src/panel/Groups.tsx +24 -3
  172. package/marketplace/plugins/command-runner/src/panel/index.tsx +1 -0
  173. package/marketplace/plugins/command-runner/src/protocol.ts +10 -0
  174. package/marketplace/plugins/command-runner/src/server/discovery.test.ts +30 -0
  175. package/marketplace/plugins/command-runner/src/server/scan.ts +16 -3
  176. package/package.json +1 -1
  177. package/src/client/components/common/header-controls/MoreMenu.tsx +24 -14
  178. package/src/client/components/common/header-controls/index.test.tsx +22 -0
  179. package/src/client/components/common/header-controls/index.tsx +8 -2
  180. package/src/client/components/mobile/LayoutWrapper.tsx +19 -2
  181. package/src/client/components/mobile/RightSidebar.tsx +49 -1
  182. package/src/client/components/mobile/SessionSidebar.tsx +25 -1
  183. package/src/client/components/mobile/header-titlebar.test.tsx +17 -0
  184. package/src/client/components/mobile/mobile-main-view/Header.test.tsx +43 -0
  185. package/src/client/components/mobile/mobile-main-view/Header.tsx +30 -0
  186. package/src/client/components/mobile/mobile-session-sidebar/Dock.tsx +5 -1
  187. package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +12 -1
  188. package/src/client/components/mobile/panel-chips.test.tsx +13 -0
  189. package/src/client/components/mobile/panel-chips.tsx +9 -2
  190. package/src/client/components/settings/categories/connect-settings/DeviceTable.test.tsx +92 -0
  191. package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +22 -3
  192. package/src/client/components/workspace/git-panel/commit-modal/Header.test.tsx +21 -0
  193. package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +13 -9
  194. package/src/client/components/workspace/terminal-panel/focus-target.test.ts +121 -0
  195. package/src/client/components/workspace/terminal-panel/focus-target.ts +54 -0
  196. package/src/client/components/workspace/terminal-panel/index.tsx +7 -1
  197. package/src/client/components/workspace/terminal-panel/instance.ts +82 -0
  198. package/src/client/components/workspace/terminal-panel/mount.ts +22 -63
  199. package/src/client/components/workspace/terminal-panel/soft-keyboard.ts +29 -0
  200. package/src/client/hooks/ui/touch-device.ts +8 -3
  201. package/src/client/hooks/ui/visibility-menu-trigger.test.ts +155 -0
  202. package/src/client/hooks/ui/visibility-menu-trigger.ts +85 -0
  203. package/src/client/hooks/workspace/panel-visibility-menu.ts +50 -0
  204. package/src/client/lib/ui/soft-keyboard.test.ts +103 -0
  205. package/src/client/lib/ui/soft-keyboard.ts +90 -0
  206. package/src/server/lib/auth/guard.ts +8 -2
  207. package/src/server/lib/connect/devices.server.test.ts +70 -0
  208. package/src/server/lib/connect/devices.server.ts +43 -1
  209. package/src/server/lib/connect/last-connect.gate.test.ts +52 -0
  210. package/src/server/lib/terminal/attach-replay.test.ts +80 -17
  211. package/src/server/plugins/static.test.ts +23 -1
  212. package/src/server/plugins/static.ts +24 -1
  213. package/src/server/routes/connect/devices.ts +5 -4
  214. package/src/shared/lib/connect/types.ts +1 -0
  215. package/dist/client/static/js/ImageView-nreh25s0.js +0 -1
  216. package/dist/client/static/js/LayoutWrapper-0x1q1q5z.js +0 -2
  217. package/dist/client/static/js/architecture-7GRP2DOG-y0zb4vqa.js +0 -1
  218. package/dist/client/static/js/bash-k6p3y3pr.js +0 -1
  219. package/dist/client/static/js/c-ve09y19q.js +0 -1
  220. package/dist/client/static/js/cpp-vhqp7bcy.js +0 -1
  221. package/dist/client/static/js/css-77mvf0ca.js +0 -1
  222. package/dist/client/static/js/css-tys2rrny.js +0 -1
  223. package/dist/client/static/js/cynefin-OW5HDTMX-nt1ed192.js +0 -1
  224. package/dist/client/static/js/eventmodeling-NTZA5JFV-v4edaxx7.js +0 -1
  225. package/dist/client/static/js/flowDiagram-KWPJA3E3-jvrvhb9d.js +0 -1
  226. package/dist/client/static/js/gitGraph-4MIJSDKK-adzhec96.js +0 -1
  227. package/dist/client/static/js/graphql-g97hycb3.js +0 -1
  228. package/dist/client/static/js/html-2syect3n.js +0 -1
  229. package/dist/client/static/js/index-1jeyjqkh.js +0 -2
  230. package/dist/client/static/js/index-270y5r9k.js +0 -2
  231. package/dist/client/static/js/index-5a4w58r2.js +0 -1
  232. package/dist/client/static/js/index-878d61js.js +0 -1
  233. package/dist/client/static/js/index-dt22v9ns.js +0 -2
  234. package/dist/client/static/js/index-jkph8wqq.js +0 -3
  235. package/dist/client/static/js/index-mmsszqvn.js +0 -1
  236. package/dist/client/static/js/info-A6RAGUB7-2ye26vqn.js +0 -1
  237. package/dist/client/static/js/ini-7ffv28px.js +0 -1
  238. package/dist/client/static/js/java-4x5yky4a.js +0 -1
  239. package/dist/client/static/js/javascript-4kw2j9t3.js +0 -1
  240. package/dist/client/static/js/json-h3kwpty2.js +0 -1
  241. package/dist/client/static/js/jsx-jk20f0dr.js +0 -1
  242. package/dist/client/static/js/lua-k02dpxq8.js +0 -1
  243. package/dist/client/static/js/markdown-fhhg7ms6.js +0 -1
  244. package/dist/client/static/js/one-dark-pro-c4q810z4.js +0 -1
  245. package/dist/client/static/js/one-light-czk9dzya.js +0 -1
  246. package/dist/client/static/js/packet-AYTQ26CC-b0j3te0q.js +0 -1
  247. package/dist/client/static/js/pie-WAS4IAKB-28qq62fn.js +0 -1
  248. package/dist/client/static/js/properties-qhvcxc13.js +0 -1
  249. package/dist/client/static/js/python-3qsrs510.js +0 -1
  250. package/dist/client/static/js/r-z2ng7mza.js +0 -1
  251. package/dist/client/static/js/radar-RG4KPBEZ-fyrcbpyd.js +0 -1
  252. package/dist/client/static/js/railroad-74A4TZTK-9s62qncd.js +0 -1
  253. package/dist/client/static/js/railroad-abnf-HS5TGJTU-f7yjmhrk.js +0 -1
  254. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-sfrw8gkz.js +0 -1
  255. package/dist/client/static/js/railroad-peg-WCYAUIDC-4mm4cern.js +0 -1
  256. package/dist/client/static/js/sql-ypk53ntb.js +0 -1
  257. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-zk37paj9.js +0 -8
  258. package/dist/client/static/js/treeView-Q6P3EWNA-a5vgg4gz.js +0 -1
  259. package/dist/client/static/js/treemap-WGGIJYW6-ctqhajgg.js +0 -1
  260. package/dist/client/static/js/tsx-zy7hb2hw.js +0 -1
  261. package/dist/client/static/js/typescript-2hr53c8j.js +0 -1
  262. package/dist/client/static/js/wardley-WFR3VGLG-ns7e0fqf.js +0 -1
  263. package/dist/client/static/js/xml-p4742r9b.js +0 -1
  264. package/dist/client/static/js/yaml-qbckg671.js +0 -1
@@ -1,4 +1,4 @@
1
- import{t,l,p,H,da,Ng,Ur,uo,ma,Ds,po}from"./index-61qjr1k0.js";import{Mt,bn,nr,Yt,Rr,eo,ve,kt,gr,to,Ar,kl,_d,Sd,Td,bi,ia,Dd,yi,yn,ki,Fa,sa,xi,no,wi,Qd,Nd,xl,Pt,Rd,Ci,ro,Ei,wl,Cl,ao,Fd,El,Ld,yu,Fr,Bl,Md,Pd,Od,Un,Il,_l,Bi,$d,Sl,v,rr,Lr,Ot,oo,Oe}from"./index-1jeyjqkh.js";import{Cd,Ed,Ae,Es,kg,Bd,Uo}from"./index-mdxnhndy.js";import{hn}from"./index-t6gznaxm.js";var ur={};hn(ur,{default:()=>Z});var Pn=/\s/;function kn(r){var e=r.length;while(e--&&Pn.test(r.charAt(e)));return e}var Jr=kn;var Tn=/^\s+/;function Cn(r){return r?r.slice(0,Jr(r)+1).replace(Tn,""):r}var Zr=Cn;var $r=NaN,An=/^[-+]0x[0-9a-f]+$/i,Rn=/^0b[01]+$/i,Mn=/^0o[0-7]+$/i,jn=parseInt;function Bn(r){if(typeof r=="number")return r;if(Rr(r))return $r;if(kt(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=kt(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Zr(r);var n=Rn.test(r);return n||Mn.test(r)?jn(r.slice(2),n?2:8):An.test(r)?$r:+r}var Qr=Bn;var re=1/0,Dn=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function Fn(r){if(!r)return r===0?r:0;if(r=Qr(r),r===re||r===-re){var e=r<0?-1:1;return e*Dn}return r===r?r:0}var U=Fn;function Gn(r){var e=U(r),n=e%1;return e===e?n?e-n:e:0}var ee=Gn;var te=Object.create,Xn=function(){function r(){}return function(e){if(!kt(e))return{};if(te)return te(e);r.prototype=e;var n=new r;return r.prototype=void 0,n}}(),ne=Xn;function Vn(r,e){var n=-1,o=r.length;e||(e=Array(o));while(++n<o)e[n]=r[n];return e}var fr=Vn;function Yn(r,e,n){if(e=="__proto__"&&kl)kl(r,e,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[e]=n}var R=Yn;var zn=Object.prototype,Wn=zn.hasOwnProperty;function qn(r,e,n){var o=r[e];if(!(Wn.call(r,e)&&ia(o,n))||n===void 0&&!(e in r))R(r,e,n)}var M=qn;function Hn(r,e,n,o){var i=!n;n||(n={});var a=-1,f=e.length;while(++a<f){var s=e[a],u=o?o(n[s],r[s],s,n,r):void 0;if(u===void 0)u=r[s];if(i)R(n,s,u);else M(n,s,u)}return n}var P=Hn;function Kn(r,e,n){if(!kt(n))return!1;var o=typeof e;if(o=="number"?yn(n)&&bi(e,n.length):o=="string"&&(e in n))return ia(n[e],r);return!1}var T=Kn;function Jn(r){return yi(function(e,n){var o=-1,i=n.length,a=i>1?n[i-1]:void 0,f=i>2?n[2]:void 0;if(a=r.length>3&&typeof a=="function"?(i--,a):void 0,f&&T(n[0],n[1],f))a=i<3?void 0:a,i=1;e=Object(e);while(++o<i){var s=n[o];if(s)r(e,s,o,a)}return e})}var oe=Jn;function Zn(r){var e=[];if(r!=null)for(var n in Object(r))e.push(n);return e}var ie=Zn;var $n=Object.prototype,Qn=$n.hasOwnProperty;function io(r){if(!kt(r))return ie(r);var e=ki(r),n=[];for(var o in r)if(!(o=="constructor"&&(e||!Qn.call(r,o))))n.push(o);return n}var ae=io;function fo(r){return yn(r)?Qd(r,!0):ae(r)}var L=fo;function so(r){var e=r==null?0:r.length;return e?Cl(r,1):[]}var S=so;function co(r){return _d(Dd(r,void 0,S),r+"")}var fe=co;var lo=Nd(Object.getPrototypeOf,Object),V=lo;var mo="[object Object]",ho=Function.prototype,go=Object.prototype,se=ho.toString,vo=go.hasOwnProperty,bo=se.call(Object);function yo(r){if(!Yt(r)||nr(r)!=mo)return!1;var e=V(r);if(e===null)return!0;var n=vo.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&se.call(n)==bo}var ue=yo;var wo="\\ud800-\\udfff",_o="\\u0300-\\u036f",Eo="\\ufe20-\\ufe2f",xo="\\u20d0-\\u20ff",Oo=_o+Eo+xo,Lo="\\ufe0e\\ufe0f",Io="\\u200d",So=RegExp("["+Io+wo+Oo+Lo+"]");function No(r){return So.test(r)}var de=No;function Po(r,e){return r&&P(e,Pt(e),r)}var ce=Po;function ko(r,e){return r&&P(e,L(e),r)}var pe=ko;var ge=typeof ur=="object"&&ur&&!ur.nodeType&&ur,le=ge&&typeof sr=="object"&&sr&&!sr.nodeType&&sr,To=le&&le.exports===ge,me=To?Mt.Buffer:void 0,he=me?me.allocUnsafe:void 0;function Co(r,e){if(e)return r.slice();var n=r.length,o=he?he(n):new r.constructor(n);return r.copy(o),o}var Z=Co;function Ao(r,e){return P(r,El(r),e)}var be=Ao;var Ro=Object.getOwnPropertySymbols,Mo=!Ro?Fd:function(r){var e=[];while(r)wl(e,El(r)),r=V(r);return e},dr=Mo;function jo(r,e){return P(r,dr(r),e)}var ye=jo;function Bo(r){return Ld(r,L,dr)}var we=Bo;var Do=Object.prototype,Fo=Do.hasOwnProperty;function Go(r){var e=r.length,n=new r.constructor(e);if(e&&typeof r[0]=="string"&&Fo.call(r,"index"))n.index=r.index,n.input=r.input;return n}var _e=Go;function Xo(r){var e=new r.constructor(r.byteLength);return new Bl(e).set(new Bl(r)),e}var Y=Xo;function Vo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var Ee=Vo;var Yo=/\w*$/;function zo(r){var e=new r.constructor(r.source,Yo.exec(r));return e.lastIndex=r.lastIndex,e}var xe=zo;var Le=bn?bn.prototype:void 0,Ie=Le?Le.valueOf:void 0;function Wo(r){return Ie?Object(Ie.call(r)):{}}var Se=Wo;function qo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var cr=qo;var Ho="[object Boolean]",Ko="[object Date]",Jo="[object Map]",Zo="[object Number]",$o="[object RegExp]",Qo="[object Set]",ri="[object String]",ei="[object Symbol]",ti="[object ArrayBuffer]",ni="[object DataView]",oi="[object Float32Array]",ii="[object Float64Array]",ai="[object Int8Array]",fi="[object Int16Array]",si="[object Int32Array]",ui="[object Uint8Array]",di="[object Uint8ClampedArray]",ci="[object Uint16Array]",pi="[object Uint32Array]";function li(r,e,n){var o=r.constructor;switch(e){case ti:return Y(r);case Ho:case Ko:return new o(+r);case ni:return Ee(r,n);case oi:case ii:case ai:case fi:case si:case ui:case di:case ci:case pi:return cr(r,n);case Jo:return new o;case Zo:case ri:return new o(r);case $o:return xe(r);case Qo:return new o;case ei:return Se(r)}}var Ne=li;function mi(r){return typeof r.constructor=="function"&&!ki(r)?ne(V(r)):{}}var pr=mi;var hi="[object Map]";function gi(r){return Yt(r)&&Fr(r)==hi}var Pe=gi;var ke=no&&no.isMap,vi=ke?xi(ke):Pe,Te=vi;var _i="[object Set]";function Oi(r){return Yt(r)&&Fr(r)==_i}var Ce=Oi;var Re=no&&no.isSet,Li=Re?xi(Re):Ce,Me=Li;var Ii=1,Si=2,Ni=4,je="[object Arguments]",Pi="[object Array]",Ti="[object Boolean]",Ai="[object Date]",Ri="[object Error]",Be="[object Function]",Mi="[object GeneratorFunction]",ji="[object Map]",Di="[object Number]",De="[object Object]",Fi="[object RegExp]",Gi="[object Set]",Xi="[object String]",Ui="[object Symbol]",Vi="[object WeakMap]",Yi="[object ArrayBuffer]",zi="[object DataView]",Wi="[object Float32Array]",qi="[object Float64Array]",Hi="[object Int8Array]",Ki="[object Int16Array]",Ji="[object Int32Array]",Zi="[object Uint8Array]",$i="[object Uint8ClampedArray]",Qi="[object Uint16Array]",ra="[object Uint32Array]",x={};x[je]=x[Pi]=x[Yi]=x[zi]=x[Ti]=x[Ai]=x[Wi]=x[qi]=x[Hi]=x[Ki]=x[Ji]=x[ji]=x[Di]=x[De]=x[Fi]=x[Gi]=x[Xi]=x[Ui]=x[Zi]=x[$i]=x[Qi]=x[ra]=!0;x[Ri]=x[Be]=x[Vi]=!1;function lr(r,e,n,o,i,a){var f,s=e&Ii,u=e&Si,d=e&Ni;if(n)f=i?n(r,o,i,a):n(r);if(f!==void 0)return f;if(!kt(r))return r;var c=ve(r);if(c){if(f=_e(r),!s)return fr(r,f)}else{var m=Fr(r),h=m==Be||m==Mi;if(sa(r))return Z(r,s);if(m==De||m==je||h&&!i){if(f=u||h?{}:pr(r),!s)return u?ye(r,pe(f,r)):be(r,ce(f,r))}else{if(!x[m])return i?r:{};f=Ne(r,m,s)}}a||(a=new ao);var b=a.get(r);if(b)return b;if(a.set(r,f),Me(r))r.forEach(function(g){f.add(lr(g,e,n,g,r,a))});else if(Te(r))r.forEach(function(g,_){f.set(_,lr(g,e,n,_,r,a))});var w=d?u?we:yu:u?L:Pt,y=c?void 0:w(r);return Sd(y||r,function(g,_){if(y)_=g,g=r[_];M(f,_,lr(g,e,n,_,r,a))}),f}var Fe=lr;var ea=1,ta=4;function na(r){return Fe(r,ea|ta)}var Ge=na;var oa=function(){return Mt.Date.now()},_r=oa;var Xe=Object.prototype,aa=Xe.hasOwnProperty,fa=yi(function(r,e){r=Object(r);var n=-1,o=e.length,i=o>2?e[2]:void 0;if(i&&T(e[0],e[1],i))o=1;while(++n<o){var a=e[n],f=L(a),s=-1,u=f.length;while(++s<u){var d=f[s],c=r[d];if(c===void 0||ia(c,Xe[d])&&!aa.call(r,d))r[d]=a[d]}}return r}),Ue=fa;function ua(r,e,n){if(n!==void 0&&!ia(r[e],n)||n===void 0&&!(e in r))R(r,e,n)}var Q=ua;function ca(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var er=ca;function pa(r){return P(r,L(r))}var Ve=pa;function la(r,e,n,o,i,a,f){var s=er(r,n),u=er(e,n),d=f.get(u);if(d){Q(r,n,d);return}var c=a?a(s,u,n+"",r,e,f):void 0,m=c===void 0;if(m){var h=ve(u),b=!h&&sa(u),w=!h&&!b&&wi(u);if(c=u,h||b||w)if(ve(s))c=s;else if($d(s))c=fr(s);else if(b)m=!1,c=Z(u,!0);else if(w)m=!1,c=cr(u,!0);else c=[];else if(ue(u)||Fa(u)){if(c=s,Fa(s))c=Ve(s);else if(!kt(s)||to(s))c=pr(u)}else m=!1}if(m)f.set(u,c),i(c,u,o,a,f),f.delete(u);Q(r,n,c)}var Ye=la;function ze(r,e,n,o,i){if(r===e)return;Il(e,function(a,f){if(i||(i=new ao),kt(a))Ye(r,e,f,n,ze,o,i);else{var s=o?o(er(r,f),a,f+"",r,e,i):void 0;if(s===void 0)s=a;Q(r,f,s)}},L)}var We=ze;function ha(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var G=ha;function ga(r){return function(e,n,o){var i=Object(e);if(!yn(e)){var a=Un(n,3);e=Pt(e),n=function(s){return a(i[s],s,i)}}var f=r(e,n,o);return f>-1?i[a?e[f]:f]:void 0}}var qe=ga;var va=Math.max;function ba(r,e,n){var o=r==null?0:r.length;if(!o)return-1;var i=n==null?0:ee(n);if(i<0)i=va(o+i,0);return Td(r,Un(e,3),i)}var He=ba;var ya=qe(He),tr=ya;function wa(r,e){var n=-1,o=yn(r)?Array(r.length):[];return Bi(r,function(i,a,f){o[++n]=e(i,a,f)}),o}var mr=wa;function _a(r,e){var n=ve(r)?eo:mr;return n(r,Un(e,3))}var E=_a;function Ea(r,e){return r==null?r:Il(r,Sl(e),L)}var Ke=Ea;function xa(r,e){return r&&_l(r,Sl(e))}var Je=xa;function Oa(r,e){return r>e}var Ze=Oa;var La=Object.prototype,Ia=La.hasOwnProperty;function Sa(r,e){return r!=null&&Ia.call(r,e)}var $e=Sa;function Na(r,e){return r!=null&&Md(r,e,$e)}var hr=Na;var Pa="[object String]";function ka(r){return typeof r=="string"||!ve(r)&&Yt(r)&&nr(r)==Pa}var Qe=ka;function Ta(r,e){return r<e}var vr=Ta;function Ca(r,e){var n={};return e=Un(e,3),_l(r,function(o,i,a){R(n,i,e(o,i,a))}),n}var z=Ca;function Aa(r,e,n){var o=-1,i=r.length;while(++o<i){var a=r[o],f=e(a);if(f!=null&&(s===void 0?f===f&&!Rr(f):n(f,s)))var s=f,u=a}return u}var W=Aa;function Ra(r){return r&&r.length?W(r,gr,Ze):void 0}var I=Ra;var Ma=oe(function(r,e,n){We(r,e,n)}),or=Ma;function ja(r){return r&&r.length?W(r,gr,vr):void 0}var j=ja;function Ba(r,e){return r&&r.length?W(r,Un(e,2),vr):void 0}var q=Ba;function Da(r,e,n,o){if(!kt(r))return r;e=Ci(e,r);var i=-1,a=e.length,f=a-1,s=r;while(s!=null&&++i<a){var u=ro(e[i]),d=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(i!=f){var c=s[u];if(d=o?o(c,u,s):void 0,d===void 0)d=kt(c)?c:bi(e[i+1])?[]:{}}M(s,u,d),s=s[u]}return r}var rt=Da;function Ga(r,e,n){var o=-1,i=e.length,a={};while(++o<i){var f=e[o],s=Ei(r,f);if(n(s,f))rt(a,Ci(f,r),s)}return a}var et=Ga;function Xa(r,e){var n=r.length;r.sort(e);while(n--)r[n]=r[n].value;return r}var tt=Xa;function Ua(r,e){if(r!==e){var n=r!==void 0,o=r===null,i=r===r,a=Rr(r),f=e!==void 0,s=e===null,u=e===e,d=Rr(e);if(!s&&!d&&!a&&r>e||a&&f&&u&&!s&&!d||o&&f&&u||!n&&u||!i)return 1;if(!o&&!a&&!d&&r<e||d&&n&&i&&!o&&!a||s&&n&&i||!f&&i||!u)return-1}return 0}var nt=Ua;function Va(r,e,n){var o=-1,i=r.criteria,a=e.criteria,f=i.length,s=n.length;while(++o<f){var u=nt(i[o],a[o]);if(u){if(o>=s)return u;var d=n[o];return u*(d=="desc"?-1:1)}}return r.index-e.index}var ot=Va;function Ya(r,e,n){if(e.length)e=eo(e,function(a){if(ve(a))return function(f){return Ei(f,a.length===1?a[0]:a)};return a});else e=[gr];var o=-1;e=eo(e,xi(Un));var i=mr(r,function(a,f,s){var u=eo(e,function(d){return d(a)});return{criteria:u,index:++o,value:a}});return tt(i,function(a,f){return ot(a,f,n)})}var it=Ya;var za=Od("length"),at=za;var st="\\ud800-\\udfff",Wa="\\u0300-\\u036f",qa="\\ufe20-\\ufe2f",Ha="\\u20d0-\\u20ff",Ka=Wa+qa+Ha,Ja="\\ufe0e\\ufe0f",Za="["+st+"]",Er="["+Ka+"]",xr="\\ud83c[\\udffb-\\udfff]",$a="(?:"+Er+"|"+xr+")",ut="[^"+st+"]",dt="(?:\\ud83c[\\udde6-\\uddff]){2}",ct="[\\ud800-\\udbff][\\udc00-\\udfff]",Qa="\\u200d",pt=$a+"?",lt="["+Ja+"]?",rf="(?:"+Qa+"(?:"+[ut,dt,ct].join("|")+")"+lt+pt+")*",ef=lt+pt+rf,tf="(?:"+[ut+Er+"?",Er,dt,ct,Za].join("|")+")",ft=RegExp(xr+"(?="+xr+")|"+tf+ef,"g");function nf(r){var e=ft.lastIndex=0;while(ft.test(r))++e;return e}var mt=nf;function of(r){return de(r)?mt(r):at(r)}var ht=of;function af(r,e){return et(r,e,function(n,o){return Pd(r,o)})}var gt=af;var ff=fe(function(r,e){return r==null?{}:gt(r,e)}),K=ff;var{ceil:sf,max:uf}=Math;function df(r,e,n,o){var i=-1,a=uf(sf((e-r)/(n||1)),0),f=Array(a);while(a--)f[o?a:++i]=r,r+=n;return f}var vt=df;function cf(r){return function(e,n,o){if(o&&typeof o!="number"&&T(e,n,o))n=o=void 0;if(e=U(e),n===void 0)n=e,e=0;else n=U(n);return o=o===void 0?e<n?1:-1:U(o),vt(e,n,o,r)}}var bt=cf;var pf=bt(),N=pf;var lf="[object Map]",mf="[object Set]";function hf(r){if(r==null)return 0;if(yn(r))return Qe(r)?ht(r):r.length;var e=Fr(r);if(e==lf||e==mf)return r.size;return xl(r).length}var yt=hf;var gf=yi(function(r,e){if(r==null)return[];var n=e.length;if(n>1&&T(r,e[0],e[1]))e=[];else if(n>2&&T(e[0],e[1],e[2]))e=[e[0]];return it(r,Cl(e,1),[])}),C=gf;var vf=0;function bf(r){var e=++vf;return Rd(r)+e}var J=bf;function yf(r,e,n){var o=-1,i=r.length,a=e.length,f={};while(++o<i){var s=o<a?e[o]:void 0;n(f,r[o],s)}return f}var wt=yf;function wf(r,e){return wt(r||[],e||[],M)}var Or=wf;class Ir{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return _t(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)_t(r);r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){var r=[],e=this._sentinel,n=e._prev;while(n!==e)r.push(JSON.stringify(n,_f)),n=n._prev;return"["+r.join(", ")+"]"}}function _t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function _f(r,e){if(r!=="_next"&&r!=="_prev")return e}var Ef=Ar(1);function Et(r,e){if(r.nodeCount()<=1)return[];var n=Of(r,e||Ef),o=xf(n.graph,n.buckets,n.zeroIdx);return S(E(o,function(i){return r.outEdges(i.v,i.w)}))}function xf(r,e,n){var o=[],i=e[e.length-1],a=e[0],f;while(r.nodeCount()){while(f=a.dequeue())Sr(r,e,n,f);while(f=i.dequeue())Sr(r,e,n,f);if(r.nodeCount()){for(var s=e.length-2;s>0;--s)if(f=e[s].dequeue(),f){o=o.concat(Sr(r,e,n,f,!0));break}}}return o}function Sr(r,e,n,o,i){var a=i?[]:void 0;return v(r.inEdges(o.v),function(f){var s=r.edge(f),u=r.node(f.v);if(i)a.push({v:f.v,w:f.w});u.out-=s,Nr(e,n,u)}),v(r.outEdges(o.v),function(f){var s=r.edge(f),u=f.w,d=r.node(u);d.in-=s,Nr(e,n,d)}),r.removeNode(o.v),a}function Of(r,e){var n=new Oe,o=0,i=0;v(r.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),v(r.edges(),function(s){var u=n.edge(s.v,s.w)||0,d=e(s),c=u+d;n.setEdge(s.v,s.w,c),i=Math.max(i,n.node(s.v).out+=d),o=Math.max(o,n.node(s.w).in+=d)});var a=N(i+o+3).map(function(){return new Ir}),f=o+1;return v(n.nodes(),function(s){Nr(a,f,n.node(s))}),{graph:n,buckets:a,zeroIdx:f}}function Nr(r,e,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+e].enqueue(n)}function xt(r){var e=r.graph().acyclicer==="greedy"?Et(r,n(r)):Lf(r);v(e,function(o){var i=r.edge(o);r.removeEdge(o),i.forwardName=o.name,i.reversed=!0,r.setEdge(o.w,o.v,i,J("rev"))});function n(o){return function(i){return o.edge(i).weight}}}function Lf(r){var e=[],n={},o={};function i(a){if(Object.prototype.hasOwnProperty.call(o,a))return;o[a]=!0,n[a]=!0,v(r.outEdges(a),function(f){if(Object.prototype.hasOwnProperty.call(n,f.w))e.push(f);else i(f.w)}),delete n[a]}return v(r.nodes(),i),e}function Lt(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var o=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,o)}})}function k(r,e,n,o){var i;do i=J(o);while(r.hasNode(i));return n.dummy=e,r.setNode(i,n),i}function St(r){var e=new Oe().setGraph(r.graph());return v(r.nodes(),function(n){e.setNode(n,r.node(n))}),v(r.edges(),function(n){var o=e.edge(n.v,n.w)||{weight:0,minlen:1},i=r.edge(n);e.setEdge(n.v,n.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),e}function br(r){var e=new Oe({multigraph:r.isMultigraph()}).setGraph(r.graph());return v(r.nodes(),function(n){if(!r.children(n).length)e.setNode(n,r.node(n))}),v(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function Pr(r,e){var{x:n,y:o}=r,i=e.x-n,a=e.y-o,f=r.width/2,s=r.height/2;if(!i&&!a)throw Error("Not possible to find intersection inside of the rectangle");var u,d;if(Math.abs(a)*f>Math.abs(i)*s){if(a<0)s=-s;u=s*i/a,d=s}else{if(i<0)f=-f;u=f,d=f*a/i}return{x:n+u,y:o+d}}function B(r){var e=E(N(Tr(r)+1),function(){return[]});return v(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!Ot(i))e[i][o.order]=n}),e}function Nt(r){var e=j(E(r.nodes(),function(n){return r.node(n).rank}));v(r.nodes(),function(n){var o=r.node(n);if(hr(o,"rank"))o.rank-=e})}function Tt(r){var e=j(E(r.nodes(),function(a){return r.node(a).rank})),n=[];v(r.nodes(),function(a){var f=r.node(a).rank-e;if(!n[f])n[f]=[];n[f].push(a)});var o=0,i=r.graph().nodeRankFactor;v(n,function(a,f){if(Ot(a)&&f%i!==0)--o;else if(o)v(a,function(s){r.node(s).rank+=o})})}function kr(r,e,n,o){var i={width:0,height:0};if(arguments.length>=4)i.rank=n,i.order=o;return k(r,"border",i,e)}function Tr(r){return I(E(r.nodes(),function(e){var n=r.node(e).rank;if(!Ot(n))return n}))}function Ct(r,e){var n={lhs:[],rhs:[]};return v(r,function(o){if(e(o))n.lhs.push(o);else n.rhs.push(o)}),n}function At(r,e){var n=_r();try{return e()}finally{console.log(r+" time: "+(_r()-n)+"ms")}}function Rt(r,e){return e()}function Bt(r){function e(n){var o=r.children(n),i=r.node(n);if(o.length)v(o,e);if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,f=i.maxRank+1;a<f;++a)jt(r,"borderLeft","_bl",n,i,a),jt(r,"borderRight","_br",n,i,a)}}v(r.children(),e)}function jt(r,e,n,o,i,a){var f={width:0,height:0,rank:a,borderType:e},s=i[e][a-1],u=k(r,"border",f,n);if(i[e][a]=u,r.setParent(u,o),s)r.setEdge(s,u,{weight:1})}function Ft(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")Xt(r)}function Gt(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")If(r);if(e==="lr"||e==="rl")Sf(r),Xt(r)}function Xt(r){v(r.nodes(),function(e){Dt(r.node(e))}),v(r.edges(),function(e){Dt(r.edge(e))})}function Dt(r){var e=r.width;r.width=r.height,r.height=e}function If(r){v(r.nodes(),function(e){Cr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Cr),Object.prototype.hasOwnProperty.call(n,"y"))Cr(n)})}function Cr(r){r.y=-r.y}function Sf(r){v(r.nodes(),function(e){Mr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Mr),Object.prototype.hasOwnProperty.call(n,"x"))Mr(n)})}function Mr(r){var e=r.x;r.x=r.y,r.y=e}function Ut(r){r.graph().dummyChains=[],v(r.edges(),function(e){Pf(r,e)})}function Pf(r,e){var n=e.v,o=r.node(n).rank,i=e.w,a=r.node(i).rank,f=e.name,s=r.edge(e),u=s.labelRank;if(a===o+1)return;r.removeEdge(e);var d=void 0,c,m;for(m=0,++o;o<a;++m,++o){if(s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:o},c=k(r,"edge",d,"_d"),o===u)d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos;if(r.setEdge(n,c,{weight:s.weight},f),m===0)r.graph().dummyChains.push(c);n=c}r.setEdge(n,i,{weight:s.weight},f)}function Vt(r){v(r.graph().dummyChains,function(e){var n=r.node(e),o=n.edgeLabel,i;r.setEdge(n.edgeObj,o);while(n.dummy){if(i=r.successors(e)[0],r.removeNode(e),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height;e=i,n=r.node(e)}})}function ir(r){var e={};function n(o){var i=r.node(o);if(Object.prototype.hasOwnProperty.call(e,o))return i.rank;e[o]=!0;var a=j(E(r.outEdges(o),function(f){return n(f.w)-r.edge(f).minlen}));if(a===Number.POSITIVE_INFINITY||a===void 0||a===null)a=0;return i.rank=a}v(r.sources(),n)}function X(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function yr(r){var e=new Oe({directed:!1}),n=r.nodes()[0],o=r.nodeCount();e.setNode(n,{});var i,a;while(kf(e,r)<o)i=Tf(e,r),a=e.hasNode(i.v)?X(r,i):-X(r,i),Cf(e,r,a);return e}function kf(r,e){function n(o){v(e.nodeEdges(o),function(i){var a=i.v,f=o===a?i.w:a;if(!r.hasNode(f)&&!X(e,i))r.setNode(f,{}),r.setEdge(o,f,{}),n(f)})}return v(r.nodes(),n),r.nodeCount()}function Tf(r,e){return q(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return X(e,n)})}function Cf(r,e,n){v(r.nodes(),function(o){e.node(o).rank+=n})}var fh=Ar(1);var mh=Ar(1);jr.CycleException=ar;function jr(r){var e={},n={},o=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new ar;if(!Object.prototype.hasOwnProperty.call(e,a))n[a]=!0,e[a]=!0,v(r.predecessors(a),i),delete n[a],o.push(a)}if(v(r.sinks(),i),yt(e)!==r.nodeCount())throw new ar;return o}function ar(){}ar.prototype=Error();function wr(r,e,n){if(!ve(e))e=[e];var o=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],a={};return v(e,function(f){if(!r.hasNode(f))throw Error("Graph does not have node: "+f);Wt(r,f,n==="post",a,o,i)}),i}function Wt(r,e,n,o,i,a){if(!Object.prototype.hasOwnProperty.call(o,e)){if(o[e]=!0,!n)a.push(e);if(v(i(e),function(f){Wt(r,f,n,o,i,a)}),n)a.push(e)}}function Br(r,e){return wr(r,e,"post")}function Dr(r,e){return wr(r,e,"pre")}F.initLowLimValues=Xr;F.initCutValues=Gr;F.calcCutValue=Ht;F.leaveEdge=Jt;F.enterEdge=Zt;F.exchangeEdges=$t;function F(r){r=St(r),ir(r);var e=yr(r);Xr(e),Gr(e,r);var n,o;while(n=Jt(e))o=Zt(e,r,n),$t(e,r,n,o)}function Gr(r,e){var n=Br(r,r.nodes());n=n.slice(0,n.length-1),v(n,function(o){Bf(r,e,o)})}function Bf(r,e,n){var o=r.node(n),i=o.parent;r.edge(n,i).cutvalue=Ht(r,e,n)}function Ht(r,e,n){var o=r.node(n),i=o.parent,a=!0,f=e.edge(n,i),s=0;if(!f)a=!1,f=e.edge(i,n);return s=f.weight,v(e.nodeEdges(n),function(u){var d=u.v===n,c=d?u.w:u.v;if(c!==i){var m=d===a,h=e.edge(u).weight;if(s+=m?h:-h,Ff(r,n,c)){var b=r.edge(n,c).cutvalue;s+=m?-b:b}}}),s}function Xr(r,e){if(arguments.length<2)e=r.nodes()[0];Kt(r,{},1,e)}function Kt(r,e,n,o,i){var a=n,f=r.node(o);if(e[o]=!0,v(r.neighbors(o),function(s){if(!Object.prototype.hasOwnProperty.call(e,s))n=Kt(r,e,n,s,o)}),f.low=a,f.lim=n++,i)f.parent=i;else delete f.parent;return n}function Jt(r){return tr(r.edges(),function(e){return r.edge(e).cutvalue<0})}function Zt(r,e,n){var{v:o,w:i}=n;if(!e.hasEdge(o,i))o=n.w,i=n.v;var a=r.node(o),f=r.node(i),s=a,u=!1;if(a.lim>f.lim)s=f,u=!0;var d=rr(e.edges(),function(c){return u===qt(r,r.node(c.v),s)&&u!==qt(r,r.node(c.w),s)});return q(d,function(c){return X(e,c)})}function $t(r,e,n,o){var{v:i,w:a}=n;r.removeEdge(i,a),r.setEdge(o.v,o.w,{}),Xr(r),Gr(r,e),Df(r,e)}function Df(r,e){var n=tr(r.nodes(),function(i){return!e.node(i).parent}),o=Dr(r,n);o=o.slice(1),v(o,function(i){var a=r.node(i).parent,f=e.edge(i,a),s=!1;if(!f)f=e.edge(a,i),s=!0;e.node(i).rank=e.node(a).rank+(s?f.minlen:-f.minlen)})}function Ff(r,e,n){return r.hasEdge(e,n)}function qt(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Vr(r){switch(r.graph().ranker){case"network-simplex":Qt(r);break;case"tight-tree":Xf(r);break;case"longest-path":Gf(r);break;default:Qt(r)}}var Gf=ir;function Xf(r){ir(r),yr(r)}function Qt(r){F(r)}function rn(r){var e=k(r,"root",{},"_root"),n=Uf(r),o=I(Lr(n))-1,i=2*o+1;r.graph().nestingRoot=e,v(r.edges(),function(f){r.edge(f).minlen*=i});var a=Vf(r)+1;v(r.children(),function(f){en(r,e,i,a,o,n,f)}),r.graph().nodeRankFactor=i}function en(r,e,n,o,i,a,f){var s=r.children(f);if(!s.length){if(f!==e)r.setEdge(e,f,{weight:0,minlen:n});return}var u=kr(r,"_bt"),d=kr(r,"_bb"),c=r.node(f);if(r.setParent(u,f),c.borderTop=u,r.setParent(d,f),c.borderBottom=d,v(s,function(m){en(r,e,n,o,i,a,m);var h=r.node(m),b=h.borderTop?h.borderTop:m,w=h.borderBottom?h.borderBottom:m,y=h.borderTop?o:2*o,g=b!==w?1:i-a[f]+1;r.setEdge(u,b,{weight:y,minlen:g,nestingEdge:!0}),r.setEdge(w,d,{weight:y,minlen:g,nestingEdge:!0})}),!r.parent(f))r.setEdge(e,u,{weight:0,minlen:i+a[f]})}function Uf(r){var e={};function n(o,i){var a=r.children(o);if(a&&a.length)v(a,function(f){n(f,i+1)});e[o]=i}return v(r.children(),function(o){n(o,1)}),e}function Vf(r){return oo(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function tn(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,v(r.edges(),function(n){var o=r.edge(n);if(o.nestingEdge)r.removeEdge(n)})}function nn(r,e,n){var o={},i;v(n,function(a){var f=r.parent(a),s,u;while(f){if(s=r.parent(f),s)u=o[s],o[s]=f;else u=i,i=f;if(u&&u!==f){e.setEdge(u,f);return}f=s}})}function on(r,e,n){var o=zf(r),i=new Oe({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(a){return r.node(a)});return v(r.nodes(),function(a){var f=r.node(a),s=r.parent(a);if(f.rank===e||f.minRank<=e&&e<=f.maxRank){if(i.setNode(a),i.setParent(a,s||o),v(r[n](a),function(u){var d=u.v===a?u.w:u.v,c=i.edge(d,a),m=!Ot(c)?c.weight:0;i.setEdge(d,a,{weight:r.edge(u).weight+m})}),Object.prototype.hasOwnProperty.call(f,"minRank"))i.setNode(a,{borderLeft:f.borderLeft[e],borderRight:f.borderRight[e]})}}),i}function zf(r){var e;while(r.hasNode(e=J("_root")));return e}function an(r,e){var n=0;for(var o=1;o<e.length;++o)n+=Wf(r,e[o-1],e[o]);return n}function Wf(r,e,n){var o=Or(n,E(n,function(d,c){return c})),i=S(E(e,function(d){return C(E(r.outEdges(d),function(c){return{pos:o[c.w],weight:r.edge(c).weight}}),"pos")})),a=1;while(a<n.length)a<<=1;var f=2*a-1;a-=1;var s=E(Array(f),function(){return 0}),u=0;return v(i.forEach(function(d){var c=d.pos+a;s[c]+=d.weight;var m=0;while(c>0){if(c%2)m+=s[c+1];c=c-1>>1,s[c]+=d.weight}u+=d.weight*m})),u}function fn(r){var e={},n=rr(r.nodes(),function(s){return!r.children(s).length}),o=I(E(n,function(s){return r.node(s).rank})),i=E(N(o+1),function(){return[]});function a(s){if(hr(e,s))return;e[s]=!0;var u=r.node(s);i[u.rank].push(s),v(r.successors(s),a)}var f=C(n,function(s){return r.node(s).rank});return v(f,a),i}function sn(r,e){return E(e,function(n){var o=r.inEdges(n);if(!o.length)return{v:n};else{var i=oo(o,function(a,f){var s=r.edge(f),u=r.node(f.v);return{sum:a.sum+s.weight*u.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function un(r,e){var n={};v(r,function(i,a){var f=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};if(!Ot(i.barycenter))f.barycenter=i.barycenter,f.weight=i.weight}),v(e.edges(),function(i){var a=n[i.v],f=n[i.w];if(!Ot(a)&&!Ot(f))f.indegree++,a.out.push(n[i.w])});var o=rr(n,function(i){return!i.indegree});return qf(o)}function qf(r){var e=[];function n(a){return function(f){if(f.merged)return;if(Ot(f.barycenter)||Ot(a.barycenter)||f.barycenter>=a.barycenter)Hf(a,f)}}function o(a){return function(f){if(f.in.push(a),--f.indegree===0)r.push(f)}}while(r.length){var i=r.pop();e.push(i),v(i.in.reverse(),n(i)),v(i.out,o(i))}return E(rr(e,function(a){return!a.merged}),function(a){return K(a,["vs","i","barycenter","weight"])})}function Hf(r,e){var n=0,o=0;if(r.weight)n+=r.barycenter*r.weight,o+=r.weight;if(e.weight)n+=e.barycenter*e.weight,o+=e.weight;r.vs=e.vs.concat(r.vs),r.barycenter=n/o,r.weight=o,r.i=Math.min(e.i,r.i),e.merged=!0}function cn(r,e){var n=Ct(r,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),o=n.lhs,i=C(n.rhs,function(c){return-c.i}),a=[],f=0,s=0,u=0;o.sort(Kf(!!e)),u=dn(a,i,u),v(o,function(c){u+=c.vs.length,a.push(c.vs),f+=c.barycenter*c.weight,s+=c.weight,u=dn(a,i,u)});var d={vs:S(a)};if(s)d.barycenter=f/s,d.weight=s;return d}function dn(r,e,n){var o;while(e.length&&(o=G(e)).i<=n)e.pop(),r.push(o.vs),n++;return n}function Kf(r){return function(e,n){if(e.barycenter<n.barycenter)return-1;else if(e.barycenter>n.barycenter)return 1;return!r?e.i-n.i:n.i-e.i}}function Yr(r,e,n,o){var i=r.children(e),a=r.node(e),f=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,u={};if(f)i=rr(i,function(w){return w!==f&&w!==s});var d=sn(r,i);v(d,function(w){if(r.children(w.v).length){var y=Yr(r,w.v,n,o);if(u[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Zf(w,y)}});var c=un(d,n);Jf(c,u);var m=cn(c,o);if(f){if(m.vs=S([f,m.vs,s]),r.predecessors(f).length){var h=r.node(r.predecessors(f)[0]),b=r.node(r.predecessors(s)[0]);if(!Object.prototype.hasOwnProperty.call(m,"barycenter"))m.barycenter=0,m.weight=0;m.barycenter=(m.barycenter*m.weight+h.order+b.order)/(m.weight+2),m.weight+=2}}return m}function Jf(r,e){v(r,function(n){n.vs=S(n.vs.map(function(o){if(e[o])return e[o].vs;return o}))})}function Zf(r,e){if(!Ot(r.barycenter))r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight;else r.barycenter=e.barycenter,r.weight=e.weight}function mn(r){var e=Tr(r),n=pn(r,N(1,e+1),"inEdges"),o=pn(r,N(e-1,-1,-1),"outEdges"),i=fn(r);ln(r,i);var a=Number.POSITIVE_INFINITY,f;for(var s=0,u=0;u<4;++s,++u){$f(s%2?n:o,s%4>=2),i=B(r);var d=an(r,i);if(d<a)u=0,f=Ge(i),a=d}ln(r,f)}function pn(r,e,n){return E(e,function(o){return on(r,o,n)})}function $f(r,e){var n=new Oe;v(r,function(o){var i=o.graph().root,a=Yr(o,i,n,e);v(a.vs,function(f,s){o.node(f).order=s}),nn(o,n,a.vs)})}function ln(r,e){v(e,function(n){v(n,function(o,i){r.node(o).order=i})})}function gn(r){var e=rs(r);v(r.graph().dummyChains,function(n){var o=r.node(n),i=o.edgeObj,a=Qf(r,e,i.v,i.w),{path:f,lca:s}=a,u=0,d=f[u],c=!0;while(n!==i.w){if(o=r.node(n),c){while((d=f[u])!==s&&r.node(d).maxRank<o.rank)u++;if(d===s)c=!1}if(!c){while(u<f.length-1&&r.node(d=f[u+1]).minRank<=o.rank)u++;d=f[u]}r.setParent(n,d),n=r.successors(n)[0]}})}function Qf(r,e,n,o){var i=[],a=[],f=Math.min(e[n].low,e[o].low),s=Math.max(e[n].lim,e[o].lim),u,d;u=n;do u=r.parent(u),i.push(u);while(u&&(e[u].low>f||s>e[u].lim));d=u,u=o;while((u=r.parent(u))!==d)a.push(u);return{path:i.concat(a.reverse()),lca:d}}function rs(r){var e={},n=0;function o(i){var a=n;v(r.children(i),o),e[i]={low:a,lim:n++}}return v(r.children(),o),e}function es(r,e){var n={};function o(i,a){var f=0,s=0,u=i.length,d=G(a);return v(a,function(c,m){var h=ns(r,c),b=h?r.node(h).order:u;if(h||c===d)v(a.slice(s,m+1),function(w){v(r.predecessors(w),function(y){var g=r.node(y),_=g.order;if((_<f||b<_)&&!(g.dummy&&r.node(w).dummy))vn(n,y,w)})}),s=m+1,f=b}),a}return oo(e,o),n}function ts(r,e){var n={};function o(a,f,s,u,d){var c;v(N(f,s),function(m){if(c=a[m],r.node(c).dummy)v(r.predecessors(c),function(h){var b=r.node(h);if(b.dummy&&(b.order<u||b.order>d))vn(n,h,c)})})}function i(a,f){var s=-1,u,d=0;return v(f,function(c,m){if(r.node(c).dummy==="border"){var h=r.predecessors(c);if(h.length)u=r.node(h[0]).order,o(f,d,m,s,u),d=m,s=u}o(f,d,f.length,u,a.length)}),f}return oo(e,i),n}function ns(r,e){if(r.node(e).dummy)return tr(r.predecessors(e),function(n){return r.node(n).dummy})}function vn(r,e,n){if(e>n){var o=e;e=n,n=o}if(!Object.prototype.hasOwnProperty.call(r,e))Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=r[e];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function os(r,e,n){if(e>n){var o=e;e=n,n=o}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function is(r,e,n,o){var i={},a={},f={};return v(e,function(s){v(s,function(u,d){i[u]=u,a[u]=u,f[u]=d})}),v(e,function(s){var u=-1;v(s,function(d){var c=o(d);if(c.length){c=C(c,function(y){return f[y]});var m=(c.length-1)/2;for(var h=Math.floor(m),b=Math.ceil(m);h<=b;++h){var w=c[h];if(a[d]===d&&u<f[w]&&!os(n,d,w))a[w]=d,a[d]=i[d]=i[w],u=f[w]}}})}),{root:i,align:a}}function as(r,e,n,o,i){var a={},f=fs(r,e,n,i),s=i?"borderLeft":"borderRight";function u(m,h){var b=f.nodes(),w=b.pop(),y={};while(w){if(y[w])m(w);else y[w]=!0,b.push(w),b=b.concat(h(w));w=b.pop()}}function d(m){a[m]=f.inEdges(m).reduce(function(h,b){return Math.max(h,a[b.v]+f.edge(b))},0)}function c(m){var h=f.outEdges(m).reduce(function(w,y){return Math.min(w,a[y.w]-f.edge(y))},Number.POSITIVE_INFINITY),b=r.node(m);if(h!==Number.POSITIVE_INFINITY&&b.borderType!==s)a[m]=Math.max(a[m],h)}return u(d,f.predecessors.bind(f)),u(c,f.successors.bind(f)),v(o,function(m){a[m]=a[n[m]]}),a}function fs(r,e,n,o){var i=new Oe,a=r.graph(),f=cs(a.nodesep,a.edgesep,o);return v(e,function(s){var u;v(s,function(d){var c=n[d];if(i.setNode(c),u){var m=n[u],h=i.edge(m,c);i.setEdge(m,c,Math.max(f(r,d,u),h||0))}u=d})}),i}function ss(r,e){return q(Lr(e),function(n){var{NEGATIVE_INFINITY:o,POSITIVE_INFINITY:i}=Number;return Ke(n,function(a,f){var s=ps(r,f)/2;o=Math.max(a+s,o),i=Math.min(a-s,i)}),o-i})}function us(r,e){var n=Lr(e),o=j(n),i=I(n);v(["u","d"],function(a){v(["l","r"],function(f){var s=a+f,u=r[s],d;if(u===e)return;var c=Lr(u);if(d=f==="l"?o-j(c):i-I(c),d)r[s]=z(u,function(m){return m+d})})})}function ds(r,e){return z(r.ul,function(n,o){if(e)return r[e.toLowerCase()][o];else{var i=C(E(r,o));return(i[1]+i[2])/2}})}function wn(r){var e=B(r),n=or(es(r,e),ts(r,e)),o={},i;v(["u","d"],function(f){i=f==="u"?e:Lr(e).reverse(),v(["l","r"],function(s){if(s==="r")i=E(i,function(m){return Lr(m).reverse()});var u=(f==="u"?r.predecessors:r.successors).bind(r),d=is(r,i,n,u),c=as(r,i,d.root,d.align,s==="r");if(s==="r")c=z(c,function(m){return-m});o[f+s]=c})});var a=ss(r,o);return us(o,a),ds(o,r.graph().align)}function cs(r,e,n){return function(o,i,a){var f=o.node(i),s=o.node(a),u=0,d;if(u+=f.width/2,Object.prototype.hasOwnProperty.call(f,"labelpos"))switch(f.labelpos.toLowerCase()){case"l":d=-f.width/2;break;case"r":d=f.width/2;break}if(d)u+=n?d:-d;if(d=0,u+=(f.dummy?e:r)/2,u+=(s.dummy?e:r)/2,u+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=s.width/2;break;case"r":d=-s.width/2;break}if(d)u+=n?d:-d;return d=0,u}}function ps(r,e){return r.node(e).width}function _n(r){r=br(r),ls(r),Je(wn(r),function(e,n){r.node(n).x=e})}function ls(r){var e=B(r),n=r.graph().ranksep,o=0;v(e,function(i){var a=I(E(i,function(f){return r.node(f).height}));v(i,function(f){r.node(f).y=o+a/2}),o+=a+n})}function qr(r,e){var n=e&&e.debugTiming?At:Rt;n("layout",()=>{var o=n(" buildLayoutGraph",()=>Ls(r));n(" runLayout",()=>ms(o,n)),n(" updateInputGraph",()=>hs(r,o))})}function ms(r,e){e(" makeSpaceForEdgeLabels",()=>Is(r)),e(" removeSelfEdges",()=>Ms(r)),e(" acyclic",()=>xt(r)),e(" nestingGraph.run",()=>rn(r)),e(" rank",()=>Vr(br(r))),e(" injectEdgeLabelProxies",()=>Ss(r)),e(" removeEmptyRanks",()=>Tt(r)),e(" nestingGraph.cleanup",()=>tn(r)),e(" normalizeRanks",()=>Nt(r)),e(" assignRankMinMax",()=>Ns(r)),e(" removeEdgeLabelProxies",()=>Ps(r)),e(" normalize.run",()=>Ut(r)),e(" parentDummyChains",()=>gn(r)),e(" addBorderSegments",()=>Bt(r)),e(" order",()=>mn(r)),e(" insertSelfEdges",()=>js(r)),e(" adjustCoordinateSystem",()=>Ft(r)),e(" position",()=>_n(r)),e(" positionSelfEdges",()=>Bs(r)),e(" removeBorderNodes",()=>Rs(r)),e(" normalize.undo",()=>Vt(r)),e(" fixupEdgeLabelCoords",()=>Cs(r)),e(" undoCoordinateSystem",()=>Gt(r)),e(" translateGraph",()=>ks(r)),e(" assignNodeIntersects",()=>Ts(r)),e(" reversePoints",()=>As(r)),e(" acyclic.undo",()=>Lt(r))}function hs(r,e){v(r.nodes(),function(n){var o=r.node(n),i=e.node(n);if(o){if(o.x=i.x,o.y=i.y,e.children(n).length)o.width=i.width,o.height=i.height}}),v(r.edges(),function(n){var o=r.edge(n),i=e.edge(n);if(o.points=i.points,Object.prototype.hasOwnProperty.call(i,"x"))o.x=i.x,o.y=i.y}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var gs=["nodesep","edgesep","ranksep","marginx","marginy"],vs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},bs=["acyclicer","ranker","rankdir","align"],ys=["width","height"],ws={width:0,height:0},_s=["minlen","weight","width","height","labeloffset"],xs={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Os=["labelpos"];function Ls(r){var e=new Oe({multigraph:!0,compound:!0}),n=Wr(r.graph());return e.setGraph(or({},vs,zr(n,gs),K(n,bs))),v(r.nodes(),function(o){var i=Wr(r.node(o));e.setNode(o,Ue(zr(i,ys),ws)),e.setParent(o,r.parent(o))}),v(r.edges(),function(o){var i=Wr(r.edge(o));e.setEdge(o,or({},xs,zr(i,_s),K(i,Os)))}),e}function Is(r){var e=r.graph();e.ranksep/=2,v(r.edges(),function(n){var o=r.edge(n);if(o.minlen*=2,o.labelpos.toLowerCase()!=="c")if(e.rankdir==="TB"||e.rankdir==="BT")o.width+=o.labeloffset;else o.height+=o.labeloffset})}function Ss(r){v(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var o=r.node(e.v),i=r.node(e.w),a={rank:(i.rank-o.rank)/2+o.rank,e};k(r,"edge-proxy",a,"_ep")}})}function Ns(r){var e=0;v(r.nodes(),function(n){var o=r.node(n);if(o.borderTop)o.minRank=r.node(o.borderTop).rank,o.maxRank=r.node(o.borderBottom).rank,e=I(e,o.maxRank)}),r.graph().maxRank=e}function Ps(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(e)})}function ks(r){var e=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,a=r.graph(),f=a.marginx||0,s=a.marginy||0;function u(d){var{x:c,y:m,width:h,height:b}=d;e=Math.min(e,c-h/2),n=Math.max(n,c+h/2),o=Math.min(o,m-b/2),i=Math.max(i,m+b/2)}v(r.nodes(),function(d){u(r.node(d))}),v(r.edges(),function(d){var c=r.edge(d);if(Object.prototype.hasOwnProperty.call(c,"x"))u(c)}),e-=f,o-=s,v(r.nodes(),function(d){var c=r.node(d);c.x-=e,c.y-=o}),v(r.edges(),function(d){var c=r.edge(d);if(v(c.points,function(m){m.x-=e,m.y-=o}),Object.prototype.hasOwnProperty.call(c,"x"))c.x-=e;if(Object.prototype.hasOwnProperty.call(c,"y"))c.y-=o}),a.width=n-e+f,a.height=i-o+s}function Ts(r){v(r.edges(),function(e){var n=r.edge(e),o=r.node(e.v),i=r.node(e.w),a,f;if(!n.points)n.points=[],a=i,f=o;else a=n.points[0],f=n.points[n.points.length-1];n.points.unshift(Pr(o,a)),n.points.push(Pr(i,f))})}function Cs(r){v(r.edges(),function(e){var n=r.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function As(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function Rs(r){v(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),o=r.node(n.borderTop),i=r.node(n.borderBottom),a=r.node(G(n.borderLeft)),f=r.node(G(n.borderRight));n.width=Math.abs(f.x-a.x),n.height=Math.abs(i.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}}),v(r.nodes(),function(e){if(r.node(e).dummy==="border")r.removeNode(e)})}function Ms(r){v(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function js(r){var e=B(r);v(e,function(n){var o=0;v(n,function(i,a){var f=r.node(i);f.order=a+o,v(f.selfEdges,function(s){k(r,"selfedge",{width:s.label.width,height:s.label.height,rank:f.rank,order:a+ ++o,e:s.e,label:s.label},"_se")}),delete f.selfEdges})})}function Bs(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var o=r.node(n.e.v),i=o.x+o.width/2,a=o.y,f=n.x-i,s=o.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:i+2*f/3,y:a-s},{x:i+5*f/6,y:a-s},{x:i+f,y:a},{x:i+5*f/6,y:a+s},{x:i+2*f/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function zr(r,e){return z(K(r,e),Number)}function Wr(r){var e={};return v(r,function(n,o){e[o.toLowerCase()]=n}),e}var En=t((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),xn=t((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Fs=t((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),Gs=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Xs=t((r,e,n,o,i)=>{let a=[],f=new Set;if(n.forEach(({start:c,end:m})=>{if(c!==o)f.add(c);if(m!==o)f.add(m)}),f.forEach((c)=>{let m=r.node(c);if(typeof m?.x==="number"&&typeof m?.y==="number")a.push(m)}),a.length===0)n.forEach(({edge:c})=>{(c.points??[]).forEach((m)=>{if(typeof m?.x==="number"&&typeof m?.y==="number")a.push(m)})});if(a.length===0)return xn(i);let s=a.reduce((c,m)=>({x:c.x+m.x/a.length,y:c.y+m.y/a.length}),{x:0,y:0}),u=s.x-e.x,d=s.y-e.y;if(Math.abs(u)>Math.abs(d))return u>0?"right":"left";if(Math.abs(d)>0)return d>0?"bottom":"top";return xn(i)},"getSelfLoopSide"),Us=t((r,e="top",n=0,o=0)=>{let i=r.x,a=r.y-n,f=r.width/2,s=r.height/2,u=Math.max(36,Math.min(100,r.width*0.8)),d=En(Math.max(o,r.width*0.35),36,u),c=En(Math.min(r.width,r.height)*0.45,24,48);switch(e){case"bottom":{let m=a+s;return[{x:i-d/2,y:m},{x:i-d/2,y:m+c},{x:i+d/2,y:m+c},{x:i+d/2,y:m}]}case"right":{let m=i+f;return[{x:m,y:a-d/2},{x:m+c,y:a-d/2},{x:m+c,y:a+d/2},{x:m,y:a+d/2}]}case"left":{let m=i-f;return[{x:m,y:a-d/2},{x:m-c,y:a-d/2},{x:m-c,y:a+d/2},{x:m,y:a+d/2}]}case"top":default:{let m=a-s;return[{x:i-d/2,y:m},{x:i-d/2,y:m-c},{x:i+d/2,y:m-c},{x:i+d/2,y:m}]}}},"getSelfLoopPoints"),Vs=t((r,e,n="top",o=0,i={})=>{let f=r.x,s=r.y-o,u=i.width??0,d=i.height??0;switch(n){case"bottom":return{x:f,y:Math.max(...e.map((c)=>c.y))+d/2+4};case"right":return{x:Math.max(...e.map((c)=>c.x))+u/2+4,y:s};case"left":return{x:Math.min(...e.map((c)=>c.x))-u/2-4,y:s};case"top":default:return{x:f,y:Math.min(...e.map((c)=>c.y))-d/2-4}}},"getSelfLoopLabelPosition"),Ln=t((r,e=0,{mergeSelfLoops:n=!0}={})=>{let o=new Map,i=[],a=r.graph()?.rankdir;return r.edges().forEach((f)=>{let s=r.edge(f);if(n&&s.selfLoop){let u=s.selfLoop.id;if(!o.has(u))o.set(u,[]);o.get(u).push({edge:s,start:f.v,end:f.w})}else i.push({edge:s,start:f.v,end:f.w})}),o.forEach((f)=>{if(f.length!==3){f.forEach((_)=>i.push(_));return}f.sort((_,A)=>_.edge.selfLoop.order-A.edge.selfLoop.order);let[s,u,d]=f,c=s.edge.originalEdge??u.edge.originalEdge??d.edge.originalEdge??u.edge,m=r.node(c.start);if(!m){f.forEach((_)=>i.push(_));return}let h={width:u.edge.width,height:u.edge.height},b=Xs(r,m,f,c.start,a),w=Us(m,b,e,h.width??0),y=Vs(m,w,b,e,h),g={...u.edge,...c,id:c.id,points:w,start:c.start,end:c.end,x:y.x,y:y.y,width:h.width,height:h.height,labelStyle:u.edge.labelStyle,fromCluster:s.edge.fromCluster??u.edge.fromCluster??d.edge.fromCluster,toCluster:s.edge.toCluster??u.edge.toCluster??d.edge.toCluster};delete g.selfLoop,delete g.originalEdge,i.push({edge:g,start:g.start,end:g.end})}),i},"getEdgesToRender"),In=t(async({element:r,graph:e,diagramType:n,id:o,parentCluster:i,siteConfig:a})=>{let f=e.graph().rankdir;l.trace("Dir in recursive render - dir:",f);let{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:m}=Cd(r,{edgePathsClass:"edgePaths"});if(!e.nodes())l.info("No nodes found for",e);else l.info("Recursive render XXX",e.nodes());if(e.edges().length>0)l.info("Recursive edges",e.edge(e.edges()[0]));let h=Fs(n);await Promise.all(e.nodes().map(async function(y){let g=e.node(y);if(i!==void 0){let _=JSON.parse(JSON.stringify(i.clusterData));if(l.trace(`Setting data for parent cluster XXX
1
+ import{t,l,p,H,pa,zg,Gr,po,fa,Ls,mo}from"./index-wv36ddd5.js";import{Pt,vn,rr,Jt,Fr,to,ve,xt,Ar,no,hr,Bl,Ld,Md,Pd,xi,sa,Od,wi,kn,Ci,La,la,Ei,ro,Bi,$d,zd,Il,Ot,Ud,Ii,ao,_i,_l,Sl,oo,Gd,Tl,jd,Bu,Lr,Dl,qd,Hd,Wd,Gn,Ql,Nl,Si,Kd,Rl,v,ar,Mr,$t,io,ze}from"./index-aznkfx1z.js";import{Qd,Nd,Ae,Ts,Sg,Rd,qo}from"./index-ek7hqfp0.js";import{yn}from"./index-gx2xefdg.js";var ur={};yn(ur,{default:()=>Z});var Nn=/\s/;function Pn(r){var e=r.length;while(e--&&Nn.test(r.charAt(e)));return e}var Jr=Pn;var Tn=/^\s+/;function Cn(r){return r?r.slice(0,Jr(r)+1).replace(Tn,""):r}var Zr=Cn;var $r=NaN,An=/^[-+]0x[0-9a-f]+$/i,Rn=/^0b[01]+$/i,Mn=/^0o[0-7]+$/i,jn=parseInt;function Bn(r){if(typeof r=="number")return r;if(Fr(r))return $r;if(xt(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=xt(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Zr(r);var n=Rn.test(r);return n||Mn.test(r)?jn(r.slice(2),n?2:8):An.test(r)?$r:+r}var Qr=Bn;var re=1/0,Dn=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function Fn(r){if(!r)return r===0?r:0;if(r=Qr(r),r===re||r===-re){var e=r<0?-1:1;return e*Dn}return r===r?r:0}var U=Fn;function Xn(r){var e=U(r),n=e%1;return e===e?n?e-n:e:0}var ee=Xn;var te=Object.create,Un=function(){function r(){}return function(e){if(!xt(e))return{};if(te)return te(e);r.prototype=e;var n=new r;return r.prototype=void 0,n}}(),ne=Un;function Vn(r,e){var n=-1,o=r.length;e||(e=Array(o));while(++n<o)e[n]=r[n];return e}var fr=Vn;function Yn(r,e,n){if(e=="__proto__"&&Bl)Bl(r,e,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[e]=n}var R=Yn;var zn=Object.prototype,Wn=zn.hasOwnProperty;function qn(r,e,n){var o=r[e];if(!(Wn.call(r,e)&&sa(o,n))||n===void 0&&!(e in r))R(r,e,n)}var M=qn;function Hn(r,e,n,o){var i=!n;n||(n={});var a=-1,f=e.length;while(++a<f){var s=e[a],u=o?o(n[s],r[s],s,n,r):void 0;if(u===void 0)u=r[s];if(i)R(n,s,u);else M(n,s,u)}return n}var P=Hn;function Kn(r,e,n){if(!xt(n))return!1;var o=typeof e;if(o=="number"?kn(n)&&xi(e,n.length):o=="string"&&(e in n))return sa(n[e],r);return!1}var T=Kn;function Jn(r){return wi(function(e,n){var o=-1,i=n.length,a=i>1?n[i-1]:void 0,f=i>2?n[2]:void 0;if(a=r.length>3&&typeof a=="function"?(i--,a):void 0,f&&T(n[0],n[1],f))a=i<3?void 0:a,i=1;e=Object(e);while(++o<i){var s=n[o];if(s)r(e,s,o,a)}return e})}var oe=Jn;function Zn(r){var e=[];if(r!=null)for(var n in Object(r))e.push(n);return e}var ie=Zn;var $n=Object.prototype,Qn=$n.hasOwnProperty;function eo(r){if(!xt(r))return ie(r);var e=Ci(r),n=[];for(var o in r)if(!(o=="constructor"&&(e||!Qn.call(r,o))))n.push(o);return n}var ae=eo;function fo(r){return kn(r)?$d(r,!0):ae(r)}var L=fo;function so(r){var e=r==null?0:r.length;return e?Sl(r,1):[]}var S=so;function uo(r){return Ld(Od(r,void 0,S),r+"")}var fe=uo;var co=zd(Object.getPrototypeOf,Object),V=co;var lo="[object Object]",ho=Function.prototype,go=Object.prototype,se=ho.toString,vo=go.hasOwnProperty,bo=se.call(Object);function yo(r){if(!Jt(r)||rr(r)!=lo)return!1;var e=V(r);if(e===null)return!0;var n=vo.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&se.call(n)==bo}var ue=yo;var wo="\\ud800-\\udfff",_o="\\u0300-\\u036f",Eo="\\ufe20-\\ufe2f",xo="\\u20d0-\\u20ff",Oo=_o+Eo+xo,Lo="\\ufe0e\\ufe0f",Io="\\u200d",So=RegExp("["+Io+wo+Oo+Lo+"]");function No(r){return So.test(r)}var de=No;function Po(r,e){return r&&P(e,Ot(e),r)}var ce=Po;function ko(r,e){return r&&P(e,L(e),r)}var pe=ko;var ge=typeof ur=="object"&&ur&&!ur.nodeType&&ur,le=ge&&typeof sr=="object"&&sr&&!sr.nodeType&&sr,To=le&&le.exports===ge,me=To?Pt.Buffer:void 0,he=me?me.allocUnsafe:void 0;function Co(r,e){if(e)return r.slice();var n=r.length,o=he?he(n):new r.constructor(n);return r.copy(o),o}var Z=Co;function Ao(r,e){return P(r,Tl(r),e)}var be=Ao;var Ro=Object.getOwnPropertySymbols,Mo=!Ro?Gd:function(r){var e=[];while(r)_l(e,Tl(r)),r=V(r);return e},dr=Mo;function jo(r,e){return P(r,dr(r),e)}var ye=jo;function Bo(r){return jd(r,L,dr)}var we=Bo;var Do=Object.prototype,Fo=Do.hasOwnProperty;function Go(r){var e=r.length,n=new r.constructor(e);if(e&&typeof r[0]=="string"&&Fo.call(r,"index"))n.index=r.index,n.input=r.input;return n}var _e=Go;function Xo(r){var e=new r.constructor(r.byteLength);return new Dl(e).set(new Dl(r)),e}var Y=Xo;function Uo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.byteLength)}var Ee=Uo;var Vo=/\w*$/;function Yo(r){var e=new r.constructor(r.source,Vo.exec(r));return e.lastIndex=r.lastIndex,e}var xe=Yo;var Oe=vn?vn.prototype:void 0,Le=Oe?Oe.valueOf:void 0;function zo(r){return Le?Object(Le.call(r)):{}}var Ie=zo;function Wo(r,e){var n=e?Y(r.buffer):r.buffer;return new r.constructor(n,r.byteOffset,r.length)}var cr=Wo;var Ho="[object Boolean]",Ko="[object Date]",Jo="[object Map]",Zo="[object Number]",$o="[object RegExp]",Qo="[object Set]",ri="[object String]",ei="[object Symbol]",ti="[object ArrayBuffer]",ni="[object DataView]",oi="[object Float32Array]",ii="[object Float64Array]",ai="[object Int8Array]",fi="[object Int16Array]",si="[object Int32Array]",ui="[object Uint8Array]",di="[object Uint8ClampedArray]",ci="[object Uint16Array]",pi="[object Uint32Array]";function li(r,e,n){var o=r.constructor;switch(e){case ti:return Y(r);case Ho:case Ko:return new o(+r);case ni:return Ee(r,n);case oi:case ii:case ai:case fi:case si:case ui:case di:case ci:case pi:return cr(r,n);case Jo:return new o;case Zo:case ri:return new o(r);case $o:return xe(r);case Qo:return new o;case ei:return Ie(r)}}var Se=li;function mi(r){return typeof r.constructor=="function"&&!Ci(r)?ne(V(r)):{}}var pr=mi;var hi="[object Map]";function gi(r){return Jt(r)&&Lr(r)==hi}var Ne=gi;var Pe=ro&&ro.isMap,vi=Pe?Ei(Pe):Ne,ke=vi;var bi="[object Set]";function yi(r){return Jt(r)&&Lr(r)==bi}var Te=yi;var Ce=ro&&ro.isSet,Oi=Ce?Ei(Ce):Te,Re=Oi;var Li=1,Ni=2,Pi=4,Me="[object Arguments]",ki="[object Array]",Ti="[object Boolean]",Ai="[object Date]",Ri="[object Error]",je="[object Function]",Mi="[object GeneratorFunction]",ji="[object Map]",Di="[object Number]",Be="[object Object]",Fi="[object RegExp]",Gi="[object Set]",Xi="[object String]",Ui="[object Symbol]",Vi="[object WeakMap]",Yi="[object ArrayBuffer]",zi="[object DataView]",Wi="[object Float32Array]",qi="[object Float64Array]",Hi="[object Int8Array]",Ki="[object Int16Array]",Ji="[object Int32Array]",Zi="[object Uint8Array]",$i="[object Uint8ClampedArray]",Qi="[object Uint16Array]",ra="[object Uint32Array]",x={};x[Me]=x[ki]=x[Yi]=x[zi]=x[Ti]=x[Ai]=x[Wi]=x[qi]=x[Hi]=x[Ki]=x[Ji]=x[ji]=x[Di]=x[Be]=x[Fi]=x[Gi]=x[Xi]=x[Ui]=x[Zi]=x[$i]=x[Qi]=x[ra]=!0;x[Ri]=x[je]=x[Vi]=!1;function lr(r,e,n,o,i,a){var f,s=e&Li,u=e&Ni,d=e&Pi;if(n)f=i?n(r,o,i,a):n(r);if(f!==void 0)return f;if(!xt(r))return r;var c=ve(r);if(c){if(f=_e(r),!s)return fr(r,f)}else{var m=Lr(r),h=m==je||m==Mi;if(la(r))return Z(r,s);if(m==Be||m==Me||h&&!i){if(f=u||h?{}:pr(r),!s)return u?ye(r,pe(f,r)):be(r,ce(f,r))}else{if(!x[m])return i?r:{};f=Se(r,m,s)}}a||(a=new oo);var b=a.get(r);if(b)return b;if(a.set(r,f),Re(r))r.forEach(function(g){f.add(lr(g,e,n,g,r,a))});else if(ke(r))r.forEach(function(g,_){f.set(_,lr(g,e,n,_,r,a))});var w=d?u?we:Bu:u?L:Ot,y=c?void 0:w(r);return Md(y||r,function(g,_){if(y)_=g,g=r[_];M(f,_,lr(g,e,n,_,r,a))}),f}var De=lr;var ea=1,ta=4;function na(r){return De(r,ea|ta)}var Fe=na;var oa=function(){return Pt.Date.now()},_r=oa;var Ge=Object.prototype,ia=Ge.hasOwnProperty,aa=wi(function(r,e){r=Object(r);var n=-1,o=e.length,i=o>2?e[2]:void 0;if(i&&T(e[0],e[1],i))o=1;while(++n<o){var a=e[n],f=L(a),s=-1,u=f.length;while(++s<u){var d=f[s],c=r[d];if(c===void 0||sa(c,Ge[d])&&!ia.call(r,d))r[d]=a[d]}}return r}),Xe=aa;function ua(r,e,n){if(n!==void 0&&!sa(r[e],n)||n===void 0&&!(e in r))R(r,e,n)}var Q=ua;function da(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var er=da;function ca(r){return P(r,L(r))}var Ue=ca;function ma(r,e,n,o,i,a,f){var s=er(r,n),u=er(e,n),d=f.get(u);if(d){Q(r,n,d);return}var c=a?a(s,u,n+"",r,e,f):void 0,m=c===void 0;if(m){var h=ve(u),b=!h&&la(u),w=!h&&!b&&Bi(u);if(c=u,h||b||w)if(ve(s))c=s;else if(Kd(s))c=fr(s);else if(b)m=!1,c=Z(u,!0);else if(w)m=!1,c=cr(u,!0);else c=[];else if(ue(u)||La(u)){if(c=s,La(s))c=Ue(s);else if(!xt(s)||no(s))c=pr(u)}else m=!1}if(m)f.set(u,c),i(c,u,o,a,f),f.delete(u);Q(r,n,c)}var Ve=ma;function Ye(r,e,n,o,i){if(r===e)return;Ql(e,function(a,f){if(i||(i=new oo),xt(a))Ve(r,e,f,n,Ye,o,i);else{var s=o?o(er(r,f),a,f+"",r,e,i):void 0;if(s===void 0)s=a;Q(r,f,s)}},L)}var We=Ye;function ha(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var G=ha;function ga(r){return function(e,n,o){var i=Object(e);if(!kn(e)){var a=Gn(n,3);e=Ot(e),n=function(s){return a(i[s],s,i)}}var f=r(e,n,o);return f>-1?i[a?e[f]:f]:void 0}}var qe=ga;var va=Math.max;function ba(r,e,n){var o=r==null?0:r.length;if(!o)return-1;var i=n==null?0:ee(n);if(i<0)i=va(o+i,0);return Pd(r,Gn(e,3),i)}var He=ba;var ya=qe(He),tr=ya;function wa(r,e){var n=-1,o=kn(r)?Array(r.length):[];return Si(r,function(i,a,f){o[++n]=e(i,a,f)}),o}var mr=wa;function _a(r,e){var n=ve(r)?to:mr;return n(r,Gn(e,3))}var E=_a;function Ea(r,e){return r==null?r:Ql(r,Rl(e),L)}var Ke=Ea;function xa(r,e){return r&&Nl(r,Rl(e))}var Je=xa;function Oa(r,e){return r>e}var Ze=Oa;var Ia=Object.prototype,Sa=Ia.hasOwnProperty;function Na(r,e){return r!=null&&Sa.call(r,e)}var $e=Na;function Pa(r,e){return r!=null&&qd(r,e,$e)}var gr=Pa;var ka="[object String]";function Ta(r){return typeof r=="string"||!ve(r)&&Jt(r)&&rr(r)==ka}var Qe=Ta;function Ca(r,e){return r<e}var vr=Ca;function Aa(r,e){var n={};return e=Gn(e,3),Nl(r,function(o,i,a){R(n,i,e(o,i,a))}),n}var z=Aa;function Ra(r,e,n){var o=-1,i=r.length;while(++o<i){var a=r[o],f=e(a);if(f!=null&&(s===void 0?f===f&&!Fr(f):n(f,s)))var s=f,u=a}return u}var W=Ra;function Ma(r){return r&&r.length?W(r,Ar,Ze):void 0}var I=Ma;var ja=oe(function(r,e,n){We(r,e,n)}),nr=ja;function Ba(r){return r&&r.length?W(r,Ar,vr):void 0}var j=Ba;function Da(r,e){return r&&r.length?W(r,Gn(e,2),vr):void 0}var q=Da;function Fa(r,e,n,o){if(!xt(r))return r;e=Ii(e,r);var i=-1,a=e.length,f=a-1,s=r;while(s!=null&&++i<a){var u=ao(e[i]),d=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(i!=f){var c=s[u];if(d=o?o(c,u,s):void 0,d===void 0)d=xt(c)?c:xi(e[i+1])?[]:{}}M(s,u,d),s=s[u]}return r}var rt=Fa;function Ga(r,e,n){var o=-1,i=e.length,a={};while(++o<i){var f=e[o],s=_i(r,f);if(n(s,f))rt(a,Ii(f,r),s)}return a}var et=Ga;function Xa(r,e){var n=r.length;r.sort(e);while(n--)r[n]=r[n].value;return r}var tt=Xa;function Ua(r,e){if(r!==e){var n=r!==void 0,o=r===null,i=r===r,a=Fr(r),f=e!==void 0,s=e===null,u=e===e,d=Fr(e);if(!s&&!d&&!a&&r>e||a&&f&&u&&!s&&!d||o&&f&&u||!n&&u||!i)return 1;if(!o&&!a&&!d&&r<e||d&&n&&i&&!o&&!a||s&&n&&i||!f&&i||!u)return-1}return 0}var nt=Ua;function Va(r,e,n){var o=-1,i=r.criteria,a=e.criteria,f=i.length,s=n.length;while(++o<f){var u=nt(i[o],a[o]);if(u){if(o>=s)return u;var d=n[o];return u*(d=="desc"?-1:1)}}return r.index-e.index}var ot=Va;function Ya(r,e,n){if(e.length)e=to(e,function(a){if(ve(a))return function(f){return _i(f,a.length===1?a[0]:a)};return a});else e=[Ar];var o=-1;e=to(e,Ei(Gn));var i=mr(r,function(a,f,s){var u=to(e,function(d){return d(a)});return{criteria:u,index:++o,value:a}});return tt(i,function(a,f){return ot(a,f,n)})}var it=Ya;var za=Wd("length"),at=za;var st="\\ud800-\\udfff",Wa="\\u0300-\\u036f",qa="\\ufe20-\\ufe2f",Ha="\\u20d0-\\u20ff",Ka=Wa+qa+Ha,Ja="\\ufe0e\\ufe0f",Za="["+st+"]",Er="["+Ka+"]",xr="\\ud83c[\\udffb-\\udfff]",$a="(?:"+Er+"|"+xr+")",ut="[^"+st+"]",dt="(?:\\ud83c[\\udde6-\\uddff]){2}",ct="[\\ud800-\\udbff][\\udc00-\\udfff]",Qa="\\u200d",pt=$a+"?",lt="["+Ja+"]?",rf="(?:"+Qa+"(?:"+[ut,dt,ct].join("|")+")"+lt+pt+")*",ef=lt+pt+rf,tf="(?:"+[ut+Er+"?",Er,dt,ct,Za].join("|")+")",ft=RegExp(xr+"(?="+xr+")|"+tf+ef,"g");function nf(r){var e=ft.lastIndex=0;while(ft.test(r))++e;return e}var mt=nf;function of(r){return de(r)?mt(r):at(r)}var ht=of;function af(r,e){return et(r,e,function(n,o){return Hd(r,o)})}var gt=af;var ff=fe(function(r,e){return r==null?{}:gt(r,e)}),K=ff;var{ceil:sf,max:uf}=Math;function df(r,e,n,o){var i=-1,a=uf(sf((e-r)/(n||1)),0),f=Array(a);while(a--)f[o?a:++i]=r,r+=n;return f}var vt=df;function cf(r){return function(e,n,o){if(o&&typeof o!="number"&&T(e,n,o))n=o=void 0;if(e=U(e),n===void 0)n=e,e=0;else n=U(n);return o=o===void 0?e<n?1:-1:U(o),vt(e,n,o,r)}}var bt=cf;var pf=bt(),N=pf;var lf="[object Map]",mf="[object Set]";function hf(r){if(r==null)return 0;if(kn(r))return Qe(r)?ht(r):r.length;var e=Lr(r);if(e==lf||e==mf)return r.size;return Il(r).length}var yt=hf;var gf=wi(function(r,e){if(r==null)return[];var n=e.length;if(n>1&&T(r,e[0],e[1]))e=[];else if(n>2&&T(e[0],e[1],e[2]))e=[e[0]];return it(r,Sl(e,1),[])}),C=gf;var vf=0;function bf(r){var e=++vf;return Ud(r)+e}var J=bf;function yf(r,e,n){var o=-1,i=r.length,a=e.length,f={};while(++o<i){var s=o<a?e[o]:void 0;n(f,r[o],s)}return f}var wt=yf;function wf(r,e){return wt(r||[],e||[],M)}var Or=wf;class Ir{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return _t(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)_t(r);r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){var r=[],e=this._sentinel,n=e._prev;while(n!==e)r.push(JSON.stringify(n,_f)),n=n._prev;return"["+r.join(", ")+"]"}}function _t(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function _f(r,e){if(r!=="_next"&&r!=="_prev")return e}var Ef=hr(1);function Et(r,e){if(r.nodeCount()<=1)return[];var n=Of(r,e||Ef),o=xf(n.graph,n.buckets,n.zeroIdx);return S(E(o,function(i){return r.outEdges(i.v,i.w)}))}function xf(r,e,n){var o=[],i=e[e.length-1],a=e[0],f;while(r.nodeCount()){while(f=a.dequeue())Sr(r,e,n,f);while(f=i.dequeue())Sr(r,e,n,f);if(r.nodeCount()){for(var s=e.length-2;s>0;--s)if(f=e[s].dequeue(),f){o=o.concat(Sr(r,e,n,f,!0));break}}}return o}function Sr(r,e,n,o,i){var a=i?[]:void 0;return v(r.inEdges(o.v),function(f){var s=r.edge(f),u=r.node(f.v);if(i)a.push({v:f.v,w:f.w});u.out-=s,Nr(e,n,u)}),v(r.outEdges(o.v),function(f){var s=r.edge(f),u=f.w,d=r.node(u);d.in-=s,Nr(e,n,d)}),r.removeNode(o.v),a}function Of(r,e){var n=new ze,o=0,i=0;v(r.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),v(r.edges(),function(s){var u=n.edge(s.v,s.w)||0,d=e(s),c=u+d;n.setEdge(s.v,s.w,c),i=Math.max(i,n.node(s.v).out+=d),o=Math.max(o,n.node(s.w).in+=d)});var a=N(i+o+3).map(function(){return new Ir}),f=o+1;return v(n.nodes(),function(s){Nr(a,f,n.node(s))}),{graph:n,buckets:a,zeroIdx:f}}function Nr(r,e,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+e].enqueue(n)}function Lt(r){var e=r.graph().acyclicer==="greedy"?Et(r,n(r)):Lf(r);v(e,function(o){var i=r.edge(o);r.removeEdge(o),i.forwardName=o.name,i.reversed=!0,r.setEdge(o.w,o.v,i,J("rev"))});function n(o){return function(i){return o.edge(i).weight}}}function Lf(r){var e=[],n={},o={};function i(a){if(Object.prototype.hasOwnProperty.call(o,a))return;o[a]=!0,n[a]=!0,v(r.outEdges(a),function(f){if(Object.prototype.hasOwnProperty.call(n,f.w))e.push(f);else i(f.w)}),delete n[a]}return v(r.nodes(),i),e}function It(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var o=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,o)}})}function k(r,e,n,o){var i;do i=J(o);while(r.hasNode(i));return n.dummy=e,r.setNode(i,n),i}function Nt(r){var e=new ze().setGraph(r.graph());return v(r.nodes(),function(n){e.setNode(n,r.node(n))}),v(r.edges(),function(n){var o=e.edge(n.v,n.w)||{weight:0,minlen:1},i=r.edge(n);e.setEdge(n.v,n.w,{weight:o.weight+i.weight,minlen:Math.max(o.minlen,i.minlen)})}),e}function br(r){var e=new ze({multigraph:r.isMultigraph()}).setGraph(r.graph());return v(r.nodes(),function(n){if(!r.children(n).length)e.setNode(n,r.node(n))}),v(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function Pr(r,e){var{x:n,y:o}=r,i=e.x-n,a=e.y-o,f=r.width/2,s=r.height/2;if(!i&&!a)throw Error("Not possible to find intersection inside of the rectangle");var u,d;if(Math.abs(a)*f>Math.abs(i)*s){if(a<0)s=-s;u=s*i/a,d=s}else{if(i<0)f=-f;u=f,d=f*a/i}return{x:n+u,y:o+d}}function B(r){var e=E(N(Tr(r)+1),function(){return[]});return v(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!$t(i))e[i][o.order]=n}),e}function kt(r){var e=j(E(r.nodes(),function(n){return r.node(n).rank}));v(r.nodes(),function(n){var o=r.node(n);if(gr(o,"rank"))o.rank-=e})}function Tt(r){var e=j(E(r.nodes(),function(a){return r.node(a).rank})),n=[];v(r.nodes(),function(a){var f=r.node(a).rank-e;if(!n[f])n[f]=[];n[f].push(a)});var o=0,i=r.graph().nodeRankFactor;v(n,function(a,f){if($t(a)&&f%i!==0)--o;else if(o)v(a,function(s){r.node(s).rank+=o})})}function kr(r,e,n,o){var i={width:0,height:0};if(arguments.length>=4)i.rank=n,i.order=o;return k(r,"border",i,e)}function Tr(r){return I(E(r.nodes(),function(e){var n=r.node(e).rank;if(!$t(n))return n}))}function Ct(r,e){var n={lhs:[],rhs:[]};return v(r,function(o){if(e(o))n.lhs.push(o);else n.rhs.push(o)}),n}function At(r,e){var n=_r();try{return e()}finally{console.log(r+" time: "+(_r()-n)+"ms")}}function Rt(r,e){return e()}function jt(r){function e(n){var o=r.children(n),i=r.node(n);if(o.length)v(o,e);if(Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,f=i.maxRank+1;a<f;++a)Mt(r,"borderLeft","_bl",n,i,a),Mt(r,"borderRight","_br",n,i,a)}}v(r.children(),e)}function Mt(r,e,n,o,i,a){var f={width:0,height:0,rank:a,borderType:e},s=i[e][a-1],u=k(r,"border",f,n);if(i[e][a]=u,r.setParent(u,o),s)r.setEdge(s,u,{weight:1})}function Dt(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")Gt(r)}function Ft(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")If(r);if(e==="lr"||e==="rl")Sf(r),Gt(r)}function Gt(r){v(r.nodes(),function(e){Bt(r.node(e))}),v(r.edges(),function(e){Bt(r.edge(e))})}function Bt(r){var e=r.width;r.width=r.height,r.height=e}function If(r){v(r.nodes(),function(e){Cr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Cr),Object.prototype.hasOwnProperty.call(n,"y"))Cr(n)})}function Cr(r){r.y=-r.y}function Sf(r){v(r.nodes(),function(e){Rr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,Rr),Object.prototype.hasOwnProperty.call(n,"x"))Rr(n)})}function Rr(r){var e=r.x;r.x=r.y,r.y=e}function Xt(r){r.graph().dummyChains=[],v(r.edges(),function(e){Pf(r,e)})}function Pf(r,e){var n=e.v,o=r.node(n).rank,i=e.w,a=r.node(i).rank,f=e.name,s=r.edge(e),u=s.labelRank;if(a===o+1)return;r.removeEdge(e);var d=void 0,c,m;for(m=0,++o;o<a;++m,++o){if(s.points=[],d={width:0,height:0,edgeLabel:s,edgeObj:e,rank:o},c=k(r,"edge",d,"_d"),o===u)d.width=s.width,d.height=s.height,d.dummy="edge-label",d.labelpos=s.labelpos;if(r.setEdge(n,c,{weight:s.weight},f),m===0)r.graph().dummyChains.push(c);n=c}r.setEdge(n,i,{weight:s.weight},f)}function Ut(r){v(r.graph().dummyChains,function(e){var n=r.node(e),o=n.edgeLabel,i;r.setEdge(n.edgeObj,o);while(n.dummy){if(i=r.successors(e)[0],r.removeNode(e),o.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")o.x=n.x,o.y=n.y,o.width=n.width,o.height=n.height;e=i,n=r.node(e)}})}function or(r){var e={};function n(o){var i=r.node(o);if(Object.prototype.hasOwnProperty.call(e,o))return i.rank;e[o]=!0;var a=j(E(r.outEdges(o),function(f){return n(f.w)-r.edge(f).minlen}));if(a===Number.POSITIVE_INFINITY||a===void 0||a===null)a=0;return i.rank=a}v(r.sources(),n)}function X(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function yr(r){var e=new ze({directed:!1}),n=r.nodes()[0],o=r.nodeCount();e.setNode(n,{});var i,a;while(kf(e,r)<o)i=Tf(e,r),a=e.hasNode(i.v)?X(r,i):-X(r,i),Cf(e,r,a);return e}function kf(r,e){function n(o){v(e.nodeEdges(o),function(i){var a=i.v,f=o===a?i.w:a;if(!r.hasNode(f)&&!X(e,i))r.setNode(f,{}),r.setEdge(o,f,{}),n(f)})}return v(r.nodes(),n),r.nodeCount()}function Tf(r,e){return q(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return X(e,n)})}function Cf(r,e,n){v(r.nodes(),function(o){e.node(o).rank+=n})}var fh=hr(1);var mh=hr(1);jr.CycleException=ir;function jr(r){var e={},n={},o=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new ir;if(!Object.prototype.hasOwnProperty.call(e,a))n[a]=!0,e[a]=!0,v(r.predecessors(a),i),delete n[a],o.push(a)}if(v(r.sinks(),i),yt(e)!==r.nodeCount())throw new ir;return o}function ir(){}ir.prototype=Error();function wr(r,e,n){if(!ve(e))e=[e];var o=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],a={};return v(e,function(f){if(!r.hasNode(f))throw Error("Graph does not have node: "+f);Yt(r,f,n==="post",a,o,i)}),i}function Yt(r,e,n,o,i,a){if(!Object.prototype.hasOwnProperty.call(o,e)){if(o[e]=!0,!n)a.push(e);if(v(i(e),function(f){Yt(r,f,n,o,i,a)}),n)a.push(e)}}function Br(r,e){return wr(r,e,"post")}function Dr(r,e){return wr(r,e,"pre")}F.initLowLimValues=Ur;F.initCutValues=Xr;F.calcCutValue=Wt;F.leaveEdge=Ht;F.enterEdge=Kt;F.exchangeEdges=Zt;function F(r){r=Nt(r),or(r);var e=yr(r);Ur(e),Xr(e,r);var n,o;while(n=Ht(e))o=Kt(e,r,n),Zt(e,r,n,o)}function Xr(r,e){var n=Br(r,r.nodes());n=n.slice(0,n.length-1),v(n,function(o){Bf(r,e,o)})}function Bf(r,e,n){var o=r.node(n),i=o.parent;r.edge(n,i).cutvalue=Wt(r,e,n)}function Wt(r,e,n){var o=r.node(n),i=o.parent,a=!0,f=e.edge(n,i),s=0;if(!f)a=!1,f=e.edge(i,n);return s=f.weight,v(e.nodeEdges(n),function(u){var d=u.v===n,c=d?u.w:u.v;if(c!==i){var m=d===a,h=e.edge(u).weight;if(s+=m?h:-h,Ff(r,n,c)){var b=r.edge(n,c).cutvalue;s+=m?-b:b}}}),s}function Ur(r,e){if(arguments.length<2)e=r.nodes()[0];qt(r,{},1,e)}function qt(r,e,n,o,i){var a=n,f=r.node(o);if(e[o]=!0,v(r.neighbors(o),function(s){if(!Object.prototype.hasOwnProperty.call(e,s))n=qt(r,e,n,s,o)}),f.low=a,f.lim=n++,i)f.parent=i;else delete f.parent;return n}function Ht(r){return tr(r.edges(),function(e){return r.edge(e).cutvalue<0})}function Kt(r,e,n){var{v:o,w:i}=n;if(!e.hasEdge(o,i))o=n.w,i=n.v;var a=r.node(o),f=r.node(i),s=a,u=!1;if(a.lim>f.lim)s=f,u=!0;var d=ar(e.edges(),function(c){return u===zt(r,r.node(c.v),s)&&u!==zt(r,r.node(c.w),s)});return q(d,function(c){return X(e,c)})}function Zt(r,e,n,o){var{v:i,w:a}=n;r.removeEdge(i,a),r.setEdge(o.v,o.w,{}),Ur(r),Xr(r,e),Df(r,e)}function Df(r,e){var n=tr(r.nodes(),function(i){return!e.node(i).parent}),o=Dr(r,n);o=o.slice(1),v(o,function(i){var a=r.node(i).parent,f=e.edge(i,a),s=!1;if(!f)f=e.edge(a,i),s=!0;e.node(i).rank=e.node(a).rank+(s?f.minlen:-f.minlen)})}function Ff(r,e,n){return r.hasEdge(e,n)}function zt(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Vr(r){switch(r.graph().ranker){case"network-simplex":Qt(r);break;case"tight-tree":Xf(r);break;case"longest-path":Gf(r);break;default:Qt(r)}}var Gf=or;function Xf(r){or(r),yr(r)}function Qt(r){F(r)}function rn(r){var e=k(r,"root",{},"_root"),n=Uf(r),o=I(Mr(n))-1,i=2*o+1;r.graph().nestingRoot=e,v(r.edges(),function(f){r.edge(f).minlen*=i});var a=Vf(r)+1;v(r.children(),function(f){en(r,e,i,a,o,n,f)}),r.graph().nodeRankFactor=i}function en(r,e,n,o,i,a,f){var s=r.children(f);if(!s.length){if(f!==e)r.setEdge(e,f,{weight:0,minlen:n});return}var u=kr(r,"_bt"),d=kr(r,"_bb"),c=r.node(f);if(r.setParent(u,f),c.borderTop=u,r.setParent(d,f),c.borderBottom=d,v(s,function(m){en(r,e,n,o,i,a,m);var h=r.node(m),b=h.borderTop?h.borderTop:m,w=h.borderBottom?h.borderBottom:m,y=h.borderTop?o:2*o,g=b!==w?1:i-a[f]+1;r.setEdge(u,b,{weight:y,minlen:g,nestingEdge:!0}),r.setEdge(w,d,{weight:y,minlen:g,nestingEdge:!0})}),!r.parent(f))r.setEdge(e,u,{weight:0,minlen:i+a[f]})}function Uf(r){var e={};function n(o,i){var a=r.children(o);if(a&&a.length)v(a,function(f){n(f,i+1)});e[o]=i}return v(r.children(),function(o){n(o,1)}),e}function Vf(r){return io(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function tn(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,v(r.edges(),function(n){var o=r.edge(n);if(o.nestingEdge)r.removeEdge(n)})}function nn(r,e,n){var o={},i;v(n,function(a){var f=r.parent(a),s,u;while(f){if(s=r.parent(f),s)u=o[s],o[s]=f;else u=i,i=f;if(u&&u!==f){e.setEdge(u,f);return}f=s}})}function on(r,e,n){var o=zf(r),i=new ze({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(a){return r.node(a)});return v(r.nodes(),function(a){var f=r.node(a),s=r.parent(a);if(f.rank===e||f.minRank<=e&&e<=f.maxRank){if(i.setNode(a),i.setParent(a,s||o),v(r[n](a),function(u){var d=u.v===a?u.w:u.v,c=i.edge(d,a),m=!$t(c)?c.weight:0;i.setEdge(d,a,{weight:r.edge(u).weight+m})}),Object.prototype.hasOwnProperty.call(f,"minRank"))i.setNode(a,{borderLeft:f.borderLeft[e],borderRight:f.borderRight[e]})}}),i}function zf(r){var e;while(r.hasNode(e=J("_root")));return e}function an(r,e){var n=0;for(var o=1;o<e.length;++o)n+=Wf(r,e[o-1],e[o]);return n}function Wf(r,e,n){var o=Or(n,E(n,function(d,c){return c})),i=S(E(e,function(d){return C(E(r.outEdges(d),function(c){return{pos:o[c.w],weight:r.edge(c).weight}}),"pos")})),a=1;while(a<n.length)a<<=1;var f=2*a-1;a-=1;var s=E(Array(f),function(){return 0}),u=0;return v(i.forEach(function(d){var c=d.pos+a;s[c]+=d.weight;var m=0;while(c>0){if(c%2)m+=s[c+1];c=c-1>>1,s[c]+=d.weight}u+=d.weight*m})),u}function fn(r){var e={},n=ar(r.nodes(),function(s){return!r.children(s).length}),o=I(E(n,function(s){return r.node(s).rank})),i=E(N(o+1),function(){return[]});function a(s){if(gr(e,s))return;e[s]=!0;var u=r.node(s);i[u.rank].push(s),v(r.successors(s),a)}var f=C(n,function(s){return r.node(s).rank});return v(f,a),i}function sn(r,e){return E(e,function(n){var o=r.inEdges(n);if(!o.length)return{v:n};else{var i=io(o,function(a,f){var s=r.edge(f),u=r.node(f.v);return{sum:a.sum+s.weight*u.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function un(r,e){var n={};v(r,function(i,a){var f=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};if(!$t(i.barycenter))f.barycenter=i.barycenter,f.weight=i.weight}),v(e.edges(),function(i){var a=n[i.v],f=n[i.w];if(!$t(a)&&!$t(f))f.indegree++,a.out.push(n[i.w])});var o=ar(n,function(i){return!i.indegree});return qf(o)}function qf(r){var e=[];function n(a){return function(f){if(f.merged)return;if($t(f.barycenter)||$t(a.barycenter)||f.barycenter>=a.barycenter)Hf(a,f)}}function o(a){return function(f){if(f.in.push(a),--f.indegree===0)r.push(f)}}while(r.length){var i=r.pop();e.push(i),v(i.in.reverse(),n(i)),v(i.out,o(i))}return E(ar(e,function(a){return!a.merged}),function(a){return K(a,["vs","i","barycenter","weight"])})}function Hf(r,e){var n=0,o=0;if(r.weight)n+=r.barycenter*r.weight,o+=r.weight;if(e.weight)n+=e.barycenter*e.weight,o+=e.weight;r.vs=e.vs.concat(r.vs),r.barycenter=n/o,r.weight=o,r.i=Math.min(e.i,r.i),e.merged=!0}function cn(r,e){var n=Ct(r,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),o=n.lhs,i=C(n.rhs,function(c){return-c.i}),a=[],f=0,s=0,u=0;o.sort(Kf(!!e)),u=dn(a,i,u),v(o,function(c){u+=c.vs.length,a.push(c.vs),f+=c.barycenter*c.weight,s+=c.weight,u=dn(a,i,u)});var d={vs:S(a)};if(s)d.barycenter=f/s,d.weight=s;return d}function dn(r,e,n){var o;while(e.length&&(o=G(e)).i<=n)e.pop(),r.push(o.vs),n++;return n}function Kf(r){return function(e,n){if(e.barycenter<n.barycenter)return-1;else if(e.barycenter>n.barycenter)return 1;return!r?e.i-n.i:n.i-e.i}}function Yr(r,e,n,o){var i=r.children(e),a=r.node(e),f=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,u={};if(f)i=ar(i,function(w){return w!==f&&w!==s});var d=sn(r,i);v(d,function(w){if(r.children(w.v).length){var y=Yr(r,w.v,n,o);if(u[w.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter"))Zf(w,y)}});var c=un(d,n);Jf(c,u);var m=cn(c,o);if(f){if(m.vs=S([f,m.vs,s]),r.predecessors(f).length){var h=r.node(r.predecessors(f)[0]),b=r.node(r.predecessors(s)[0]);if(!Object.prototype.hasOwnProperty.call(m,"barycenter"))m.barycenter=0,m.weight=0;m.barycenter=(m.barycenter*m.weight+h.order+b.order)/(m.weight+2),m.weight+=2}}return m}function Jf(r,e){v(r,function(n){n.vs=S(n.vs.map(function(o){if(e[o])return e[o].vs;return o}))})}function Zf(r,e){if(!$t(r.barycenter))r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight;else r.barycenter=e.barycenter,r.weight=e.weight}function mn(r){var e=Tr(r),n=pn(r,N(1,e+1),"inEdges"),o=pn(r,N(e-1,-1,-1),"outEdges"),i=fn(r);ln(r,i);var a=Number.POSITIVE_INFINITY,f;for(var s=0,u=0;u<4;++s,++u){$f(s%2?n:o,s%4>=2),i=B(r);var d=an(r,i);if(d<a)u=0,f=Fe(i),a=d}ln(r,f)}function pn(r,e,n){return E(e,function(o){return on(r,o,n)})}function $f(r,e){var n=new ze;v(r,function(o){var i=o.graph().root,a=Yr(o,i,n,e);v(a.vs,function(f,s){o.node(f).order=s}),nn(o,n,a.vs)})}function ln(r,e){v(e,function(n){v(n,function(o,i){r.node(o).order=i})})}function hn(r){var e=rs(r);v(r.graph().dummyChains,function(n){var o=r.node(n),i=o.edgeObj,a=Qf(r,e,i.v,i.w),{path:f,lca:s}=a,u=0,d=f[u],c=!0;while(n!==i.w){if(o=r.node(n),c){while((d=f[u])!==s&&r.node(d).maxRank<o.rank)u++;if(d===s)c=!1}if(!c){while(u<f.length-1&&r.node(d=f[u+1]).minRank<=o.rank)u++;d=f[u]}r.setParent(n,d),n=r.successors(n)[0]}})}function Qf(r,e,n,o){var i=[],a=[],f=Math.min(e[n].low,e[o].low),s=Math.max(e[n].lim,e[o].lim),u,d;u=n;do u=r.parent(u),i.push(u);while(u&&(e[u].low>f||s>e[u].lim));d=u,u=o;while((u=r.parent(u))!==d)a.push(u);return{path:i.concat(a.reverse()),lca:d}}function rs(r){var e={},n=0;function o(i){var a=n;v(r.children(i),o),e[i]={low:a,lim:n++}}return v(r.children(),o),e}function es(r,e){var n={};function o(i,a){var f=0,s=0,u=i.length,d=G(a);return v(a,function(c,m){var h=ns(r,c),b=h?r.node(h).order:u;if(h||c===d)v(a.slice(s,m+1),function(w){v(r.predecessors(w),function(y){var g=r.node(y),_=g.order;if((_<f||b<_)&&!(g.dummy&&r.node(w).dummy))gn(n,y,w)})}),s=m+1,f=b}),a}return io(e,o),n}function ts(r,e){var n={};function o(a,f,s,u,d){var c;v(N(f,s),function(m){if(c=a[m],r.node(c).dummy)v(r.predecessors(c),function(h){var b=r.node(h);if(b.dummy&&(b.order<u||b.order>d))gn(n,h,c)})})}function i(a,f){var s=-1,u,d=0;return v(f,function(c,m){if(r.node(c).dummy==="border"){var h=r.predecessors(c);if(h.length)u=r.node(h[0]).order,o(f,d,m,s,u),d=m,s=u}o(f,d,f.length,u,a.length)}),f}return io(e,i),n}function ns(r,e){if(r.node(e).dummy)return tr(r.predecessors(e),function(n){return r.node(n).dummy})}function gn(r,e,n){if(e>n){var o=e;e=n,n=o}if(!Object.prototype.hasOwnProperty.call(r,e))Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=r[e];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function os(r,e,n){if(e>n){var o=e;e=n,n=o}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function is(r,e,n,o){var i={},a={},f={};return v(e,function(s){v(s,function(u,d){i[u]=u,a[u]=u,f[u]=d})}),v(e,function(s){var u=-1;v(s,function(d){var c=o(d);if(c.length){c=C(c,function(y){return f[y]});var m=(c.length-1)/2;for(var h=Math.floor(m),b=Math.ceil(m);h<=b;++h){var w=c[h];if(a[d]===d&&u<f[w]&&!os(n,d,w))a[w]=d,a[d]=i[d]=i[w],u=f[w]}}})}),{root:i,align:a}}function as(r,e,n,o,i){var a={},f=fs(r,e,n,i),s=i?"borderLeft":"borderRight";function u(m,h){var b=f.nodes(),w=b.pop(),y={};while(w){if(y[w])m(w);else y[w]=!0,b.push(w),b=b.concat(h(w));w=b.pop()}}function d(m){a[m]=f.inEdges(m).reduce(function(h,b){return Math.max(h,a[b.v]+f.edge(b))},0)}function c(m){var h=f.outEdges(m).reduce(function(w,y){return Math.min(w,a[y.w]-f.edge(y))},Number.POSITIVE_INFINITY),b=r.node(m);if(h!==Number.POSITIVE_INFINITY&&b.borderType!==s)a[m]=Math.max(a[m],h)}return u(d,f.predecessors.bind(f)),u(c,f.successors.bind(f)),v(o,function(m){a[m]=a[n[m]]}),a}function fs(r,e,n,o){var i=new ze,a=r.graph(),f=cs(a.nodesep,a.edgesep,o);return v(e,function(s){var u;v(s,function(d){var c=n[d];if(i.setNode(c),u){var m=n[u],h=i.edge(m,c);i.setEdge(m,c,Math.max(f(r,d,u),h||0))}u=d})}),i}function ss(r,e){return q(Mr(e),function(n){var{NEGATIVE_INFINITY:o,POSITIVE_INFINITY:i}=Number;return Ke(n,function(a,f){var s=ps(r,f)/2;o=Math.max(a+s,o),i=Math.min(a-s,i)}),o-i})}function us(r,e){var n=Mr(e),o=j(n),i=I(n);v(["u","d"],function(a){v(["l","r"],function(f){var s=a+f,u=r[s],d;if(u===e)return;var c=Mr(u);if(d=f==="l"?o-j(c):i-I(c),d)r[s]=z(u,function(m){return m+d})})})}function ds(r,e){return z(r.ul,function(n,o){if(e)return r[e.toLowerCase()][o];else{var i=C(E(r,o));return(i[1]+i[2])/2}})}function bn(r){var e=B(r),n=nr(es(r,e),ts(r,e)),o={},i;v(["u","d"],function(f){i=f==="u"?e:Mr(e).reverse(),v(["l","r"],function(s){if(s==="r")i=E(i,function(m){return Mr(m).reverse()});var u=(f==="u"?r.predecessors:r.successors).bind(r),d=is(r,i,n,u),c=as(r,i,d.root,d.align,s==="r");if(s==="r")c=z(c,function(m){return-m});o[f+s]=c})});var a=ss(r,o);return us(o,a),ds(o,r.graph().align)}function cs(r,e,n){return function(o,i,a){var f=o.node(i),s=o.node(a),u=0,d;if(u+=f.width/2,Object.prototype.hasOwnProperty.call(f,"labelpos"))switch(f.labelpos.toLowerCase()){case"l":d=-f.width/2;break;case"r":d=f.width/2;break}if(d)u+=n?d:-d;if(d=0,u+=(f.dummy?e:r)/2,u+=(s.dummy?e:r)/2,u+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":d=s.width/2;break;case"r":d=-s.width/2;break}if(d)u+=n?d:-d;return d=0,u}}function ps(r,e){return r.node(e).width}function wn(r){r=br(r),ls(r),Je(bn(r),function(e,n){r.node(n).x=e})}function ls(r){var e=B(r),n=r.graph().ranksep,o=0;v(e,function(i){var a=I(E(i,function(f){return r.node(f).height}));v(i,function(f){r.node(f).y=o+a/2}),o+=a+n})}function qr(r,e){var n=e&&e.debugTiming?At:Rt;n("layout",()=>{var o=n(" buildLayoutGraph",()=>Os(r));n(" runLayout",()=>ms(o,n)),n(" updateInputGraph",()=>hs(r,o))})}function ms(r,e){e(" makeSpaceForEdgeLabels",()=>Is(r)),e(" removeSelfEdges",()=>js(r)),e(" acyclic",()=>Lt(r)),e(" nestingGraph.run",()=>rn(r)),e(" rank",()=>Vr(br(r))),e(" injectEdgeLabelProxies",()=>Ss(r)),e(" removeEmptyRanks",()=>Tt(r)),e(" nestingGraph.cleanup",()=>tn(r)),e(" normalizeRanks",()=>kt(r)),e(" assignRankMinMax",()=>Ns(r)),e(" removeEdgeLabelProxies",()=>Ps(r)),e(" normalize.run",()=>Xt(r)),e(" parentDummyChains",()=>hn(r)),e(" addBorderSegments",()=>jt(r)),e(" order",()=>mn(r)),e(" insertSelfEdges",()=>Bs(r)),e(" adjustCoordinateSystem",()=>Dt(r)),e(" position",()=>wn(r)),e(" positionSelfEdges",()=>Ds(r)),e(" removeBorderNodes",()=>Ms(r)),e(" normalize.undo",()=>Ut(r)),e(" fixupEdgeLabelCoords",()=>As(r)),e(" undoCoordinateSystem",()=>Ft(r)),e(" translateGraph",()=>ks(r)),e(" assignNodeIntersects",()=>Cs(r)),e(" reversePoints",()=>Rs(r)),e(" acyclic.undo",()=>It(r))}function hs(r,e){v(r.nodes(),function(n){var o=r.node(n),i=e.node(n);if(o){if(o.x=i.x,o.y=i.y,e.children(n).length)o.width=i.width,o.height=i.height}}),v(r.edges(),function(n){var o=r.edge(n),i=e.edge(n);if(o.points=i.points,Object.prototype.hasOwnProperty.call(i,"x"))o.x=i.x,o.y=i.y}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var gs=["nodesep","edgesep","ranksep","marginx","marginy"],vs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},bs=["acyclicer","ranker","rankdir","align"],ys=["width","height"],ws={width:0,height:0},_s=["minlen","weight","width","height","labeloffset"],Es={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xs=["labelpos"];function Os(r){var e=new ze({multigraph:!0,compound:!0}),n=Wr(r.graph());return e.setGraph(nr({},vs,zr(n,gs),K(n,bs))),v(r.nodes(),function(o){var i=Wr(r.node(o));e.setNode(o,Xe(zr(i,ys),ws)),e.setParent(o,r.parent(o))}),v(r.edges(),function(o){var i=Wr(r.edge(o));e.setEdge(o,nr({},Es,zr(i,_s),K(i,xs)))}),e}function Is(r){var e=r.graph();e.ranksep/=2,v(r.edges(),function(n){var o=r.edge(n);if(o.minlen*=2,o.labelpos.toLowerCase()!=="c")if(e.rankdir==="TB"||e.rankdir==="BT")o.width+=o.labeloffset;else o.height+=o.labeloffset})}function Ss(r){v(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var o=r.node(e.v),i=r.node(e.w),a={rank:(i.rank-o.rank)/2+o.rank,e};k(r,"edge-proxy",a,"_ep")}})}function Ns(r){var e=0;v(r.nodes(),function(n){var o=r.node(n);if(o.borderTop)o.minRank=r.node(o.borderTop).rank,o.maxRank=r.node(o.borderBottom).rank,e=I(e,o.maxRank)}),r.graph().maxRank=e}function Ps(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(e)})}function ks(r){var e=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,i=0,a=r.graph(),f=a.marginx||0,s=a.marginy||0;function u(d){var{x:c,y:m,width:h,height:b}=d;e=Math.min(e,c-h/2),n=Math.max(n,c+h/2),o=Math.min(o,m-b/2),i=Math.max(i,m+b/2)}v(r.nodes(),function(d){u(r.node(d))}),v(r.edges(),function(d){var c=r.edge(d);if(Object.prototype.hasOwnProperty.call(c,"x"))u(c)}),e-=f,o-=s,v(r.nodes(),function(d){var c=r.node(d);c.x-=e,c.y-=o}),v(r.edges(),function(d){var c=r.edge(d);if(v(c.points,function(m){m.x-=e,m.y-=o}),Object.prototype.hasOwnProperty.call(c,"x"))c.x-=e;if(Object.prototype.hasOwnProperty.call(c,"y"))c.y-=o}),a.width=n-e+f,a.height=i-o+s}function Cs(r){v(r.edges(),function(e){var n=r.edge(e),o=r.node(e.v),i=r.node(e.w),a,f;if(!n.points)n.points=[],a=i,f=o;else a=n.points[0],f=n.points[n.points.length-1];n.points.unshift(Pr(o,a)),n.points.push(Pr(i,f))})}function As(r){v(r.edges(),function(e){var n=r.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function Rs(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function Ms(r){v(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),o=r.node(n.borderTop),i=r.node(n.borderBottom),a=r.node(G(n.borderLeft)),f=r.node(G(n.borderRight));n.width=Math.abs(f.x-a.x),n.height=Math.abs(i.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}}),v(r.nodes(),function(e){if(r.node(e).dummy==="border")r.removeNode(e)})}function js(r){v(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function Bs(r){var e=B(r);v(e,function(n){var o=0;v(n,function(i,a){var f=r.node(i);f.order=a+o,v(f.selfEdges,function(s){k(r,"selfedge",{width:s.label.width,height:s.label.height,rank:f.rank,order:a+ ++o,e:s.e,label:s.label},"_se")}),delete f.selfEdges})})}function Ds(r){v(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var o=r.node(n.e.v),i=o.x+o.width/2,a=o.y,f=n.x-i,s=o.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:i+2*f/3,y:a-s},{x:i+5*f/6,y:a-s},{x:i+f,y:a},{x:i+5*f/6,y:a+s},{x:i+2*f/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function zr(r,e){return z(K(r,e),Number)}function Wr(r){var e={};return v(r,function(n,o){e[o.toLowerCase()]=n}),e}var _n=t((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),En=t((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Fs=t((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),Gs=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Xs=t((r,e,n,o,i)=>{let a=[],f=new Set;if(n.forEach(({start:c,end:m})=>{if(c!==o)f.add(c);if(m!==o)f.add(m)}),f.forEach((c)=>{let m=r.node(c);if(typeof m?.x==="number"&&typeof m?.y==="number")a.push(m)}),a.length===0)n.forEach(({edge:c})=>{(c.points??[]).forEach((m)=>{if(typeof m?.x==="number"&&typeof m?.y==="number")a.push(m)})});if(a.length===0)return En(i);let s=a.reduce((c,m)=>({x:c.x+m.x/a.length,y:c.y+m.y/a.length}),{x:0,y:0}),u=s.x-e.x,d=s.y-e.y;if(Math.abs(u)>Math.abs(d))return u>0?"right":"left";if(Math.abs(d)>0)return d>0?"bottom":"top";return En(i)},"getSelfLoopSide"),Us=t((r,e="top",n=0,o=0)=>{let i=r.x,a=r.y-n,f=r.width/2,s=r.height/2,u=Math.max(36,Math.min(100,r.width*0.8)),d=_n(Math.max(o,r.width*0.35),36,u),c=_n(Math.min(r.width,r.height)*0.45,24,48);switch(e){case"bottom":{let m=a+s;return[{x:i-d/2,y:m},{x:i-d/2,y:m+c},{x:i+d/2,y:m+c},{x:i+d/2,y:m}]}case"right":{let m=i+f;return[{x:m,y:a-d/2},{x:m+c,y:a-d/2},{x:m+c,y:a+d/2},{x:m,y:a+d/2}]}case"left":{let m=i-f;return[{x:m,y:a-d/2},{x:m-c,y:a-d/2},{x:m-c,y:a+d/2},{x:m,y:a+d/2}]}case"top":default:{let m=a-s;return[{x:i-d/2,y:m},{x:i-d/2,y:m-c},{x:i+d/2,y:m-c},{x:i+d/2,y:m}]}}},"getSelfLoopPoints"),Vs=t((r,e,n="top",o=0,i={})=>{let f=r.x,s=r.y-o,u=i.width??0,d=i.height??0;switch(n){case"bottom":return{x:f,y:Math.max(...e.map((c)=>c.y))+d/2+4};case"right":return{x:Math.max(...e.map((c)=>c.x))+u/2+4,y:s};case"left":return{x:Math.min(...e.map((c)=>c.x))-u/2-4,y:s};case"top":default:return{x:f,y:Math.min(...e.map((c)=>c.y))-d/2-4}}},"getSelfLoopLabelPosition"),On=t((r,e=0,{mergeSelfLoops:n=!0}={})=>{let o=new Map,i=[],a=r.graph()?.rankdir;return r.edges().forEach((f)=>{let s=r.edge(f);if(n&&s.selfLoop){let u=s.selfLoop.id;if(!o.has(u))o.set(u,[]);o.get(u).push({edge:s,start:f.v,end:f.w})}else i.push({edge:s,start:f.v,end:f.w})}),o.forEach((f)=>{if(f.length!==3){f.forEach((_)=>i.push(_));return}f.sort((_,A)=>_.edge.selfLoop.order-A.edge.selfLoop.order);let[s,u,d]=f,c=s.edge.originalEdge??u.edge.originalEdge??d.edge.originalEdge??u.edge,m=r.node(c.start);if(!m){f.forEach((_)=>i.push(_));return}let h={width:u.edge.width,height:u.edge.height},b=Xs(r,m,f,c.start,a),w=Us(m,b,e,h.width??0),y=Vs(m,w,b,e,h),g={...u.edge,...c,id:c.id,points:w,start:c.start,end:c.end,x:y.x,y:y.y,width:h.width,height:h.height,labelStyle:u.edge.labelStyle,fromCluster:s.edge.fromCluster??u.edge.fromCluster??d.edge.fromCluster,toCluster:s.edge.toCluster??u.edge.toCluster??d.edge.toCluster};delete g.selfLoop,delete g.originalEdge,i.push({edge:g,start:g.start,end:g.end})}),i},"getEdgesToRender"),Ln=t(async({element:r,graph:e,diagramType:n,id:o,parentCluster:i,siteConfig:a})=>{let f=e.graph().rankdir;l.trace("Dir in recursive render - dir:",f);let{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:m}=Qd(r,{edgePathsClass:"edgePaths"});if(!e.nodes())l.info("No nodes found for",e);else l.info("Recursive render XXX",e.nodes());if(e.edges().length>0)l.info("Recursive edges",e.edge(e.edges()[0]));let h=Fs(n);await Promise.all(e.nodes().map(async function(y){let g=e.node(y);if(i!==void 0){let _=JSON.parse(JSON.stringify(i.clusterData));if(l.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,y,`
3
3
  data=`,_.height,`
4
- Parent cluster`,i.height),e.setNode(i.id,_),!e.parent(y))l.trace("Setting parent",y,i.id),e.setParent(y,i.id,_)}if(l.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){l.info("Cluster identified XBX",y,g.width,e.node(y));let{ranksep:_,nodesep:A}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:_+25,nodesep:A});let Hr=await Hs({element:c,graph:g.graph,diagramType:n,id:o,parentCluster:e.node(y),siteConfig:a}),Kr=Hr.elem;H(g,Kr),g.diff=Hr.diff||0,l.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),Ng(Kr,g)}else if(e.children(y).length>0)l.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",e),l.trace(Es(g.id,e)),Ae.set(g.id,{id:Es(g.id,e),node:g});else l.trace("Node - the non recursive path XAX",y,c,e.node(y),f),await Ed(c,e.node(y),{config:a,dir:f})})),await t(async()=>{let y=e.edges().map(async function(g){let _=e.edge(g.v,g.w,g.name);if(l.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),l.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),l.info("Fix",Ae,"ids:",g.v,g.w,"Translating: ",Ae.get(g.v),Ae.get(g.w)),h&&_.selfLoop){if(_.selfLoop.order!==1)return;let A={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await ma(d,A),_.width=A.width,_.height=A.height,_.labelStyle=A.labelStyle;return}await ma(d,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=da(a);return{elem:m,graph:e,groups:{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:m},diagramType:n,id:o,mergeSelfLoops:h,subGraphTitleTotalMargin:w}},"measureDagreGraph"),Sn=t((r)=>{l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),qr(r)},"runDagreGraphLayout"),Ys=t((r,e,n)=>{let o=r.node(e);if(!o)return;let i={...o};if(o?.clusterNode)i.y=(o.y??0)+n;else if(r.children(e).length>0)i.height=(o.height??0)+n;else i.y=(o.y??0)+n/2;return i},"normalizeDagreNode"),On=t((r,e)=>{Gs.forEach((n)=>{if(e[n]!==void 0)r[n]=e[n]})},"applyDagreNodeLayout"),zs=t((r,e,n,o)=>({...r,start:r.start??e,end:r.end??n,points:(r.points??[]).map((i)=>({...i,y:typeof i.y==="number"?i.y+o:i.y}))}),"normalizeDagreEdge"),Ws=t((r,e)=>{let{graph:n,mergeSelfLoops:o,subGraphTitleTotalMargin:i=0}=e,a=new Map(r.nodes.map((s)=>[s.id,s]));Bd(n).forEach((s)=>{let u=Ys(n,s,i);if(!u)return;On(n.node(s),u);let d=a.get(s);if(d)On(d,u)});let f=i/2;return r.edges=Ln(n,f,{mergeSelfLoops:o}).map(({edge:s,start:u,end:d})=>zs(s,u,d,f)),r},"applyDagreLayoutResult"),qs=t(async({elem:r,graph:e,groups:{clusters:n,edgePaths:o},diagramType:i,id:a,mergeSelfLoops:f,subGraphTitleTotalMargin:s})=>{let u=0;await Promise.all(Bd(e).map(async function(m){let h=e.node(m);if(l.info("Position XBX => "+m+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h?.clusterNode)h.y+=s,l.info("A tainted cluster node XBX1",m,h.id,h.width,h.height,h.x,h.y,e.parent(m)),Ae.get(h.id).node=h,Ur(h);else if(e.children(m).length>0){l.info("A pure cluster node XBX1",m,h.id,h.x,h.y,h.width,h.height,e.parent(m)),h.height+=s,e.node(h.parentId);let b=h?.padding/2||0,w=h?.labelBBox?.height||0,y=w-b||0;l.debug("OffsetY",y,"labelHeight",w,"halfPadding",b),await uo(n,h),Ae.get(h.id).node=h}else{let b=e.node(h.parentId);h.y+=s/2,l.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",b,b?.offsetY,h),Ur(h)}}));let d=s/2;return Ln(e,d,{mergeSelfLoops:f}).forEach(function({edge:m,start:h,end:b}){l.info("Edge "+h+" -> "+b+": "+JSON.stringify(m),m),m.points.forEach((_)=>_.y+=d);let w=e.node(h),y=e.node(b),g=po(o,m,Ae,i,w,y,a);Ds(m,g)}),e.nodes().forEach(function(m){let h=e.node(m);if(l.info(m,h.type,h.diff),h.isGroup)u=h.diff}),l.warn("Returning from recursive render XAX",r,u),{elem:r,diff:u}},"paintDagreLayoutCore"),Hs=t(async(r)=>{let e=await In(r);return Sn(e.graph),await qs(e)},"renderDagreSubgraph"),Nn=t((r)=>{let e=new Oe({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach((n)=>{if(e.setNode(n.id,{...n}),n.parentId)e.setParent(n.id,n.parentId)}),l.debug("Edges:",r.edges),r.edges.forEach((n)=>{if(n.start===n.end){let o=n.start,i=o+"---"+o+"---1",a=o+"---"+o+"---2",f=e.node(o);e.setNode(i,{domId:i,id:i,parentId:f.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(i,f.parentId),e.setNode(a,{domId:a,id:a,parentId:f.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(a,f.parentId);let s=structuredClone(n),u=structuredClone(n),d=structuredClone(n),c=structuredClone(n);if(u.originalEdge=s,u.selfLoop={id:s.id,order:0},d.originalEdge=s,d.selfLoop={id:s.id,order:1},c.originalEdge=s,c.selfLoop={id:s.id,order:2},u.label="",u.arrowTypeEnd="none",u.endLabelLeft="",u.endLabelRight="",u.startLabelLeft="",u.id=o+"-cyclic-special-1",d.startLabelRight="",d.startLabelLeft="",d.endLabelLeft="",d.endLabelRight="",d.arrowTypeStart="none",d.arrowTypeEnd="none",d.id=o+"-cyclic-special-mid",c.label="",c.startLabelRight="",c.startLabelLeft="",c.arrowTypeStart="none",f.isGroup)u.fromCluster=o,c.toCluster=o;c.id=o+"-cyclic-special-2",c.arrowTypeStart="none",e.setEdge(o,i,u,o+"-cyclic-special-0"),e.setEdge(i,a,d,o+"-cyclic-special-1"),e.setEdge(a,o,c,o+"-cyclic-special-2")}else e.setEdge(n.start,n.end,{...n},n.id)}),kg(e),{graph:e}},"prepareLayoutForDagre"),Ks=t(async(r,{element:e,preparedLayout:n})=>{let o=n??Nn(r),i=p(),a=await In({element:e,graph:o.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:i});return o.measuredLayout=a,a},"measureDagreLayout"),Js=t((r,e)=>{let n=e.preparedLayout?.measuredLayout;if(!n)throw Error("runDagreLayoutCore requires measureDagreLayout to run first");return Sn(n.graph),Ws(r,n),n},"runDagreLayoutCore"),Zs=t((r,{measure:e})=>Bd(e.graph).map((n)=>e.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),$s=t((r,e,{measure:n})=>r?n.graph.node(r):void 0,"getDagreEdgeNode"),Kg=Uo({prepareLayout:Nn,measureLayout:Ks,runLayoutCore:Js,paintOptions:{clusterDb:Ae,getNodes:Zs,getEdgeNode:$s,skipNode:t((r,{measure:e})=>!e.graph.hasNode(r.id),"skipNode"),isCluster:t((r,{measure:e})=>e.graph.hasNode(r.id)&&(e.graph.children(r.id)??[]).length>0,"isCluster")}});export{Ws as applyDagreLayoutResult,Ln as getEdgesToRender,Ks as measureDagreLayout,Nn as prepareLayoutForDagre,Kg as render,Js as runDagreLayoutCore};
4
+ Parent cluster`,i.height),e.setNode(i.id,_),!e.parent(y))l.trace("Setting parent",y,i.id),e.setParent(y,i.id,_)}if(l.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),g?.clusterNode){l.info("Cluster identified XBX",y,g.width,e.node(y));let{ranksep:_,nodesep:A}=e.graph();g.graph.setGraph({...g.graph.graph(),ranksep:_+25,nodesep:A});let Hr=await Hs({element:c,graph:g.graph,diagramType:n,id:o,parentCluster:e.node(y),siteConfig:a}),Kr=Hr.elem;H(g,Kr),g.diff=Hr.diff||0,l.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),zg(Kr,g)}else if(e.children(y).length>0)l.trace("Cluster - the non recursive path XBX",y,g.id,g,g.width,"Graph:",e),l.trace(Ts(g.id,e)),Ae.set(g.id,{id:Ts(g.id,e),node:g});else l.trace("Node - the non recursive path XAX",y,c,e.node(y),f),await Nd(c,e.node(y),{config:a,dir:f})})),await t(async()=>{let y=e.edges().map(async function(g){let _=e.edge(g.v,g.w,g.name);if(l.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(g)),l.info("Edge "+g.v+" -> "+g.w+": ",g," ",JSON.stringify(e.edge(g))),l.info("Fix",Ae,"ids:",g.v,g.w,"Translating: ",Ae.get(g.v),Ae.get(g.w)),h&&_.selfLoop){if(_.selfLoop.order!==1)return;let A={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await fa(d,A),_.width=A.width,_.height=A.height,_.labelStyle=A.labelStyle;return}await fa(d,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=pa(a);return{elem:m,graph:e,groups:{clusters:s,edgePaths:u,edgeLabels:d,nodes:c,rootGroups:m},diagramType:n,id:o,mergeSelfLoops:h,subGraphTitleTotalMargin:w}},"measureDagreGraph"),In=t((r)=>{l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),qr(r)},"runDagreGraphLayout"),Ys=t((r,e,n)=>{let o=r.node(e);if(!o)return;let i={...o};if(o?.clusterNode)i.y=(o.y??0)+n;else if(r.children(e).length>0)i.height=(o.height??0)+n;else i.y=(o.y??0)+n/2;return i},"normalizeDagreNode"),xn=t((r,e)=>{Gs.forEach((n)=>{if(e[n]!==void 0)r[n]=e[n]})},"applyDagreNodeLayout"),zs=t((r,e,n,o)=>({...r,start:r.start??e,end:r.end??n,points:(r.points??[]).map((i)=>({...i,y:typeof i.y==="number"?i.y+o:i.y}))}),"normalizeDagreEdge"),Ws=t((r,e)=>{let{graph:n,mergeSelfLoops:o,subGraphTitleTotalMargin:i=0}=e,a=new Map(r.nodes.map((s)=>[s.id,s]));Rd(n).forEach((s)=>{let u=Ys(n,s,i);if(!u)return;xn(n.node(s),u);let d=a.get(s);if(d)xn(d,u)});let f=i/2;return r.edges=On(n,f,{mergeSelfLoops:o}).map(({edge:s,start:u,end:d})=>zs(s,u,d,f)),r},"applyDagreLayoutResult"),qs=t(async({elem:r,graph:e,groups:{clusters:n,edgePaths:o},diagramType:i,id:a,mergeSelfLoops:f,subGraphTitleTotalMargin:s})=>{let u=0;await Promise.all(Rd(e).map(async function(m){let h=e.node(m);if(l.info("Position XBX => "+m+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h?.clusterNode)h.y+=s,l.info("A tainted cluster node XBX1",m,h.id,h.width,h.height,h.x,h.y,e.parent(m)),Ae.get(h.id).node=h,Gr(h);else if(e.children(m).length>0){l.info("A pure cluster node XBX1",m,h.id,h.x,h.y,h.width,h.height,e.parent(m)),h.height+=s,e.node(h.parentId);let b=h?.padding/2||0,w=h?.labelBBox?.height||0,y=w-b||0;l.debug("OffsetY",y,"labelHeight",w,"halfPadding",b),await po(n,h),Ae.get(h.id).node=h}else{let b=e.node(h.parentId);h.y+=s/2,l.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",b,b?.offsetY,h),Gr(h)}}));let d=s/2;return On(e,d,{mergeSelfLoops:f}).forEach(function({edge:m,start:h,end:b}){l.info("Edge "+h+" -> "+b+": "+JSON.stringify(m),m),m.points.forEach((_)=>_.y+=d);let w=e.node(h),y=e.node(b),g=mo(o,m,Ae,i,w,y,a);Ls(m,g)}),e.nodes().forEach(function(m){let h=e.node(m);if(l.info(m,h.type,h.diff),h.isGroup)u=h.diff}),l.warn("Returning from recursive render XAX",r,u),{elem:r,diff:u}},"paintDagreLayoutCore"),Hs=t(async(r)=>{let e=await Ln(r);return In(e.graph),await qs(e)},"renderDagreSubgraph"),Sn=t((r)=>{let e=new ze({multigraph:!0,compound:!0}).setGraph({rankdir:r.direction,nodesep:r.config?.nodeSpacing||r.nodeSpacing||r.config?.flowchart?.nodeSpacing,ranksep:r.config?.rankSpacing||r.rankSpacing||r.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return r.nodes.forEach((n)=>{if(e.setNode(n.id,{...n}),n.parentId)e.setParent(n.id,n.parentId)}),l.debug("Edges:",r.edges),r.edges.forEach((n)=>{if(n.start===n.end){let o=n.start,i=o+"---"+o+"---1",a=o+"---"+o+"---2",f=e.node(o);e.setNode(i,{domId:i,id:i,parentId:f.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(i,f.parentId),e.setNode(a,{domId:a,id:a,parentId:f.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(a,f.parentId);let s=structuredClone(n),u=structuredClone(n),d=structuredClone(n),c=structuredClone(n);if(u.originalEdge=s,u.selfLoop={id:s.id,order:0},d.originalEdge=s,d.selfLoop={id:s.id,order:1},c.originalEdge=s,c.selfLoop={id:s.id,order:2},u.label="",u.arrowTypeEnd="none",u.endLabelLeft="",u.endLabelRight="",u.startLabelLeft="",u.id=o+"-cyclic-special-1",d.startLabelRight="",d.startLabelLeft="",d.endLabelLeft="",d.endLabelRight="",d.arrowTypeStart="none",d.arrowTypeEnd="none",d.id=o+"-cyclic-special-mid",c.label="",c.startLabelRight="",c.startLabelLeft="",c.arrowTypeStart="none",f.isGroup)u.fromCluster=o,c.toCluster=o;c.id=o+"-cyclic-special-2",c.arrowTypeStart="none",e.setEdge(o,i,u,o+"-cyclic-special-0"),e.setEdge(i,a,d,o+"-cyclic-special-1"),e.setEdge(a,o,c,o+"-cyclic-special-2")}else e.setEdge(n.start,n.end,{...n},n.id)}),Sg(e),{graph:e}},"prepareLayoutForDagre"),Ks=t(async(r,{element:e,preparedLayout:n})=>{let o=n??Sn(r),i=p(),a=await Ln({element:e,graph:o.graph,diagramType:r.type,id:r.diagramId,parentCluster:void 0,siteConfig:i});return o.measuredLayout=a,a},"measureDagreLayout"),Js=t((r,e)=>{let n=e.preparedLayout?.measuredLayout;if(!n)throw Error("runDagreLayoutCore requires measureDagreLayout to run first");return In(n.graph),Ws(r,n),n},"runDagreLayoutCore"),Zs=t((r,{measure:e})=>Rd(e.graph).map((n)=>e.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),$s=t((r,e,{measure:n})=>r?n.graph.node(r):void 0,"getDagreEdgeNode"),Kg=qo({prepareLayout:Sn,measureLayout:Ks,runLayoutCore:Js,paintOptions:{clusterDb:Ae,getNodes:Zs,getEdgeNode:$s,skipNode:t((r,{measure:e})=>!e.graph.hasNode(r.id),"skipNode"),isCluster:t((r,{measure:e})=>e.graph.hasNode(r.id)&&(e.graph.children(r.id)??[]).length>0,"isCluster")}});export{Ws as applyDagreLayoutResult,On as getEdgesToRender,Ks as measureDagreLayout,Sn as prepareLayoutForDagre,Kg as render,Js as runDagreLayoutCore};