@kabmo-labs/kabmo 0.46.0 → 0.47.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 (301) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +439 -435
  3. package/dist/client/static/js/{CsvGrid-br4j001k.js → CsvGrid-vfgttmym.js} +2 -2
  4. package/dist/client/static/js/{DocxView-kmtkbmmw.js → DocxView-dc41t6rp.js} +2 -2
  5. package/dist/client/static/js/{DrawioView-3df0g3jr.js → DrawioView-wpwr38d9.js} +2 -2
  6. package/dist/client/static/js/HtmlPreview-23n7t5cs.js +1 -0
  7. package/dist/client/static/js/ImageView-mvjb3qh1.js +1 -0
  8. package/dist/client/static/js/LayoutWrapper-eenx0hp2.js +2 -0
  9. package/dist/client/static/js/{Modal-tmxhxd6q.js → Modal-dsqhas10.js} +13 -13
  10. package/dist/client/static/js/{PdfView-p5z7c7eg.js → PdfView-cpvsbfk0.js} +1 -1
  11. package/dist/client/static/js/{SessionsView-t06h6zfx.js → SessionsView-s0crtcm8.js} +1 -1
  12. package/dist/client/static/js/{SheetView-agw459v2.js → SheetView-n6mst0hq.js} +13 -13
  13. package/dist/client/static/js/{SvgPreview-b9rfy1h6.js → SvgPreview-g2aqq812.js} +1 -1
  14. package/dist/client/static/js/{abnfDiagram-O67JEVCF-wbnhzcnj.js → abnfDiagram-O67JEVCF-3vac8sq4.js} +1 -1
  15. package/dist/client/static/js/architecture-7GRP2DOG-b5w9mnn5.js +1 -0
  16. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-t2sgevea.js → architectureDiagram-NJMV4G6O-1nh4htz2.js} +3 -3
  17. package/dist/client/static/js/{astro-hyj5wege.js → astro-63zcysj7.js} +1 -1
  18. package/dist/client/static/js/bash-hv3167gh.js +1 -0
  19. package/dist/client/static/js/{blockDiagram-BEXU5L5S-v2nzp54a.js → blockDiagram-BEXU5L5S-62z6kaar.js} +2 -2
  20. package/dist/client/static/js/{c4Diagram-YGBWAQC7-7h03146b.js → c4Diagram-YGBWAQC7-rts5zgx4.js} +3 -3
  21. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-m57e9kp1.js → classDiagram-v2-NBCMYWYE-tnpww186.js} +1 -1
  22. package/dist/client/static/js/{cose-bilkent-JH36ORCC-c4tnh4mg.js → cose-bilkent-JH36ORCC-8vsjbzwa.js} +1 -1
  23. package/dist/client/static/js/cpp-v2mqp8j7.js +1 -0
  24. package/dist/client/static/js/css-x7gyc3ta.js +1 -0
  25. package/dist/client/static/js/cynefin-OW5HDTMX-kdj8rjc1.js +1 -0
  26. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-mjf6njey.js → cynefinDiagram-VND7K2PF-005gc8km.js} +1 -1
  27. package/dist/client/static/js/{dagre-6A5THRUB-6yma9ch3.js → dagre-6A5THRUB-41zsteyd.js} +2 -2
  28. package/dist/client/static/js/{diagram-22UHCM2B-1q4ce2gb.js → diagram-22UHCM2B-prsm18a1.js} +3 -3
  29. package/dist/client/static/js/{diagram-3UASUU5V-0ttps29p.js → diagram-3UASUU5V-5nx9wf04.js} +1 -1
  30. package/dist/client/static/js/{diagram-ATOU4E4O-1mzexgv1.js → diagram-ATOU4E4O-k3d4z3aq.js} +3 -3
  31. package/dist/client/static/js/{diagram-CDSNMT55-4ae89t23.js → diagram-CDSNMT55-x2c5x5j2.js} +2 -2
  32. package/dist/client/static/js/{diagram-MLGK6HIB-057jaqvh.js → diagram-MLGK6HIB-nvr76jqh.js} +1 -1
  33. package/dist/client/static/js/{diagram-MPIPVDR6-p6yyq5sx.js → diagram-MPIPVDR6-v1jpzp9p.js} +1 -1
  34. package/dist/client/static/js/{dockerfile-00hqsk9c.js → dockerfile-vz6va73h.js} +1 -1
  35. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-bsk7dvm4.js → ebnfDiagram-ZINNZB2B-0v4tqr9v.js} +1 -1
  36. package/dist/client/static/js/{elk-276RUBZZ-dsq91er5.js → elk-276RUBZZ-qfn4r7xj.js} +1 -1
  37. package/dist/client/static/js/{erDiagram-OPXOYQCR-p7p13mbh.js → erDiagram-OPXOYQCR-cd667n9f.js} +4 -4
  38. package/dist/client/static/js/{erlang-814e8qy5.js → erlang-vk66vt7q.js} +1 -1
  39. package/dist/client/static/js/eventmodeling-NTZA5JFV-m57b7ytw.js +1 -0
  40. package/dist/client/static/js/flowDiagram-KWPJA3E3-fasj2gxy.js +1 -0
  41. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-bwgnttyk.js → ganttDiagram-FUAMR5RP-ps0h3drm.js} +1 -1
  42. package/dist/client/static/js/gitGraph-4MIJSDKK-wvzsc4ph.js +1 -0
  43. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-ca0gj5am.js → gitGraphDiagram-X574FWY7-fts23jer.js} +2 -2
  44. package/dist/client/static/js/graphql-a4gbqpj9.js +1 -0
  45. package/dist/client/static/js/{index-y2z8nsvw.js → index-0dkc6z8e.js} +2 -2
  46. package/dist/client/static/js/{index-eqhjs1yv.js → index-1d8bxjsz.js} +4 -4
  47. package/dist/client/static/js/{index-kty4ncsr.js → index-1whzs9kb.js} +2 -2
  48. package/dist/client/static/js/{index-qfxn7yh5.js → index-396r53n0.js} +2 -2
  49. package/dist/client/static/js/{index-qn200x1b.js → index-39d8zbkx.js} +6 -6
  50. package/dist/client/static/js/{index-dn7hg4em.js → index-3nsrnyqr.js} +2 -2
  51. package/dist/client/static/js/{index-jkay7aw7.js → index-4jzsr1ky.js} +2 -2
  52. package/dist/client/static/js/{index-064vdkrs.js → index-4wnzs76g.js} +1 -1
  53. package/dist/client/static/js/{index-16sd19f0.js → index-4x9p7hf9.js} +2 -2
  54. package/dist/client/static/js/{index-zq0qxb17.js → index-52nd4hgm.js} +1 -1
  55. package/dist/client/static/js/{index-8pksqzwq.js → index-54mkp2r2.js} +1 -1
  56. package/dist/client/static/js/{index-abs635a1.js → index-56rtb871.js} +25 -25
  57. package/dist/client/static/js/{index-dxvtjn6a.js → index-5f4b44ay.js} +2 -2
  58. package/dist/client/static/js/{index-95kese1h.js → index-6009v8jf.js} +1 -1
  59. package/dist/client/static/js/{index-29npynva.js → index-62jgcgfd.js} +5 -5
  60. package/dist/client/static/js/{index-nw5mvcaj.js → index-64p1dncg.js} +2 -2
  61. package/dist/client/static/js/{index-fj5rsp5v.js → index-6d6hxwb5.js} +2 -2
  62. package/dist/client/static/js/{index-19x11s5w.js → index-70g527sb.js} +2 -2
  63. package/dist/client/static/js/{index-9d3n04vb.js → index-7zeah164.js} +2 -2
  64. package/dist/client/static/js/{index-5h8y54t6.js → index-7zedprz3.js} +1 -1
  65. package/dist/client/static/js/{index-g7s0wsag.js → index-9ab6xaxd.js} +2 -2
  66. package/dist/client/static/js/index-9vqkyj58.js +3 -0
  67. package/dist/client/static/js/{index-x1fqhhpp.js → index-9xsf8162.js} +35 -35
  68. package/dist/client/static/js/{index-j718pxb3.js → index-a4h5np9r.js} +2 -2
  69. package/dist/client/static/js/{index-bjv5ga2e.js → index-an2wv33f.js} +2 -2
  70. package/dist/client/static/js/{index-64sqfr4a.js → index-c5hjht5e.js} +2 -2
  71. package/dist/client/static/js/{index-aagt3382.js → index-c63qyysm.js} +1 -1
  72. package/dist/client/static/js/{index-red856x6.js → index-ccgzzydx.js} +1 -1
  73. package/dist/client/static/js/{index-ex5dtdx2.js → index-cra9mgkq.js} +4 -4
  74. package/dist/client/static/js/index-cvyqp8nz.css +1 -0
  75. package/dist/client/static/js/index-d2xtbabt.js +2 -0
  76. package/dist/client/static/js/{index-7055hdx1.js → index-dxkefysk.js} +1 -1
  77. package/dist/client/static/js/index-dxp2yvy7.js +2 -0
  78. package/dist/client/static/js/{index-vjmg7kn5.js → index-dyc886cc.js} +1 -1
  79. package/dist/client/static/js/{index-5wz0y88c.js → index-dzeyd153.js} +2 -2
  80. package/dist/client/static/js/{index-qf3y3ahx.js → index-e5j5gc4h.js} +2 -2
  81. package/dist/client/static/js/{index-2ks0m8ss.js → index-evmcc5qh.js} +2 -2
  82. package/dist/client/static/js/{index-f7te27n5.js → index-f2ahkev0.js} +5 -5
  83. package/dist/client/static/js/{index-5gf52a6d.js → index-fjex1y0t.js} +2 -2
  84. package/dist/client/static/js/{index-bafe7hmd.js → index-fxd8dfj4.js} +2 -2
  85. package/dist/client/static/js/{index-trvqvb1v.js → index-g4kkapka.js} +2 -2
  86. package/dist/client/static/js/{index-561gkvve.js → index-gzkzwgzv.js} +2 -2
  87. package/dist/client/static/js/{index-twsbv1yn.js → index-n1yr4khe.js} +1 -1
  88. package/dist/client/static/js/{index-d23eacf2.js → index-nkahe229.js} +2 -2
  89. package/dist/client/static/js/{index-3bf7r7z4.js → index-p6s3fz6b.js} +11 -11
  90. package/dist/client/static/js/{index-hnb66d3s.js → index-q4ke39rh.js} +2 -2
  91. package/dist/client/static/js/index-qtd0e38d.js +1 -0
  92. package/dist/client/static/js/{index-ncpwteyt.js → index-tqgj7rd9.js} +2 -2
  93. package/dist/client/static/js/{index-wbws16ag.js → index-x0xspam4.js} +2 -2
  94. package/dist/client/static/js/{index-amys498v.js → index-x2v1zmth.js} +186 -186
  95. package/dist/client/static/js/{index-pwe6chtp.js → index-x9hfvbz6.js} +1 -1
  96. package/dist/client/static/js/{index-dr5hca5b.js → index-xk1cqjkn.js} +3 -3
  97. package/dist/client/static/js/{index-k5zfzgez.js → index-y6ke70e6.js} +2 -2
  98. package/dist/client/static/js/{index-zedt16w7.js → index-zhjjpvcc.js} +1 -1
  99. package/dist/client/static/js/info-A6RAGUB7-ym2xevn8.js +1 -0
  100. package/dist/client/static/js/{infoDiagram-VRGFBTTK-7q58qdf1.js → infoDiagram-VRGFBTTK-88qbtpq5.js} +1 -1
  101. package/dist/client/static/js/ini-80p6sp79.js +1 -0
  102. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-9jmeszag.js → ishikawaDiagram-OU5B5YK6-s8bagk00.js} +1 -1
  103. package/dist/client/static/js/java-mm2b3s9b.js +1 -0
  104. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-0d7xe845.js → journeyDiagram-ZHPQQLJL-hz8z0b9x.js} +2 -2
  105. package/dist/client/static/js/json-fzy76fkw.js +1 -0
  106. package/dist/client/static/js/jsx-c7v2f8s7.js +1 -0
  107. package/dist/client/static/js/{julia-yv2j8qd0.js → julia-dm0j9apa.js} +1 -1
  108. package/dist/client/static/js/{kanban-definition-PNTS6WVX-7p83rwdn.js → kanban-definition-PNTS6WVX-sjjnjb51.js} +1 -1
  109. package/dist/client/static/js/lua-ppfdxrmv.js +1 -0
  110. package/dist/client/static/js/markdown-xed7y3ds.js +1 -0
  111. package/dist/client/static/js/{mermaid.core-hwhzw0wv.js → mermaid.core-zvwygxbh.js} +7 -7
  112. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-hy0rtr7t.js → mindmap-definition-NLK3R4M7-kgj8enan.js} +2 -2
  113. package/dist/client/static/js/one-dark-pro-mq6sn6a2.js +1 -0
  114. package/dist/client/static/js/one-light-pt6t6vax.js +1 -0
  115. package/dist/client/static/js/packet-AYTQ26CC-01vcsy6x.js +1 -0
  116. package/dist/client/static/js/{pegDiagram-GJSIUBJH-kd8t53tx.js → pegDiagram-GJSIUBJH-gxzw1qwa.js} +1 -1
  117. package/dist/client/static/js/{perl-917pjq5a.js → perl-4jcm2jxv.js} +1 -1
  118. package/dist/client/static/js/{php-hwz75qzt.js → php-q32mec74.js} +1 -1
  119. package/dist/client/static/js/pie-WAS4IAKB-053gzkmh.js +1 -0
  120. package/dist/client/static/js/{pieDiagram-5QR66LMP-h3x03f80.js → pieDiagram-5QR66LMP-pdqwyqcm.js} +1 -1
  121. package/dist/client/static/js/properties-8ysbq2n2.js +1 -0
  122. package/dist/client/static/js/python-4ysexc8s.js +1 -0
  123. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-y2b1ncbg.js → quadrantDiagram-O4NWA36T-yx2t364p.js} +1 -1
  124. package/dist/client/static/js/r-hrsw5arc.js +1 -0
  125. package/dist/client/static/js/radar-RG4KPBEZ-bkpby8am.js +1 -0
  126. package/dist/client/static/js/railroad-74A4TZTK-67bxrjgw.js +1 -0
  127. package/dist/client/static/js/railroad-abnf-HS5TGJTU-xj9ymacg.js +1 -0
  128. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-2xxpbnf6.js +1 -0
  129. package/dist/client/static/js/railroad-peg-WCYAUIDC-78w88znz.js +1 -0
  130. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-x188rcxf.js → railroadDiagram-XR7U4H2S-800fdzkr.js} +1 -1
  131. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-g5e9fk17.js → requirementDiagram-PLB6GJNP-vc5rpgtm.js} +1 -1
  132. package/dist/client/static/js/{ruby-er7ayhte.js → ruby-npmpb290.js} +1 -1
  133. package/dist/client/static/js/{rust-1v8xbxn9.js → rust-waks43wh.js} +1 -1
  134. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-y9ht91gf.js → sankeyDiagram-IPEJSGJF-ccjk8zgn.js} +2 -2
  135. package/dist/client/static/js/{sass-n47tt136.js → sass-502a4r7y.js} +1 -1
  136. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-pp8s63rt.js → sequenceDiagram-PO4LG4MO-c0tk7gfn.js} +6 -6
  137. package/dist/client/static/js/{sizeCapture-INFHLROL-k6dhfxex.js → sizeCapture-INFHLROL-fma9p1vy.js} +1 -1
  138. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-y3akpsm4.js → stateDiagram-v2-GCMORJYK-d8f24b7j.js} +2 -2
  139. package/dist/client/static/js/{svelte-2pmz35vx.js → svelte-c15d0421.js} +1 -1
  140. package/dist/client/static/js/{swimlanes-2SLR337P-89081dr3.js → swimlanes-2SLR337P-sdt7qy36.js} +1 -1
  141. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-rz309qrx.js +8 -0
  142. package/dist/client/static/js/{timeline-definition-EJHVYXUP-tz6r8g3q.js → timeline-definition-EJHVYXUP-rv8qyr8b.js} +2 -2
  143. package/dist/client/static/js/treeView-Q6P3EWNA-g2bkjr4z.js +1 -0
  144. package/dist/client/static/js/treemap-WGGIJYW6-pj7yw9rw.js +1 -0
  145. package/dist/client/static/js/tsx-xjp2ds8g.js +1 -0
  146. package/dist/client/static/js/typescript-yg97da8h.js +1 -0
  147. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-yq2y1b09.js → usecaseDiagram-POWQR4AR-w6ew1red.js} +2 -2
  148. package/dist/client/static/js/{vennDiagram-UO4OBE2U-qdmjf6x3.js → vennDiagram-UO4OBE2U-p9axw7ch.js} +1 -1
  149. package/dist/client/static/js/{vue-d5gpjfgn.js → vue-xpemy62d.js} +1 -1
  150. package/dist/client/static/js/wardley-WFR3VGLG-c7ekf8r2.js +1 -0
  151. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-3n2sm7rj.js → wardleyDiagram-VNRHLVJA-5ewc8s4p.js} +1 -1
  152. package/dist/client/static/js/xml-nrb23phz.js +1 -0
  153. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-d7n2av2t.js → xychartDiagram-PMCCYNJV-7n4gn7k6.js} +2 -2
  154. package/dist/client/static/js/yaml-sqs6pjpx.js +1 -0
  155. package/marketplace/marketplace.json +34 -7
  156. package/marketplace/plugins/kanban/README.md +143 -0
  157. package/marketplace/plugins/kanban/icon.svg +5 -0
  158. package/marketplace/plugins/kanban/package.json +30 -0
  159. package/marketplace/plugins/kanban/src/app.tsx +34 -0
  160. package/marketplace/plugins/kanban/src/mcp-tools.ts +296 -0
  161. package/marketplace/plugins/kanban/src/mcp.test.ts +199 -0
  162. package/marketplace/plugins/kanban/src/mcp.ts +148 -0
  163. package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +319 -0
  164. package/marketplace/plugins/kanban/src/panel/CardTile.tsx +97 -0
  165. package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +116 -0
  166. package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +249 -0
  167. package/marketplace/plugins/kanban/src/panel/catalogs.ts +114 -0
  168. package/marketplace/plugins/kanban/src/panel/index.tsx +327 -0
  169. package/marketplace/plugins/kanban/src/panel/panel.test.ts +219 -0
  170. package/marketplace/plugins/kanban/src/panel/start-work.ts +132 -0
  171. package/marketplace/plugins/kanban/src/panel/use-board.ts +148 -0
  172. package/marketplace/plugins/kanban/src/panel/use-card-detail.ts +70 -0
  173. package/marketplace/plugins/kanban/src/panel/use-writes.ts +123 -0
  174. package/marketplace/plugins/kanban/src/protocol.ts +180 -0
  175. package/marketplace/plugins/kanban/src/server.test.ts +113 -0
  176. package/marketplace/plugins/kanban/src/server.ts +227 -0
  177. package/marketplace/plugins/kanban/src/store/board.test.ts +311 -0
  178. package/marketplace/plugins/kanban/src/store/board.ts +147 -0
  179. package/marketplace/plugins/kanban/src/store/cards.ts +228 -0
  180. package/marketplace/plugins/kanban/src/store/fs.ts +159 -0
  181. package/marketplace/plugins/kanban/src/store/ops.ts +245 -0
  182. package/marketplace/plugins/kanban/src/store/resolve.test.ts +82 -0
  183. package/marketplace/plugins/kanban/src/store/resolve.ts +135 -0
  184. package/marketplace/plugins/kanban/tsconfig.json +26 -0
  185. package/package.json +2 -2
  186. package/src/client/components/common/file-icon/index.tsx +1 -1
  187. package/src/client/components/layout/desktop-layout/LeftColumn.tsx +14 -4
  188. package/src/client/components/layout/desktop-layout/RightColumn.test.tsx +204 -0
  189. package/src/client/components/layout/desktop-layout/RightColumn.tsx +37 -16
  190. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +34 -7
  191. package/src/client/components/layout/desktop-layout/index.tsx +17 -22
  192. package/src/client/components/mobile/RightSidebar.tsx +10 -8
  193. package/src/client/components/mobile/mobile-right-sidebar/EditorSurface.tsx +2 -0
  194. package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +11 -3
  195. package/src/client/components/mobile/mobile-session-sidebar/use-drawer-tabs.ts +2 -1
  196. package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.test.tsx +21 -0
  197. package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +8 -4
  198. package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +8 -2
  199. package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +15 -4
  200. package/src/client/components/workspace/chat-timeline/MessageList.test.ts +11 -0
  201. package/src/client/components/workspace/chat-timeline/MessageList.tsx +29 -21
  202. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +21 -0
  203. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +7 -1
  204. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +3 -1
  205. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +1 -1
  206. package/src/client/components/workspace/editor/FilePane.tsx +4 -2
  207. package/src/client/components/workspace/editor/Tabs.tsx +7 -1
  208. package/src/client/components/workspace/editor/Toolbar.tsx +7 -1
  209. package/src/client/components/workspace/editor/chrome-rows.test.tsx +126 -0
  210. package/src/client/components/workspace/editor/viewers/HtmlPreview.test.tsx +94 -0
  211. package/src/client/components/workspace/editor/viewers/HtmlPreview.tsx +71 -0
  212. package/src/client/components/workspace/editor/viewers/bytes.ts +1 -1
  213. package/src/client/components/workspace/editor/viewers/dispatch.tsx +18 -2
  214. package/src/client/components/workspace/editor/viewers/viewers.test.ts +14 -1
  215. package/src/client/components/workspace/panel-header/index.test.tsx +2 -1
  216. package/src/client/components/workspace/panel-header/index.tsx +6 -4
  217. package/src/client/hooks/chat/timeline/row-measure.ts +75 -0
  218. package/src/client/hooks/chat/timeline/row-window.test.ts +41 -21
  219. package/src/client/hooks/chat/timeline/row-window.ts +6 -24
  220. package/src/client/hooks/editor/resolve-viewer.ts +1 -1
  221. package/src/client/hooks/editor/use-editor-drop.ts +14 -0
  222. package/src/client/hooks/editor/use-editor-tab-state.ts +5 -4
  223. package/src/client/hooks/ui/media-query.ts +27 -0
  224. package/src/client/hooks/workspace/file-tabs.ts +10 -0
  225. package/src/client/hooks/workspace/panel-tabs-reveal.test.tsx +20 -17
  226. package/src/client/hooks/workspace/panel-tabs-reveal.ts +29 -17
  227. package/src/client/hooks/workspace/panel-tabs.ts +3 -2
  228. package/src/client/hooks/workspace/right-panel-presence.test.ts +152 -0
  229. package/src/client/hooks/workspace/right-panel-presence.ts +119 -0
  230. package/src/client/hooks/workspace/session-state/index.test.tsx +145 -0
  231. package/src/client/hooks/workspace/session-state/index.ts +28 -16
  232. package/src/client/lib/router/search-params.test.ts +83 -0
  233. package/src/client/lib/router/search-params.ts +14 -3
  234. package/src/server/lib/mcp/session-mcp.test.ts +64 -1
  235. package/src/server/lib/mcp/session-overlay.server.ts +7 -4
  236. package/src/server/lib/omp/rpc/constants.test.ts +31 -0
  237. package/src/server/lib/omp/rpc/constants.ts +19 -0
  238. package/src/server/lib/omp/rpc/session-new.ts +78 -0
  239. package/src/server/lib/omp/rpc/session-registry.ts +22 -49
  240. package/src/server/lib/omp/rpc/spawn-mcp.ts +8 -1
  241. package/src/server/lib/omp/session/blobs.server.ts +2 -1
  242. package/src/server/lib/plugins/e2e.test.ts +71 -2
  243. package/src/server/lib/plugins/loader.server.ts +20 -1
  244. package/src/server/lib/plugins/module-import.server.ts +45 -0
  245. package/src/server/routes/agent/new-prompt.test.ts +81 -0
  246. package/src/server/routes/agent/new.ts +78 -4
  247. package/src/server/routes/fs/raw.test.ts +12 -0
  248. package/src/server/routes/fs/raw.ts +2 -6
  249. package/src/server/routes/wiki/asset.ts +1 -1
  250. package/src/shared/lib/fs/document-kind.test.ts +39 -2
  251. package/src/shared/lib/fs/document-kind.ts +49 -1
  252. package/src/shared/lib/fs/file-kind.test.ts +30 -3
  253. package/src/shared/lib/fs/file-kind.ts +7 -104
  254. package/src/shared/lib/fs/mime.ts +159 -0
  255. package/src/shared/lib/workspace/sidebar-width.test.ts +34 -0
  256. package/src/shared/lib/workspace/sidebar-width.ts +33 -0
  257. package/src/shared/lib/workspace/workspace-panel-widths.test.ts +124 -0
  258. package/src/shared/lib/workspace/workspace-panel-widths.ts +115 -18
  259. package/dist/client/static/js/ImageView-2r8p5z3y.js +0 -1
  260. package/dist/client/static/js/LayoutWrapper-rq3d2a4e.js +0 -2
  261. package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +0 -1
  262. package/dist/client/static/js/bash-8d8z8zrg.js +0 -1
  263. package/dist/client/static/js/cpp-620mvjkk.js +0 -1
  264. package/dist/client/static/js/css-bt76kxbq.js +0 -1
  265. package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +0 -1
  266. package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +0 -1
  267. package/dist/client/static/js/flowDiagram-KWPJA3E3-7b4w6phx.js +0 -1
  268. package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +0 -1
  269. package/dist/client/static/js/graphql-j1a6zp7m.js +0 -1
  270. package/dist/client/static/js/index-3qnjdjg2.js +0 -1
  271. package/dist/client/static/js/index-4bqssvt6.js +0 -2
  272. package/dist/client/static/js/index-dpy3ewrn.css +0 -1
  273. package/dist/client/static/js/index-gq5w5w8x.js +0 -2
  274. package/dist/client/static/js/index-ta6gpcpw.js +0 -3
  275. package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +0 -1
  276. package/dist/client/static/js/ini-5f4zqtqr.js +0 -1
  277. package/dist/client/static/js/java-jj41mty3.js +0 -1
  278. package/dist/client/static/js/json-rnh2h17x.js +0 -1
  279. package/dist/client/static/js/jsx-4gecrt29.js +0 -1
  280. package/dist/client/static/js/lua-zszaw2f7.js +0 -1
  281. package/dist/client/static/js/markdown-nm6gw4v4.js +0 -1
  282. package/dist/client/static/js/one-dark-pro-4b8er03c.js +0 -1
  283. package/dist/client/static/js/one-light-e6r3vsz4.js +0 -1
  284. package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +0 -1
  285. package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +0 -1
  286. package/dist/client/static/js/properties-rkptax7r.js +0 -1
  287. package/dist/client/static/js/python-qf1se1mj.js +0 -1
  288. package/dist/client/static/js/r-ms0cygq2.js +0 -1
  289. package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +0 -1
  290. package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +0 -1
  291. package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +0 -1
  292. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +0 -1
  293. package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +0 -1
  294. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-3q2a15wc.js +0 -8
  295. package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +0 -1
  296. package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +0 -1
  297. package/dist/client/static/js/tsx-gx7td06z.js +0 -1
  298. package/dist/client/static/js/typescript-1a808spn.js +0 -1
  299. package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +0 -1
  300. package/dist/client/static/js/xml-3117mxd9.js +0 -1
  301. package/dist/client/static/js/yaml-dmvh8vyt.js +0 -1
@@ -1,4 +1,4 @@
1
- import{t,l,p,W,fa,cA,qr,Ao,Aa,Ks,ho}from"./index-x1fqhhpp.js";import{Ut,Bn,ir,Xt,Mr,ao,ke,_t,yr,oo,vr,Ol,Kd,Vd,Yd,_i,ca,Jd,Si,In,Ti,Pa,ua,Di,io,Ni,Zd,Xd,$l,Gt,ep,Qi,so,Ri,zl,Ul,lo,tp,Gl,np,Lu,Pr,jl,rp,ap,op,Wn,ql,Hl,Fi,ip,Wl,v,sr,Or,jt,co,Ge}from"./index-dn7hg4em.js";import{jd,qd,he,Us,Jg,Hd,Ko}from"./index-y2z8nsvw.js";import{En}from"./index-2ks0m8ss.js";var ur={};En(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 kn=/^\s+/;function Tn(r){return r?r.slice(0,Jr(r)+1).replace(kn,""):r}var Zr=Tn;var $r=NaN,Cn=/^[-+]0x[0-9a-f]+$/i,An=/^0b[01]+$/i,Rn=/^0o[0-7]+$/i,Mn=parseInt;function jn(r){if(typeof r=="number")return r;if(Mr(r))return $r;if(_t(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=_t(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Zr(r);var n=An.test(r);return n||Rn.test(r)?Mn(r.slice(2),n?2:8):Cn.test(r)?$r:+r}var Qr=jn;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(!_t(e))return{};if(te)return te(e);r.prototype=e;var n=new r;return r.prototype=void 0,n}}(),ne=Xn;function Un(r,e){var n=-1,o=r.length;e||(e=Array(o));while(++n<o)e[n]=r[n];return e}var ar=Un;function Vn(r,e,n){if(e=="__proto__"&&Ol)Ol(r,e,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[e]=n}var R=Vn;var Yn=Object.prototype,zn=Yn.hasOwnProperty;function qn(r,e,n){var o=r[e];if(!(zn.call(r,e)&&ca(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(!_t(n))return!1;var o=typeof e;if(o=="number"?In(n)&&_i(e,n.length):o=="string"&&(e in n))return ca(n[e],r);return!1}var T=Kn;function Jn(r){return Si(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 ro(r){if(!_t(r))return ie(r);var e=Ti(r),n=[];for(var o in r)if(!(o=="constructor"&&(e||!Qn.call(r,o))))n.push(o);return n}var ae=ro;function eo(r){return In(r)?Zd(r,!0):ae(r)}var L=eo;function to(r){var e=r==null?0:r.length;return e?Ul(r,1):[]}var S=to;function no(r){return Kd(Jd(r,void 0,S),r+"")}var fe=no;var fo=Xd(Object.getPrototypeOf,Object),V=fo;var uo="[object Object]",po=Function.prototype,mo=Object.prototype,se=po.toString,go=mo.hasOwnProperty,vo=se.call(Object);function bo(r){if(!Xt(r)||ir(r)!=uo)return!1;var e=V(r);if(e===null)return!0;var n=go.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&se.call(n)==vo}var ue=bo;var yo="\\ud800-\\udfff",wo="\\u0300-\\u036f",_o="\\ufe20-\\ufe2f",Eo="\\u20d0-\\u20ff",xo=wo+_o+Eo,Oo="\\ufe0e\\ufe0f",Lo="\\u200d",Io=RegExp("["+Lo+yo+xo+Oo+"]");function So(r){return Io.test(r)}var de=So;function No(r,e){return r&&P(e,Gt(e),r)}var ce=No;function Po(r,e){return r&&P(e,L(e),r)}var pe=Po;var ve=typeof ur=="object"&&ur&&!ur.nodeType&&ur,le=ve&&typeof fr=="object"&&fr&&!fr.nodeType&&fr,ko=le&&le.exports===ve,me=ko?Ut.Buffer:void 0,ge=me?me.allocUnsafe:void 0;function To(r,e){if(e)return r.slice();var n=r.length,o=ge?ge(n):new r.constructor(n);return r.copy(o),o}var Z=To;function Co(r,e){return P(r,Gl(r),e)}var be=Co;var Ro=Object.getOwnPropertySymbols,Mo=!Ro?tp:function(r){var e=[];while(r)zl(e,Gl(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 np(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 jl(e).set(new jl(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=Bn?Bn.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 qo="[object Boolean]",Ho="[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 qo:case Ho: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"&&!Ti(r)?ne(V(r)):{}}var pr=mi;var hi="[object Map]";function gi(r){return Xt(r)&&Pr(r)==hi}var Ne=gi;var Pe=io&&io.isMap,vi=Pe?Di(Pe):Ne,Te=vi;var bi="[object Set]";function yi(r){return Xt(r)&&Pr(r)==bi}var Ce=yi;var Ae=io&&io.isSet,wi=Ae?Di(Ae):Ce,Re=wi;var Ei=1,xi=2,Oi=4,Me="[object Arguments]",Li="[object Array]",Ii="[object Boolean]",Pi="[object Date]",ki="[object Error]",je="[object Function]",Ci="[object GeneratorFunction]",Ai="[object Map]",Mi="[object Number]",Be="[object Object]",ji="[object RegExp]",Bi="[object Set]",Gi="[object String]",Xi="[object Symbol]",Ui="[object WeakMap]",Vi="[object ArrayBuffer]",Yi="[object DataView]",zi="[object Float32Array]",Wi="[object Float64Array]",qi="[object Int8Array]",Hi="[object Int16Array]",Ki="[object Int32Array]",Ji="[object Uint8Array]",Zi="[object Uint8ClampedArray]",$i="[object Uint16Array]",ra="[object Uint32Array]",x={};x[Me]=x[Li]=x[Vi]=x[Yi]=x[Ii]=x[Pi]=x[zi]=x[Wi]=x[qi]=x[Hi]=x[Ki]=x[Ai]=x[Mi]=x[Be]=x[ji]=x[Bi]=x[Gi]=x[Xi]=x[Ji]=x[Zi]=x[$i]=x[ra]=!0;x[ki]=x[je]=x[Ui]=!1;function lr(r,e,n,o,i,a){var f,s=e&Ei,u=e&xi,d=e&Oi;if(n)f=i?n(r,o,i,a):n(r);if(f!==void 0)return f;if(!_t(r))return r;var c=ke(r);if(c){if(f=_e(r),!s)return ar(r,f)}else{var m=Pr(r),h=m==je||m==Ci;if(ua(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 lo);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(Te(r))r.forEach(function(g,_){f.set(_,lr(g,e,n,_,r,a))});var w=d?u?we:Lu:u?L:Gt,y=c?void 0:w(r);return Vd(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 Ut.Date.now()},Er=oa;var Xe=Object.prototype,ia=Xe.hasOwnProperty,aa=Si(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||ca(c,Xe[d])&&!ia.call(r,d))r[d]=a[d]}}return r}),Ue=aa;function sa(r,e,n){if(n!==void 0&&!ca(r[e],n)||n===void 0&&!(e in r))R(r,e,n)}var Q=sa;function da(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var rr=da;function pa(r){return P(r,L(r))}var Ve=pa;function la(r,e,n,o,i,a,f){var s=rr(r,n),u=rr(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=ke(u),b=!h&&ua(u),w=!h&&!b&&Ni(u);if(c=u,h||b||w)if(ke(s))c=s;else if(ip(s))c=ar(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)||Pa(u)){if(c=s,Pa(s))c=Ve(s);else if(!_t(s)||oo(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;ql(e,function(a,f){if(i||(i=new lo),_t(a))Ye(r,e,f,n,ze,o,i);else{var s=o?o(rr(r,f),a,f+"",r,e,i):void 0;if(s===void 0)s=a;Q(r,f,s)}},L)}var We=ze;function ma(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var G=ma;function ha(r){return function(e,n,o){var i=Object(e);if(!In(e)){var a=Wn(n,3);e=Gt(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=ha;var ga=Math.max;function va(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=ga(o+i,0);return Yd(r,Wn(e,3),i)}var He=va;var ba=qe(He),er=ba;function ya(r,e){var n=-1,o=In(r)?Array(r.length):[];return Fi(r,function(i,a,f){o[++n]=e(i,a,f)}),o}var mr=ya;function wa(r,e){var n=ke(r)?ao:mr;return n(r,Wn(e,3))}var E=wa;function _a(r,e){return r==null?r:ql(r,Wl(e),L)}var Ke=_a;function Ea(r,e){return r&&Hl(r,Wl(e))}var Je=Ea;function xa(r,e){return r>e}var Ze=xa;var Oa=Object.prototype,La=Oa.hasOwnProperty;function Ia(r,e){return r!=null&&La.call(r,e)}var $e=Ia;function Sa(r,e){return r!=null&&rp(r,e,$e)}var hr=Sa;var Na="[object String]";function ka(r){return typeof r=="string"||!ke(r)&&Xt(r)&&ir(r)==Na}var Qe=ka;function Ta(r,e){return r<e}var gr=Ta;function Ca(r,e){var n={};return e=Wn(e,3),Hl(r,function(o,i,a){R(n,i,e(o,i,a))}),n}var z=Ca;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&&!Mr(f):n(f,s)))var s=f,u=a}return u}var q=Ra;function Ma(r){return r&&r.length?q(r,yr,Ze):void 0}var I=Ma;var ja=oe(function(r,e,n){We(r,e,n)}),tr=ja;function Ba(r){return r&&r.length?q(r,yr,gr):void 0}var j=Ba;function Da(r,e){return r&&r.length?q(r,Wn(e,2),gr):void 0}var H=Da;function Fa(r,e,n,o){if(!_t(r))return r;e=Qi(e,r);var i=-1,a=e.length,f=a-1,s=r;while(s!=null&&++i<a){var u=so(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=_t(c)?c:_i(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=Ri(r,f);if(n(s,f))rt(a,Qi(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=Mr(r),f=e!==void 0,s=e===null,u=e===e,d=Mr(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=ao(e,function(a){if(ke(a))return function(f){return Ri(f,a.length===1?a[0]:a)};return a});else e=[yr];var o=-1;e=ao(e,Di(Wn));var i=mr(r,function(a,f,s){var u=ao(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=op("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+"]",xr="["+Ka+"]",Lr="\\ud83c[\\udffb-\\udfff]",$a="(?:"+xr+"|"+Lr+")",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+xr+"?",xr,dt,ct,Za].join("|")+")",ft=RegExp(Lr+"(?="+Lr+")|"+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 ap(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(In(r))return Qe(r)?ht(r):r.length;var e=Pr(r);if(e==lf||e==mf)return r.size;return $l(r).length}var yt=hf;var gf=Si(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,Ul(e,1),[])}),C=gf;var vf=0;function bf(r){var e=++vf;return ep(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 Ir=wf;class Sr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return Et(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)Et(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 Et(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=vr(1);function xt(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())Nr(r,e,n,f);while(f=i.dequeue())Nr(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(Nr(r,e,n,f,!0));break}}}return o}function Nr(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,kr(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,kr(e,n,d)}),r.removeNode(o.v),a}function Of(r,e){var n=new Ge,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 Sr}),f=o+1;return v(n.nodes(),function(s){kr(a,f,n.node(s))}),{graph:n,buckets:a,zeroIdx:f}}function kr(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 Ot(r){var e=r.graph().acyclicer==="greedy"?xt(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 Ge().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 Ge({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 Tr(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(Ar(r)+1),function(){return[]});return v(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!jt(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 Pt(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(jt(a)&&f%i!==0)--o;else if(o)v(a,function(s){r.node(s).rank+=o})})}function Cr(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 Ar(r){return I(E(r.nodes(),function(e){var n=r.node(e).rank;if(!jt(n))return n}))}function kt(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 Tt(r,e){var n=Er();try{return e()}finally{console.log(r+" time: "+(Er()-n)+"ms")}}function Ct(r,e){return e()}function Rt(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)At(r,"borderLeft","_bl",n,i,a),At(r,"borderRight","_br",n,i,a)}}v(r.children(),e)}function At(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 Bt(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")Ft(r)}function Dt(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")If(r);if(e==="lr"||e==="rl")Sf(r),Ft(r)}function Ft(r){v(r.nodes(),function(e){Mt(r.node(e))}),v(r.edges(),function(e){Mt(r.edge(e))})}function Mt(r){var e=r.width;r.width=r.height,r.height=e}function If(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,"y"))Rr(n)})}function Rr(r){r.y=-r.y}function Sf(r){v(r.nodes(),function(e){jr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,jr),Object.prototype.hasOwnProperty.call(n,"x"))jr(n)})}function jr(r){var e=r.x;r.x=r.y,r.y=e}function Vt(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 Yt(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 nr(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 wr(r){var e=new Ge({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 H(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=vr(1);var mh=vr(1);Br.CycleException=or;function Br(r){var e={},n={},o=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new or;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 or;return o}function or(){}or.prototype=Error();function _r(r,e,n){if(!ke(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 Dr(r,e){return _r(r,e,"post")}function Fr(r,e){return _r(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),nr(r);var e=wr(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=Dr(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 er(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=sr(e.edges(),function(c){return u===qt(r,r.node(c.v),s)&&u!==qt(r,r.node(c.w),s)});return H(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=er(r.nodes(),function(i){return!e.node(i).parent}),o=Fr(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 Ur(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=nr;function Xf(r){nr(r),wr(r)}function Qt(r){F(r)}function rn(r){var e=k(r,"root",{},"_root"),n=Uf(r),o=I(Or(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=Cr(r,"_bt"),d=Cr(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 co(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 Ge({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=!jt(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=Ir(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=sr(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=co(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(!jt(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(!jt(a)&&!jt(f))f.indegree++,a.out.push(n[i.w])});var o=sr(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(jt(f.barycenter)||jt(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(sr(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=kt(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 Vr(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=sr(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=Vr(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(!jt(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=Ar(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 Ge;v(r,function(o){var i=o.graph().root,a=Vr(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 co(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 co(e,i),n}function ns(r,e){if(r.node(e).dummy)return er(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 Ge,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 H(Or(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=Or(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=Or(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 vn(r){var e=B(r),n=tr(es(r,e),ts(r,e)),o={},i;v(["u","d"],function(f){i=f==="u"?e:Or(e).reverse(),v(["l","r"],function(s){if(s==="r")i=E(i,function(m){return Or(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 bn(r){r=br(r),ls(r),Je(vn(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 Wr(r,e){var n=e&&e.debugTiming?Tt:Ct;n("layout",()=>{var o=n(" buildLayoutGraph",()=>Os(r));n(" runLayout",()=>ms(o,n)),n(" updateInputGraph",()=>hs(r,o))})}function ms(r,e){e(" makeSpaceForEdgeLabels",()=>Ls(r)),e(" removeSelfEdges",()=>Rs(r)),e(" acyclic",()=>Ot(r)),e(" nestingGraph.run",()=>rn(r)),e(" rank",()=>Ur(br(r))),e(" injectEdgeLabelProxies",()=>Is(r)),e(" removeEmptyRanks",()=>Pt(r)),e(" nestingGraph.cleanup",()=>tn(r)),e(" normalizeRanks",()=>Nt(r)),e(" assignRankMinMax",()=>Ss(r)),e(" removeEdgeLabelProxies",()=>Ns(r)),e(" normalize.run",()=>Vt(r)),e(" parentDummyChains",()=>hn(r)),e(" addBorderSegments",()=>Rt(r)),e(" order",()=>mn(r)),e(" insertSelfEdges",()=>Ms(r)),e(" adjustCoordinateSystem",()=>Bt(r)),e(" position",()=>bn(r)),e(" positionSelfEdges",()=>js(r)),e(" removeBorderNodes",()=>As(r)),e(" normalize.undo",()=>Yt(r)),e(" fixupEdgeLabelCoords",()=>Ts(r)),e(" undoCoordinateSystem",()=>Dt(r)),e(" translateGraph",()=>Ps(r)),e(" assignNodeIntersects",()=>ks(r)),e(" reversePoints",()=>Cs(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"],Es={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xs=["labelpos"];function Os(r){var e=new Ge({multigraph:!0,compound:!0}),n=zr(r.graph());return e.setGraph(tr({},vs,Yr(n,gs),K(n,bs))),v(r.nodes(),function(o){var i=zr(r.node(o));e.setNode(o,Ue(Yr(i,ys),ws)),e.setParent(o,r.parent(o))}),v(r.edges(),function(o){var i=zr(r.edge(o));e.setEdge(o,tr({},Es,Yr(i,_s),K(i,xs)))}),e}function Ls(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 Is(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 Ss(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 Ns(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 Ps(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 ks(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(Tr(o,a)),n.points.push(Tr(i,f))})}function Ts(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 Cs(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function As(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 Rs(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 Ms(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 js(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 Yr(r,e){return z(K(r,e),Number)}function zr(r){var e={};return v(r,function(n,o){e[o.toLowerCase()]=n}),e}var yn=t((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),wn=t((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Bs=t((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),Ds=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Fs=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 wn(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 wn(i)},"getSelfLoopSide"),Gs=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=yn(Math.max(o,r.width*0.35),36,u),c=yn(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"),Xs=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"),xn=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=Fs(r,m,f,c.start,a),w=Gs(m,b,e,h.width??0),y=Xs(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"),On=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}=jd(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=Bs(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,W,fa,pA,qr,Ao,Aa,Ys,ho}from"./index-9xsf8162.js";import{Ut,Bn,ir,Xt,Mr,ao,ke,_t,yr,oo,vr,$l,Yd,Jd,Zd,Ti,ca,Xd,Di,In,Ni,Pa,ua,Qi,io,Ri,ep,tp,zl,Gt,np,Fi,so,Li,Ul,Gl,lo,rp,jl,ap,Ou,Pr,ql,op,ip,sp,Wn,Hl,Wl,Mi,lp,Kl,v,sr,Or,jt,co,Ge}from"./index-3nsrnyqr.js";import{Hd,Wd,he,js,eA,Kd,Ko}from"./index-0dkc6z8e.js";import{En}from"./index-evmcc5qh.js";var ur={};En(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 kn=/^\s+/;function Tn(r){return r?r.slice(0,Jr(r)+1).replace(kn,""):r}var Zr=Tn;var $r=NaN,Cn=/^[-+]0x[0-9a-f]+$/i,An=/^0b[01]+$/i,Rn=/^0o[0-7]+$/i,Mn=parseInt;function jn(r){if(typeof r=="number")return r;if(Mr(r))return $r;if(_t(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=_t(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Zr(r);var n=An.test(r);return n||Rn.test(r)?Mn(r.slice(2),n?2:8):Cn.test(r)?$r:+r}var Qr=jn;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(!_t(e))return{};if(te)return te(e);r.prototype=e;var n=new r;return r.prototype=void 0,n}}(),ne=Xn;function Un(r,e){var n=-1,o=r.length;e||(e=Array(o));while(++n<o)e[n]=r[n];return e}var ar=Un;function Vn(r,e,n){if(e=="__proto__"&&$l)$l(r,e,{configurable:!0,enumerable:!0,value:n,writable:!0});else r[e]=n}var R=Vn;var Yn=Object.prototype,zn=Yn.hasOwnProperty;function qn(r,e,n){var o=r[e];if(!(zn.call(r,e)&&ca(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(!_t(n))return!1;var o=typeof e;if(o=="number"?In(n)&&Ti(e,n.length):o=="string"&&(e in n))return ca(n[e],r);return!1}var T=Kn;function Jn(r){return Di(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 ro(r){if(!_t(r))return ie(r);var e=Ni(r),n=[];for(var o in r)if(!(o=="constructor"&&(e||!Qn.call(r,o))))n.push(o);return n}var ae=ro;function eo(r){return In(r)?ep(r,!0):ae(r)}var L=eo;function to(r){var e=r==null?0:r.length;return e?Gl(r,1):[]}var S=to;function no(r){return Yd(Xd(r,void 0,S),r+"")}var fe=no;var fo=tp(Object.getPrototypeOf,Object),V=fo;var uo="[object Object]",po=Function.prototype,mo=Object.prototype,se=po.toString,go=mo.hasOwnProperty,vo=se.call(Object);function bo(r){if(!Xt(r)||ir(r)!=uo)return!1;var e=V(r);if(e===null)return!0;var n=go.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&se.call(n)==vo}var ue=bo;var yo="\\ud800-\\udfff",wo="\\u0300-\\u036f",_o="\\ufe20-\\ufe2f",Eo="\\u20d0-\\u20ff",xo=wo+_o+Eo,Oo="\\ufe0e\\ufe0f",Lo="\\u200d",Io=RegExp("["+Lo+yo+xo+Oo+"]");function So(r){return Io.test(r)}var de=So;function No(r,e){return r&&P(e,Gt(e),r)}var ce=No;function Po(r,e){return r&&P(e,L(e),r)}var pe=Po;var ve=typeof ur=="object"&&ur&&!ur.nodeType&&ur,le=ve&&typeof fr=="object"&&fr&&!fr.nodeType&&fr,ko=le&&le.exports===ve,me=ko?Ut.Buffer:void 0,ge=me?me.allocUnsafe:void 0;function To(r,e){if(e)return r.slice();var n=r.length,o=ge?ge(n):new r.constructor(n);return r.copy(o),o}var Z=To;function Co(r,e){return P(r,jl(r),e)}var be=Co;var Ro=Object.getOwnPropertySymbols,Mo=!Ro?rp:function(r){var e=[];while(r)Ul(e,jl(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 ap(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 ql(e).set(new ql(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=Bn?Bn.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 qo="[object Boolean]",Ho="[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 qo:case Ho: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"&&!Ni(r)?ne(V(r)):{}}var pr=mi;var hi="[object Map]";function gi(r){return Xt(r)&&Pr(r)==hi}var Ne=gi;var Pe=io&&io.isMap,vi=Pe?Qi(Pe):Ne,Te=vi;var bi="[object Set]";function yi(r){return Xt(r)&&Pr(r)==bi}var Ce=yi;var Ae=io&&io.isSet,wi=Ae?Qi(Ae):Ce,Re=wi;var _i=1,Ei=2,xi=4,Me="[object Arguments]",Oi="[object Array]",Ii="[object Boolean]",Si="[object Date]",Pi="[object Error]",je="[object Function]",ki="[object GeneratorFunction]",Ci="[object Map]",Ai="[object Number]",Be="[object Object]",ji="[object RegExp]",Bi="[object Set]",Gi="[object String]",Xi="[object Symbol]",Ui="[object WeakMap]",Vi="[object ArrayBuffer]",Yi="[object DataView]",zi="[object Float32Array]",Wi="[object Float64Array]",qi="[object Int8Array]",Hi="[object Int16Array]",Ki="[object Int32Array]",Ji="[object Uint8Array]",Zi="[object Uint8ClampedArray]",$i="[object Uint16Array]",ra="[object Uint32Array]",x={};x[Me]=x[Oi]=x[Vi]=x[Yi]=x[Ii]=x[Si]=x[zi]=x[Wi]=x[qi]=x[Hi]=x[Ki]=x[Ci]=x[Ai]=x[Be]=x[ji]=x[Bi]=x[Gi]=x[Xi]=x[Ji]=x[Zi]=x[$i]=x[ra]=!0;x[Pi]=x[je]=x[Ui]=!1;function lr(r,e,n,o,i,a){var f,s=e&_i,u=e&Ei,d=e&xi;if(n)f=i?n(r,o,i,a):n(r);if(f!==void 0)return f;if(!_t(r))return r;var c=ke(r);if(c){if(f=_e(r),!s)return ar(r,f)}else{var m=Pr(r),h=m==je||m==ki;if(ua(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 lo);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(Te(r))r.forEach(function(g,_){f.set(_,lr(g,e,n,_,r,a))});var w=d?u?we:Ou:u?L:Gt,y=c?void 0:w(r);return Jd(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 Ut.Date.now()},Er=oa;var Xe=Object.prototype,ia=Xe.hasOwnProperty,aa=Di(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||ca(c,Xe[d])&&!ia.call(r,d))r[d]=a[d]}}return r}),Ue=aa;function sa(r,e,n){if(n!==void 0&&!ca(r[e],n)||n===void 0&&!(e in r))R(r,e,n)}var Q=sa;function da(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var rr=da;function pa(r){return P(r,L(r))}var Ve=pa;function la(r,e,n,o,i,a,f){var s=rr(r,n),u=rr(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=ke(u),b=!h&&ua(u),w=!h&&!b&&Ri(u);if(c=u,h||b||w)if(ke(s))c=s;else if(lp(s))c=ar(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)||Pa(u)){if(c=s,Pa(s))c=Ve(s);else if(!_t(s)||oo(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;Hl(e,function(a,f){if(i||(i=new lo),_t(a))Ye(r,e,f,n,ze,o,i);else{var s=o?o(rr(r,f),a,f+"",r,e,i):void 0;if(s===void 0)s=a;Q(r,f,s)}},L)}var We=ze;function ma(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var G=ma;function ha(r){return function(e,n,o){var i=Object(e);if(!In(e)){var a=Wn(n,3);e=Gt(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=ha;var ga=Math.max;function va(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=ga(o+i,0);return Zd(r,Wn(e,3),i)}var He=va;var ba=qe(He),er=ba;function ya(r,e){var n=-1,o=In(r)?Array(r.length):[];return Mi(r,function(i,a,f){o[++n]=e(i,a,f)}),o}var mr=ya;function wa(r,e){var n=ke(r)?ao:mr;return n(r,Wn(e,3))}var E=wa;function _a(r,e){return r==null?r:Hl(r,Kl(e),L)}var Ke=_a;function Ea(r,e){return r&&Wl(r,Kl(e))}var Je=Ea;function xa(r,e){return r>e}var Ze=xa;var Oa=Object.prototype,La=Oa.hasOwnProperty;function Ia(r,e){return r!=null&&La.call(r,e)}var $e=Ia;function Sa(r,e){return r!=null&&op(r,e,$e)}var hr=Sa;var Na="[object String]";function ka(r){return typeof r=="string"||!ke(r)&&Xt(r)&&ir(r)==Na}var Qe=ka;function Ta(r,e){return r<e}var gr=Ta;function Ca(r,e){var n={};return e=Wn(e,3),Wl(r,function(o,i,a){R(n,i,e(o,i,a))}),n}var z=Ca;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&&!Mr(f):n(f,s)))var s=f,u=a}return u}var q=Ra;function Ma(r){return r&&r.length?q(r,yr,Ze):void 0}var I=Ma;var ja=oe(function(r,e,n){We(r,e,n)}),tr=ja;function Ba(r){return r&&r.length?q(r,yr,gr):void 0}var j=Ba;function Da(r,e){return r&&r.length?q(r,Wn(e,2),gr):void 0}var H=Da;function Fa(r,e,n,o){if(!_t(r))return r;e=Fi(e,r);var i=-1,a=e.length,f=a-1,s=r;while(s!=null&&++i<a){var u=so(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=_t(c)?c:Ti(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=Li(r,f);if(n(s,f))rt(a,Fi(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=Mr(r),f=e!==void 0,s=e===null,u=e===e,d=Mr(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=ao(e,function(a){if(ke(a))return function(f){return Li(f,a.length===1?a[0]:a)};return a});else e=[yr];var o=-1;e=ao(e,Qi(Wn));var i=mr(r,function(a,f,s){var u=ao(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=sp("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+"]",xr="["+Ka+"]",Lr="\\ud83c[\\udffb-\\udfff]",$a="(?:"+xr+"|"+Lr+")",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+xr+"?",xr,dt,ct,Za].join("|")+")",ft=RegExp(Lr+"(?="+Lr+")|"+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 ip(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(In(r))return Qe(r)?ht(r):r.length;var e=Pr(r);if(e==lf||e==mf)return r.size;return zl(r).length}var yt=hf;var gf=Di(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,Gl(e,1),[])}),C=gf;var vf=0;function bf(r){var e=++vf;return np(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 Ir=wf;class Sr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return Et(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)Et(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 Et(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=vr(1);function xt(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())Nr(r,e,n,f);while(f=i.dequeue())Nr(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(Nr(r,e,n,f,!0));break}}}return o}function Nr(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,kr(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,kr(e,n,d)}),r.removeNode(o.v),a}function Of(r,e){var n=new Ge,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 Sr}),f=o+1;return v(n.nodes(),function(s){kr(a,f,n.node(s))}),{graph:n,buckets:a,zeroIdx:f}}function kr(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 Ot(r){var e=r.graph().acyclicer==="greedy"?xt(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 Ge().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 Ge({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 Tr(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(Ar(r)+1),function(){return[]});return v(r.nodes(),function(n){var o=r.node(n),i=o.rank;if(!jt(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 Pt(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(jt(a)&&f%i!==0)--o;else if(o)v(a,function(s){r.node(s).rank+=o})})}function Cr(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 Ar(r){return I(E(r.nodes(),function(e){var n=r.node(e).rank;if(!jt(n))return n}))}function kt(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 Tt(r,e){var n=Er();try{return e()}finally{console.log(r+" time: "+(Er()-n)+"ms")}}function Ct(r,e){return e()}function Rt(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)At(r,"borderLeft","_bl",n,i,a),At(r,"borderRight","_br",n,i,a)}}v(r.children(),e)}function At(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 Bt(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")Ft(r)}function Dt(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")If(r);if(e==="lr"||e==="rl")Sf(r),Ft(r)}function Ft(r){v(r.nodes(),function(e){Mt(r.node(e))}),v(r.edges(),function(e){Mt(r.edge(e))})}function Mt(r){var e=r.width;r.width=r.height,r.height=e}function If(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,"y"))Rr(n)})}function Rr(r){r.y=-r.y}function Sf(r){v(r.nodes(),function(e){jr(r.node(e))}),v(r.edges(),function(e){var n=r.edge(e);if(v(n.points,jr),Object.prototype.hasOwnProperty.call(n,"x"))jr(n)})}function jr(r){var e=r.x;r.x=r.y,r.y=e}function Vt(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 Yt(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 nr(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 wr(r){var e=new Ge({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 H(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=vr(1);var mh=vr(1);Br.CycleException=or;function Br(r){var e={},n={},o=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new or;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 or;return o}function or(){}or.prototype=Error();function _r(r,e,n){if(!ke(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 Dr(r,e){return _r(r,e,"post")}function Fr(r,e){return _r(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),nr(r);var e=wr(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=Dr(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 er(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=sr(e.edges(),function(c){return u===qt(r,r.node(c.v),s)&&u!==qt(r,r.node(c.w),s)});return H(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=er(r.nodes(),function(i){return!e.node(i).parent}),o=Fr(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 Ur(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=nr;function Xf(r){nr(r),wr(r)}function Qt(r){F(r)}function rn(r){var e=k(r,"root",{},"_root"),n=Uf(r),o=I(Or(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=Cr(r,"_bt"),d=Cr(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 co(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 Ge({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=!jt(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=Ir(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=sr(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=co(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(!jt(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(!jt(a)&&!jt(f))f.indegree++,a.out.push(n[i.w])});var o=sr(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(jt(f.barycenter)||jt(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(sr(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=kt(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 Vr(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=sr(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=Vr(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(!jt(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=Ar(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 Ge;v(r,function(o){var i=o.graph().root,a=Vr(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 co(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 co(e,i),n}function ns(r,e){if(r.node(e).dummy)return er(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 Ge,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 H(Or(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=Or(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=Or(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 vn(r){var e=B(r),n=tr(es(r,e),ts(r,e)),o={},i;v(["u","d"],function(f){i=f==="u"?e:Or(e).reverse(),v(["l","r"],function(s){if(s==="r")i=E(i,function(m){return Or(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 bn(r){r=br(r),ls(r),Je(vn(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 Wr(r,e){var n=e&&e.debugTiming?Tt:Ct;n("layout",()=>{var o=n(" buildLayoutGraph",()=>Os(r));n(" runLayout",()=>ms(o,n)),n(" updateInputGraph",()=>hs(r,o))})}function ms(r,e){e(" makeSpaceForEdgeLabels",()=>Ls(r)),e(" removeSelfEdges",()=>Rs(r)),e(" acyclic",()=>Ot(r)),e(" nestingGraph.run",()=>rn(r)),e(" rank",()=>Ur(br(r))),e(" injectEdgeLabelProxies",()=>Is(r)),e(" removeEmptyRanks",()=>Pt(r)),e(" nestingGraph.cleanup",()=>tn(r)),e(" normalizeRanks",()=>Nt(r)),e(" assignRankMinMax",()=>Ss(r)),e(" removeEdgeLabelProxies",()=>Ns(r)),e(" normalize.run",()=>Vt(r)),e(" parentDummyChains",()=>hn(r)),e(" addBorderSegments",()=>Rt(r)),e(" order",()=>mn(r)),e(" insertSelfEdges",()=>Ms(r)),e(" adjustCoordinateSystem",()=>Bt(r)),e(" position",()=>bn(r)),e(" positionSelfEdges",()=>Bs(r)),e(" removeBorderNodes",()=>As(r)),e(" normalize.undo",()=>Yt(r)),e(" fixupEdgeLabelCoords",()=>Ts(r)),e(" undoCoordinateSystem",()=>Dt(r)),e(" translateGraph",()=>Ps(r)),e(" assignNodeIntersects",()=>ks(r)),e(" reversePoints",()=>Cs(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"],Es={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xs=["labelpos"];function Os(r){var e=new Ge({multigraph:!0,compound:!0}),n=zr(r.graph());return e.setGraph(tr({},vs,Yr(n,gs),K(n,bs))),v(r.nodes(),function(o){var i=zr(r.node(o));e.setNode(o,Ue(Yr(i,ys),ws)),e.setParent(o,r.parent(o))}),v(r.edges(),function(o){var i=zr(r.edge(o));e.setEdge(o,tr({},Es,Yr(i,_s),K(i,xs)))}),e}function Ls(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 Is(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 Ss(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 Ns(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 Ps(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 ks(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(Tr(o,a)),n.points.push(Tr(i,f))})}function Ts(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 Cs(r){v(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function As(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 Rs(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 Ms(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 Yr(r,e){return z(K(r,e),Number)}function zr(r){var e={};return v(r,function(n,o){e[o.toLowerCase()]=n}),e}var yn=t((r,e,n)=>Math.max(e,Math.min(n,r)),"clamp"),wn=t((r="TB")=>{switch(r){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),Ds=t((r)=>r==="flowchart"||r==="flowchart-v2"||r==="stateDiagram"||r==="er"||r==="classDiagram","shouldMergeSelfLoopSegments"),Fs=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Gs=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 wn(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 wn(i)},"getSelfLoopSide"),Xs=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=yn(Math.max(o,r.width*0.35),36,u),c=yn(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"),Us=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"),xn=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=Gs(r,m,f,c.start,a),w=Xs(m,b,e,h.width??0),y=Us(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"),On=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}=Hd(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=Ds(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 qs({element:c,graph:g.graph,diagramType:n,id:o,parentCluster:e.node(y),siteConfig:a}),Kr=Hr.elem;W(g,Kr),g.diff=Hr.diff||0,l.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),cA(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(Us(g.id,e)),he.set(g.id,{id:Us(g.id,e),node:g});else l.trace("Node - the non recursive path XAX",y,c,e.node(y),f),await qd(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",he,"ids:",g.v,g.w,"Translating: ",he.get(g.v),he.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 Aa(d,A),_.width=A.width,_.height=A.height,_.labelStyle=A.labelStyle;return}await Aa(d,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=fa(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"),Ln=t((r)=>{l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),Wr(r)},"runDagreGraphLayout"),Vs=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"),_n=t((r,e)=>{Ds.forEach((n)=>{if(e[n]!==void 0)r[n]=e[n]})},"applyDagreNodeLayout"),Ys=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"),zs=t((r,e)=>{let{graph:n,mergeSelfLoops:o,subGraphTitleTotalMargin:i=0}=e,a=new Map(r.nodes.map((s)=>[s.id,s]));Hd(n).forEach((s)=>{let u=Vs(n,s,i);if(!u)return;_n(n.node(s),u);let d=a.get(s);if(d)_n(d,u)});let f=i/2;return r.edges=xn(n,f,{mergeSelfLoops:o}).map(({edge:s,start:u,end:d})=>Ys(s,u,d,f)),r},"applyDagreLayoutResult"),Ws=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(Hd(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)),he.get(h.id).node=h,qr(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 Ao(n,h),he.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),qr(h)}}));let d=s/2;return xn(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=ho(o,m,he,i,w,y,a);Ks(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"),qs=t(async(r)=>{let e=await On(r);return Ln(e.graph),await Ws(e)},"renderDagreSubgraph"),Sn=t((r)=>{let e=new Ge({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)}),Jg(e),{graph:e}},"prepareLayoutForDagre"),Hs=t(async(r,{element:e,preparedLayout:n})=>{let o=n??Sn(r),i=p(),a=await On({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 Ln(n.graph),zs(r,n),n},"runDagreLayoutCore"),Zs=t((r,{measure:e})=>Hd(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"),qg=Ko({prepareLayout:Sn,measureLayout:Hs,runLayoutCore:Js,paintOptions:{clusterDb:he,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{zs as applyDagreLayoutResult,xn as getEdgesToRender,Hs as measureDagreLayout,Sn as prepareLayoutForDagre,qg 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;W(g,Kr),g.diff=Hr.diff||0,l.info("New compound node after recursive render XAX",y,"width",g.width,"height",g.height),pA(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(js(g.id,e)),he.set(g.id,{id:js(g.id,e),node:g});else l.trace("Node - the non recursive path XAX",y,c,e.node(y),f),await Wd(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",he,"ids:",g.v,g.w,"Translating: ",he.get(g.v),he.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 Aa(d,A),_.width=A.width,_.height=A.height,_.labelStyle=A.labelStyle;return}await Aa(d,_)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:w}=fa(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"),Ln=t((r)=>{l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),Wr(r)},"runDagreGraphLayout"),Vs=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"),_n=t((r,e)=>{Fs.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]));Kd(n).forEach((s)=>{let u=Vs(n,s,i);if(!u)return;_n(n.node(s),u);let d=a.get(s);if(d)_n(d,u)});let f=i/2;return r.edges=xn(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(Kd(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)),he.get(h.id).node=h,qr(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 Ao(n,h),he.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),qr(h)}}));let d=s/2;return xn(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=ho(o,m,he,i,w,y,a);Ys(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 On(r);return Ln(e.graph),await qs(e)},"renderDagreSubgraph"),Sn=t((r)=>{let e=new Ge({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)}),eA(e),{graph:e}},"prepareLayoutForDagre"),Ks=t(async(r,{element:e,preparedLayout:n})=>{let o=n??Sn(r),i=p(),a=await On({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 Ln(n.graph),Ws(r,n),n},"runDagreLayoutCore"),Zs=t((r,{measure:e})=>Kd(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"),qg=Ko({prepareLayout:Sn,measureLayout:Ks,runLayoutCore:Js,paintOptions:{clusterDb:he,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,xn as getEdgesToRender,Ks as measureDagreLayout,Sn as prepareLayoutForDagre,qg as render,Js as runDagreLayoutCore};
@@ -1,4 +1,4 @@
1
- import{t,l,ft,da,w,F,M,G,z,j,H,q,p,pa,Mi,h,cr,ur,V,Sn,gt,nt,rt,Yn,lc,Lt,Mt,Fn,Pt,At}from"./index-x1fqhhpp.js";import{zt}from"./index-amys498v.js";import{Oa}from"./index-j718pxb3.js";var pt={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},y1=new Set([pt.SHAPE_UNSUPPORTED,pt.SHAPE_REMOVED,pt.CONTAINMENT_VIOLATION]),ms=new Set(Object.values(pt).filter((e)=>!y1.has(e))),w1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),N1=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),R1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),dt="roundedRect";function ht(e){if(!e)return e;return w1.get(e)??e}t(ht,"resolveShapeAlias");function E1(e,r){for(let n of e){if(n.isGroup)continue;if(!n.shape||n.shape==="squareRect"||n.shape==="rect")n.shape=dt;if(N1.has(n.shape)){let a=`shape "${n.shape}" was removed in v0.8.1, using "${dt}"`;if(r?.emitError)r.emitError("SHAPE_REMOVED",a,{nodeId:n.id});else l.warn(`agentflow: ${a}`);n.shape=dt;continue}if(!R1.has(n.shape)){let a=`shape "${n.shape}" is not supported, using "${dt}"`;if(r?.emitWarning)r.emitWarning("SHAPE_UNSUPPORTED",a,{nodeId:n.id});else l.warn(`agentflow: ${a}`);n.shape=dt}}}t(E1,"normaliseNodeShapes");var Qt=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),C1=Qt.size,S1=t((e)=>`af-kind-${e}`,"kindClass"),O1=[...Qt.keys()],x1=t((e)=>Math.max(1,e-C1),"containerSlotCount"),T1=t((e,r)=>{let n=C1+e%x1(r);return r>0?n%r:n},"containerSlot");function D1(e,r,n){let a=p().themeVariables?.borderColorArray,c=Array.isArray(a)?a.length:0,d=n.size;for(let o of e??[]){if(o.isGroup||o.shape==="collapsedGroup"){let m=n.get(String(o.id))??d++;o.colorIndex=T1(m,c);continue}let f=r(String(o.id));if(f&&Qt.has(f))o.cssClasses=`${o.cssClasses??""} ${S1(f)}`.replace(/\s+/g," ").trim()}}t(D1,"assignColorSlots");var A1="agentflow-",i1=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),P1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),G1={flow:"flowGroup"};function Xt(e){if(Array.isArray(e))return e.map((n)=>Xt(n));if(e===null||typeof e!=="object")return e;let r={};for(let n of Object.keys(e)){if(n==="__proto__"||n==="constructor"||n==="prototype")continue;r[n]=Xt(e[n])}return r}t(Xt,"stripPrototypeKeys");function _1(e){let r=!1,n=!1,a=0,c,d=[];for(let o of e.split(`
1
+ import{t,l,ft,da,w,F,M,G,z,j,H,q,p,pa,Oi,h,cr,ur,V,Sn,gt,nt,rt,Yn,cc,Lt,Mt,Fn,Pt,At}from"./index-9xsf8162.js";import{zt}from"./index-x2v1zmth.js";import{Oa}from"./index-a4h5np9r.js";var pt={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},y1=new Set([pt.SHAPE_UNSUPPORTED,pt.SHAPE_REMOVED,pt.CONTAINMENT_VIOLATION]),ms=new Set(Object.values(pt).filter((e)=>!y1.has(e))),w1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),N1=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),R1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),dt="roundedRect";function ht(e){if(!e)return e;return w1.get(e)??e}t(ht,"resolveShapeAlias");function E1(e,r){for(let n of e){if(n.isGroup)continue;if(!n.shape||n.shape==="squareRect"||n.shape==="rect")n.shape=dt;if(N1.has(n.shape)){let a=`shape "${n.shape}" was removed in v0.8.1, using "${dt}"`;if(r?.emitError)r.emitError("SHAPE_REMOVED",a,{nodeId:n.id});else l.warn(`agentflow: ${a}`);n.shape=dt;continue}if(!R1.has(n.shape)){let a=`shape "${n.shape}" is not supported, using "${dt}"`;if(r?.emitWarning)r.emitWarning("SHAPE_UNSUPPORTED",a,{nodeId:n.id});else l.warn(`agentflow: ${a}`);n.shape=dt}}}t(E1,"normaliseNodeShapes");var Qt=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),C1=Qt.size,S1=t((e)=>`af-kind-${e}`,"kindClass"),O1=[...Qt.keys()],x1=t((e)=>Math.max(1,e-C1),"containerSlotCount"),T1=t((e,r)=>{let n=C1+e%x1(r);return r>0?n%r:n},"containerSlot");function D1(e,r,n){let a=p().themeVariables?.borderColorArray,c=Array.isArray(a)?a.length:0,d=n.size;for(let o of e??[]){if(o.isGroup||o.shape==="collapsedGroup"){let m=n.get(String(o.id))??d++;o.colorIndex=T1(m,c);continue}let f=r(String(o.id));if(f&&Qt.has(f))o.cssClasses=`${o.cssClasses??""} ${S1(f)}`.replace(/\s+/g," ").trim()}}t(D1,"assignColorSlots");var A1="agentflow-",i1=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),P1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),G1={flow:"flowGroup"};function Xt(e){if(Array.isArray(e))return e.map((n)=>Xt(n));if(e===null||typeof e!=="object")return e;let r={};for(let n of Object.keys(e)){if(n==="__proto__"||n==="constructor"||n==="prototype")continue;r[n]=Xt(e[n])}return r}t(Xt,"stripPrototypeKeys");function _1(e){let r=!1,n=!1,a=0,c,d=[];for(let o of e.split(`
2
2
  `)){if(c!==void 0){let A=o.length-o.trimStart().length;if(o.trim()===""||A>c){d.push(o);continue}c=void 0}let f=-1;for(let A=0;A<o.length;A++){let C=o[A];if(n){if(C==="\\")A++;else if(C==='"')n=!1}else if(r){if(C==="'")r=!1}else if(C==='"')n=!0;else if(C==="'")r=!0;else if(C==="#"&&(A===0||o[A-1]===" "||o[A-1]==="\t")){f=A;break}else if(C==="["||C==="{")a++;else if(C==="]"||C==="}")a=Math.max(0,a-1)}if(r||n||a>0){d.push(o);continue}let m=f>=0?o.slice(0,f):o,k=f>=0?o.slice(f):"";if(/:\s*[>|][\d+-]*\s*$/.test(m)){c=o.length-o.trimStart().length,d.push(o);continue}d.push(m.replace(/,([\t ]*)$/,"$1")+k)}return d.join(`
3
3
  `)}t(_1,"stripLineTrailingCommas");var U1=class{constructor(){this.vertexCounter=0,this.config=p(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=M,this.setAccDescription=z,this.setDiagramTitle=H,this.getAccTitle=G,this.getAccDescription=j,this.getDiagramTitle=q,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{t(this,"AgentFlowDB")}sanitizeText(e){return w.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,a,c,d,o={},f,m){if(!e||e.trim().length===0)return;let k;if(f!==void 0){let E;if(!f.includes(`
4
4
  `))E=`{
@@ -6,7 +6,7 @@ import{t,l,ft,da,w,F,M,G,z,j,H,q,p,pa,Mi,h,cr,ur,V,Sn,gt,nt,rt,Yn,lc,Lt,Mt,Fn,Pt
6
6
  }`;else E=f+`
7
7
  `;try{k=ur(E,{schema:cr})??{}}catch(g){let b=f.includes(`
8
8
  `)?_1(f):f;if(b!==f)try{k=ur(b+`
9
- `,{schema:cr})??{}}catch{this.rethrowMetadataYamlError(g,f,m)}else this.rethrowMetadataYamlError(g,f,m)}k=Xt(k)}let A;if(k&&typeof k.shape==="string"){let E=k;A=E.shape;let g=ht(A);if(g&&g!==A)E.shape=g}let C=this.subGraphLookup.get(e);if(C&&k){C.metadata={...C.metadata,...k};return}let B=this.connectors.get(e);if(B&&k){B.metadata={...B.metadata,...k};return}if(e==="connectors")return;let D=this.edges.find((E)=>E.id===e);if(D){let E=k;if(E?.animate!==void 0)D.animate=E.animate;if(E?.animation!==void 0)D.animation=E.animation;if(E?.curve!==void 0)D.interpolate=E.curve;if(k)D.metadata={...D.metadata,...k};return}let P,v=this.vertices.get(e);if(v===void 0)v={id:e,labelType:"text",domId:A1+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,v);if(this.vertexCounter++,r!==void 0){if(this.config=p(),P=this.sanitizeText(r.text.trim()),v.labelType=r.type,P.startsWith('"')&&P.endsWith('"'))P=P.substring(1,P.length-1);v.text=P}else if(v.text===void 0)v.text=e;if(n!==void 0)v.type=n;if(a!==void 0&&a!==null)a.forEach((E)=>{v.styles.push(E)});if(c!==void 0&&c!==null)c.forEach((E)=>{v.classes.push(E)});if(d!==void 0)v.dir=d;if(v.props===void 0)v.props=o;else if(o!==void 0)Object.assign(v.props,o);if(k){if(v.metadata={...v.metadata,...k},k.shape){let E=A??k.shape;if(typeof E!=="string")throw this.positionedShapeError(`No such shape: ${JSON.stringify(E)}.`,m);if(E!==E.toLowerCase()||E.includes("_"))throw this.positionedShapeError(`No such shape: ${E}. Shape names should be lowercase.`,m);else if(!lc(k.shape))throw this.positionedShapeError(`No such shape: ${k.shape}.`,m);v.type=k?.shape}if(k?.label)v.text=this.sanitizeText(k.label),v.labelType=this.sanitizeNodeLabelType(k?.labelType)}}positionedShapeError(e,r){let n=Error(e);if(!r)return n;let a=r.first_line+this.frontmatterLineOffset;return Object.assign(n,{hash:{text:"",token:null,line:a-1,loc:{first_line:a,last_line:r.last_line+this.frontmatterLineOffset,first_column:r.first_column,last_column:r.last_column},expected:[]}}),n}rethrowMetadataYamlError(e,r,n){let a=e;if(!a||a.name!=="YAMLException"||!a.mark||!n)throw e;let c;try{let d=!r.includes(`
9
+ `,{schema:cr})??{}}catch{this.rethrowMetadataYamlError(g,f,m)}else this.rethrowMetadataYamlError(g,f,m)}k=Xt(k)}let A;if(k&&typeof k.shape==="string"){let E=k;A=E.shape;let g=ht(A);if(g&&g!==A)E.shape=g}let C=this.subGraphLookup.get(e);if(C&&k){C.metadata={...C.metadata,...k};return}let B=this.connectors.get(e);if(B&&k){B.metadata={...B.metadata,...k};return}if(e==="connectors")return;let D=this.edges.find((E)=>E.id===e);if(D){let E=k;if(E?.animate!==void 0)D.animate=E.animate;if(E?.animation!==void 0)D.animation=E.animation;if(E?.curve!==void 0)D.interpolate=E.curve;if(k)D.metadata={...D.metadata,...k};return}let P,v=this.vertices.get(e);if(v===void 0)v={id:e,labelType:"text",domId:A1+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,v);if(this.vertexCounter++,r!==void 0){if(this.config=p(),P=this.sanitizeText(r.text.trim()),v.labelType=r.type,P.startsWith('"')&&P.endsWith('"'))P=P.substring(1,P.length-1);v.text=P}else if(v.text===void 0)v.text=e;if(n!==void 0)v.type=n;if(a!==void 0&&a!==null)a.forEach((E)=>{v.styles.push(E)});if(c!==void 0&&c!==null)c.forEach((E)=>{v.classes.push(E)});if(d!==void 0)v.dir=d;if(v.props===void 0)v.props=o;else if(o!==void 0)Object.assign(v.props,o);if(k){if(v.metadata={...v.metadata,...k},k.shape){let E=A??k.shape;if(typeof E!=="string")throw this.positionedShapeError(`No such shape: ${JSON.stringify(E)}.`,m);if(E!==E.toLowerCase()||E.includes("_"))throw this.positionedShapeError(`No such shape: ${E}. Shape names should be lowercase.`,m);else if(!cc(k.shape))throw this.positionedShapeError(`No such shape: ${k.shape}.`,m);v.type=k?.shape}if(k?.label)v.text=this.sanitizeText(k.label),v.labelType=this.sanitizeNodeLabelType(k?.labelType)}}positionedShapeError(e,r){let n=Error(e);if(!r)return n;let a=r.first_line+this.frontmatterLineOffset;return Object.assign(n,{hash:{text:"",token:null,line:a-1,loc:{first_line:a,last_line:r.last_line+this.frontmatterLineOffset,first_column:r.first_column,last_column:r.last_column},expected:[]}}),n}rethrowMetadataYamlError(e,r,n){let a=e;if(!a||a.name!=="YAMLException"||!a.mark||!n)throw e;let c;try{let d=!r.includes(`
10
10
  `),o=d?`{
11
11
  `+r+`
12
12
  }`:r+`
@@ -19,7 +19,7 @@ ${v.join(`
19
19
 
20
20
  Initialize mermaid with maxEdges set to a higher number to allow more edges.
21
21
  You cannot set this config via configuration inside the diagram as it is a secure config.
22
- You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e==="object"&&"id"in e&&typeof e.id==="string"}addLink(e,r,n){let a=this.isLinkData(n)?n.id.replace("@",""):void 0;l.info("addLink",e,r,a);for(let c of e)for(let d of r){let o=c===e[e.length-1],f=d===r[0];if(o&&f)this.addSingleLink(c,d,n,a);else this.addSingleLink(c,d,n,void 0)}}updateLinkInterpolate(e,r){e.forEach((n)=>{if(n==="default"){this.edges.defaultInterpolate=r;return}if(typeof n==="number"&&n>=this.edges.length)throw Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[n].interpolate=r})}updateLink(e,r){e.forEach((n)=>{if(typeof n==="number"&&n>=this.edges.length)throw Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(n==="default")this.edges.defaultStyle=r;else if(this.edges[n].style=r,(this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some((a)=>a?.startsWith("fill")))this.edges[n]?.style?.push("fill:none")})}addClass(e,r){let n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach((a)=>{let c=this.classes.get(a);if(c===void 0)c={id:a,styles:[],textStyles:[]},this.classes.set(a,c);if(n!==void 0&&n!==null)n.forEach((d)=>{if(/color/.exec(d)){let o=d.replace("fill","bgFill");c.textStyles.push(o)}c.styles.push(d)})})}setDirection(e){if(this.direction=e.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(e,r){for(let n of e.split(",")){let a=this.vertices.get(n);if(a)a.classes.push(r);let c=this.edges.find((o)=>o.id===n);if(c)c.classes.push(r);let d=this.subGraphLookup.get(n);if(d)d.classes.push(r)}}setTooltip(e,r){if(r===void 0)return;r=this.sanitizeText(r);for(let n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}setClickFun(e,r,n){if(p().securityLevel!=="loose")return;if(r===void 0)return;let a=[];if(typeof n==="string"){a=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d<a.length;d++){let o=a[d].trim();if(o.startsWith('"')&&o.endsWith('"'))o=o.substr(1,o.length-2);a[d]=o}}if(a.length===0)a.push(e);let c=this.vertices.get(e);if(c)c.haveCallback=!0,this.funs.push(()=>{let d=this.lookUpDomId(e),o=document.querySelector(`[id="${d}"]`);if(o!==null)o.addEventListener("click",()=>{V.runFunc(r,...a)},!1)})}setLink(e,r,n){e.split(",").forEach((a)=>{let c=this.vertices.get(a);if(c!==void 0)c.link=V.formatUrl(r,this.config),c.linkTarget=n}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach((a)=>{this.setClickFun(a,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach((r)=>{r(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return P1.has(e.type)}getTools(){let e=[];for(let r of this.vertices.values())if(this.isToolDefinition(r))e.push(r);return e}getClasses(){return this.classes}setupToolTips(e){let r=Oa();h(e).select("svg").selectAll("g.node").on("mouseover",(c)=>{let d=h(c.currentTarget),o=d.attr("title");if(o===null)return;let f=c.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(d.attr("title")).style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),r.html(zt.sanitize(o)),d.classed("hover",!0)}).on("mouseout",(c)=>{r.transition().duration(500).style("opacity",0),h(c.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=p(),this.diagramId="",this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,F()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n,a){let c=e?.text?.trim(),d=n?.text;if(e===n&&n?.text&&/\s/.exec(n.text))c=void 0;let f=t((D)=>{let P={boolean:{},number:{},string:{}},v=[],E;return{nodeList:D.filter(function(b){let _=typeof b;if(b.stmt&&b.stmt==="dir")return E=b.value,!1;if(b.trim()==="")return!1;if(_ in P)return P[_].hasOwnProperty(b)?!1:P[_][b]=!0;else return v.includes(b)?!1:v.push(b)}),dir:E}},"uniq")(r.flat()),{nodeList:m,dir:k}=f,A=p().flowchart??{};if(k=k??(A.inheritDir?this.getDirection()??p().direction??void 0:void 0),this.version==="gen-1")for(let D=0;D<m.length;D++)m[D]=this.lookUpDomId(m[D]);c=c??"subGraph"+this.subCount,d=d||"",d=this.sanitizeText(d),this.subCount=this.subCount+1;let C={id:c,nodes:m.filter((D)=>D!==c&&!this.globalNodes.has(D)),title:d.trim(),classes:[],dir:k,labelType:this.sanitizeNodeLabelType(n?.type),type:a??"flow"};l.info("Adding",C.id,C.nodes,C.dir),C.nodes=this.makeUniq(C,this.subGraphs).nodes;let B=this.getPosForId(c);if(B!==-1){let D=this.subGraphs[B];for(let P of C.nodes)if(!D.nodes.includes(P))D.nodes.push(P);if(C.title)D.title=C.title;if(C.dir)D.dir=C.dir;if(C.type)D.type=C.type;this.subGraphLookup.set(c,D)}else this.subGraphs.push(C),this.subGraphLookup.set(c,C);return c}addGlobal(e){for(let r of e.flat()){if(typeof r!=="string")continue;let n=r.trim();if(n!=="")this.globalNodes.add(n)}for(let r of this.subGraphs)r.nodes=r.nodes.filter((n)=>!this.globalNodes.has(n))}getPosForId(e){for(let[r,n]of this.subGraphs.entries())if(n.id===e)return r;return-1}indexNodes2(e,r){let n=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let a=0,c=1;while(a<n.length){let d=this.getPosForId(n[a]);if(d>=0){let o=this.indexNodes2(e,d);if(o.result)return{result:!0,count:c+o.count};else c=c+o.count}a=a+1}return{result:!1,count:c}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}addConnector(e,r){let n=e?.text?.trim();if(!n)return"";let a=r?.text?.trim()??"",c=a.length>0?this.sanitizeText(a):n,d=this.connectors.get(n);if(!d)d={id:n,labelType:"text",domId:A1+n+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:c},this.connectors.set(n,d),this.vertices.set(n,d),this.vertexCounter++;else if(a.length>0)d.text=c;return n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}computeEdgeSemantic(e,r){if(e==="arrow_point"&&r==="normal")return"sequence";if(e==="arrow_cross"&&r==="normal")return"failure";if(e==="arrow_open"&&r==="dotted")return"reference";return}destructStartLink(e){let r=e.trim(),n="arrow_open",a="normal";if(r.includes("."))a="dotted";return{type:"arrow_open",stroke:a}}countChar(e,r){let n=r.length,a=0;for(let c=0;c<n;++c)if(r[c]===e)++a;return a}destructEndLink(e){let r=e.trim(),n=r.slice(0,-1),a="arrow_open";switch(r.slice(-1)){case"x":a="arrow_cross";break;case">":a="arrow_point";break;case"-":case".":a="arrow_open",n=r;break}let c="normal",d=n.length-1,o=this.countChar(".",n);if(o>0)c="dotted",d=o;return{type:a,stroke:c,length:d}}destructLink(e,r){let n=this.destructEndLink(e),a;if(r){if(a=this.destructStartLink(r),a.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};return a.type=n.type,a.length=n.length,{...a,edgeSemantic:this.computeEdgeSemantic(a.type,a.stroke)}}return{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,r){for(let n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){let n=[];return e.nodes.forEach((a,c)=>{if(!this.exists(r,a))n.push(e.nodes[c])}),{nodes:n}}getTypeFromVertex(e){let r=typeof e.type==="string"?ht(e.type):e.type;switch(r){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return r}}findNode(e,r){return e.find((n)=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,a,c,d){let o=n.get(e.id),f=a.get(e.id)??!1,m=this.findNode(r,e.id);if(m)m.cssStyles=e.styles,m.cssCompiledStyles=this.getCompiledStyles(e.classes),m.cssClasses=e.classes.join(" ");else{let k={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:c.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};if(f)r.push({...k,isGroup:!0,shape:"rect"});else r.push({...k,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:c.agentflow?.wrappingWidth,minWidth:c.agentflow?.minNodeWidth})}}getCompiledStyles(e){let r=[];for(let n of e){let a=this.classes.get(n);if(a?.styles)r=[...r,...a.styles??[]].map((c)=>c.trim());if(a?.textStyles)r=[...r,...a.textStyles??[]].map((c)=>c.trim())}return r}runPostParseValidators(){if(this.postParseValidationRun)return;this.postParseValidationRun=!0}getData(){this.runPostParseValidators();let e=p(),r=[],n=[],a=this.getSubGraphs(),c=new Map,d=new Map,o=new Set,f=new Map,m=t((g,b,_=new Set)=>{if(_.has(g))return;_.add(g);let Y=this.subGraphLookup.get(g);if(!Y)return;for(let fe of Y.nodes){if(fe===b||_.has(fe))continue;o.add(fe),f.set(fe,b),m(fe,b,_)}},"collectDescendants");for(let g of a)if(g.metadata?.view==="collapsed"&&!o.has(g.id))m(g.id,g.id);let k=t((g,b)=>{let _=new Set,Y=b;while(Y!==void 0&&!_.has(Y)){if(Y===g)return!0;_.add(Y),Y=c.get(Y)}return!1},"wouldCloseContainmentCycle");for(let g=a.length-1;g>=0;g--){let b=a[g];if(o.has(b.id))continue;if(b.nodes.length>0)d.set(b.id,!0);for(let _ of b.nodes){if(k(_,b.id)){this.emitWarning(pt.CONTAINMENT_VIOLATION,`Container "${b.id}" cannot contain "${_}" because "${_}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:_});continue}c.set(_,b.id)}}for(let g=a.length-1;g>=0;g--){let b=a[g];if(o.has(b.id))continue;if(b.metadata?.view==="collapsed"){let Y={...b.metadata,containerType:b.type};r.push({id:b.id,label:b.title,labelStyle:"",labelType:b.labelType,parentId:c.get(b.id),padding:8,cssCompiledStyles:this.getCompiledStyles(b.classes),cssClasses:b.classes.join(" "),shape:"collapsedGroup",dir:b.dir,isGroup:!1,look:e.look,metadata:Y})}else r.push({id:b.id,label:b.title,labelStyle:"",labelType:b.labelType,parentId:c.get(b.id),padding:8,cssCompiledStyles:this.getCompiledStyles(b.classes),cssClasses:b.classes.join(" "),shape:G1[b.type??"flow"],dir:b.dir,isGroup:!0,look:e.look,metadata:b.metadata})}this.getVertices().forEach((g)=>{if(o.has(g.id))return;this.addNodeFromVertex(g,r,c,d,e,e.look||"classic")});let C=this.getEdges();C.forEach((g,b)=>{let _=f.get(g.start)??g.start,Y=f.get(g.end)??g.end;if(_===Y&&g.start!==g.end)return;let{arrowTypeStart:fe,arrowTypeEnd:Se}=this.destructEdgeType(g.type),Ee=[...C.defaultStyle??[]];if(g.style)Ee.push(...g.style);let xe={id:Sn(_,Y,{counter:b,prefix:"L"},g.id),isUserDefinedId:g.isUserDefinedId,start:_,end:Y,type:g.type??"normal",label:g.text,labelType:g.labelType,labelpos:"c",thickness:g.stroke,minlen:g.length,classes:g?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:g?.stroke==="invisible"||g?.type==="arrow_open"?"none":fe,arrowTypeEnd:g?.stroke==="invisible"||g?.type==="arrow_open"?"none":Se,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(g.classes),labelStyle:Ee,style:Ee,pattern:g.stroke,look:e.look,animate:g.animate,animation:g.animation,curve:g.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:g.metadata};n.push(xe)}),E1(r,this);let B=new Map,D=new Map;for(let g of a){let b=c.get(g.id);if(b!==void 0)D.set(b,[...D.get(b)??[],g.id])}let P=0,v=t((g)=>{if(B.has(g))return;B.set(g,P++);for(let b of D.get(g)??[])v(b)},"walkContainers");for(let g of a)if(c.get(g.id)===void 0)v(g.id);let E=new Set(this.getConnectors().map((g)=>g.id));return D1(r,(g)=>{if(E.has(g))return"connector";let b=this.vertices.get(g);return b?this.deriveVertexKind(b,ht(b.type)):void 0},B),{nodes:r,edges:n,other:{},config:e,connectors:this.getConnectors()}}defaultConfig(){return Mi.flowchart}deriveVertexKind(e,r){if(this.isToolDefinition(e))return"tool";if(r==="hexagon"||r==="hex")return"action";if(r==="lean-right"||r==="lean_right")return"input";if(r==="lin-doc"||r==="lined-document")return"refdoc";if(r==="diamond")return"decision";return"task"}getSemanticModel(){this.runPostParseValidators();let e=new Set(this.subGraphs.map((o)=>o.id)),r=[],n=[];for(let[o,f]of this.vertices){if(e.has(o))continue;if(f.isConnector){let A={id:o};if(f.text!==void 0&&f.text!==o)A.title=f.text;if(f.metadata&&Object.keys(f.metadata).length>0){let C={};for(let[B,D]of Object.entries(f.metadata)){if(i1.has(B))continue;C[B]=D}if(Object.keys(C).length>0)A.metadata=C}n.push(A);continue}let m={id:o};if(f.text!==void 0)m.label=f.text;let k=typeof f.type==="string"?ht(f.type):f.type;if(k!==void 0)m.shape=k;if(m.vertexKind=this.deriveVertexKind(f,k),f.metadata&&Object.keys(f.metadata).length>0){let A={};for(let[C,B]of Object.entries(f.metadata)){if(i1.has(C))continue;A[C]=B}if(Object.keys(A).length>0)m.metadata=A}r.push(m)}let a=this.edges.map((o)=>{let f={start:o.start,end:o.end};if(o.id!==void 0)f.id=o.id;if(typeof o.text==="string"&&o.text.length>0)f.label=o.text;if(o.type!==void 0)f.type=o.type;if(o.stroke!==void 0)f.stroke=o.stroke;if(o.edgeSemantic!==void 0)f.edgeSemantic=o.edgeSemantic;if(o.length!==void 0)f.length=o.length;if(o.metadata&&Object.keys(o.metadata).length>0)f.metadata={...o.metadata};return f}),c=this.subGraphs.map((o)=>{let f={id:o.id,nodes:[...o.nodes]};if(o.type!==void 0)f.type=o.type;if(o.title!==void 0)f.title=o.title;if(o.dir!==void 0)f.direction=o.dir;if(o.metadata&&Object.keys(o.metadata).length>0){let m={};for(let[k,A]of Object.entries(o.metadata)){if(i1.has(k))continue;m[k]=A}if(Object.keys(m).length>0)f.metadata=m}return f}),d={vertices:r,edges:a,subGraphs:c,connectors:n,diagnostics:this.diagnostics};if(this.direction!==void 0)d.direction=this.direction;return d}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let r=e?.first_line??0,n=e?.first_column??0,a=e?.last_line??r,c=e?.last_column??n,[d,o]=e?.range??[0,0];return{startLine:r+this.frontmatterLineOffset,startColumn:n,endLine:a+this.frontmatterLineOffset,endColumn:c,startIndex:d,endIndex:o}}pushMapping(e,r,n){if(!e)return;let a={id:e,type:r,position:this.toElementPosition(n)};return this.elementMappings.push(a),a}addVertexMapping(e,r,n,a){let c=this.pushMapping(e,"vertex",a);if(c&&n==null)this.bareVertexMappings.add(c)}extendVertexMapping(e,r){if(!e||!r)return;let n=this.toElementPosition(r);for(let a=this.elementMappings.length-1;a>=0;a--){let c=this.elementMappings[a];if(c.type==="vertex"&&c.id===e){if(this.bareVertexMappings.has(c))c.type="attachment",this.bareVertexMappings.delete(c);if(n.endLine>c.position.endLine||n.endLine===c.position.endLine&&n.endColumn>c.position.endColumn)c.position.endLine=n.endLine,c.position.endColumn=n.endColumn,c.position.endIndex=n.endIndex;return}}this.pushMapping(e,"attachment",r)}addEdgeMapping(e,r,n,a){let c=Array.isArray(r)?r.map((o)=>typeof o==="string"?o:o?.id??"").filter(Boolean):[],d=c.length>0?c.join(">"):"edge";this.pushMapping(d,"edge",a)}addSubgraphMapping(e,r,n,a){let c=(typeof e==="string"?e:e?.text)??"",d=this.toElementPosition(n),o=a?this.toElementPosition(a):d;if(!c)return;this.elementMappings.push({id:c,type:"subgraph",position:{startLine:d.startLine,startColumn:d.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:d.startIndex,endIndex:o.endIndex}})}addConnectorMapping(e,r,n,a){let c=e?.text?.trim()??"";if(!c)return;let d=this.toElementPosition(n),o=a?this.toElementPosition(a):d;this.elementMappings.push({id:c,type:"connector",position:{startLine:d.startLine,startColumn:d.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:d.startIndex,endIndex:o.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find((r)=>r.id===e)}getElementsOnLine(e){return this.elementMappings.filter((r)=>e>=r.position.startLine&&e<=r.position.endLine)}getElementAtPosition(e,r){let n=this.elementMappings.filter((c)=>{let{startLine:d,startColumn:o,endLine:f,endColumn:m}=c.position;if(e<d||e>f)return!1;if(e===d&&r<o)return!1;if(e===f&&r>m)return!1;return!0});if(n.length===0)return;let a=t(({position:c})=>[c.endLine-c.startLine,c.endColumn-c.startColumn],"span");return n.reduce((c,d)=>{let[o,f]=a(c),[m,k]=a(d);if(m!==o)return m<o?d:c;return k<f?d:c})}getMappingStats(){let e=0,r=0,n=0,a=0,c=0;for(let d of this.elementMappings)if(d.type==="vertex")e++;else if(d.type==="edge")r++;else if(d.type==="subgraph")n++;else if(d.type==="connector")a++;else if(d.type==="attachment")c++;return{vertices:e,edges:r,subgraphs:n,connectors:a,attachments:c,totalElements:this.elementMappings.length}}emitDiagnostic(e,r,n,a){let c=a?.nodeId??a?.edgeId,d=c?this.getElementById(c):void 0,o={id:e,severity:r,message:n,...a?.nodeId?{nodeId:a.nodeId}:{},...a?.edgeId&&!a?.nodeId?{edgeId:a.edgeId}:{},...d?{position:d.position}:{}};if(this.diagnostics.some((k)=>k.id===o.id&&k.severity===o.severity&&k.message===o.message&&k.nodeId===o.nodeId&&k.edgeId===o.edgeId))return;this.diagnostics.push(o);let m=`agentflow[${e}]: ${n}`;if(r==="error")l.error(m);else l.warn(m)}emitWarning(e,r,n){this.emitDiagnostic(e,"warning",r,n)}emitError(e,r,n){this.emitDiagnostic(e,"error",r,n)}getDiagnostics(){return[...this.diagnostics]}},j1=t(function(e,r){return r.db.getClasses()},"getClasses"),z1=t(async function(e,r,n,a){l.debug("Drawing agentflow diagram",r);let{securityLevel:c,agentflow:d,layout:o}=p();a.db.setDiagramId(r),l.debug("Before getData: ");let f=a.db.getData();l.debug("Data: ",f);let m=Pt(r,c),k=a.db.getDirection();if(f.type=a.type,f.layoutAlgorithm=Mt(o),f.layoutAlgorithm==="dagre"&&o==="elk")l.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.");f.direction=k,f.nodeSpacing=d?.nodeSpacing||50,f.rankSpacing=d?.rankSpacing||50,f.markers=["point","circle","cross","hierarchy"],f.diagramId=r,l.debug("REF1:",f),await Lt(f,m);let A=d?.diagramPadding??8;V.insertTitle(m,"agentflowTitleText",d?.titleTopMargin??0,a.db.getDiagramTitle()),At(m,A,"agentflow",d?.useMaxWidth??!0)},"draw"),W1={getClasses:j1,draw:z1},r1=function(){var e=t(function(we,S,x,T){for(x=x||{},T=we.length;T--;x[we[T]]=S);return x},"o"),r=[1,5],n=[1,4],a=[1,3],c=[1,6],d=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],o=[2,2],f=[1,15],m=[1,16],k=[1,17],A=[1,18],C=[1,19],B=[1,26],D=[1,27],P=[1,28],v=[1,30],E=[1,31],g=[1,32],b=[1,55],_=[1,54],Y=[1,34],fe=[1,35],Se=[1,36],Ee=[1,37],xe=[1,38],Q=[1,50],J=[1,52],Z=[1,48],ee=[1,53],te=[1,49],se=[1,56],ie=[1,51],re=[1,57],ne=[1,58],Ne=[1,39],Re=[1,40],Oe=[1,41],Pe=[1,42],Ge=[1,43],Me=[1,64],I=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],ce=[1,70],de=[1,68],he=[1,67],pe=[1,69],We=[8,9,10,12,78,80,81],Ke=[1,88],He=[1,101],Ye=[1,106],qe=[1,105],Xe=[1,102],Qe=[1,98],Je=[1,104],Ze=[1,100],$e=[1,107],et=[1,103],tt=[1,108],st=[1,99],Ue=[8,9,10,11,12,43,78,80,81],oe=[8,9,10,11,12,43,49,78,80,81],be=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],n1=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],it=[47,63,92,105,108,109,112,114,117,118,119],a1=[1,131],o1=[1,132],bt=[1,134],kt=[1,133],u1=[47,63,65,77,92,105,108,109,112,114,117,118,119],mt=[1,143],Et=[1,157],Ct=[1,158],St=[1,159],xt=[1,162],Tt=[1,161],Dt=[1,160],_t=[1,145],vt=[1,147],Ft=[1,151],l1=[1,139],c1=[1,140],Vt=[1,152],It=[1,153],Bt=[1,154],yt=[1,155],wt=[1,156],Nt=[1,163],Rt=[1,164],Ot=[1,141],Gt=[1,142],Ut=[1,149],jt=[1,144],Wt=[1,148],Kt=[1,146],at=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],d1=[1,168],ot=[1,170],X=[8,9,10,12],ke=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],y=[1,190],ue=[1,186],le=[1,187],N=[1,191],R=[1,188],O=[1,189],ut=[80,119,122],U=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],h1=[11,109],ye=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],Te=[1,269],De=[1,267],_e=[1,271],ve=[1,265],Fe=[1,266],Ve=[1,268],Ie=[1,270],Le=[1,272],lt=[1,292],p1=[8,9,10,12,109],Ce=[8,9,10,11,12,63,87,108,109,112,113,114,115],Jt={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:"error",8:"COMMENT",9:"SEMI",10:"NEWLINE",11:"SPACE",12:"EOF",13:"GRAPH",14:"NODIR",15:"DIR",28:"flow",30:"SQS",32:"SQE",33:"end",35:"global",36:"connector",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"SHAPE_DATA",47:"AMP",49:"STYLE_SEPARATOR",51:"DOUBLECIRCLESTART",52:"DOUBLECIRCLEEND",53:"PS",54:"PE",55:"(-",56:"-)",57:"STADIUMSTART",58:"STADIUMEND",59:"SUBROUTINESTART",60:"SUBROUTINEEND",61:"VERTEX_WITH_PROPS_START",62:"NODE_STRING[field]",63:"COLON",64:"NODE_STRING[value]",65:"PIPE",66:"CYLINDERSTART",67:"CYLINDEREND",68:"DIAMOND_START",69:"DIAMOND_STOP",70:"TAGEND",71:"TRAPSTART",72:"TRAPEND",73:"INVTRAPSTART",74:"INVTRAPEND",77:"TESTSTR",78:"START_LINK",80:"LINK",81:"LINK_ID",83:"STR",84:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"idString[vertex]",97:"idString[class]",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"STR[link]",103:"STR[tooltip]",105:"DEFAULT",107:"INTERPOLATE",108:"NUM",109:"COMMA",112:"NODE_STRING",113:"UNIT",114:"BRKT",115:"PCT",117:"MINUS",118:"MULT",119:"UNICODE_TEXT",120:"TEXT",121:"TAGSTART",122:"EDGE_TEXT",124:"direction_tb",125:"direction_bt",126:"direction_rl",127:"direction_lr",128:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:t(function(S,x,T,u,W,s,L){var i=s.length-1;switch(W){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 198:this.$=s[i];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:u.setDirection("TB"),this.$="TB";break;case 14:u.setDirection(s[i-1]),this.$=s[i-1];break;case 32:this.$=s[i-1].nodes;break;case 38:if(this.$=u.addSubGraph(s[i-6],s[i-1],s[i-4],"flow"),u.addSubgraphMapping)u.addSubgraphMapping(s[i-6],s[i-4],L[i-8],L[i]);break;case 39:if(this.$=u.addSubGraph(s[i-7],s[i-1],s[i-5],"flow"),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],L[i-3]),u.addSubgraphMapping)u.addSubgraphMapping(s[i-7],s[i-5],L[i-9],L[i]);break;case 40:if(this.$=u.addSubGraph(s[i-3],s[i-1],{text:"",type:"text"},"flow"),u.addSubgraphMapping)u.addSubgraphMapping(s[i-3],{text:"",type:"text"},L[i-5],L[i]);break;case 41:if(this.$=u.addSubGraph(s[i-4],s[i-1],{text:"",type:"text"},"flow"),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],L[i-3]),u.addSubgraphMapping)u.addSubgraphMapping(s[i-4],{text:"",type:"text"},L[i-6],L[i]);break;case 42:if(this.$=u.addSubGraph(void 0,s[i-1],void 0,"flow"),u.addSubgraphMapping)u.addSubgraphMapping(void 0,void 0,L[i-3],L[i]);break;case 43:u.addGlobal(s[i-1]),this.$=[];break;case 44:if(this.$=u.addConnector(s[i-4],s[i-2]),u.addConnectorMapping)u.addConnectorMapping(s[i-4],s[i-2],L[i-6],L[i]);break;case 45:if(this.$=u.addConnector(s[i-5],s[i-3]),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],L[i-1]),u.addConnectorMapping)u.addConnectorMapping(s[i-5],s[i-3],L[i-7],L[i]);break;case 46:if(this.$=u.addConnector(s[i-1],{text:"",type:"text"}),u.addConnectorMapping)u.addConnectorMapping(s[i-1],{text:"",type:"text"},L[i-3],L[i]);break;case 47:if(this.$=u.addConnector(s[i-2],{text:"",type:"text"}),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],L[i-1]),u.addConnectorMapping)u.addConnectorMapping(s[i-2],{text:"",type:"text"},L[i-4],L[i]);break;case 49:this.$=s[i].trim(),u.setAccTitle(this.$);break;case 50:case 51:this.$=s[i].trim(),u.setAccDescription(this.$);break;case 56:this.$=s[i-1]+s[i];break;case 57:this.$=s[i];break;case 58:if(u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],L[i]),u.extendVertexMapping)u.extendVertexMapping(s[i-1][s[i-1].length-1],L[i]);if(u.addLink(s[i-3].stmt,s[i-1],s[i-2]),u.addEdgeMapping)u.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 59:if(u.addLink(s[i-2].stmt,s[i],s[i-1]),u.addEdgeMapping)u.addEdgeMapping(s[i-2].stmt,s[i],s[i-1],this._$);this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 60:if(u.addLink(s[i-3].stmt,s[i-1],s[i-2]),u.addEdgeMapping)u.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 61:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 62:if(u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],L[i]),u.extendVertexMapping)u.extendVertexMapping(s[i-1][s[i-1].length-1],L[i]);this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 63:this.$={stmt:s[i],nodes:s[i]};break;case 64:this.$=[s[i]];break;case 65:if(u.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4],L[i-4]),u.extendVertexMapping)u.extendVertexMapping(s[i-5][s[i-5].length-1],L[i-4]);this.$=s[i-5].concat(s[i]);break;case 66:this.$=s[i-4].concat(s[i]);break;case 67:this.$=s[i];break;case 68:this.$=s[i-2],u.setClass(s[i-2],s[i]);break;case 69:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"square"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"square",this._$);break;case 70:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"doublecircle"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"doublecircle",this._$);break;case 71:if(this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"circle"),u.addVertexMapping)u.addVertexMapping(s[i-5],s[i-2],"circle",this._$);break;case 72:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"ellipse"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"ellipse",this._$);break;case 73:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"stadium"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"stadium",this._$);break;case 74:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"subroutine"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"subroutine",this._$);break;case 75:if(this.$=s[i-7],u.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]])),u.addVertexMapping)u.addVertexMapping(s[i-7],s[i-1],"rect",this._$);break;case 76:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"cylinder"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"cylinder",this._$);break;case 77:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"round"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"round",this._$);break;case 78:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"diamond"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"diamond",this._$);break;case 79:if(this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"hexagon"),u.addVertexMapping)u.addVertexMapping(s[i-5],s[i-2],"hexagon",this._$);break;case 80:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"odd"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"odd",this._$);break;case 81:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"trapezoid"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"trapezoid",this._$);break;case 82:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"inv_trapezoid"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"inv_trapezoid",this._$);break;case 83:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_right"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"lean_right",this._$);break;case 84:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_left"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"lean_left",this._$);break;case 85:if(this.$=s[i],u.addVertex(s[i]),u.addVertexMapping)u.addVertexMapping(s[i],void 0,void 0,this._$);break;case 86:s[i-1].text=s[i],this.$=s[i-1];break;case 87:case 88:s[i-2].text=s[i-1],this.$=s[i-2];break;case 89:this.$=s[i];break;case 90:var K=u.destructLink(s[i],s[i-2]);this.$={type:K.type,stroke:K.stroke,length:K.length,edgeSemantic:K.edgeSemantic,text:s[i-1]};break;case 91:var K=u.destructLink(s[i],s[i-2]);this.$={type:K.type,stroke:K.stroke,length:K.length,edgeSemantic:K.edgeSemantic,text:s[i-1],id:s[i-3]};break;case 92:this.$={text:s[i],type:"text"};break;case 93:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 94:this.$={text:s[i],type:"string"};break;case 95:this.$={text:s[i],type:"markdown"};break;case 96:var K=u.destructLink(s[i]);this.$={type:K.type,stroke:K.stroke,length:K.length,edgeSemantic:K.edgeSemantic};break;case 97:var K=u.destructLink(s[i]);this.$={type:K.type,stroke:K.stroke,length:K.length,edgeSemantic:K.edgeSemantic,id:s[i-1]};break;case 98:this.$=s[i-1];break;case 99:this.$={text:s[i],type:"text"};break;case 100:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 101:this.$={text:s[i],type:"string"};break;case 102:case 119:this.$={text:s[i],type:"markdown"};break;case 116:this.$={text:s[i],type:"text"};break;case 117:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 118:this.$={text:s[i],type:"text"};break;case 120:this.$=s[i-4],u.addClass(s[i-2],s[i]);break;case 121:this.$=s[i-4],u.setClass(s[i-2],s[i]);break;case 122:case 130:this.$=s[i-1],u.setClickEvent(s[i-1],s[i]);break;case 123:case 131:this.$=s[i-3],u.setClickEvent(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 124:this.$=s[i-2],u.setClickEvent(s[i-2],s[i-1],s[i]);break;case 125:this.$=s[i-4],u.setClickEvent(s[i-4],s[i-3],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 126:this.$=s[i-2],u.setLink(s[i-2],s[i]);break;case 127:this.$=s[i-4],u.setLink(s[i-4],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 128:this.$=s[i-4],u.setLink(s[i-4],s[i-2],s[i]);break;case 129:this.$=s[i-6],u.setLink(s[i-6],s[i-4],s[i]),u.setTooltip(s[i-6],s[i-2]);break;case 132:this.$=s[i-1],u.setLink(s[i-1],s[i]);break;case 133:this.$=s[i-3],u.setLink(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 134:this.$=s[i-3],u.setLink(s[i-3],s[i-2],s[i]);break;case 135:this.$=s[i-5],u.setLink(s[i-5],s[i-4],s[i]),u.setTooltip(s[i-5],s[i-2]);break;case 136:this.$=s[i-4],u.addVertex(s[i-2],void 0,void 0,s[i]);break;case 137:this.$=s[i-4],u.updateLink([s[i-2]],s[i]);break;case 138:this.$=s[i-4],u.updateLink(s[i-2],s[i]);break;case 139:this.$=s[i-8],u.updateLinkInterpolate([s[i-6]],s[i-2]),u.updateLink([s[i-6]],s[i]);break;case 140:this.$=s[i-8],u.updateLinkInterpolate(s[i-6],s[i-2]),u.updateLink(s[i-6],s[i]);break;case 141:this.$=s[i-6],u.updateLinkInterpolate([s[i-4]],s[i]);break;case 142:this.$=s[i-6],u.updateLinkInterpolate(s[i-4],s[i]);break;case 143:case 145:this.$=[s[i]];break;case 144:case 146:s[i-2].push(s[i]),this.$=s[i-2];break;case 148:this.$=s[i-1]+s[i];break;case 196:this.$=s[i];break;case 197:this.$=s[i-1]+""+s[i];break;case 199:this.$=s[i-1]+""+s[i];break;case 200:this.$={stmt:"dir",value:"TB"};break;case 201:this.$={stmt:"dir",value:"BT"};break;case 202:this.$={stmt:"dir",value:"RL"};break;case 203:this.$={stmt:"dir",value:"LR"};break;case 204:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,8:r,10:n,11:a,13:c},{1:[3]},e(d,o,{5:7}),{4:8,8:r,10:n,11:a,13:c},{4:9,8:r,10:n,11:a,13:c},{4:10,8:r,10:n,11:a,13:c},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(d,[2,10]),e(d,[2,11]),e(d,[2,12]),e(d,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:Me,16:59,19:62},e(I,[2,3]),e(I,[2,4]),e(I,[2,5]),e(I,[2,6]),e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),{8:ce,9:de,10:he,12:pe,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:ce,9:de,10:he,12:pe,22:75},{8:ce,9:de,10:he,12:pe,22:76},{8:ce,9:de,10:he,12:pe,22:77},{8:ce,9:de,10:he,12:pe,22:78},{8:ce,9:de,10:he,12:pe,22:79},{8:ce,9:de,10:he,11:[1,80],12:pe,22:81},{8:ce,9:de,10:he,12:pe,22:82},{11:[1,83]},e(I,[2,48]),{39:[1,84]},{41:[1,85]},e(I,[2,51]),e(We,[2,63],{19:86,34:87,11:Me,43:Ke}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:He,47:Ye,63:qe,83:[1,96],92:Xe,98:[1,93],100:[1,94],104:95,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st,123:97},e(I,[2,200]),e(I,[2,201]),e(I,[2,202]),e(I,[2,203]),e(I,[2,204]),e(Ue,[2,64]),e(Ue,[2,67],{49:[1,109]}),e(oe,[2,85],{116:122,30:[1,110],47:b,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:_,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),e(be,[2,196]),e(be,[2,157]),e(be,[2,158]),e(be,[2,159]),e(be,[2,160]),e(be,[2,161]),e(be,[2,162]),e(be,[2,163]),e(be,[2,164]),e(be,[2,165]),e(be,[2,166]),e(be,[2,167]),e(d,[2,14]),e(d,[2,20]),e(d,[2,21]),{10:[1,123]},e(d,[2,23]),e(n1,[2,31],{19:124,11:Me}),e(I,[2,32]),{45:125,46:44,47:b,48:45,50:46,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(I,[2,52]),e(I,[2,53]),e(I,[2,54]),e(I,[2,55]),e(it,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:a1,84:o1,119:bt,122:kt},{78:[1,135],80:[1,136]},e(u1,[2,96]),e(I,[2,33]),e(I,[2,34]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),{11:mt,13:Et,15:Ct,28:St,29:137,33:xt,35:Tt,36:Dt,47:_t,63:vt,78:Ft,83:l1,84:c1,86:150,87:Vt,88:It,89:Bt,90:yt,91:wt,92:Nt,93:Rt,94:138,108:Ot,112:Gt,114:Ut,117:jt,118:Wt,119:Kt},e(at,o,{5:165}),e(at,o,{5:166}),{11:mt,13:Et,15:Ct,28:St,29:167,33:xt,35:Tt,36:Dt,47:_t,63:vt,78:Ft,83:l1,84:c1,86:150,87:Vt,88:It,89:Bt,90:yt,91:wt,92:Nt,93:Rt,94:138,108:Ot,112:Gt,114:Ut,117:jt,118:Wt,119:Kt},e(I,[2,49]),e(I,[2,50]),e(We,[2,61],{47:d1}),e(We,[2,62],{19:169,11:Me,43:ot}),e(Ue,[2,57]),{47:b,50:171,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{105:[1,172],106:173,108:[1,174]},{47:b,50:175,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{47:b,50:176,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(X,[2,130],{123:181,11:[1,180],15:He,47:Ye,63:qe,92:Xe,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st}),e(X,[2,132],{11:[1,182]}),e(ke,[2,198]),e(ke,[2,185]),e(ke,[2,186]),e(ke,[2,187]),e(ke,[2,188]),e(ke,[2,189]),e(ke,[2,190]),e(ke,[2,191]),e(ke,[2,192]),e(ke,[2,193]),e(ke,[2,194]),e(ke,[2,195]),{47:b,50:183,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{31:184,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:192,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:194,53:[1,193],70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:195,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:196,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:197,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{112:[1,198]},{31:199,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:200,68:[1,201],70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:202,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:203,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:204,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},e(be,[2,197]),e(d,[2,22]),e(n1,[2,30]),e(We,[2,59],{34:205,19:206,11:Me,43:Ke}),e(it,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{80:[1,210],82:211,119:bt,122:kt},e(ut,[2,92]),e(ut,[2,94]),e(ut,[2,95]),e(ut,[2,183]),e(ut,[2,184]),{79:212,82:130,83:a1,84:o1,119:bt,122:kt},e(u1,[2,97]),{8:ce,9:de,10:he,11:mt,12:pe,13:Et,15:Ct,22:214,28:St,30:[1,213],33:xt,34:215,35:Tt,36:Dt,43:Ke,47:_t,63:vt,78:Ft,86:150,87:Vt,88:It,89:Bt,90:yt,91:wt,92:Nt,93:Rt,94:216,108:Ot,112:Gt,114:Ut,117:jt,118:Wt,119:Kt},e(U,[2,116]),e(U,[2,118]),e(U,[2,119]),e(U,[2,172]),e(U,[2,173]),e(U,[2,174]),e(U,[2,175]),e(U,[2,176]),e(U,[2,177]),e(U,[2,178]),e(U,[2,179]),e(U,[2,180]),e(U,[2,181]),e(U,[2,182]),e(U,[2,103]),e(U,[2,104]),e(U,[2,105]),e(U,[2,106]),e(U,[2,107]),e(U,[2,108]),e(U,[2,109]),e(U,[2,110]),e(U,[2,111]),e(U,[2,112]),e(U,[2,113]),e(U,[2,114]),e(U,[2,115]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,217],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,218],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{8:ce,9:de,10:he,11:mt,12:pe,13:Et,15:Ct,22:220,28:St,30:[1,219],33:xt,34:221,35:Tt,36:Dt,43:Ke,47:_t,63:vt,78:Ft,86:150,87:Vt,88:It,89:Bt,90:yt,91:wt,92:Nt,93:Rt,94:216,108:Ot,112:Gt,114:Ut,117:jt,118:Wt,119:Kt},{11:Me,19:222},{47:[1,223]},e(Ue,[2,56]),{11:[1,224],47:b,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,225]},{11:[1,226],109:[1,227]},e(h1,[2,143]),{11:[1,228],47:b,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,229],47:b,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{83:[1,230]},e(X,[2,124],{11:[1,231]}),e(X,[2,126],{11:[1,232]}),{83:[1,233]},e(ke,[2,199]),{83:[1,234],101:[1,235]},e(Ue,[2,68],{116:122,47:b,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),{32:[1,236],70:y,85:237,119:N,120:R,121:O},e(ye,[2,99]),e(ye,[2,101]),e(ye,[2,102]),e(ye,[2,168]),e(ye,[2,169]),e(ye,[2,170]),e(ye,[2,171]),{52:[1,238],70:y,85:237,119:N,120:R,121:O},{31:239,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{54:[1,240],70:y,85:237,119:N,120:R,121:O},{56:[1,241],70:y,85:237,119:N,120:R,121:O},{58:[1,242],70:y,85:237,119:N,120:R,121:O},{60:[1,243],70:y,85:237,119:N,120:R,121:O},{63:[1,244]},{67:[1,245],70:y,85:237,119:N,120:R,121:O},{69:[1,246],70:y,85:237,119:N,120:R,121:O},{31:247,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{32:[1,248],70:y,85:237,119:N,120:R,121:O},{70:y,72:[1,249],74:[1,250],85:237,119:N,120:R,121:O},{70:y,72:[1,252],74:[1,251],85:237,119:N,120:R,121:O},e(We,[2,58],{19:169,11:Me,43:ot}),e(We,[2,60],{47:d1}),e(it,[2,88]),e(it,[2,87]),{65:[1,253],70:y,85:237,119:N,120:R,121:O},e(it,[2,90]),e(ut,[2,93]),{80:[1,254],82:211,119:bt,122:kt},{31:255,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},e(at,o,{5:256}),{8:ce,9:de,10:he,12:pe,22:257,43:ot},e(U,[2,117]),e(I,[2,42]),e(I,[2,43]),{31:258,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},e(I,[2,46]),{8:ce,9:de,10:he,12:pe,22:259,43:ot},{46:260,47:b,48:45,50:46,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{11:Me,19:261},{11:Te,63:De,87:_e,95:262,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:273,107:[1,274],108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:275,107:[1,276],108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{108:[1,277]},{11:Te,63:De,87:_e,95:278,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{47:b,50:279,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(X,[2,131]),e(X,[2,133],{11:[1,283]}),e(X,[2,134]),e(oe,[2,69]),e(ye,[2,100]),e(oe,[2,70]),{54:[1,284],70:y,85:237,119:N,120:R,121:O},e(oe,[2,77]),e(oe,[2,72]),e(oe,[2,73]),e(oe,[2,74]),{112:[1,285]},e(oe,[2,76]),e(oe,[2,78]),{69:[1,286],70:y,85:237,119:N,120:R,121:O},e(oe,[2,80]),e(oe,[2,81]),e(oe,[2,83]),e(oe,[2,82]),e(oe,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(it,[2,91]),{32:[1,287],70:y,85:237,119:N,120:R,121:O},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,288],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(at,o,{5:289}),{32:[1,290],70:y,85:237,119:N,120:R,121:O},e(I,[2,47]),e(Ue,[2,66]),{46:291,47:b,48:45,50:46,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,136],{109:lt}),e(p1,[2,145],{111:293,11:Te,63:De,87:_e,108:ve,112:Fe,113:Ve,114:Ie,115:Le}),e(Ce,[2,147]),e(Ce,[2,149]),e(Ce,[2,150]),e(Ce,[2,151]),e(Ce,[2,152]),e(Ce,[2,153]),e(Ce,[2,154]),e(Ce,[2,155]),e(Ce,[2,156]),e(X,[2,137],{109:lt}),{11:[1,294]},e(X,[2,138],{109:lt}),{11:[1,295]},e(h1,[2,144]),e(X,[2,120],{109:lt}),e(X,[2,121],{116:122,47:b,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),e(X,[2,125]),e(X,[2,127],{11:[1,296]}),e(X,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:ce,9:de,10:he,12:pe,22:301,34:302,43:Ke},e(I,[2,40]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,303],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{8:ce,9:de,10:he,12:pe,22:304,34:305,43:Ke},e(Ue,[2,65]),{11:Te,63:De,87:_e,108:ve,110:306,111:264,112:Fe,113:Ve,114:Ie,115:Le},e(Ce,[2,148]),{15:He,47:Ye,63:qe,92:Xe,104:307,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st,123:97},{15:He,47:Ye,63:qe,92:Xe,104:308,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st,123:97},{101:[1,309]},e(X,[2,135]),e(oe,[2,71]),{31:310,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},e(oe,[2,79]),e(at,o,{5:311}),{8:ce,9:de,10:he,12:pe,22:312,43:ot},e(I,[2,41]),e(I,[2,44]),{8:ce,9:de,10:he,12:pe,22:313,43:ot},e(p1,[2,146],{111:293,11:Te,63:De,87:_e,108:ve,112:Fe,113:Ve,114:Ie,115:Le}),e(X,[2,141],{123:181,11:[1,314],15:He,47:Ye,63:qe,92:Xe,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st}),e(X,[2,142],{123:181,11:[1,315],15:He,47:Ye,63:qe,92:Xe,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st}),e(X,[2,129]),{32:[1,316],70:y,85:237,119:N,120:R,121:O},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,317],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(at,o,{5:318}),e(I,[2,45]),{11:Te,63:De,87:_e,95:319,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:320,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},e(oe,[2,75]),e(I,[2,38]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,321],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(X,[2,139],{109:lt}),e(X,[2,140],{109:lt}),e(I,[2,39])],defaultActions:{},parseError:t(function(S,x){if(x.recoverable)this.trace(S);else{var T=Error(S);throw T.hash=x,T}},"parseError"),parse:t(function(S){var x=this,T=[0],u=[],W=[null],s=[],L=this.table,i="",K=0,f1=0,g1=0,I1=2,b1=1,L1=s.slice.call(arguments,1),ae=Object.create(this.lexer),je={yy:{}};for(var Zt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Zt))je.yy[Zt]=this.yy[Zt];if(ae.setInput(S,je.yy),je.yy.lexer=ae,je.yy.parser=this,typeof ae.yylloc>"u")ae.yylloc={};var $t=ae.yylloc;s.push($t);var B1=ae.options&&ae.options.ranges;if(typeof je.yy.parseError==="function")this.parseError=je.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function M1(Ae){T.length=T.length-2*Ae,W.length=W.length-Ae,s.length=s.length-Ae}t(M1,"popStack");function k1(){var Ae=u.pop()||ae.lex()||b1;if(typeof Ae!=="number"){if(Ae instanceof Array)u=Ae,Ae=u.pop();Ae=x.symbols_[Ae]||Ae}return Ae}t(k1,"lex");var ge,e1,ze,me,Q1,t1,ct={},Yt,Be,m1,qt;while(!0){if(ze=T[T.length-1],this.defaultActions[ze])me=this.defaultActions[ze];else{if(ge===null||typeof ge>"u")ge=k1();me=L[ze]&&L[ze][ge]}if(typeof me>"u"||!me.length||!me[0]){var s1="";qt=[];for(Yt in L[ze])if(this.terminals_[Yt]&&Yt>I1)qt.push("'"+this.terminals_[Yt]+"'");if(ae.showPosition)s1="Parse error on line "+(K+1)+`:
22
+ You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e==="object"&&"id"in e&&typeof e.id==="string"}addLink(e,r,n){let a=this.isLinkData(n)?n.id.replace("@",""):void 0;l.info("addLink",e,r,a);for(let c of e)for(let d of r){let o=c===e[e.length-1],f=d===r[0];if(o&&f)this.addSingleLink(c,d,n,a);else this.addSingleLink(c,d,n,void 0)}}updateLinkInterpolate(e,r){e.forEach((n)=>{if(n==="default"){this.edges.defaultInterpolate=r;return}if(typeof n==="number"&&n>=this.edges.length)throw Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[n].interpolate=r})}updateLink(e,r){e.forEach((n)=>{if(typeof n==="number"&&n>=this.edges.length)throw Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(n==="default")this.edges.defaultStyle=r;else if(this.edges[n].style=r,(this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some((a)=>a?.startsWith("fill")))this.edges[n]?.style?.push("fill:none")})}addClass(e,r){let n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach((a)=>{let c=this.classes.get(a);if(c===void 0)c={id:a,styles:[],textStyles:[]},this.classes.set(a,c);if(n!==void 0&&n!==null)n.forEach((d)=>{if(/color/.exec(d)){let o=d.replace("fill","bgFill");c.textStyles.push(o)}c.styles.push(d)})})}setDirection(e){if(this.direction=e.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(e,r){for(let n of e.split(",")){let a=this.vertices.get(n);if(a)a.classes.push(r);let c=this.edges.find((o)=>o.id===n);if(c)c.classes.push(r);let d=this.subGraphLookup.get(n);if(d)d.classes.push(r)}}setTooltip(e,r){if(r===void 0)return;r=this.sanitizeText(r);for(let n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}setClickFun(e,r,n){if(p().securityLevel!=="loose")return;if(r===void 0)return;let a=[];if(typeof n==="string"){a=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let d=0;d<a.length;d++){let o=a[d].trim();if(o.startsWith('"')&&o.endsWith('"'))o=o.substr(1,o.length-2);a[d]=o}}if(a.length===0)a.push(e);let c=this.vertices.get(e);if(c)c.haveCallback=!0,this.funs.push(()=>{let d=this.lookUpDomId(e),o=document.querySelector(`[id="${d}"]`);if(o!==null)o.addEventListener("click",()=>{V.runFunc(r,...a)},!1)})}setLink(e,r,n){e.split(",").forEach((a)=>{let c=this.vertices.get(a);if(c!==void 0)c.link=V.formatUrl(r,this.config),c.linkTarget=n}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach((a)=>{this.setClickFun(a,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach((r)=>{r(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return P1.has(e.type)}getTools(){let e=[];for(let r of this.vertices.values())if(this.isToolDefinition(r))e.push(r);return e}getClasses(){return this.classes}setupToolTips(e){let r=Oa();h(e).select("svg").selectAll("g.node").on("mouseover",(c)=>{let d=h(c.currentTarget),o=d.attr("title");if(o===null)return;let f=c.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(d.attr("title")).style("left",window.scrollX+f.left+(f.right-f.left)/2+"px").style("top",window.scrollY+f.bottom+"px"),r.html(zt.sanitize(o)),d.classed("hover",!0)}).on("mouseout",(c)=>{r.transition().duration(500).style("opacity",0),h(c.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=p(),this.diagramId="",this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,F()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n,a){let c=e?.text?.trim(),d=n?.text;if(e===n&&n?.text&&/\s/.exec(n.text))c=void 0;let f=t((D)=>{let P={boolean:{},number:{},string:{}},v=[],E;return{nodeList:D.filter(function(b){let _=typeof b;if(b.stmt&&b.stmt==="dir")return E=b.value,!1;if(b.trim()==="")return!1;if(_ in P)return P[_].hasOwnProperty(b)?!1:P[_][b]=!0;else return v.includes(b)?!1:v.push(b)}),dir:E}},"uniq")(r.flat()),{nodeList:m,dir:k}=f,A=p().flowchart??{};if(k=k??(A.inheritDir?this.getDirection()??p().direction??void 0:void 0),this.version==="gen-1")for(let D=0;D<m.length;D++)m[D]=this.lookUpDomId(m[D]);c=c??"subGraph"+this.subCount,d=d||"",d=this.sanitizeText(d),this.subCount=this.subCount+1;let C={id:c,nodes:m.filter((D)=>D!==c&&!this.globalNodes.has(D)),title:d.trim(),classes:[],dir:k,labelType:this.sanitizeNodeLabelType(n?.type),type:a??"flow"};l.info("Adding",C.id,C.nodes,C.dir),C.nodes=this.makeUniq(C,this.subGraphs).nodes;let B=this.getPosForId(c);if(B!==-1){let D=this.subGraphs[B];for(let P of C.nodes)if(!D.nodes.includes(P))D.nodes.push(P);if(C.title)D.title=C.title;if(C.dir)D.dir=C.dir;if(C.type)D.type=C.type;this.subGraphLookup.set(c,D)}else this.subGraphs.push(C),this.subGraphLookup.set(c,C);return c}addGlobal(e){for(let r of e.flat()){if(typeof r!=="string")continue;let n=r.trim();if(n!=="")this.globalNodes.add(n)}for(let r of this.subGraphs)r.nodes=r.nodes.filter((n)=>!this.globalNodes.has(n))}getPosForId(e){for(let[r,n]of this.subGraphs.entries())if(n.id===e)return r;return-1}indexNodes2(e,r){let n=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let a=0,c=1;while(a<n.length){let d=this.getPosForId(n[a]);if(d>=0){let o=this.indexNodes2(e,d);if(o.result)return{result:!0,count:c+o.count};else c=c+o.count}a=a+1}return{result:!1,count:c}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}addConnector(e,r){let n=e?.text?.trim();if(!n)return"";let a=r?.text?.trim()??"",c=a.length>0?this.sanitizeText(a):n,d=this.connectors.get(n);if(!d)d={id:n,labelType:"text",domId:A1+n+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:c},this.connectors.set(n,d),this.vertices.set(n,d),this.vertexCounter++;else if(a.length>0)d.text=c;return n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}computeEdgeSemantic(e,r){if(e==="arrow_point"&&r==="normal")return"sequence";if(e==="arrow_cross"&&r==="normal")return"failure";if(e==="arrow_open"&&r==="dotted")return"reference";return}destructStartLink(e){let r=e.trim(),n="arrow_open",a="normal";if(r.includes("."))a="dotted";return{type:"arrow_open",stroke:a}}countChar(e,r){let n=r.length,a=0;for(let c=0;c<n;++c)if(r[c]===e)++a;return a}destructEndLink(e){let r=e.trim(),n=r.slice(0,-1),a="arrow_open";switch(r.slice(-1)){case"x":a="arrow_cross";break;case">":a="arrow_point";break;case"-":case".":a="arrow_open",n=r;break}let c="normal",d=n.length-1,o=this.countChar(".",n);if(o>0)c="dotted",d=o;return{type:a,stroke:c,length:d}}destructLink(e,r){let n=this.destructEndLink(e),a;if(r){if(a=this.destructStartLink(r),a.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};return a.type=n.type,a.length=n.length,{...a,edgeSemantic:this.computeEdgeSemantic(a.type,a.stroke)}}return{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,r){for(let n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){let n=[];return e.nodes.forEach((a,c)=>{if(!this.exists(r,a))n.push(e.nodes[c])}),{nodes:n}}getTypeFromVertex(e){let r=typeof e.type==="string"?ht(e.type):e.type;switch(r){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return r}}findNode(e,r){return e.find((n)=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,a,c,d){let o=n.get(e.id),f=a.get(e.id)??!1,m=this.findNode(r,e.id);if(m)m.cssStyles=e.styles,m.cssCompiledStyles=this.getCompiledStyles(e.classes),m.cssClasses=e.classes.join(" ");else{let k={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:o,padding:c.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:d,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};if(f)r.push({...k,isGroup:!0,shape:"rect"});else r.push({...k,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:c.agentflow?.wrappingWidth,minWidth:c.agentflow?.minNodeWidth})}}getCompiledStyles(e){let r=[];for(let n of e){let a=this.classes.get(n);if(a?.styles)r=[...r,...a.styles??[]].map((c)=>c.trim());if(a?.textStyles)r=[...r,...a.textStyles??[]].map((c)=>c.trim())}return r}runPostParseValidators(){if(this.postParseValidationRun)return;this.postParseValidationRun=!0}getData(){this.runPostParseValidators();let e=p(),r=[],n=[],a=this.getSubGraphs(),c=new Map,d=new Map,o=new Set,f=new Map,m=t((g,b,_=new Set)=>{if(_.has(g))return;_.add(g);let Y=this.subGraphLookup.get(g);if(!Y)return;for(let fe of Y.nodes){if(fe===b||_.has(fe))continue;o.add(fe),f.set(fe,b),m(fe,b,_)}},"collectDescendants");for(let g of a)if(g.metadata?.view==="collapsed"&&!o.has(g.id))m(g.id,g.id);let k=t((g,b)=>{let _=new Set,Y=b;while(Y!==void 0&&!_.has(Y)){if(Y===g)return!0;_.add(Y),Y=c.get(Y)}return!1},"wouldCloseContainmentCycle");for(let g=a.length-1;g>=0;g--){let b=a[g];if(o.has(b.id))continue;if(b.nodes.length>0)d.set(b.id,!0);for(let _ of b.nodes){if(k(_,b.id)){this.emitWarning(pt.CONTAINMENT_VIOLATION,`Container "${b.id}" cannot contain "${_}" because "${_}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:_});continue}c.set(_,b.id)}}for(let g=a.length-1;g>=0;g--){let b=a[g];if(o.has(b.id))continue;if(b.metadata?.view==="collapsed"){let Y={...b.metadata,containerType:b.type};r.push({id:b.id,label:b.title,labelStyle:"",labelType:b.labelType,parentId:c.get(b.id),padding:8,cssCompiledStyles:this.getCompiledStyles(b.classes),cssClasses:b.classes.join(" "),shape:"collapsedGroup",dir:b.dir,isGroup:!1,look:e.look,metadata:Y})}else r.push({id:b.id,label:b.title,labelStyle:"",labelType:b.labelType,parentId:c.get(b.id),padding:8,cssCompiledStyles:this.getCompiledStyles(b.classes),cssClasses:b.classes.join(" "),shape:G1[b.type??"flow"],dir:b.dir,isGroup:!0,look:e.look,metadata:b.metadata})}this.getVertices().forEach((g)=>{if(o.has(g.id))return;this.addNodeFromVertex(g,r,c,d,e,e.look||"classic")});let C=this.getEdges();C.forEach((g,b)=>{let _=f.get(g.start)??g.start,Y=f.get(g.end)??g.end;if(_===Y&&g.start!==g.end)return;let{arrowTypeStart:fe,arrowTypeEnd:Se}=this.destructEdgeType(g.type),Ee=[...C.defaultStyle??[]];if(g.style)Ee.push(...g.style);let xe={id:Sn(_,Y,{counter:b,prefix:"L"},g.id),isUserDefinedId:g.isUserDefinedId,start:_,end:Y,type:g.type??"normal",label:g.text,labelType:g.labelType,labelpos:"c",thickness:g.stroke,minlen:g.length,classes:g?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:g?.stroke==="invisible"||g?.type==="arrow_open"?"none":fe,arrowTypeEnd:g?.stroke==="invisible"||g?.type==="arrow_open"?"none":Se,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(g.classes),labelStyle:Ee,style:Ee,pattern:g.stroke,look:e.look,animate:g.animate,animation:g.animation,curve:g.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:g.metadata};n.push(xe)}),E1(r,this);let B=new Map,D=new Map;for(let g of a){let b=c.get(g.id);if(b!==void 0)D.set(b,[...D.get(b)??[],g.id])}let P=0,v=t((g)=>{if(B.has(g))return;B.set(g,P++);for(let b of D.get(g)??[])v(b)},"walkContainers");for(let g of a)if(c.get(g.id)===void 0)v(g.id);let E=new Set(this.getConnectors().map((g)=>g.id));return D1(r,(g)=>{if(E.has(g))return"connector";let b=this.vertices.get(g);return b?this.deriveVertexKind(b,ht(b.type)):void 0},B),{nodes:r,edges:n,other:{},config:e,connectors:this.getConnectors()}}defaultConfig(){return Oi.flowchart}deriveVertexKind(e,r){if(this.isToolDefinition(e))return"tool";if(r==="hexagon"||r==="hex")return"action";if(r==="lean-right"||r==="lean_right")return"input";if(r==="lin-doc"||r==="lined-document")return"refdoc";if(r==="diamond")return"decision";return"task"}getSemanticModel(){this.runPostParseValidators();let e=new Set(this.subGraphs.map((o)=>o.id)),r=[],n=[];for(let[o,f]of this.vertices){if(e.has(o))continue;if(f.isConnector){let A={id:o};if(f.text!==void 0&&f.text!==o)A.title=f.text;if(f.metadata&&Object.keys(f.metadata).length>0){let C={};for(let[B,D]of Object.entries(f.metadata)){if(i1.has(B))continue;C[B]=D}if(Object.keys(C).length>0)A.metadata=C}n.push(A);continue}let m={id:o};if(f.text!==void 0)m.label=f.text;let k=typeof f.type==="string"?ht(f.type):f.type;if(k!==void 0)m.shape=k;if(m.vertexKind=this.deriveVertexKind(f,k),f.metadata&&Object.keys(f.metadata).length>0){let A={};for(let[C,B]of Object.entries(f.metadata)){if(i1.has(C))continue;A[C]=B}if(Object.keys(A).length>0)m.metadata=A}r.push(m)}let a=this.edges.map((o)=>{let f={start:o.start,end:o.end};if(o.id!==void 0)f.id=o.id;if(typeof o.text==="string"&&o.text.length>0)f.label=o.text;if(o.type!==void 0)f.type=o.type;if(o.stroke!==void 0)f.stroke=o.stroke;if(o.edgeSemantic!==void 0)f.edgeSemantic=o.edgeSemantic;if(o.length!==void 0)f.length=o.length;if(o.metadata&&Object.keys(o.metadata).length>0)f.metadata={...o.metadata};return f}),c=this.subGraphs.map((o)=>{let f={id:o.id,nodes:[...o.nodes]};if(o.type!==void 0)f.type=o.type;if(o.title!==void 0)f.title=o.title;if(o.dir!==void 0)f.direction=o.dir;if(o.metadata&&Object.keys(o.metadata).length>0){let m={};for(let[k,A]of Object.entries(o.metadata)){if(i1.has(k))continue;m[k]=A}if(Object.keys(m).length>0)f.metadata=m}return f}),d={vertices:r,edges:a,subGraphs:c,connectors:n,diagnostics:this.diagnostics};if(this.direction!==void 0)d.direction=this.direction;return d}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let r=e?.first_line??0,n=e?.first_column??0,a=e?.last_line??r,c=e?.last_column??n,[d,o]=e?.range??[0,0];return{startLine:r+this.frontmatterLineOffset,startColumn:n,endLine:a+this.frontmatterLineOffset,endColumn:c,startIndex:d,endIndex:o}}pushMapping(e,r,n){if(!e)return;let a={id:e,type:r,position:this.toElementPosition(n)};return this.elementMappings.push(a),a}addVertexMapping(e,r,n,a){let c=this.pushMapping(e,"vertex",a);if(c&&n==null)this.bareVertexMappings.add(c)}extendVertexMapping(e,r){if(!e||!r)return;let n=this.toElementPosition(r);for(let a=this.elementMappings.length-1;a>=0;a--){let c=this.elementMappings[a];if(c.type==="vertex"&&c.id===e){if(this.bareVertexMappings.has(c))c.type="attachment",this.bareVertexMappings.delete(c);if(n.endLine>c.position.endLine||n.endLine===c.position.endLine&&n.endColumn>c.position.endColumn)c.position.endLine=n.endLine,c.position.endColumn=n.endColumn,c.position.endIndex=n.endIndex;return}}this.pushMapping(e,"attachment",r)}addEdgeMapping(e,r,n,a){let c=Array.isArray(r)?r.map((o)=>typeof o==="string"?o:o?.id??"").filter(Boolean):[],d=c.length>0?c.join(">"):"edge";this.pushMapping(d,"edge",a)}addSubgraphMapping(e,r,n,a){let c=(typeof e==="string"?e:e?.text)??"",d=this.toElementPosition(n),o=a?this.toElementPosition(a):d;if(!c)return;this.elementMappings.push({id:c,type:"subgraph",position:{startLine:d.startLine,startColumn:d.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:d.startIndex,endIndex:o.endIndex}})}addConnectorMapping(e,r,n,a){let c=e?.text?.trim()??"";if(!c)return;let d=this.toElementPosition(n),o=a?this.toElementPosition(a):d;this.elementMappings.push({id:c,type:"connector",position:{startLine:d.startLine,startColumn:d.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:d.startIndex,endIndex:o.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find((r)=>r.id===e)}getElementsOnLine(e){return this.elementMappings.filter((r)=>e>=r.position.startLine&&e<=r.position.endLine)}getElementAtPosition(e,r){let n=this.elementMappings.filter((c)=>{let{startLine:d,startColumn:o,endLine:f,endColumn:m}=c.position;if(e<d||e>f)return!1;if(e===d&&r<o)return!1;if(e===f&&r>m)return!1;return!0});if(n.length===0)return;let a=t(({position:c})=>[c.endLine-c.startLine,c.endColumn-c.startColumn],"span");return n.reduce((c,d)=>{let[o,f]=a(c),[m,k]=a(d);if(m!==o)return m<o?d:c;return k<f?d:c})}getMappingStats(){let e=0,r=0,n=0,a=0,c=0;for(let d of this.elementMappings)if(d.type==="vertex")e++;else if(d.type==="edge")r++;else if(d.type==="subgraph")n++;else if(d.type==="connector")a++;else if(d.type==="attachment")c++;return{vertices:e,edges:r,subgraphs:n,connectors:a,attachments:c,totalElements:this.elementMappings.length}}emitDiagnostic(e,r,n,a){let c=a?.nodeId??a?.edgeId,d=c?this.getElementById(c):void 0,o={id:e,severity:r,message:n,...a?.nodeId?{nodeId:a.nodeId}:{},...a?.edgeId&&!a?.nodeId?{edgeId:a.edgeId}:{},...d?{position:d.position}:{}};if(this.diagnostics.some((k)=>k.id===o.id&&k.severity===o.severity&&k.message===o.message&&k.nodeId===o.nodeId&&k.edgeId===o.edgeId))return;this.diagnostics.push(o);let m=`agentflow[${e}]: ${n}`;if(r==="error")l.error(m);else l.warn(m)}emitWarning(e,r,n){this.emitDiagnostic(e,"warning",r,n)}emitError(e,r,n){this.emitDiagnostic(e,"error",r,n)}getDiagnostics(){return[...this.diagnostics]}},j1=t(function(e,r){return r.db.getClasses()},"getClasses"),z1=t(async function(e,r,n,a){l.debug("Drawing agentflow diagram",r);let{securityLevel:c,agentflow:d,layout:o}=p();a.db.setDiagramId(r),l.debug("Before getData: ");let f=a.db.getData();l.debug("Data: ",f);let m=Pt(r,c),k=a.db.getDirection();if(f.type=a.type,f.layoutAlgorithm=Mt(o),f.layoutAlgorithm==="dagre"&&o==="elk")l.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.");f.direction=k,f.nodeSpacing=d?.nodeSpacing||50,f.rankSpacing=d?.rankSpacing||50,f.markers=["point","circle","cross","hierarchy"],f.diagramId=r,l.debug("REF1:",f),await Lt(f,m);let A=d?.diagramPadding??8;V.insertTitle(m,"agentflowTitleText",d?.titleTopMargin??0,a.db.getDiagramTitle()),At(m,A,"agentflow",d?.useMaxWidth??!0)},"draw"),W1={getClasses:j1,draw:z1},r1=function(){var e=t(function(we,S,x,T){for(x=x||{},T=we.length;T--;x[we[T]]=S);return x},"o"),r=[1,5],n=[1,4],a=[1,3],c=[1,6],d=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],o=[2,2],f=[1,15],m=[1,16],k=[1,17],A=[1,18],C=[1,19],B=[1,26],D=[1,27],P=[1,28],v=[1,30],E=[1,31],g=[1,32],b=[1,55],_=[1,54],Y=[1,34],fe=[1,35],Se=[1,36],Ee=[1,37],xe=[1,38],Q=[1,50],J=[1,52],Z=[1,48],ee=[1,53],te=[1,49],se=[1,56],ie=[1,51],re=[1,57],ne=[1,58],Ne=[1,39],Re=[1,40],Oe=[1,41],Pe=[1,42],Ge=[1,43],Me=[1,64],I=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],ce=[1,70],de=[1,68],he=[1,67],pe=[1,69],We=[8,9,10,12,78,80,81],Ke=[1,88],He=[1,101],Ye=[1,106],qe=[1,105],Xe=[1,102],Qe=[1,98],Je=[1,104],Ze=[1,100],$e=[1,107],et=[1,103],tt=[1,108],st=[1,99],Ue=[8,9,10,11,12,43,78,80,81],oe=[8,9,10,11,12,43,49,78,80,81],be=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],n1=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],it=[47,63,92,105,108,109,112,114,117,118,119],a1=[1,131],o1=[1,132],bt=[1,134],kt=[1,133],u1=[47,63,65,77,92,105,108,109,112,114,117,118,119],mt=[1,143],Et=[1,157],Ct=[1,158],St=[1,159],xt=[1,162],Tt=[1,161],Dt=[1,160],_t=[1,145],vt=[1,147],Ft=[1,151],l1=[1,139],c1=[1,140],Vt=[1,152],It=[1,153],Bt=[1,154],yt=[1,155],wt=[1,156],Nt=[1,163],Rt=[1,164],Ot=[1,141],Gt=[1,142],Ut=[1,149],jt=[1,144],Wt=[1,148],Kt=[1,146],at=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],d1=[1,168],ot=[1,170],X=[8,9,10,12],ke=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],y=[1,190],ue=[1,186],le=[1,187],N=[1,191],R=[1,188],O=[1,189],ut=[80,119,122],U=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],h1=[11,109],ye=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],Te=[1,269],De=[1,267],_e=[1,271],ve=[1,265],Fe=[1,266],Ve=[1,268],Ie=[1,270],Le=[1,272],lt=[1,292],p1=[8,9,10,12,109],Ce=[8,9,10,11,12,63,87,108,109,112,113,114,115],Jt={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:"error",8:"COMMENT",9:"SEMI",10:"NEWLINE",11:"SPACE",12:"EOF",13:"GRAPH",14:"NODIR",15:"DIR",28:"flow",30:"SQS",32:"SQE",33:"end",35:"global",36:"connector",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"SHAPE_DATA",47:"AMP",49:"STYLE_SEPARATOR",51:"DOUBLECIRCLESTART",52:"DOUBLECIRCLEEND",53:"PS",54:"PE",55:"(-",56:"-)",57:"STADIUMSTART",58:"STADIUMEND",59:"SUBROUTINESTART",60:"SUBROUTINEEND",61:"VERTEX_WITH_PROPS_START",62:"NODE_STRING[field]",63:"COLON",64:"NODE_STRING[value]",65:"PIPE",66:"CYLINDERSTART",67:"CYLINDEREND",68:"DIAMOND_START",69:"DIAMOND_STOP",70:"TAGEND",71:"TRAPSTART",72:"TRAPEND",73:"INVTRAPSTART",74:"INVTRAPEND",77:"TESTSTR",78:"START_LINK",80:"LINK",81:"LINK_ID",83:"STR",84:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"idString[vertex]",97:"idString[class]",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"STR[link]",103:"STR[tooltip]",105:"DEFAULT",107:"INTERPOLATE",108:"NUM",109:"COMMA",112:"NODE_STRING",113:"UNIT",114:"BRKT",115:"PCT",117:"MINUS",118:"MULT",119:"UNICODE_TEXT",120:"TEXT",121:"TAGSTART",122:"EDGE_TEXT",124:"direction_tb",125:"direction_bt",126:"direction_rl",127:"direction_lr",128:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:t(function(S,x,T,u,W,s,L){var i=s.length-1;switch(W){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 198:this.$=s[i];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:u.setDirection("TB"),this.$="TB";break;case 14:u.setDirection(s[i-1]),this.$=s[i-1];break;case 32:this.$=s[i-1].nodes;break;case 38:if(this.$=u.addSubGraph(s[i-6],s[i-1],s[i-4],"flow"),u.addSubgraphMapping)u.addSubgraphMapping(s[i-6],s[i-4],L[i-8],L[i]);break;case 39:if(this.$=u.addSubGraph(s[i-7],s[i-1],s[i-5],"flow"),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],L[i-3]),u.addSubgraphMapping)u.addSubgraphMapping(s[i-7],s[i-5],L[i-9],L[i]);break;case 40:if(this.$=u.addSubGraph(s[i-3],s[i-1],{text:"",type:"text"},"flow"),u.addSubgraphMapping)u.addSubgraphMapping(s[i-3],{text:"",type:"text"},L[i-5],L[i]);break;case 41:if(this.$=u.addSubGraph(s[i-4],s[i-1],{text:"",type:"text"},"flow"),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-3],L[i-3]),u.addSubgraphMapping)u.addSubgraphMapping(s[i-4],{text:"",type:"text"},L[i-6],L[i]);break;case 42:if(this.$=u.addSubGraph(void 0,s[i-1],void 0,"flow"),u.addSubgraphMapping)u.addSubgraphMapping(void 0,void 0,L[i-3],L[i]);break;case 43:u.addGlobal(s[i-1]),this.$=[];break;case 44:if(this.$=u.addConnector(s[i-4],s[i-2]),u.addConnectorMapping)u.addConnectorMapping(s[i-4],s[i-2],L[i-6],L[i]);break;case 45:if(this.$=u.addConnector(s[i-5],s[i-3]),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],L[i-1]),u.addConnectorMapping)u.addConnectorMapping(s[i-5],s[i-3],L[i-7],L[i]);break;case 46:if(this.$=u.addConnector(s[i-1],{text:"",type:"text"}),u.addConnectorMapping)u.addConnectorMapping(s[i-1],{text:"",type:"text"},L[i-3],L[i]);break;case 47:if(this.$=u.addConnector(s[i-2],{text:"",type:"text"}),u.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,s[i-1],L[i-1]),u.addConnectorMapping)u.addConnectorMapping(s[i-2],{text:"",type:"text"},L[i-4],L[i]);break;case 49:this.$=s[i].trim(),u.setAccTitle(this.$);break;case 50:case 51:this.$=s[i].trim(),u.setAccDescription(this.$);break;case 56:this.$=s[i-1]+s[i];break;case 57:this.$=s[i];break;case 58:if(u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],L[i]),u.extendVertexMapping)u.extendVertexMapping(s[i-1][s[i-1].length-1],L[i]);if(u.addLink(s[i-3].stmt,s[i-1],s[i-2]),u.addEdgeMapping)u.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 59:if(u.addLink(s[i-2].stmt,s[i],s[i-1]),u.addEdgeMapping)u.addEdgeMapping(s[i-2].stmt,s[i],s[i-1],this._$);this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 60:if(u.addLink(s[i-3].stmt,s[i-1],s[i-2]),u.addEdgeMapping)u.addEdgeMapping(s[i-3].stmt,s[i-1],s[i-2],this._$);this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 61:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 62:if(u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i],L[i]),u.extendVertexMapping)u.extendVertexMapping(s[i-1][s[i-1].length-1],L[i]);this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 63:this.$={stmt:s[i],nodes:s[i]};break;case 64:this.$=[s[i]];break;case 65:if(u.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4],L[i-4]),u.extendVertexMapping)u.extendVertexMapping(s[i-5][s[i-5].length-1],L[i-4]);this.$=s[i-5].concat(s[i]);break;case 66:this.$=s[i-4].concat(s[i]);break;case 67:this.$=s[i];break;case 68:this.$=s[i-2],u.setClass(s[i-2],s[i]);break;case 69:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"square"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"square",this._$);break;case 70:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"doublecircle"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"doublecircle",this._$);break;case 71:if(this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"circle"),u.addVertexMapping)u.addVertexMapping(s[i-5],s[i-2],"circle",this._$);break;case 72:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"ellipse"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"ellipse",this._$);break;case 73:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"stadium"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"stadium",this._$);break;case 74:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"subroutine"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"subroutine",this._$);break;case 75:if(this.$=s[i-7],u.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]])),u.addVertexMapping)u.addVertexMapping(s[i-7],s[i-1],"rect",this._$);break;case 76:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"cylinder"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"cylinder",this._$);break;case 77:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"round"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"round",this._$);break;case 78:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"diamond"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"diamond",this._$);break;case 79:if(this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"hexagon"),u.addVertexMapping)u.addVertexMapping(s[i-5],s[i-2],"hexagon",this._$);break;case 80:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"odd"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"odd",this._$);break;case 81:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"trapezoid"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"trapezoid",this._$);break;case 82:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"inv_trapezoid"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"inv_trapezoid",this._$);break;case 83:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_right"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"lean_right",this._$);break;case 84:if(this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_left"),u.addVertexMapping)u.addVertexMapping(s[i-3],s[i-1],"lean_left",this._$);break;case 85:if(this.$=s[i],u.addVertex(s[i]),u.addVertexMapping)u.addVertexMapping(s[i],void 0,void 0,this._$);break;case 86:s[i-1].text=s[i],this.$=s[i-1];break;case 87:case 88:s[i-2].text=s[i-1],this.$=s[i-2];break;case 89:this.$=s[i];break;case 90:var K=u.destructLink(s[i],s[i-2]);this.$={type:K.type,stroke:K.stroke,length:K.length,edgeSemantic:K.edgeSemantic,text:s[i-1]};break;case 91:var K=u.destructLink(s[i],s[i-2]);this.$={type:K.type,stroke:K.stroke,length:K.length,edgeSemantic:K.edgeSemantic,text:s[i-1],id:s[i-3]};break;case 92:this.$={text:s[i],type:"text"};break;case 93:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 94:this.$={text:s[i],type:"string"};break;case 95:this.$={text:s[i],type:"markdown"};break;case 96:var K=u.destructLink(s[i]);this.$={type:K.type,stroke:K.stroke,length:K.length,edgeSemantic:K.edgeSemantic};break;case 97:var K=u.destructLink(s[i]);this.$={type:K.type,stroke:K.stroke,length:K.length,edgeSemantic:K.edgeSemantic,id:s[i-1]};break;case 98:this.$=s[i-1];break;case 99:this.$={text:s[i],type:"text"};break;case 100:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 101:this.$={text:s[i],type:"string"};break;case 102:case 119:this.$={text:s[i],type:"markdown"};break;case 116:this.$={text:s[i],type:"text"};break;case 117:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 118:this.$={text:s[i],type:"text"};break;case 120:this.$=s[i-4],u.addClass(s[i-2],s[i]);break;case 121:this.$=s[i-4],u.setClass(s[i-2],s[i]);break;case 122:case 130:this.$=s[i-1],u.setClickEvent(s[i-1],s[i]);break;case 123:case 131:this.$=s[i-3],u.setClickEvent(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 124:this.$=s[i-2],u.setClickEvent(s[i-2],s[i-1],s[i]);break;case 125:this.$=s[i-4],u.setClickEvent(s[i-4],s[i-3],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 126:this.$=s[i-2],u.setLink(s[i-2],s[i]);break;case 127:this.$=s[i-4],u.setLink(s[i-4],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 128:this.$=s[i-4],u.setLink(s[i-4],s[i-2],s[i]);break;case 129:this.$=s[i-6],u.setLink(s[i-6],s[i-4],s[i]),u.setTooltip(s[i-6],s[i-2]);break;case 132:this.$=s[i-1],u.setLink(s[i-1],s[i]);break;case 133:this.$=s[i-3],u.setLink(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 134:this.$=s[i-3],u.setLink(s[i-3],s[i-2],s[i]);break;case 135:this.$=s[i-5],u.setLink(s[i-5],s[i-4],s[i]),u.setTooltip(s[i-5],s[i-2]);break;case 136:this.$=s[i-4],u.addVertex(s[i-2],void 0,void 0,s[i]);break;case 137:this.$=s[i-4],u.updateLink([s[i-2]],s[i]);break;case 138:this.$=s[i-4],u.updateLink(s[i-2],s[i]);break;case 139:this.$=s[i-8],u.updateLinkInterpolate([s[i-6]],s[i-2]),u.updateLink([s[i-6]],s[i]);break;case 140:this.$=s[i-8],u.updateLinkInterpolate(s[i-6],s[i-2]),u.updateLink(s[i-6],s[i]);break;case 141:this.$=s[i-6],u.updateLinkInterpolate([s[i-4]],s[i]);break;case 142:this.$=s[i-6],u.updateLinkInterpolate(s[i-4],s[i]);break;case 143:case 145:this.$=[s[i]];break;case 144:case 146:s[i-2].push(s[i]),this.$=s[i-2];break;case 148:this.$=s[i-1]+s[i];break;case 196:this.$=s[i];break;case 197:this.$=s[i-1]+""+s[i];break;case 199:this.$=s[i-1]+""+s[i];break;case 200:this.$={stmt:"dir",value:"TB"};break;case 201:this.$={stmt:"dir",value:"BT"};break;case 202:this.$={stmt:"dir",value:"RL"};break;case 203:this.$={stmt:"dir",value:"LR"};break;case 204:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,8:r,10:n,11:a,13:c},{1:[3]},e(d,o,{5:7}),{4:8,8:r,10:n,11:a,13:c},{4:9,8:r,10:n,11:a,13:c},{4:10,8:r,10:n,11:a,13:c},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(d,[2,10]),e(d,[2,11]),e(d,[2,12]),e(d,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:Me,16:59,19:62},e(I,[2,3]),e(I,[2,4]),e(I,[2,5]),e(I,[2,6]),e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),{8:ce,9:de,10:he,12:pe,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:ce,9:de,10:he,12:pe,22:75},{8:ce,9:de,10:he,12:pe,22:76},{8:ce,9:de,10:he,12:pe,22:77},{8:ce,9:de,10:he,12:pe,22:78},{8:ce,9:de,10:he,12:pe,22:79},{8:ce,9:de,10:he,11:[1,80],12:pe,22:81},{8:ce,9:de,10:he,12:pe,22:82},{11:[1,83]},e(I,[2,48]),{39:[1,84]},{41:[1,85]},e(I,[2,51]),e(We,[2,63],{19:86,34:87,11:Me,43:Ke}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:He,47:Ye,63:qe,83:[1,96],92:Xe,98:[1,93],100:[1,94],104:95,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st,123:97},e(I,[2,200]),e(I,[2,201]),e(I,[2,202]),e(I,[2,203]),e(I,[2,204]),e(Ue,[2,64]),e(Ue,[2,67],{49:[1,109]}),e(oe,[2,85],{116:122,30:[1,110],47:b,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:_,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),e(be,[2,196]),e(be,[2,157]),e(be,[2,158]),e(be,[2,159]),e(be,[2,160]),e(be,[2,161]),e(be,[2,162]),e(be,[2,163]),e(be,[2,164]),e(be,[2,165]),e(be,[2,166]),e(be,[2,167]),e(d,[2,14]),e(d,[2,20]),e(d,[2,21]),{10:[1,123]},e(d,[2,23]),e(n1,[2,31],{19:124,11:Me}),e(I,[2,32]),{45:125,46:44,47:b,48:45,50:46,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(I,[2,52]),e(I,[2,53]),e(I,[2,54]),e(I,[2,55]),e(it,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:a1,84:o1,119:bt,122:kt},{78:[1,135],80:[1,136]},e(u1,[2,96]),e(I,[2,33]),e(I,[2,34]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),{11:mt,13:Et,15:Ct,28:St,29:137,33:xt,35:Tt,36:Dt,47:_t,63:vt,78:Ft,83:l1,84:c1,86:150,87:Vt,88:It,89:Bt,90:yt,91:wt,92:Nt,93:Rt,94:138,108:Ot,112:Gt,114:Ut,117:jt,118:Wt,119:Kt},e(at,o,{5:165}),e(at,o,{5:166}),{11:mt,13:Et,15:Ct,28:St,29:167,33:xt,35:Tt,36:Dt,47:_t,63:vt,78:Ft,83:l1,84:c1,86:150,87:Vt,88:It,89:Bt,90:yt,91:wt,92:Nt,93:Rt,94:138,108:Ot,112:Gt,114:Ut,117:jt,118:Wt,119:Kt},e(I,[2,49]),e(I,[2,50]),e(We,[2,61],{47:d1}),e(We,[2,62],{19:169,11:Me,43:ot}),e(Ue,[2,57]),{47:b,50:171,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{105:[1,172],106:173,108:[1,174]},{47:b,50:175,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{47:b,50:176,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(X,[2,130],{123:181,11:[1,180],15:He,47:Ye,63:qe,92:Xe,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st}),e(X,[2,132],{11:[1,182]}),e(ke,[2,198]),e(ke,[2,185]),e(ke,[2,186]),e(ke,[2,187]),e(ke,[2,188]),e(ke,[2,189]),e(ke,[2,190]),e(ke,[2,191]),e(ke,[2,192]),e(ke,[2,193]),e(ke,[2,194]),e(ke,[2,195]),{47:b,50:183,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{31:184,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:192,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:194,53:[1,193],70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:195,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:196,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:197,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{112:[1,198]},{31:199,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:200,68:[1,201],70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:202,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:203,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{31:204,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},e(be,[2,197]),e(d,[2,22]),e(n1,[2,30]),e(We,[2,59],{34:205,19:206,11:Me,43:Ke}),e(it,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{80:[1,210],82:211,119:bt,122:kt},e(ut,[2,92]),e(ut,[2,94]),e(ut,[2,95]),e(ut,[2,183]),e(ut,[2,184]),{79:212,82:130,83:a1,84:o1,119:bt,122:kt},e(u1,[2,97]),{8:ce,9:de,10:he,11:mt,12:pe,13:Et,15:Ct,22:214,28:St,30:[1,213],33:xt,34:215,35:Tt,36:Dt,43:Ke,47:_t,63:vt,78:Ft,86:150,87:Vt,88:It,89:Bt,90:yt,91:wt,92:Nt,93:Rt,94:216,108:Ot,112:Gt,114:Ut,117:jt,118:Wt,119:Kt},e(U,[2,116]),e(U,[2,118]),e(U,[2,119]),e(U,[2,172]),e(U,[2,173]),e(U,[2,174]),e(U,[2,175]),e(U,[2,176]),e(U,[2,177]),e(U,[2,178]),e(U,[2,179]),e(U,[2,180]),e(U,[2,181]),e(U,[2,182]),e(U,[2,103]),e(U,[2,104]),e(U,[2,105]),e(U,[2,106]),e(U,[2,107]),e(U,[2,108]),e(U,[2,109]),e(U,[2,110]),e(U,[2,111]),e(U,[2,112]),e(U,[2,113]),e(U,[2,114]),e(U,[2,115]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,217],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,218],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{8:ce,9:de,10:he,11:mt,12:pe,13:Et,15:Ct,22:220,28:St,30:[1,219],33:xt,34:221,35:Tt,36:Dt,43:Ke,47:_t,63:vt,78:Ft,86:150,87:Vt,88:It,89:Bt,90:yt,91:wt,92:Nt,93:Rt,94:216,108:Ot,112:Gt,114:Ut,117:jt,118:Wt,119:Kt},{11:Me,19:222},{47:[1,223]},e(Ue,[2,56]),{11:[1,224],47:b,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,225]},{11:[1,226],109:[1,227]},e(h1,[2,143]),{11:[1,228],47:b,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{11:[1,229],47:b,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:122,117:ie,118:re,119:ne},{83:[1,230]},e(X,[2,124],{11:[1,231]}),e(X,[2,126],{11:[1,232]}),{83:[1,233]},e(ke,[2,199]),{83:[1,234],101:[1,235]},e(Ue,[2,68],{116:122,47:b,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),{32:[1,236],70:y,85:237,119:N,120:R,121:O},e(ye,[2,99]),e(ye,[2,101]),e(ye,[2,102]),e(ye,[2,168]),e(ye,[2,169]),e(ye,[2,170]),e(ye,[2,171]),{52:[1,238],70:y,85:237,119:N,120:R,121:O},{31:239,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{54:[1,240],70:y,85:237,119:N,120:R,121:O},{56:[1,241],70:y,85:237,119:N,120:R,121:O},{58:[1,242],70:y,85:237,119:N,120:R,121:O},{60:[1,243],70:y,85:237,119:N,120:R,121:O},{63:[1,244]},{67:[1,245],70:y,85:237,119:N,120:R,121:O},{69:[1,246],70:y,85:237,119:N,120:R,121:O},{31:247,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},{32:[1,248],70:y,85:237,119:N,120:R,121:O},{70:y,72:[1,249],74:[1,250],85:237,119:N,120:R,121:O},{70:y,72:[1,252],74:[1,251],85:237,119:N,120:R,121:O},e(We,[2,58],{19:169,11:Me,43:ot}),e(We,[2,60],{47:d1}),e(it,[2,88]),e(it,[2,87]),{65:[1,253],70:y,85:237,119:N,120:R,121:O},e(it,[2,90]),e(ut,[2,93]),{80:[1,254],82:211,119:bt,122:kt},{31:255,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},e(at,o,{5:256}),{8:ce,9:de,10:he,12:pe,22:257,43:ot},e(U,[2,117]),e(I,[2,42]),e(I,[2,43]),{31:258,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},e(I,[2,46]),{8:ce,9:de,10:he,12:pe,22:259,43:ot},{46:260,47:b,48:45,50:46,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},{11:Me,19:261},{11:Te,63:De,87:_e,95:262,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:273,107:[1,274],108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:275,107:[1,276],108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{108:[1,277]},{11:Te,63:De,87:_e,95:278,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{47:b,50:279,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(X,[2,131]),e(X,[2,133],{11:[1,283]}),e(X,[2,134]),e(oe,[2,69]),e(ye,[2,100]),e(oe,[2,70]),{54:[1,284],70:y,85:237,119:N,120:R,121:O},e(oe,[2,77]),e(oe,[2,72]),e(oe,[2,73]),e(oe,[2,74]),{112:[1,285]},e(oe,[2,76]),e(oe,[2,78]),{69:[1,286],70:y,85:237,119:N,120:R,121:O},e(oe,[2,80]),e(oe,[2,81]),e(oe,[2,83]),e(oe,[2,82]),e(oe,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(it,[2,91]),{32:[1,287],70:y,85:237,119:N,120:R,121:O},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,288],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(at,o,{5:289}),{32:[1,290],70:y,85:237,119:N,120:R,121:O},e(I,[2,47]),e(Ue,[2,66]),{46:291,47:b,48:45,50:46,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne},e(X,[2,136],{109:lt}),e(p1,[2,145],{111:293,11:Te,63:De,87:_e,108:ve,112:Fe,113:Ve,114:Ie,115:Le}),e(Ce,[2,147]),e(Ce,[2,149]),e(Ce,[2,150]),e(Ce,[2,151]),e(Ce,[2,152]),e(Ce,[2,153]),e(Ce,[2,154]),e(Ce,[2,155]),e(Ce,[2,156]),e(X,[2,137],{109:lt}),{11:[1,294]},e(X,[2,138],{109:lt}),{11:[1,295]},e(h1,[2,144]),e(X,[2,120],{109:lt}),e(X,[2,121],{116:122,47:b,63:_,92:Q,105:J,108:Z,109:ee,112:te,114:se,117:ie,118:re,119:ne}),e(X,[2,125]),e(X,[2,127],{11:[1,296]}),e(X,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:ce,9:de,10:he,12:pe,22:301,34:302,43:Ke},e(I,[2,40]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,303],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},{8:ce,9:de,10:he,12:pe,22:304,34:305,43:Ke},e(Ue,[2,65]),{11:Te,63:De,87:_e,108:ve,110:306,111:264,112:Fe,113:Ve,114:Ie,115:Le},e(Ce,[2,148]),{15:He,47:Ye,63:qe,92:Xe,104:307,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st,123:97},{15:He,47:Ye,63:qe,92:Xe,104:308,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st,123:97},{101:[1,309]},e(X,[2,135]),e(oe,[2,71]),{31:310,70:y,83:ue,84:le,85:185,119:N,120:R,121:O},e(oe,[2,79]),e(at,o,{5:311}),{8:ce,9:de,10:he,12:pe,22:312,43:ot},e(I,[2,41]),e(I,[2,44]),{8:ce,9:de,10:he,12:pe,22:313,43:ot},e(p1,[2,146],{111:293,11:Te,63:De,87:_e,108:ve,112:Fe,113:Ve,114:Ie,115:Le}),e(X,[2,141],{123:181,11:[1,314],15:He,47:Ye,63:qe,92:Xe,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st}),e(X,[2,142],{123:181,11:[1,315],15:He,47:Ye,63:qe,92:Xe,108:Qe,109:Je,112:Ze,114:$e,117:et,118:tt,119:st}),e(X,[2,129]),{32:[1,316],70:y,85:237,119:N,120:R,121:O},{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,317],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(at,o,{5:318}),e(I,[2,45]),{11:Te,63:De,87:_e,95:319,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},{11:Te,63:De,87:_e,95:320,108:ve,110:263,111:264,112:Fe,113:Ve,114:Ie,115:Le},e(oe,[2,75]),e(I,[2,38]),{6:13,7:14,8:f,9:m,10:k,11:A,12:C,21:20,23:21,24:22,25:23,26:24,27:25,28:B,33:[1,321],35:D,36:P,37:29,38:v,40:E,42:g,45:33,46:44,47:b,48:45,50:46,63:_,87:Y,88:fe,89:Se,90:Ee,91:xe,92:Q,105:J,108:Z,109:ee,112:te,114:se,116:47,117:ie,118:re,119:ne,124:Ne,125:Re,126:Oe,127:Pe,128:Ge},e(X,[2,139],{109:lt}),e(X,[2,140],{109:lt}),e(I,[2,39])],defaultActions:{},parseError:t(function(S,x){if(x.recoverable)this.trace(S);else{var T=Error(S);throw T.hash=x,T}},"parseError"),parse:t(function(S){var x=this,T=[0],u=[],W=[null],s=[],L=this.table,i="",K=0,f1=0,g1=0,I1=2,b1=1,L1=s.slice.call(arguments,1),ae=Object.create(this.lexer),je={yy:{}};for(var Zt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Zt))je.yy[Zt]=this.yy[Zt];if(ae.setInput(S,je.yy),je.yy.lexer=ae,je.yy.parser=this,typeof ae.yylloc>"u")ae.yylloc={};var $t=ae.yylloc;s.push($t);var B1=ae.options&&ae.options.ranges;if(typeof je.yy.parseError==="function")this.parseError=je.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function M1(Ae){T.length=T.length-2*Ae,W.length=W.length-Ae,s.length=s.length-Ae}t(M1,"popStack");function k1(){var Ae=u.pop()||ae.lex()||b1;if(typeof Ae!=="number"){if(Ae instanceof Array)u=Ae,Ae=u.pop();Ae=x.symbols_[Ae]||Ae}return Ae}t(k1,"lex");var ge,e1,ze,me,Q1,t1,ct={},Yt,Be,m1,qt;while(!0){if(ze=T[T.length-1],this.defaultActions[ze])me=this.defaultActions[ze];else{if(ge===null||typeof ge>"u")ge=k1();me=L[ze]&&L[ze][ge]}if(typeof me>"u"||!me.length||!me[0]){var s1="";qt=[];for(Yt in L[ze])if(this.terminals_[Yt]&&Yt>I1)qt.push("'"+this.terminals_[Yt]+"'");if(ae.showPosition)s1="Parse error on line "+(K+1)+`:
23
23
  `+ae.showPosition()+`
24
24
  Expecting `+qt.join(", ")+", got '"+(this.terminals_[ge]||ge)+"'";else s1="Parse error on line "+(K+1)+": Unexpected "+(ge==b1?"end of input":"'"+(this.terminals_[ge]||ge)+"'");this.parseError(s1,{text:ae.match,token:this.terminals_[ge]||ge,line:ae.yylineno,loc:$t,expected:qt})}if(me[0]instanceof Array&&me.length>1)throw Error("Parse Error: multiple actions possible at state: "+ze+", token: "+ge);switch(me[0]){case 1:if(T.push(ge),W.push(ae.yytext),s.push(ae.yylloc),T.push(me[1]),ge=null,!e1){if(f1=ae.yyleng,i=ae.yytext,K=ae.yylineno,$t=ae.yylloc,g1>0)g1--}else ge=e1,e1=null;break;case 2:if(Be=this.productions_[me[1]][1],ct.$=W[W.length-Be],ct._$={first_line:s[s.length-(Be||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(Be||1)].first_column,last_column:s[s.length-1].last_column},B1)ct._$.range=[s[s.length-(Be||1)].range[0],s[s.length-1].range[1]];if(t1=this.performAction.apply(ct,[i,f1,K,je.yy,me[1],W,s].concat(L1)),typeof t1<"u")return t1;if(Be)T=T.slice(0,-1*Be*2),W=W.slice(0,-1*Be),s=s.slice(0,-1*Be);T.push(this.productions_[me[1]][0]),W.push(ct.$),s.push(ct._$),m1=L[T[T.length-2]][T[T.length-1]],T.push(m1);break;case 3:return!0}}return!0},"parse")},V1=function(){var we={EOF:1,parseError:t(function(x,T){if(this.yy.parser)this.yy.parser.parseError(x,T);else throw Error(x)},"parseError"),setInput:t(function(S,x){if(this.yy=x||this.yy||{},this._input=S,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var x=S.match(/(?:\r\n?|\n).*/g);if(x)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),S},"input"),unput:t(function(S){var x=S.length,T=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var u=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),T.length-1)this.yylineno-=T.length-1;var W=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:T?(T.length===u.length?this.yylloc.first_column:0)+u[u.length-T.length].length-T[0].length:this.yylloc.first_column-x},this.options.ranges)this.yylloc.range=[W[0],W[0]+this.yyleng-x];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
25
25
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(S){this.unput(this.match.slice(S))},"less"),pastInput:t(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var S=this.match;if(S.length<20)S+=this._input.substr(0,20-S.length);return(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var S=this.pastInput(),x=Array(S.length+1).join("-");return S+this.upcomingInput()+`