@foris/ai-agent 0.9.1-beta.2 → 0.9.1-beta.3

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 (325) hide show
  1. package/dist/abap-Y8Dl9g_6.js +6 -0
  2. package/dist/actionscript-3-DZzbMeqX.js +6 -0
  3. package/dist/ada-vP6ak0IW.js +6 -0
  4. package/dist/ai-agent.es.js +14 -2779
  5. package/dist/ai-agent.umd.js +3213 -4
  6. package/dist/andromeeda-BIpZ7gaU.js +4 -0
  7. package/dist/angular-html-CHuhdNYa.js +32 -0
  8. package/dist/angular-ts-CkwnAxZa.js +32 -0
  9. package/dist/apache-BUjz-sD2.js +6 -0
  10. package/dist/apex-oLhhs58q.js +6 -0
  11. package/dist/apl-C8FRyJIY.js +24 -0
  12. package/dist/applescript-BPx7YFFu.js +6 -0
  13. package/dist/ara-Z2fSOxSw.js +6 -0
  14. package/dist/arc-BzRDGNYi.js +85 -0
  15. package/dist/architectureDiagram-VXUJARFQ-jlW87y1j.js +4682 -0
  16. package/dist/asciidoc-B-pCoB3G.js +6 -0
  17. package/dist/asm-BTWLY5ym.js +6 -0
  18. package/dist/astro-CAC4-sRr.js +25 -0
  19. package/dist/aurora-x-BwoVEUWZ.js +4 -0
  20. package/dist/awk-Fb0P9dkn.js +6 -0
  21. package/dist/ayu-dark-CxPZkpb2.js +4 -0
  22. package/dist/ballerina-oZK-YekG.js +6 -0
  23. package/dist/bat-0FvbqU9S.js +6 -0
  24. package/dist/beancount-DqJEb89h.js +6 -0
  25. package/dist/berry-DODBq_Ff.js +6 -0
  26. package/dist/bibtex-EULQRLY5.js +6 -0
  27. package/dist/bicep-BorU73w0.js +6 -0
  28. package/dist/blade-Bwl5-ENK.js +27 -0
  29. package/dist/blockDiagram-VD42YOAC-P4woNHAr.js +2415 -0
  30. package/dist/bsl-NkNNwerW.js +8 -0
  31. package/dist/c-eeMepfLm.js +6 -0
  32. package/dist/c4Diagram-YG6GDRKO-CB9WFLmJ.js +1593 -0
  33. package/dist/cadence-02UX7mW8.js +6 -0
  34. package/dist/cairo-Cp116741.js +18 -0
  35. package/dist/catppuccin-frappe-D3cH2rXe.js +4 -0
  36. package/dist/catppuccin-latte-C0LRGUW4.js +4 -0
  37. package/dist/catppuccin-macchiato-c5wQ11TT.js +4 -0
  38. package/dist/catppuccin-mocha-WMD6Qvya.js +4 -0
  39. package/dist/channel-B-TkD8Bv.js +5 -0
  40. package/dist/chunk-4BX2VUAB-DCjARiNr.js +9 -0
  41. package/dist/chunk-55IACEB6-DvmPHLo5.js +8 -0
  42. package/dist/chunk-B4BG7PRW-L08cVxNP.js +1377 -0
  43. package/dist/chunk-DI55MBZ5-zkyTO7pn.js +1383 -0
  44. package/dist/chunk-FMBD7UC4-BkpbM-uP.js +19 -0
  45. package/dist/chunk-QN33PNHL-DSFN3Uoh.js +20 -0
  46. package/dist/chunk-QZHKN3VN-CAgMv7Xo.js +15 -0
  47. package/dist/chunk-TZMSLE5B-B6GY_sBW.js +64 -0
  48. package/dist/clarity-PKm5CwqM.js +6 -0
  49. package/dist/classDiagram-2ON5EDUG-KqDAjO33.js +30 -0
  50. package/dist/classDiagram-v2-WZHVMYZB-KqDAjO33.js +30 -0
  51. package/dist/clojure-CXJfHrL3.js +6 -0
  52. package/dist/cmake-BJz8BOTU.js +6 -0
  53. package/dist/cobol-DNTp9HAy.js +20 -0
  54. package/dist/code-block-QI2IAROF-Culy9AKV.js +2042 -0
  55. package/dist/codeowners-Bt9yU6NX.js +6 -0
  56. package/dist/codeql-DHkodjjI.js +6 -0
  57. package/dist/coffee-BrprHIxF.js +18 -0
  58. package/dist/common-lisp-EVqT9Zhp.js +6 -0
  59. package/dist/coq-B0L9upzn.js +6 -0
  60. package/dist/cose-bilkent-S5V4N54A-DtppvcNV.js +2620 -0
  61. package/dist/cpp-CwJ5QP3s.js +29 -0
  62. package/dist/crystal-DWRgWI1Z.js +24 -0
  63. package/dist/csv-CmYOceLb.js +6 -0
  64. package/dist/cue-ZzumE7IT.js +6 -0
  65. package/dist/cypher-jpdmjtA6.js +6 -0
  66. package/dist/cytoscape.esm-ClN43hhW.js +18846 -0
  67. package/dist/d-CBagWSwH.js +6 -0
  68. package/dist/dagre-6UL2VRFP-BfvQz4N-.js +459 -0
  69. package/dist/dark-plus-pUHDTVV0.js +4 -0
  70. package/dist/dart-6ObCrKr9.js +6 -0
  71. package/dist/dax-CcDT-8dH.js +6 -0
  72. package/dist/defaultLocale-D1piDxzZ.js +177 -0
  73. package/dist/desktop-B93p9R9O.js +6 -0
  74. package/dist/diagram-PSM6KHXK-ka-cDwC2.js +552 -0
  75. package/dist/diagram-QEK2KX5R-BW-yTygZ.js +232 -0
  76. package/dist/diagram-S2PKOQOG-j24g_p7y.js +154 -0
  77. package/dist/diff-BxzP2J8R.js +6 -0
  78. package/dist/docker-CsHqm9tx.js +6 -0
  79. package/dist/dotenv-BMjVjUL1.js +6 -0
  80. package/dist/dracula-BtZx2Kac.js +4 -0
  81. package/dist/dracula-soft-BKa-aqBv.js +4 -0
  82. package/dist/dream-maker-PAx17jaB.js +6 -0
  83. package/dist/edge-B5_tHZZy.js +21 -0
  84. package/dist/elixir-Dj_1qPNg.js +18 -0
  85. package/dist/elm-DZPAA5Qn.js +9 -0
  86. package/dist/emacs-lisp-Cfxdx5D-.js +6 -0
  87. package/dist/erDiagram-Q2GNP2WA-BoiJgXhe.js +854 -0
  88. package/dist/erb-DiYOU0he.js +31 -0
  89. package/dist/erlang-CNRRyeIc.js +18 -0
  90. package/dist/everforest-dark-DMCBqXCK.js +4 -0
  91. package/dist/everforest-light-BbXl82Em.js +4 -0
  92. package/dist/fennel-N4WcXuKx.js +6 -0
  93. package/dist/fish-BTDEUgqH.js +6 -0
  94. package/dist/flowDiagram-NV44I4VS-BHGntIlE.js +1639 -0
  95. package/dist/fluent-BMXUxfv1.js +6 -0
  96. package/dist/fortran-fixed-form-DUsA-VGo.js +8 -0
  97. package/dist/fortran-free-form-DPIT_jbP.js +6 -0
  98. package/dist/fsharp-yevJ8DSS.js +18 -0
  99. package/dist/ganttDiagram-JELNMOA3-Ce8NwhCP.js +2710 -0
  100. package/dist/gdresource-BwtMIoBm.js +10 -0
  101. package/dist/gdscript-BifyeYhI.js +6 -0
  102. package/dist/gdshader-Bk8fF6yr.js +6 -0
  103. package/dist/genie-DzUvd7U9.js +6 -0
  104. package/dist/gherkin-DHRaV0YP.js +6 -0
  105. package/dist/git-commit-Bd32YZ0K.js +8 -0
  106. package/dist/git-rebase-BWMiWxYf.js +18 -0
  107. package/dist/gitGraphDiagram-NY62KEGX-DxoN7y5T.js +723 -0
  108. package/dist/github-dark-DenFmJkN.js +4 -0
  109. package/dist/github-dark-default-BJPUVz4H.js +4 -0
  110. package/dist/github-dark-dimmed-DUshB20C.js +4 -0
  111. package/dist/github-dark-high-contrast-D3aGCnF8.js +4 -0
  112. package/dist/github-light-JYsPkUQd.js +4 -0
  113. package/dist/github-light-default-D99KPAby.js +4 -0
  114. package/dist/github-light-high-contrast-BbmZE-Mp.js +4 -0
  115. package/dist/gleam-Bv284lvN.js +6 -0
  116. package/dist/glimmer-js-Nc7Kk_CN.js +21 -0
  117. package/dist/glimmer-ts-DLoneyA9.js +21 -0
  118. package/dist/glsl-CkUcVZNK.js +8 -0
  119. package/dist/gnuplot-yPG9-sE_.js +6 -0
  120. package/dist/graph-C-gpLwEq.js +1189 -0
  121. package/dist/graphql-CB9Yiq18.js +23 -0
  122. package/dist/groovy-CJQTphOW.js +6 -0
  123. package/dist/gruvbox-dark-hard-C5HOtKIh.js +4 -0
  124. package/dist/gruvbox-dark-medium-FVgwJHuz.js +4 -0
  125. package/dist/gruvbox-dark-soft-B46F314v.js +4 -0
  126. package/dist/gruvbox-light-hard-CJD38wDZ.js +4 -0
  127. package/dist/gruvbox-light-medium-BlIhMYTA.js +4 -0
  128. package/dist/gruvbox-light-soft-DoPHyLVZ.js +4 -0
  129. package/dist/hack-dNZDE7CK.js +19 -0
  130. package/dist/haml-CIHYN_l8.js +19 -0
  131. package/dist/handlebars-5wdAGqTJ.js +21 -0
  132. package/dist/haskell-WeIwNIP6.js +6 -0
  133. package/dist/haxe-TztHsm5T.js +6 -0
  134. package/dist/hcl-D438OF-I.js +6 -0
  135. package/dist/hjson-DYBUbqOl.js +6 -0
  136. package/dist/hlsl-Bk8TCZNL.js +6 -0
  137. package/dist/houston-BDYrDoDW.js +4 -0
  138. package/dist/html-derivative-89LwIO26.js +18 -0
  139. package/dist/http-Dsh8rSJR.js +26 -0
  140. package/dist/hurl-NdmqbL7E.js +26 -0
  141. package/dist/hxml-GbqSQCLa.js +8 -0
  142. package/dist/hy-Brt5EZ7-.js +6 -0
  143. package/dist/imba-CimUv-Uh.js +6 -0
  144. package/dist/index-C3mwt8G1.js +67982 -0
  145. package/dist/infoDiagram-WHAUD3N6-DdxAG2VL.js +35 -0
  146. package/dist/ini-BZIuRIvJ.js +6 -0
  147. package/dist/init-DjUOC4st.js +16 -0
  148. package/dist/java-DY6VlHhP.js +6 -0
  149. package/dist/jinja-BuwNoMI4.js +21 -0
  150. package/dist/jison-_q6rTsMi.js +18 -0
  151. package/dist/journeyDiagram-XKPGCS4Q-CT5Fbg6c.js +848 -0
  152. package/dist/json5-BT4Fjg39.js +6 -0
  153. package/dist/jsonc-CHjZD8gR.js +6 -0
  154. package/dist/jsonl-BGuvDmy9.js +6 -0
  155. package/dist/jsonnet-Bx2cfsXg.js +6 -0
  156. package/dist/jssm-BcADi6EI.js +6 -0
  157. package/dist/jsx-BtKADgXT.js +6 -0
  158. package/dist/julia-BCBeSq7V.js +27 -0
  159. package/dist/kanagawa-dragon-CiKur4Hl.js +4 -0
  160. package/dist/kanagawa-lotus-BKu-smKu.js +4 -0
  161. package/dist/kanagawa-wave-CQwozSzG.js +4 -0
  162. package/dist/kanban-definition-3W4ZIXB7-CxtMdkvq.js +732 -0
  163. package/dist/katex.min-l0sNRNKZ.js +1 -0
  164. package/dist/kdl-BNOv9TC3.js +6 -0
  165. package/dist/kotlin-ByBMgTeR.js +6 -0
  166. package/dist/kusto-VWFLl2T0.js +6 -0
  167. package/dist/laserwave-6a00oqik.js +4 -0
  168. package/dist/latex-DF20280u.js +9 -0
  169. package/dist/layout-D2NtTgFh.js +1730 -0
  170. package/dist/lean-D5yRrexI.js +6 -0
  171. package/dist/less-B1GLI2Di.js +6 -0
  172. package/dist/light-plus-CZuVqSLX.js +4 -0
  173. package/dist/linear-sERCAB61.js +277 -0
  174. package/dist/liquid-CFYzC-s7.js +21 -0
  175. package/dist/llvm-co1rIKs3.js +6 -0
  176. package/dist/log-Al8wyEFV.js +6 -0
  177. package/dist/logo-DBa4JDzV.js +6 -0
  178. package/dist/lua-kX5WP_P5.js +8 -0
  179. package/dist/luau-DtBSxLyz.js +6 -0
  180. package/dist/make-CsMclxtr.js +6 -0
  181. package/dist/marko-OTJE9YCh.js +23 -0
  182. package/dist/material-theme-D6KBX41T.js +4 -0
  183. package/dist/material-theme-darker-CkRroheE.js +4 -0
  184. package/dist/material-theme-lighter-BUBw43Yz.js +4 -0
  185. package/dist/material-theme-ocean-ClGX14Ja.js +4 -0
  186. package/dist/material-theme-palenight-C1RVm8K1.js +4 -0
  187. package/dist/matlab-BOAaUVP0.js +6 -0
  188. package/dist/mdc-tFNBAW39.js +21 -0
  189. package/dist/mdx-BOhZZUJ8.js +6 -0
  190. package/dist/mermaid-B0ixDHKN.js +6 -0
  191. package/dist/mermaid-NA5CF7SZ-620UJKEg.js +14 -0
  192. package/dist/mermaid.core-08D5Vldk.js +14401 -0
  193. package/dist/min-dark-C7ak0t6c.js +4 -0
  194. package/dist/min-light-CKFxVcPp.js +4 -0
  195. package/dist/mindmap-definition-VGOIOE7T-CTZ_Wx0b.js +798 -0
  196. package/dist/mipsasm-CTx18fBl.js +6 -0
  197. package/dist/mojo-BD611d7o.js +6 -0
  198. package/dist/monokai-C1KBYcO0.js +4 -0
  199. package/dist/move-F-dICmj2.js +6 -0
  200. package/dist/narrat-DmhDCBs-.js +6 -0
  201. package/dist/nextflow-DmSVRGjG.js +6 -0
  202. package/dist/nginx-COxS3qoU.js +9 -0
  203. package/dist/night-owl-Bm2rzalh.js +4 -0
  204. package/dist/nim-CZHmlxcO.js +28 -0
  205. package/dist/nix-BZK5F767.js +9 -0
  206. package/dist/nord-CC5OiUXg.js +4 -0
  207. package/dist/nushell-D8j3dhT-.js +6 -0
  208. package/dist/objective-c-Itk8tzmv.js +6 -0
  209. package/dist/objective-cpp-DGt5UKRO.js +6 -0
  210. package/dist/ocaml-eSVK32Eg.js +6 -0
  211. package/dist/openscad-Sp5uZ6f2.js +6 -0
  212. package/dist/ordinal-MUacOSdK.js +65 -0
  213. package/dist/pascal-xy8pJNns.js +6 -0
  214. package/dist/perl-CvmtpKyV.js +24 -0
  215. package/dist/php-B1tFq0rn.js +25 -0
  216. package/dist/pieDiagram-ADFJNKIX-DtleX3ES.js +173 -0
  217. package/dist/pkl-C-zSNmaA.js +6 -0
  218. package/dist/plastic-CSTz3KZp.js +4 -0
  219. package/dist/plsql-pVbGZfOv.js +6 -0
  220. package/dist/po-BNfHvqmm.js +6 -0
  221. package/dist/poimandres-C-VADXHD.js +4 -0
  222. package/dist/polar-CAZahv3u.js +6 -0
  223. package/dist/postcss-05aHdL-n.js +6 -0
  224. package/dist/powerquery-DI9HkTvs.js +6 -0
  225. package/dist/powershell-Clc4ydu-.js +6 -0
  226. package/dist/prisma-FZjmVtSl.js +6 -0
  227. package/dist/prolog-C5-yg4TO.js +6 -0
  228. package/dist/proto-MmCPeFAD.js +6 -0
  229. package/dist/pug-xpTstXA9.js +20 -0
  230. package/dist/puppet-CUJHmnxV.js +6 -0
  231. package/dist/purescript-rUfGld-4.js +6 -0
  232. package/dist/qml-G4_KKZym.js +18 -0
  233. package/dist/qmldir-BInDYbpo.js +6 -0
  234. package/dist/qss-AeJTysr_.js +6 -0
  235. package/dist/quadrantDiagram-AYHSOK5B-D193y_DL.js +1038 -0
  236. package/dist/r-Bm0uF0U2.js +6 -0
  237. package/dist/racket-B83wSAja.js +6 -0
  238. package/dist/raku-nEQ4ZJJ7.js +6 -0
  239. package/dist/razor-BS4LwTsw.js +19 -0
  240. package/dist/red-7y8PH7HH.js +4 -0
  241. package/dist/reg-m_s_Kiip.js +6 -0
  242. package/dist/regexp-BazyLpPg.js +6 -0
  243. package/dist/rel-BcRfyd6Q.js +6 -0
  244. package/dist/requirementDiagram-UZGBJVZJ-DcSe-m6d.js +864 -0
  245. package/dist/riscv-Ce8MAQLP.js +6 -0
  246. package/dist/rose-pine-BKc3yVeu.js +4 -0
  247. package/dist/rose-pine-dawn-BulJcPZT.js +4 -0
  248. package/dist/rose-pine-moon-j6jiXKV8.js +4 -0
  249. package/dist/rosmsg-Cz0w1km8.js +6 -0
  250. package/dist/rst-BvkiqG_4.js +39 -0
  251. package/dist/ruby-CSrNBwZK.js +40 -0
  252. package/dist/sankeyDiagram-TZEHDZUN-HpXuokMl.js +838 -0
  253. package/dist/sas-DciBl6hq.js +18 -0
  254. package/dist/sass-DxHp5rTx.js +6 -0
  255. package/dist/scala-D4grkFkl.js +6 -0
  256. package/dist/scheme-BCRWuEm4.js +6 -0
  257. package/dist/scss-Sr5SHsiH.js +18 -0
  258. package/dist/sdbl-B7T8abf4.js +6 -0
  259. package/dist/sequenceDiagram-WL72ISMW-D_5I_YtC.js +2530 -0
  260. package/dist/shaderlab-Cr62-Wb4.js +8 -0
  261. package/dist/shellsession-B0YIY3D-.js +18 -0
  262. package/dist/slack-dark-i7wN4OET.js +4 -0
  263. package/dist/slack-ochin-ndHf0LoP.js +4 -0
  264. package/dist/smalltalk-BlI1_OkM.js +6 -0
  265. package/dist/snazzy-light-BlSJXAu4.js +4 -0
  266. package/dist/solarized-dark-UTmkh7lw.js +4 -0
  267. package/dist/solarized-light-BheCkDPT.js +4 -0
  268. package/dist/solidity-DUWnFhS6.js +6 -0
  269. package/dist/soy-I6L3jl3W.js +18 -0
  270. package/dist/sparql-B0KWFEri.js +8 -0
  271. package/dist/splunk-CRXR8A9s.js +6 -0
  272. package/dist/ssh-config-DP-hNVbF.js +6 -0
  273. package/dist/stata-BNwq7-ev.js +18 -0
  274. package/dist/stateDiagram-FKZM4ZOC-CRSpvNED.js +276 -0
  275. package/dist/stateDiagram-v2-4FDKWEC3-DfUK-Zbc.js +29 -0
  276. package/dist/style.css +1 -1
  277. package/dist/stylus-CyKEU1Ej.js +6 -0
  278. package/dist/svelte-Din0yw3u.js +22 -0
  279. package/dist/swift-9UzSvamq.js +6 -0
  280. package/dist/synthwave-84-NU3C_KFZ.js +4 -0
  281. package/dist/system-verilog-BCm7smPJ.js +6 -0
  282. package/dist/systemd-C-4qm6XH.js +6 -0
  283. package/dist/talonscript-CFF3LF_O.js +6 -0
  284. package/dist/tasl-Cg_WBUAe.js +6 -0
  285. package/dist/tcl-DN7buRTF.js +6 -0
  286. package/dist/templ-CBu7yCES.js +20 -0
  287. package/dist/terraform-DGvcn9zM.js +6 -0
  288. package/dist/tex-DpOayVob.js +8 -0
  289. package/dist/timeline-definition-IT6M3QCI-DaJ4iEOK.js +813 -0
  290. package/dist/tokyo-night-DP4TmcQl.js +4 -0
  291. package/dist/treemap-KMMF4GRG-C3Ab2yjL.js +16045 -0
  292. package/dist/ts-tags-3Kvfz4et.js +49 -0
  293. package/dist/tsv-BtvSkaG0.js +6 -0
  294. package/dist/tsx-B8rCNbgL.js +6 -0
  295. package/dist/turtle-_H59FV7D.js +6 -0
  296. package/dist/twig-3l_q-6xZ.js +37 -0
  297. package/dist/typespec-DWqp-kUU.js +6 -0
  298. package/dist/typst-D_1QKWns.js +6 -0
  299. package/dist/v-BPCNiyYe.js +6 -0
  300. package/dist/vala-uxaPR7d1.js +6 -0
  301. package/dist/vb-D8_c5-KN.js +6 -0
  302. package/dist/verilog-B-bybjPF.js +6 -0
  303. package/dist/vesper-BckBta1U.js +4 -0
  304. package/dist/vhdl-CUlNa8ac.js +6 -0
  305. package/dist/viml-DsfA-sWm.js +6 -0
  306. package/dist/vitesse-black-BoGvW84i.js +4 -0
  307. package/dist/vitesse-dark-Cym-eLtO.js +4 -0
  308. package/dist/vitesse-light-CcmG315c.js +4 -0
  309. package/dist/vue-BuFQ04-G.js +37 -0
  310. package/dist/vue-html-CyxHqgfT.js +21 -0
  311. package/dist/vue-vine-B_YNGutq.js +30 -0
  312. package/dist/vyper-CPQuu50u.js +6 -0
  313. package/dist/wasm-BBXxrAl7.js +6 -0
  314. package/dist/wasm-DQxwEHae.js +7 -0
  315. package/dist/wenyan-pbVjoM9_.js +6 -0
  316. package/dist/wgsl-DY4iK1q1.js +6 -0
  317. package/dist/wikitext-Z-MoUasO.js +6 -0
  318. package/dist/wit-CQMQOlTg.js +6 -0
  319. package/dist/wolfram-Dz4KXISs.js +6 -0
  320. package/dist/xml-C2J0sS9M.js +8 -0
  321. package/dist/xsl-CbTBIiv3.js +9 -0
  322. package/dist/xychartDiagram-PRI3JC2R-Cf2smXg5.js +1353 -0
  323. package/dist/zenscript-CxBjpf9c.js +6 -0
  324. package/dist/zig-Vm0PO9wB.js +6 -0
  325. package/package.json +25 -25
@@ -0,0 +1,2415 @@
1
+ import { g as Ce } from "./chunk-FMBD7UC4-BkpbM-uP.js";
2
+ import { aG as Ie, aH as Be, aI as Oe, aJ as Jt, aK as Qt, aL as Rt, aM as Ae, aN as Re, aO as te, aP as Tt, aQ as ee, aR as gt, aS as ze, aT as Me, aU as je, aV as Fe, aW as Pe, aX as We, aY as Ye, _ as g, F as it, d as R, e as Ke, l as L, y as Ue, A as He, aZ as Xe, R as Ve, S as Ge, c as z, O as $e, a_ as Z, ax as re, ar as Ze, u as rt, k as qe, a$ as Je, b0 as mt, i as Lt, b1 as Qe } from "./mermaid.core-08D5Vldk.js";
3
+ import { G as tr } from "./graph-C-gpLwEq.js";
4
+ import { c as er } from "./channel-B-TkD8Bv.js";
5
+ import "./index-C3mwt8G1.js";
6
+ import "react/jsx-runtime";
7
+ import "react";
8
+ import "class-variance-authority";
9
+ import "clsx";
10
+ import "tailwind-merge";
11
+ import "react-dom";
12
+ import "cmdk";
13
+ import "nanoid";
14
+ import "@foris/avocado-icons";
15
+ import "react-markdown";
16
+ function rr(e, t) {
17
+ for (var a = -1, i = e == null ? 0 : e.length; ++a < i && t(e[a], a, e) !== !1; )
18
+ ;
19
+ return e;
20
+ }
21
+ function ae(e) {
22
+ return Ie(e) ? Be(e) : Oe(e);
23
+ }
24
+ function ar(e, t) {
25
+ return e && Jt(t, ae(t), e);
26
+ }
27
+ function sr(e, t) {
28
+ for (var a = -1, i = e == null ? 0 : e.length, l = 0, s = []; ++a < i; ) {
29
+ var r = e[a];
30
+ t(r, a, e) && (s[l++] = r);
31
+ }
32
+ return s;
33
+ }
34
+ function ir() {
35
+ return [];
36
+ }
37
+ var nr = Object.prototype, lr = nr.propertyIsEnumerable, zt = Object.getOwnPropertySymbols, se = zt ? function(e) {
38
+ return e == null ? [] : (e = Object(e), sr(zt(e), function(t) {
39
+ return lr.call(e, t);
40
+ }));
41
+ } : ir;
42
+ function cr(e, t) {
43
+ return Jt(e, se(e), t);
44
+ }
45
+ function or(e, t) {
46
+ for (var a = -1, i = t.length, l = e.length; ++a < i; )
47
+ e[l + a] = t[a];
48
+ return e;
49
+ }
50
+ function hr(e, t, a) {
51
+ var i = t(e);
52
+ return Qt(e) ? i : or(i, a(e));
53
+ }
54
+ function gr(e) {
55
+ return hr(e, ae, se);
56
+ }
57
+ var ur = Object.prototype, dr = ur.hasOwnProperty;
58
+ function pr(e) {
59
+ var t = e.length, a = new e.constructor(t);
60
+ return t && typeof e[0] == "string" && dr.call(e, "index") && (a.index = e.index, a.input = e.input), a;
61
+ }
62
+ function fr(e, t) {
63
+ var a = e.buffer;
64
+ return new e.constructor(a, e.byteOffset, e.byteLength);
65
+ }
66
+ var yr = /\w*$/;
67
+ function xr(e) {
68
+ var t = new e.constructor(e.source, yr.exec(e));
69
+ return t.lastIndex = e.lastIndex, t;
70
+ }
71
+ var Mt = Rt ? Rt.prototype : void 0, jt = Mt ? Mt.valueOf : void 0;
72
+ function br(e) {
73
+ return jt ? Object(jt.call(e)) : {};
74
+ }
75
+ var wr = "[object Boolean]", mr = "[object Date]", Lr = "[object Map]", Sr = "[object Number]", vr = "[object RegExp]", Er = "[object Set]", _r = "[object String]", kr = "[object Symbol]", Tr = "[object ArrayBuffer]", Dr = "[object DataView]", Nr = "[object Float32Array]", Cr = "[object Float64Array]", Ir = "[object Int8Array]", Br = "[object Int16Array]", Or = "[object Int32Array]", Ar = "[object Uint8Array]", Rr = "[object Uint8ClampedArray]", zr = "[object Uint16Array]", Mr = "[object Uint32Array]";
76
+ function jr(e, t, a) {
77
+ var i = e.constructor;
78
+ switch (t) {
79
+ case Tr:
80
+ return Re(e);
81
+ case wr:
82
+ case mr:
83
+ return new i(+e);
84
+ case Dr:
85
+ return fr(e);
86
+ case Nr:
87
+ case Cr:
88
+ case Ir:
89
+ case Br:
90
+ case Or:
91
+ case Ar:
92
+ case Rr:
93
+ case zr:
94
+ case Mr:
95
+ return Ae(e, a);
96
+ case Lr:
97
+ return new i();
98
+ case Sr:
99
+ case _r:
100
+ return new i(e);
101
+ case vr:
102
+ return xr(e);
103
+ case Er:
104
+ return new i();
105
+ case kr:
106
+ return br(e);
107
+ }
108
+ }
109
+ var Fr = "[object Map]";
110
+ function Pr(e) {
111
+ return te(e) && Tt(e) == Fr;
112
+ }
113
+ var Ft = gt && gt.isMap, Wr = Ft ? ee(Ft) : Pr, Yr = "[object Set]";
114
+ function Kr(e) {
115
+ return te(e) && Tt(e) == Yr;
116
+ }
117
+ var Pt = gt && gt.isSet, Ur = Pt ? ee(Pt) : Kr, Hr = 1, ie = "[object Arguments]", Xr = "[object Array]", Vr = "[object Boolean]", Gr = "[object Date]", $r = "[object Error]", ne = "[object Function]", Zr = "[object GeneratorFunction]", qr = "[object Map]", Jr = "[object Number]", le = "[object Object]", Qr = "[object RegExp]", ta = "[object Set]", ea = "[object String]", ra = "[object Symbol]", aa = "[object WeakMap]", sa = "[object ArrayBuffer]", ia = "[object DataView]", na = "[object Float32Array]", la = "[object Float64Array]", ca = "[object Int8Array]", oa = "[object Int16Array]", ha = "[object Int32Array]", ga = "[object Uint8Array]", ua = "[object Uint8ClampedArray]", da = "[object Uint16Array]", pa = "[object Uint32Array]", C = {};
118
+ C[ie] = C[Xr] = C[sa] = C[ia] = C[Vr] = C[Gr] = C[na] = C[la] = C[ca] = C[oa] = C[ha] = C[qr] = C[Jr] = C[le] = C[Qr] = C[ta] = C[ea] = C[ra] = C[ga] = C[ua] = C[da] = C[pa] = !0;
119
+ C[$r] = C[ne] = C[aa] = !1;
120
+ function ot(e, t, a, i, l, s) {
121
+ var r, n = t & Hr;
122
+ if (r !== void 0)
123
+ return r;
124
+ if (!ze(e))
125
+ return e;
126
+ var o = Qt(e);
127
+ if (o)
128
+ return r = pr(e), Me(e, r);
129
+ var d = Tt(e), h = d == ne || d == Zr;
130
+ if (je(e))
131
+ return Fe(e, n);
132
+ if (d == le || d == ie || h && !l)
133
+ return r = h ? {} : Pe(e), cr(e, ar(r, e));
134
+ if (!C[d])
135
+ return l ? e : {};
136
+ r = jr(e, d, n), s || (s = new We());
137
+ var x = s.get(e);
138
+ if (x)
139
+ return x;
140
+ s.set(e, r), Ur(e) ? e.forEach(function(S) {
141
+ r.add(ot(S, t, a, S, e, s));
142
+ }) : Wr(e) && e.forEach(function(S, k) {
143
+ r.set(k, ot(S, t, a, k, e, s));
144
+ });
145
+ var b = gr, m = o ? void 0 : b(e);
146
+ return rr(m || e, function(S, k) {
147
+ m && (k = S, S = e[k]), Ye(r, k, ot(S, t, a, k, e, s));
148
+ }), r;
149
+ }
150
+ var fa = 4;
151
+ function ya(e) {
152
+ return ot(e, fa);
153
+ }
154
+ var St = function() {
155
+ var e = /* @__PURE__ */ g(function(D, y, u, p) {
156
+ for (u = u || {}, p = D.length; p--; u[D[p]] = y)
157
+ ;
158
+ return u;
159
+ }, "o"), t = [1, 15], a = [1, 7], i = [1, 13], l = [1, 14], s = [1, 19], r = [1, 16], n = [1, 17], o = [1, 18], d = [8, 30], h = [8, 10, 21, 28, 29, 30, 31, 39, 43, 46], x = [1, 23], b = [1, 24], m = [8, 10, 15, 16, 21, 28, 29, 30, 31, 39, 43, 46], S = [8, 10, 15, 16, 21, 27, 28, 29, 30, 31, 39, 43, 46], k = [1, 49], E = {
160
+ trace: /* @__PURE__ */ g(function() {
161
+ }, "trace"),
162
+ yy: {},
163
+ symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, NODE_ID: 31, nodeShapeNLabel: 32, dirList: 33, DIR: 34, NODE_DSTART: 35, NODE_DEND: 36, BLOCK_ARROW_START: 37, BLOCK_ARROW_END: 38, classDef: 39, CLASSDEF_ID: 40, CLASSDEF_STYLEOPTS: 41, DEFAULT: 42, class: 43, CLASSENTITY_IDS: 44, STYLECLASS: 45, style: 46, STYLE_ENTITY_IDS: 47, STYLE_DEFINITION_DATA: 48, $accept: 0, $end: 1 },
164
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "NODE_ID", 34: "DIR", 35: "NODE_DSTART", 36: "NODE_DEND", 37: "BLOCK_ARROW_START", 38: "BLOCK_ARROW_END", 39: "classDef", 40: "CLASSDEF_ID", 41: "CLASSDEF_STYLEOPTS", 42: "DEFAULT", 43: "class", 44: "CLASSENTITY_IDS", 45: "STYLECLASS", 46: "style", 47: "STYLE_ENTITY_IDS", 48: "STYLE_DEFINITION_DATA" },
165
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [33, 1], [33, 2], [32, 3], [32, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
166
+ performAction: /* @__PURE__ */ g(function(y, u, p, w, v, c, _) {
167
+ var f = c.length - 1;
168
+ switch (v) {
169
+ case 4:
170
+ w.getLogger().debug("Rule: separator (NL) ");
171
+ break;
172
+ case 5:
173
+ w.getLogger().debug("Rule: separator (Space) ");
174
+ break;
175
+ case 6:
176
+ w.getLogger().debug("Rule: separator (EOF) ");
177
+ break;
178
+ case 7:
179
+ w.getLogger().debug("Rule: hierarchy: ", c[f - 1]), w.setHierarchy(c[f - 1]);
180
+ break;
181
+ case 8:
182
+ w.getLogger().debug("Stop NL ");
183
+ break;
184
+ case 9:
185
+ w.getLogger().debug("Stop EOF ");
186
+ break;
187
+ case 10:
188
+ w.getLogger().debug("Stop NL2 ");
189
+ break;
190
+ case 11:
191
+ w.getLogger().debug("Stop EOF2 ");
192
+ break;
193
+ case 12:
194
+ w.getLogger().debug("Rule: statement: ", c[f]), typeof c[f].length == "number" ? this.$ = c[f] : this.$ = [c[f]];
195
+ break;
196
+ case 13:
197
+ w.getLogger().debug("Rule: statement #2: ", c[f - 1]), this.$ = [c[f - 1]].concat(c[f]);
198
+ break;
199
+ case 14:
200
+ w.getLogger().debug("Rule: link: ", c[f], y), this.$ = { edgeTypeStr: c[f], label: "" };
201
+ break;
202
+ case 15:
203
+ w.getLogger().debug("Rule: LABEL link: ", c[f - 3], c[f - 1], c[f]), this.$ = { edgeTypeStr: c[f], label: c[f - 1] };
204
+ break;
205
+ case 18:
206
+ const M = parseInt(c[f]), A = w.generateId();
207
+ this.$ = { id: A, type: "space", label: "", width: M, children: [] };
208
+ break;
209
+ case 23:
210
+ w.getLogger().debug("Rule: (nodeStatement link node) ", c[f - 2], c[f - 1], c[f], " typestr: ", c[f - 1].edgeTypeStr);
211
+ const H = w.edgeStrToEdgeData(c[f - 1].edgeTypeStr);
212
+ this.$ = [
213
+ { id: c[f - 2].id, label: c[f - 2].label, type: c[f - 2].type, directions: c[f - 2].directions },
214
+ { id: c[f - 2].id + "-" + c[f].id, start: c[f - 2].id, end: c[f].id, label: c[f - 1].label, type: "edge", directions: c[f].directions, arrowTypeEnd: H, arrowTypeStart: "arrow_open" },
215
+ { id: c[f].id, label: c[f].label, type: w.typeStr2Type(c[f].typeStr), directions: c[f].directions }
216
+ ];
217
+ break;
218
+ case 24:
219
+ w.getLogger().debug("Rule: nodeStatement (abc88 node size) ", c[f - 1], c[f]), this.$ = { id: c[f - 1].id, label: c[f - 1].label, type: w.typeStr2Type(c[f - 1].typeStr), directions: c[f - 1].directions, widthInColumns: parseInt(c[f], 10) };
220
+ break;
221
+ case 25:
222
+ w.getLogger().debug("Rule: nodeStatement (node) ", c[f]), this.$ = { id: c[f].id, label: c[f].label, type: w.typeStr2Type(c[f].typeStr), directions: c[f].directions, widthInColumns: 1 };
223
+ break;
224
+ case 26:
225
+ w.getLogger().debug("APA123", this ? this : "na"), w.getLogger().debug("COLUMNS: ", c[f]), this.$ = { type: "column-setting", columns: c[f] === "auto" ? -1 : parseInt(c[f]) };
226
+ break;
227
+ case 27:
228
+ w.getLogger().debug("Rule: id-block statement : ", c[f - 2], c[f - 1]), w.generateId(), this.$ = { ...c[f - 2], type: "composite", children: c[f - 1] };
229
+ break;
230
+ case 28:
231
+ w.getLogger().debug("Rule: blockStatement : ", c[f - 2], c[f - 1], c[f]);
232
+ const W = w.generateId();
233
+ this.$ = { id: W, type: "composite", label: "", children: c[f - 1] };
234
+ break;
235
+ case 29:
236
+ w.getLogger().debug("Rule: node (NODE_ID separator): ", c[f]), this.$ = { id: c[f] };
237
+ break;
238
+ case 30:
239
+ w.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", c[f - 1], c[f]), this.$ = { id: c[f - 1], label: c[f].label, typeStr: c[f].typeStr, directions: c[f].directions };
240
+ break;
241
+ case 31:
242
+ w.getLogger().debug("Rule: dirList: ", c[f]), this.$ = [c[f]];
243
+ break;
244
+ case 32:
245
+ w.getLogger().debug("Rule: dirList: ", c[f - 1], c[f]), this.$ = [c[f - 1]].concat(c[f]);
246
+ break;
247
+ case 33:
248
+ w.getLogger().debug("Rule: nodeShapeNLabel: ", c[f - 2], c[f - 1], c[f]), this.$ = { typeStr: c[f - 2] + c[f], label: c[f - 1] };
249
+ break;
250
+ case 34:
251
+ w.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", c[f - 3], c[f - 2], " #3:", c[f - 1], c[f]), this.$ = { typeStr: c[f - 3] + c[f], label: c[f - 2], directions: c[f - 1] };
252
+ break;
253
+ case 35:
254
+ case 36:
255
+ this.$ = { type: "classDef", id: c[f - 1].trim(), css: c[f].trim() };
256
+ break;
257
+ case 37:
258
+ this.$ = { type: "applyClass", id: c[f - 1].trim(), styleClass: c[f].trim() };
259
+ break;
260
+ case 38:
261
+ this.$ = { type: "applyStyles", id: c[f - 1].trim(), stylesStr: c[f].trim() };
262
+ break;
263
+ }
264
+ }, "anonymous"),
265
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 10: t, 11: 3, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: s, 39: r, 43: n, 46: o }, { 8: [1, 20] }, e(d, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 10: t, 21: a, 28: i, 29: l, 31: s, 39: r, 43: n, 46: o }), e(h, [2, 16], { 14: 22, 15: x, 16: b }), e(h, [2, 17]), e(h, [2, 18]), e(h, [2, 19]), e(h, [2, 20]), e(h, [2, 21]), e(h, [2, 22]), e(m, [2, 25], { 27: [1, 25] }), e(h, [2, 26]), { 19: 26, 26: 12, 31: s }, { 10: t, 11: 27, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: s, 39: r, 43: n, 46: o }, { 40: [1, 28], 42: [1, 29] }, { 44: [1, 30] }, { 47: [1, 31] }, e(S, [2, 29], { 32: 32, 35: [1, 33], 37: [1, 34] }), { 1: [2, 7] }, e(d, [2, 13]), { 26: 35, 31: s }, { 31: [2, 14] }, { 17: [1, 36] }, e(m, [2, 24]), { 10: t, 11: 37, 13: 4, 14: 22, 15: x, 16: b, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: s, 39: r, 43: n, 46: o }, { 30: [1, 38] }, { 41: [1, 39] }, { 41: [1, 40] }, { 45: [1, 41] }, { 48: [1, 42] }, e(S, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(m, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(h, [2, 28]), e(h, [2, 35]), e(h, [2, 36]), e(h, [2, 37]), e(h, [2, 38]), { 36: [1, 47] }, { 33: 48, 34: k }, { 15: [1, 50] }, e(h, [2, 27]), e(S, [2, 33]), { 38: [1, 51] }, { 33: 52, 34: k, 38: [2, 31] }, { 31: [2, 15] }, e(S, [2, 34]), { 38: [2, 32] }],
266
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
267
+ parseError: /* @__PURE__ */ g(function(y, u) {
268
+ if (u.recoverable)
269
+ this.trace(y);
270
+ else {
271
+ var p = new Error(y);
272
+ throw p.hash = u, p;
273
+ }
274
+ }, "parseError"),
275
+ parse: /* @__PURE__ */ g(function(y) {
276
+ var u = this, p = [0], w = [], v = [null], c = [], _ = this.table, f = "", M = 0, A = 0, H = 2, W = 1, J = c.slice.call(arguments, 1), j = Object.create(this.lexer), Q = { yy: {} };
277
+ for (var yt in this.yy)
278
+ Object.prototype.hasOwnProperty.call(this.yy, yt) && (Q.yy[yt] = this.yy[yt]);
279
+ j.setInput(y, Q.yy), Q.yy.lexer = j, Q.yy.parser = this, typeof j.yylloc > "u" && (j.yylloc = {});
280
+ var xt = j.yylloc;
281
+ c.push(xt);
282
+ var De = j.options && j.options.ranges;
283
+ typeof Q.yy.parseError == "function" ? this.parseError = Q.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
284
+ function Ne(K) {
285
+ p.length = p.length - 2 * K, v.length = v.length - K, c.length = c.length - K;
286
+ }
287
+ g(Ne, "popStack");
288
+ function Ot() {
289
+ var K;
290
+ return K = w.pop() || j.lex() || W, typeof K != "number" && (K instanceof Array && (w = K, K = w.pop()), K = u.symbols_[K] || K), K;
291
+ }
292
+ g(Ot, "lex");
293
+ for (var Y, tt, X, bt, et = {}, nt, q, At, lt; ; ) {
294
+ if (tt = p[p.length - 1], this.defaultActions[tt] ? X = this.defaultActions[tt] : ((Y === null || typeof Y > "u") && (Y = Ot()), X = _[tt] && _[tt][Y]), typeof X > "u" || !X.length || !X[0]) {
295
+ var wt = "";
296
+ lt = [];
297
+ for (nt in _[tt])
298
+ this.terminals_[nt] && nt > H && lt.push("'" + this.terminals_[nt] + "'");
299
+ j.showPosition ? wt = "Parse error on line " + (M + 1) + `:
300
+ ` + j.showPosition() + `
301
+ Expecting ` + lt.join(", ") + ", got '" + (this.terminals_[Y] || Y) + "'" : wt = "Parse error on line " + (M + 1) + ": Unexpected " + (Y == W ? "end of input" : "'" + (this.terminals_[Y] || Y) + "'"), this.parseError(wt, {
302
+ text: j.match,
303
+ token: this.terminals_[Y] || Y,
304
+ line: j.yylineno,
305
+ loc: xt,
306
+ expected: lt
307
+ });
308
+ }
309
+ if (X[0] instanceof Array && X.length > 1)
310
+ throw new Error("Parse Error: multiple actions possible at state: " + tt + ", token: " + Y);
311
+ switch (X[0]) {
312
+ case 1:
313
+ p.push(Y), v.push(j.yytext), c.push(j.yylloc), p.push(X[1]), Y = null, A = j.yyleng, f = j.yytext, M = j.yylineno, xt = j.yylloc;
314
+ break;
315
+ case 2:
316
+ if (q = this.productions_[X[1]][1], et.$ = v[v.length - q], et._$ = {
317
+ first_line: c[c.length - (q || 1)].first_line,
318
+ last_line: c[c.length - 1].last_line,
319
+ first_column: c[c.length - (q || 1)].first_column,
320
+ last_column: c[c.length - 1].last_column
321
+ }, De && (et._$.range = [
322
+ c[c.length - (q || 1)].range[0],
323
+ c[c.length - 1].range[1]
324
+ ]), bt = this.performAction.apply(et, [
325
+ f,
326
+ A,
327
+ M,
328
+ Q.yy,
329
+ X[1],
330
+ v,
331
+ c
332
+ ].concat(J)), typeof bt < "u")
333
+ return bt;
334
+ q && (p = p.slice(0, -1 * q * 2), v = v.slice(0, -1 * q), c = c.slice(0, -1 * q)), p.push(this.productions_[X[1]][0]), v.push(et.$), c.push(et._$), At = _[p[p.length - 2]][p[p.length - 1]], p.push(At);
335
+ break;
336
+ case 3:
337
+ return !0;
338
+ }
339
+ }
340
+ return !0;
341
+ }, "parse")
342
+ }, N = /* @__PURE__ */ function() {
343
+ var D = {
344
+ EOF: 1,
345
+ parseError: /* @__PURE__ */ g(function(u, p) {
346
+ if (this.yy.parser)
347
+ this.yy.parser.parseError(u, p);
348
+ else
349
+ throw new Error(u);
350
+ }, "parseError"),
351
+ // resets the lexer, sets new input
352
+ setInput: /* @__PURE__ */ g(function(y, u) {
353
+ return this.yy = u || this.yy || {}, this._input = y, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
354
+ first_line: 1,
355
+ first_column: 0,
356
+ last_line: 1,
357
+ last_column: 0
358
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
359
+ }, "setInput"),
360
+ // consumes and returns one char from the input
361
+ input: /* @__PURE__ */ g(function() {
362
+ var y = this._input[0];
363
+ this.yytext += y, this.yyleng++, this.offset++, this.match += y, this.matched += y;
364
+ var u = y.match(/(?:\r\n?|\n).*/g);
365
+ return u ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), y;
366
+ }, "input"),
367
+ // unshifts one char (or a string) into the input
368
+ unput: /* @__PURE__ */ g(function(y) {
369
+ var u = y.length, p = y.split(/(?:\r\n?|\n)/g);
370
+ this._input = y + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - u), this.offset -= u;
371
+ var w = this.match.split(/(?:\r\n?|\n)/g);
372
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), p.length - 1 && (this.yylineno -= p.length - 1);
373
+ var v = this.yylloc.range;
374
+ return this.yylloc = {
375
+ first_line: this.yylloc.first_line,
376
+ last_line: this.yylineno + 1,
377
+ first_column: this.yylloc.first_column,
378
+ last_column: p ? (p.length === w.length ? this.yylloc.first_column : 0) + w[w.length - p.length].length - p[0].length : this.yylloc.first_column - u
379
+ }, this.options.ranges && (this.yylloc.range = [v[0], v[0] + this.yyleng - u]), this.yyleng = this.yytext.length, this;
380
+ }, "unput"),
381
+ // When called from action, caches matched text and appends it on next action
382
+ more: /* @__PURE__ */ g(function() {
383
+ return this._more = !0, this;
384
+ }, "more"),
385
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
386
+ reject: /* @__PURE__ */ g(function() {
387
+ if (this.options.backtrack_lexer)
388
+ this._backtrack = !0;
389
+ else
390
+ 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).
391
+ ` + this.showPosition(), {
392
+ text: "",
393
+ token: null,
394
+ line: this.yylineno
395
+ });
396
+ return this;
397
+ }, "reject"),
398
+ // retain first n characters of the match
399
+ less: /* @__PURE__ */ g(function(y) {
400
+ this.unput(this.match.slice(y));
401
+ }, "less"),
402
+ // displays already matched input, i.e. for error messages
403
+ pastInput: /* @__PURE__ */ g(function() {
404
+ var y = this.matched.substr(0, this.matched.length - this.match.length);
405
+ return (y.length > 20 ? "..." : "") + y.substr(-20).replace(/\n/g, "");
406
+ }, "pastInput"),
407
+ // displays upcoming input, i.e. for error messages
408
+ upcomingInput: /* @__PURE__ */ g(function() {
409
+ var y = this.match;
410
+ return y.length < 20 && (y += this._input.substr(0, 20 - y.length)), (y.substr(0, 20) + (y.length > 20 ? "..." : "")).replace(/\n/g, "");
411
+ }, "upcomingInput"),
412
+ // displays the character position where the lexing error occurred, i.e. for error messages
413
+ showPosition: /* @__PURE__ */ g(function() {
414
+ var y = this.pastInput(), u = new Array(y.length + 1).join("-");
415
+ return y + this.upcomingInput() + `
416
+ ` + u + "^";
417
+ }, "showPosition"),
418
+ // test the lexed token: return FALSE when not a match, otherwise return token
419
+ test_match: /* @__PURE__ */ g(function(y, u) {
420
+ var p, w, v;
421
+ if (this.options.backtrack_lexer && (v = {
422
+ yylineno: this.yylineno,
423
+ yylloc: {
424
+ first_line: this.yylloc.first_line,
425
+ last_line: this.last_line,
426
+ first_column: this.yylloc.first_column,
427
+ last_column: this.yylloc.last_column
428
+ },
429
+ yytext: this.yytext,
430
+ match: this.match,
431
+ matches: this.matches,
432
+ matched: this.matched,
433
+ yyleng: this.yyleng,
434
+ offset: this.offset,
435
+ _more: this._more,
436
+ _input: this._input,
437
+ yy: this.yy,
438
+ conditionStack: this.conditionStack.slice(0),
439
+ done: this.done
440
+ }, this.options.ranges && (v.yylloc.range = this.yylloc.range.slice(0))), w = y[0].match(/(?:\r\n?|\n).*/g), w && (this.yylineno += w.length), this.yylloc = {
441
+ first_line: this.yylloc.last_line,
442
+ last_line: this.yylineno + 1,
443
+ first_column: this.yylloc.last_column,
444
+ last_column: w ? w[w.length - 1].length - w[w.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + y[0].length
445
+ }, this.yytext += y[0], this.match += y[0], this.matches = y, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(y[0].length), this.matched += y[0], p = this.performAction.call(this, this.yy, this, u, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), p)
446
+ return p;
447
+ if (this._backtrack) {
448
+ for (var c in v)
449
+ this[c] = v[c];
450
+ return !1;
451
+ }
452
+ return !1;
453
+ }, "test_match"),
454
+ // return next match in input
455
+ next: /* @__PURE__ */ g(function() {
456
+ if (this.done)
457
+ return this.EOF;
458
+ this._input || (this.done = !0);
459
+ var y, u, p, w;
460
+ this._more || (this.yytext = "", this.match = "");
461
+ for (var v = this._currentRules(), c = 0; c < v.length; c++)
462
+ if (p = this._input.match(this.rules[v[c]]), p && (!u || p[0].length > u[0].length)) {
463
+ if (u = p, w = c, this.options.backtrack_lexer) {
464
+ if (y = this.test_match(p, v[c]), y !== !1)
465
+ return y;
466
+ if (this._backtrack) {
467
+ u = !1;
468
+ continue;
469
+ } else
470
+ return !1;
471
+ } else if (!this.options.flex)
472
+ break;
473
+ }
474
+ return u ? (y = this.test_match(u, v[w]), y !== !1 ? y : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
475
+ ` + this.showPosition(), {
476
+ text: "",
477
+ token: null,
478
+ line: this.yylineno
479
+ });
480
+ }, "next"),
481
+ // return next match that has a token
482
+ lex: /* @__PURE__ */ g(function() {
483
+ var u = this.next();
484
+ return u || this.lex();
485
+ }, "lex"),
486
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
487
+ begin: /* @__PURE__ */ g(function(u) {
488
+ this.conditionStack.push(u);
489
+ }, "begin"),
490
+ // pop the previously active lexer condition state off the condition stack
491
+ popState: /* @__PURE__ */ g(function() {
492
+ var u = this.conditionStack.length - 1;
493
+ return u > 0 ? this.conditionStack.pop() : this.conditionStack[0];
494
+ }, "popState"),
495
+ // produce the lexer rule set which is active for the currently active lexer condition state
496
+ _currentRules: /* @__PURE__ */ g(function() {
497
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
498
+ }, "_currentRules"),
499
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
500
+ topState: /* @__PURE__ */ g(function(u) {
501
+ return u = this.conditionStack.length - 1 - Math.abs(u || 0), u >= 0 ? this.conditionStack[u] : "INITIAL";
502
+ }, "topState"),
503
+ // alias for begin(condition)
504
+ pushState: /* @__PURE__ */ g(function(u) {
505
+ this.begin(u);
506
+ }, "pushState"),
507
+ // return the number of states currently on the stack
508
+ stateStackSize: /* @__PURE__ */ g(function() {
509
+ return this.conditionStack.length;
510
+ }, "stateStackSize"),
511
+ options: {},
512
+ performAction: /* @__PURE__ */ g(function(u, p, w, v) {
513
+ switch (w) {
514
+ case 0:
515
+ return u.getLogger().debug("Found block-beta"), 10;
516
+ case 1:
517
+ return u.getLogger().debug("Found id-block"), 29;
518
+ case 2:
519
+ return u.getLogger().debug("Found block"), 10;
520
+ case 3:
521
+ u.getLogger().debug(".", p.yytext);
522
+ break;
523
+ case 4:
524
+ u.getLogger().debug("_", p.yytext);
525
+ break;
526
+ case 5:
527
+ return 5;
528
+ case 6:
529
+ return p.yytext = -1, 28;
530
+ case 7:
531
+ return p.yytext = p.yytext.replace(/columns\s+/, ""), u.getLogger().debug("COLUMNS (LEX)", p.yytext), 28;
532
+ case 8:
533
+ this.pushState("md_string");
534
+ break;
535
+ case 9:
536
+ return "MD_STR";
537
+ case 10:
538
+ this.popState();
539
+ break;
540
+ case 11:
541
+ this.pushState("string");
542
+ break;
543
+ case 12:
544
+ u.getLogger().debug("LEX: POPPING STR:", p.yytext), this.popState();
545
+ break;
546
+ case 13:
547
+ return u.getLogger().debug("LEX: STR end:", p.yytext), "STR";
548
+ case 14:
549
+ return p.yytext = p.yytext.replace(/space\:/, ""), u.getLogger().debug("SPACE NUM (LEX)", p.yytext), 21;
550
+ case 15:
551
+ return p.yytext = "1", u.getLogger().debug("COLUMNS (LEX)", p.yytext), 21;
552
+ case 16:
553
+ return 42;
554
+ case 17:
555
+ return "LINKSTYLE";
556
+ case 18:
557
+ return "INTERPOLATE";
558
+ case 19:
559
+ return this.pushState("CLASSDEF"), 39;
560
+ case 20:
561
+ return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
562
+ case 21:
563
+ return this.popState(), this.pushState("CLASSDEFID"), 40;
564
+ case 22:
565
+ return this.popState(), 41;
566
+ case 23:
567
+ return this.pushState("CLASS"), 43;
568
+ case 24:
569
+ return this.popState(), this.pushState("CLASS_STYLE"), 44;
570
+ case 25:
571
+ return this.popState(), 45;
572
+ case 26:
573
+ return this.pushState("STYLE_STMNT"), 46;
574
+ case 27:
575
+ return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
576
+ case 28:
577
+ return this.popState(), 48;
578
+ case 29:
579
+ return this.pushState("acc_title"), "acc_title";
580
+ case 30:
581
+ return this.popState(), "acc_title_value";
582
+ case 31:
583
+ return this.pushState("acc_descr"), "acc_descr";
584
+ case 32:
585
+ return this.popState(), "acc_descr_value";
586
+ case 33:
587
+ this.pushState("acc_descr_multiline");
588
+ break;
589
+ case 34:
590
+ this.popState();
591
+ break;
592
+ case 35:
593
+ return "acc_descr_multiline_value";
594
+ case 36:
595
+ return 30;
596
+ case 37:
597
+ return this.popState(), u.getLogger().debug("Lex: (("), "NODE_DEND";
598
+ case 38:
599
+ return this.popState(), u.getLogger().debug("Lex: (("), "NODE_DEND";
600
+ case 39:
601
+ return this.popState(), u.getLogger().debug("Lex: ))"), "NODE_DEND";
602
+ case 40:
603
+ return this.popState(), u.getLogger().debug("Lex: (("), "NODE_DEND";
604
+ case 41:
605
+ return this.popState(), u.getLogger().debug("Lex: (("), "NODE_DEND";
606
+ case 42:
607
+ return this.popState(), u.getLogger().debug("Lex: (-"), "NODE_DEND";
608
+ case 43:
609
+ return this.popState(), u.getLogger().debug("Lex: -)"), "NODE_DEND";
610
+ case 44:
611
+ return this.popState(), u.getLogger().debug("Lex: (("), "NODE_DEND";
612
+ case 45:
613
+ return this.popState(), u.getLogger().debug("Lex: ]]"), "NODE_DEND";
614
+ case 46:
615
+ return this.popState(), u.getLogger().debug("Lex: ("), "NODE_DEND";
616
+ case 47:
617
+ return this.popState(), u.getLogger().debug("Lex: ])"), "NODE_DEND";
618
+ case 48:
619
+ return this.popState(), u.getLogger().debug("Lex: /]"), "NODE_DEND";
620
+ case 49:
621
+ return this.popState(), u.getLogger().debug("Lex: /]"), "NODE_DEND";
622
+ case 50:
623
+ return this.popState(), u.getLogger().debug("Lex: )]"), "NODE_DEND";
624
+ case 51:
625
+ return this.popState(), u.getLogger().debug("Lex: )"), "NODE_DEND";
626
+ case 52:
627
+ return this.popState(), u.getLogger().debug("Lex: ]>"), "NODE_DEND";
628
+ case 53:
629
+ return this.popState(), u.getLogger().debug("Lex: ]"), "NODE_DEND";
630
+ case 54:
631
+ return u.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
632
+ case 55:
633
+ return u.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
634
+ case 56:
635
+ return u.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
636
+ case 57:
637
+ return u.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
638
+ case 58:
639
+ return u.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
640
+ case 59:
641
+ return u.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
642
+ case 60:
643
+ return u.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
644
+ case 61:
645
+ return u.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
646
+ case 62:
647
+ return u.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
648
+ case 63:
649
+ return u.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
650
+ case 64:
651
+ return u.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
652
+ case 65:
653
+ return this.pushState("NODE"), 35;
654
+ case 66:
655
+ return this.pushState("NODE"), 35;
656
+ case 67:
657
+ return this.pushState("NODE"), 35;
658
+ case 68:
659
+ return this.pushState("NODE"), 35;
660
+ case 69:
661
+ return this.pushState("NODE"), 35;
662
+ case 70:
663
+ return this.pushState("NODE"), 35;
664
+ case 71:
665
+ return this.pushState("NODE"), 35;
666
+ case 72:
667
+ return u.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
668
+ case 73:
669
+ return this.pushState("BLOCK_ARROW"), u.getLogger().debug("LEX ARR START"), 37;
670
+ case 74:
671
+ return u.getLogger().debug("Lex: NODE_ID", p.yytext), 31;
672
+ case 75:
673
+ return u.getLogger().debug("Lex: EOF", p.yytext), 8;
674
+ case 76:
675
+ this.pushState("md_string");
676
+ break;
677
+ case 77:
678
+ this.pushState("md_string");
679
+ break;
680
+ case 78:
681
+ return "NODE_DESCR";
682
+ case 79:
683
+ this.popState();
684
+ break;
685
+ case 80:
686
+ u.getLogger().debug("Lex: Starting string"), this.pushState("string");
687
+ break;
688
+ case 81:
689
+ u.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
690
+ break;
691
+ case 82:
692
+ return u.getLogger().debug("LEX: NODE_DESCR:", p.yytext), "NODE_DESCR";
693
+ case 83:
694
+ u.getLogger().debug("LEX POPPING"), this.popState();
695
+ break;
696
+ case 84:
697
+ u.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
698
+ break;
699
+ case 85:
700
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (right): dir:", p.yytext), "DIR";
701
+ case 86:
702
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (left):", p.yytext), "DIR";
703
+ case 87:
704
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (x):", p.yytext), "DIR";
705
+ case 88:
706
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (y):", p.yytext), "DIR";
707
+ case 89:
708
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (up):", p.yytext), "DIR";
709
+ case 90:
710
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), u.getLogger().debug("Lex (down):", p.yytext), "DIR";
711
+ case 91:
712
+ return p.yytext = "]>", u.getLogger().debug("Lex (ARROW_DIR end):", p.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
713
+ case 92:
714
+ return u.getLogger().debug("Lex: LINK", "#" + p.yytext + "#"), 15;
715
+ case 93:
716
+ return u.getLogger().debug("Lex: LINK", p.yytext), 15;
717
+ case 94:
718
+ return u.getLogger().debug("Lex: LINK", p.yytext), 15;
719
+ case 95:
720
+ return u.getLogger().debug("Lex: LINK", p.yytext), 15;
721
+ case 96:
722
+ return u.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
723
+ case 97:
724
+ return u.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
725
+ case 98:
726
+ return u.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
727
+ case 99:
728
+ this.pushState("md_string");
729
+ break;
730
+ case 100:
731
+ return u.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
732
+ case 101:
733
+ return this.popState(), u.getLogger().debug("Lex: LINK", "#" + p.yytext + "#"), 15;
734
+ case 102:
735
+ return this.popState(), u.getLogger().debug("Lex: LINK", p.yytext), 15;
736
+ case 103:
737
+ return this.popState(), u.getLogger().debug("Lex: LINK", p.yytext), 15;
738
+ case 104:
739
+ return u.getLogger().debug("Lex: COLON", p.yytext), p.yytext = p.yytext.slice(1), 27;
740
+ }
741
+ }, "anonymous"),
742
+ rules: [/^(?:block-beta\b)/, /^(?:block:)/, /^(?:block\b)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
743
+ conditions: { STYLE_DEFINITION: { rules: [28], inclusive: !1 }, STYLE_STMNT: { rules: [27], inclusive: !1 }, CLASSDEFID: { rules: [22], inclusive: !1 }, CLASSDEF: { rules: [20, 21], inclusive: !1 }, CLASS_STYLE: { rules: [25], inclusive: !1 }, CLASS: { rules: [24], inclusive: !1 }, LLABEL: { rules: [99, 100, 101, 102, 103], inclusive: !1 }, ARROW_DIR: { rules: [85, 86, 87, 88, 89, 90, 91], inclusive: !1 }, BLOCK_ARROW: { rules: [76, 81, 84], inclusive: !1 }, NODE: { rules: [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 77, 80], inclusive: !1 }, md_string: { rules: [9, 10, 78, 79], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [12, 13, 82, 83], inclusive: !1 }, acc_descr_multiline: { rules: [34, 35], inclusive: !1 }, acc_descr: { rules: [32], inclusive: !1 }, acc_title: { rules: [30], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 23, 26, 29, 31, 33, 36, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 92, 93, 94, 95, 96, 97, 98, 104], inclusive: !0 } }
744
+ };
745
+ return D;
746
+ }();
747
+ E.lexer = N;
748
+ function T() {
749
+ this.yy = {};
750
+ }
751
+ return g(T, "Parser"), T.prototype = E, E.Parser = T, new T();
752
+ }();
753
+ St.parser = St;
754
+ var xa = St, G = /* @__PURE__ */ new Map(), Dt = [], vt = /* @__PURE__ */ new Map(), Wt = "color", Yt = "fill", ba = "bgFill", ce = ",", wa = z(), ut = /* @__PURE__ */ new Map(), ma = /* @__PURE__ */ g((e) => qe.sanitizeText(e, wa), "sanitizeText"), La = /* @__PURE__ */ g(function(e, t = "") {
755
+ let a = ut.get(e);
756
+ a || (a = { id: e, styles: [], textStyles: [] }, ut.set(e, a)), t != null && t.split(ce).forEach((i) => {
757
+ const l = i.replace(/([^;]*);/, "$1").trim();
758
+ if (RegExp(Wt).exec(i)) {
759
+ const r = l.replace(Yt, ba).replace(Wt, Yt);
760
+ a.textStyles.push(r);
761
+ }
762
+ a.styles.push(l);
763
+ });
764
+ }, "addStyleClass"), Sa = /* @__PURE__ */ g(function(e, t = "") {
765
+ const a = G.get(e);
766
+ t != null && (a.styles = t.split(ce));
767
+ }, "addStyle2Node"), va = /* @__PURE__ */ g(function(e, t) {
768
+ e.split(",").forEach(function(a) {
769
+ let i = G.get(a);
770
+ if (i === void 0) {
771
+ const l = a.trim();
772
+ i = { id: l, type: "na", children: [] }, G.set(l, i);
773
+ }
774
+ i.classes || (i.classes = []), i.classes.push(t);
775
+ });
776
+ }, "setCssClass"), oe = /* @__PURE__ */ g((e, t) => {
777
+ const a = e.flat(), i = [], l = a.find((r) => (r == null ? void 0 : r.type) === "column-setting"), s = (l == null ? void 0 : l.columns) ?? -1;
778
+ for (const r of a) {
779
+ if (typeof s == "number" && s > 0 && r.type !== "column-setting" && typeof r.widthInColumns == "number" && r.widthInColumns > s && L.warn(
780
+ `Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${s}`
781
+ ), r.label && (r.label = ma(r.label)), r.type === "classDef") {
782
+ La(r.id, r.css);
783
+ continue;
784
+ }
785
+ if (r.type === "applyClass") {
786
+ va(r.id, (r == null ? void 0 : r.styleClass) ?? "");
787
+ continue;
788
+ }
789
+ if (r.type === "applyStyles") {
790
+ r != null && r.stylesStr && Sa(r.id, r == null ? void 0 : r.stylesStr);
791
+ continue;
792
+ }
793
+ if (r.type === "column-setting")
794
+ t.columns = r.columns ?? -1;
795
+ else if (r.type === "edge") {
796
+ const n = (vt.get(r.id) ?? 0) + 1;
797
+ vt.set(r.id, n), r.id = n + "-" + r.id, Dt.push(r);
798
+ } else {
799
+ r.label || (r.type === "composite" ? r.label = "" : r.label = r.id);
800
+ const n = G.get(r.id);
801
+ if (n === void 0 ? G.set(r.id, r) : (r.type !== "na" && (n.type = r.type), r.label !== r.id && (n.label = r.label)), r.children && oe(r.children, r), r.type === "space") {
802
+ const o = r.width ?? 1;
803
+ for (let d = 0; d < o; d++) {
804
+ const h = ya(r);
805
+ h.id = h.id + "-" + d, G.set(h.id, h), i.push(h);
806
+ }
807
+ } else
808
+ n === void 0 && i.push(r);
809
+ }
810
+ }
811
+ t.children = i;
812
+ }, "populateBlockDatabase"), Nt = [], st = { id: "root", type: "composite", children: [], columns: -1 }, Ea = /* @__PURE__ */ g(() => {
813
+ L.debug("Clear called"), Ue(), st = { id: "root", type: "composite", children: [], columns: -1 }, G = /* @__PURE__ */ new Map([["root", st]]), Nt = [], ut = /* @__PURE__ */ new Map(), Dt = [], vt = /* @__PURE__ */ new Map();
814
+ }, "clear");
815
+ function he(e) {
816
+ switch (L.debug("typeStr2Type", e), e) {
817
+ case "[]":
818
+ return "square";
819
+ case "()":
820
+ return L.debug("we have a round"), "round";
821
+ case "(())":
822
+ return "circle";
823
+ case ">]":
824
+ return "rect_left_inv_arrow";
825
+ case "{}":
826
+ return "diamond";
827
+ case "{{}}":
828
+ return "hexagon";
829
+ case "([])":
830
+ return "stadium";
831
+ case "[[]]":
832
+ return "subroutine";
833
+ case "[()]":
834
+ return "cylinder";
835
+ case "((()))":
836
+ return "doublecircle";
837
+ case "[//]":
838
+ return "lean_right";
839
+ case "[\\\\]":
840
+ return "lean_left";
841
+ case "[/\\]":
842
+ return "trapezoid";
843
+ case "[\\/]":
844
+ return "inv_trapezoid";
845
+ case "<[]>":
846
+ return "block_arrow";
847
+ default:
848
+ return "na";
849
+ }
850
+ }
851
+ g(he, "typeStr2Type");
852
+ function ge(e) {
853
+ switch (L.debug("typeStr2Type", e), e) {
854
+ case "==":
855
+ return "thick";
856
+ default:
857
+ return "normal";
858
+ }
859
+ }
860
+ g(ge, "edgeTypeStr2Type");
861
+ function ue(e) {
862
+ switch (e.replace(/^[\s-]+|[\s-]+$/g, "")) {
863
+ case "x":
864
+ return "arrow_cross";
865
+ case "o":
866
+ return "arrow_circle";
867
+ case ">":
868
+ return "arrow_point";
869
+ default:
870
+ return "";
871
+ }
872
+ }
873
+ g(ue, "edgeStrToEdgeData");
874
+ var Kt = 0, _a = /* @__PURE__ */ g(() => (Kt++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + Kt), "generateId"), ka = /* @__PURE__ */ g((e) => {
875
+ st.children = e, oe(e, st), Nt = st.children;
876
+ }, "setHierarchy"), Ta = /* @__PURE__ */ g((e) => {
877
+ const t = G.get(e);
878
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
879
+ }, "getColumns"), Da = /* @__PURE__ */ g(() => [...G.values()], "getBlocksFlat"), Na = /* @__PURE__ */ g(() => Nt || [], "getBlocks"), Ca = /* @__PURE__ */ g(() => Dt, "getEdges"), Ia = /* @__PURE__ */ g((e) => G.get(e), "getBlock"), Ba = /* @__PURE__ */ g((e) => {
880
+ G.set(e.id, e);
881
+ }, "setBlock"), Oa = /* @__PURE__ */ g(() => L, "getLogger"), Aa = /* @__PURE__ */ g(function() {
882
+ return ut;
883
+ }, "getClasses"), Ra = {
884
+ getConfig: /* @__PURE__ */ g(() => it().block, "getConfig"),
885
+ typeStr2Type: he,
886
+ edgeTypeStr2Type: ge,
887
+ edgeStrToEdgeData: ue,
888
+ getLogger: Oa,
889
+ getBlocksFlat: Da,
890
+ getBlocks: Na,
891
+ getEdges: Ca,
892
+ setHierarchy: ka,
893
+ getBlock: Ia,
894
+ setBlock: Ba,
895
+ getColumns: Ta,
896
+ getClasses: Aa,
897
+ clear: Ea,
898
+ generateId: _a
899
+ }, za = Ra, ct = /* @__PURE__ */ g((e, t) => {
900
+ const a = er, i = a(e, "r"), l = a(e, "g"), s = a(e, "b");
901
+ return He(i, l, s, t);
902
+ }, "fade"), Ma = /* @__PURE__ */ g((e) => `.label {
903
+ font-family: ${e.fontFamily};
904
+ color: ${e.nodeTextColor || e.textColor};
905
+ }
906
+ .cluster-label text {
907
+ fill: ${e.titleColor};
908
+ }
909
+ .cluster-label span,p {
910
+ color: ${e.titleColor};
911
+ }
912
+
913
+
914
+
915
+ .label text,span,p {
916
+ fill: ${e.nodeTextColor || e.textColor};
917
+ color: ${e.nodeTextColor || e.textColor};
918
+ }
919
+
920
+ .node rect,
921
+ .node circle,
922
+ .node ellipse,
923
+ .node polygon,
924
+ .node path {
925
+ fill: ${e.mainBkg};
926
+ stroke: ${e.nodeBorder};
927
+ stroke-width: 1px;
928
+ }
929
+ .flowchart-label text {
930
+ text-anchor: middle;
931
+ }
932
+ // .flowchart-label .text-outer-tspan {
933
+ // text-anchor: middle;
934
+ // }
935
+ // .flowchart-label .text-inner-tspan {
936
+ // text-anchor: start;
937
+ // }
938
+
939
+ .node .label {
940
+ text-align: center;
941
+ }
942
+ .node.clickable {
943
+ cursor: pointer;
944
+ }
945
+
946
+ .arrowheadPath {
947
+ fill: ${e.arrowheadColor};
948
+ }
949
+
950
+ .edgePath .path {
951
+ stroke: ${e.lineColor};
952
+ stroke-width: 2.0px;
953
+ }
954
+
955
+ .flowchart-link {
956
+ stroke: ${e.lineColor};
957
+ fill: none;
958
+ }
959
+
960
+ .edgeLabel {
961
+ background-color: ${e.edgeLabelBackground};
962
+ rect {
963
+ opacity: 0.5;
964
+ background-color: ${e.edgeLabelBackground};
965
+ fill: ${e.edgeLabelBackground};
966
+ }
967
+ text-align: center;
968
+ }
969
+
970
+ /* For html labels only */
971
+ .labelBkg {
972
+ background-color: ${ct(e.edgeLabelBackground, 0.5)};
973
+ // background-color:
974
+ }
975
+
976
+ .node .cluster {
977
+ // fill: ${ct(e.mainBkg, 0.5)};
978
+ fill: ${ct(e.clusterBkg, 0.5)};
979
+ stroke: ${ct(e.clusterBorder, 0.2)};
980
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
981
+ stroke-width: 1px;
982
+ }
983
+
984
+ .cluster text {
985
+ fill: ${e.titleColor};
986
+ }
987
+
988
+ .cluster span,p {
989
+ color: ${e.titleColor};
990
+ }
991
+ /* .cluster div {
992
+ color: ${e.titleColor};
993
+ } */
994
+
995
+ div.mermaidTooltip {
996
+ position: absolute;
997
+ text-align: center;
998
+ max-width: 200px;
999
+ padding: 2px;
1000
+ font-family: ${e.fontFamily};
1001
+ font-size: 12px;
1002
+ background: ${e.tertiaryColor};
1003
+ border: 1px solid ${e.border2};
1004
+ border-radius: 2px;
1005
+ pointer-events: none;
1006
+ z-index: 100;
1007
+ }
1008
+
1009
+ .flowchartTitleText {
1010
+ text-anchor: middle;
1011
+ font-size: 18px;
1012
+ fill: ${e.textColor};
1013
+ }
1014
+ ${Ce()}
1015
+ `, "getStyles"), ja = Ma, Fa = /* @__PURE__ */ g((e, t, a, i) => {
1016
+ t.forEach((l) => {
1017
+ $a[l](e, a, i);
1018
+ });
1019
+ }, "insertMarkers"), Pa = /* @__PURE__ */ g((e, t, a) => {
1020
+ L.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
1021
+ }, "extension"), Wa = /* @__PURE__ */ g((e, t, a) => {
1022
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
1023
+ }, "composition"), Ya = /* @__PURE__ */ g((e, t, a) => {
1024
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
1025
+ }, "aggregation"), Ka = /* @__PURE__ */ g((e, t, a) => {
1026
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1027
+ }, "dependency"), Ua = /* @__PURE__ */ g((e, t, a) => {
1028
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
1029
+ }, "lollipop"), Ha = /* @__PURE__ */ g((e, t, a) => {
1030
+ e.append("marker").attr("id", a + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
1031
+ }, "point"), Xa = /* @__PURE__ */ g((e, t, a) => {
1032
+ e.append("marker").attr("id", a + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
1033
+ }, "circle"), Va = /* @__PURE__ */ g((e, t, a) => {
1034
+ e.append("marker").attr("id", a + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
1035
+ }, "cross"), Ga = /* @__PURE__ */ g((e, t, a) => {
1036
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
1037
+ }, "barb"), $a = {
1038
+ extension: Pa,
1039
+ composition: Wa,
1040
+ aggregation: Ya,
1041
+ dependency: Ka,
1042
+ lollipop: Ua,
1043
+ point: Ha,
1044
+ circle: Xa,
1045
+ cross: Va,
1046
+ barb: Ga
1047
+ }, Za = Fa, Zt, qt, O = ((qt = (Zt = z()) == null ? void 0 : Zt.block) == null ? void 0 : qt.padding) ?? 8;
1048
+ function de(e, t) {
1049
+ if (e === 0 || !Number.isInteger(e))
1050
+ throw new Error("Columns must be an integer !== 0.");
1051
+ if (t < 0 || !Number.isInteger(t))
1052
+ throw new Error("Position must be a non-negative integer." + t);
1053
+ if (e < 0)
1054
+ return { px: t, py: 0 };
1055
+ if (e === 1)
1056
+ return { px: 0, py: t };
1057
+ const a = t % e, i = Math.floor(t / e);
1058
+ return { px: a, py: i };
1059
+ }
1060
+ g(de, "calculateBlockPosition");
1061
+ var qa = /* @__PURE__ */ g((e) => {
1062
+ let t = 0, a = 0;
1063
+ for (const i of e.children) {
1064
+ const { width: l, height: s, x: r, y: n } = i.size ?? { width: 0, height: 0, x: 0, y: 0 };
1065
+ L.debug(
1066
+ "getMaxChildSize abc95 child:",
1067
+ i.id,
1068
+ "width:",
1069
+ l,
1070
+ "height:",
1071
+ s,
1072
+ "x:",
1073
+ r,
1074
+ "y:",
1075
+ n,
1076
+ i.type
1077
+ ), i.type !== "space" && (l > t && (t = l / (e.widthInColumns ?? 1)), s > a && (a = s));
1078
+ }
1079
+ return { width: t, height: a };
1080
+ }, "getMaxChildSize");
1081
+ function dt(e, t, a = 0, i = 0) {
1082
+ var r, n, o, d, h, x, b, m, S, k, E;
1083
+ L.debug(
1084
+ "setBlockSizes abc95 (start)",
1085
+ e.id,
1086
+ (r = e == null ? void 0 : e.size) == null ? void 0 : r.x,
1087
+ "block width =",
1088
+ e == null ? void 0 : e.size,
1089
+ "siblingWidth",
1090
+ a
1091
+ ), (n = e == null ? void 0 : e.size) != null && n.width || (e.size = {
1092
+ width: a,
1093
+ height: i,
1094
+ x: 0,
1095
+ y: 0
1096
+ });
1097
+ let l = 0, s = 0;
1098
+ if (((o = e.children) == null ? void 0 : o.length) > 0) {
1099
+ for (const v of e.children)
1100
+ dt(v, t);
1101
+ const N = qa(e);
1102
+ l = N.width, s = N.height, L.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", l, s);
1103
+ for (const v of e.children)
1104
+ v.size && (L.debug(
1105
+ `abc95 Setting size of children of ${e.id} id=${v.id} ${l} ${s} ${JSON.stringify(v.size)}`
1106
+ ), v.size.width = l * (v.widthInColumns ?? 1) + O * ((v.widthInColumns ?? 1) - 1), v.size.height = s, v.size.x = 0, v.size.y = 0, L.debug(
1107
+ `abc95 updating size of ${e.id} children child:${v.id} maxWidth:${l} maxHeight:${s}`
1108
+ ));
1109
+ for (const v of e.children)
1110
+ dt(v, t, l, s);
1111
+ const T = e.columns ?? -1;
1112
+ let D = 0;
1113
+ for (const v of e.children)
1114
+ D += v.widthInColumns ?? 1;
1115
+ let y = e.children.length;
1116
+ T > 0 && T < D && (y = T);
1117
+ const u = Math.ceil(D / y);
1118
+ let p = y * (l + O) + O, w = u * (s + O) + O;
1119
+ if (p < a) {
1120
+ L.debug(
1121
+ `Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${i} width ${p}`
1122
+ ), p = a, w = i;
1123
+ const v = (a - y * O - O) / y, c = (i - u * O - O) / u;
1124
+ L.debug("Size indata abc88", e.id, "childWidth", v, "maxWidth", l), L.debug("Size indata abc88", e.id, "childHeight", c, "maxHeight", s), L.debug("Size indata abc88 xSize", y, "padding", O);
1125
+ for (const _ of e.children)
1126
+ _.size && (_.size.width = v, _.size.height = c, _.size.x = 0, _.size.y = 0);
1127
+ }
1128
+ if (L.debug(
1129
+ `abc95 (finale calc) ${e.id} xSize ${y} ySize ${u} columns ${T}${e.children.length} width=${Math.max(p, ((d = e.size) == null ? void 0 : d.width) || 0)}`
1130
+ ), p < (((h = e == null ? void 0 : e.size) == null ? void 0 : h.width) || 0)) {
1131
+ p = ((x = e == null ? void 0 : e.size) == null ? void 0 : x.width) || 0;
1132
+ const v = T > 0 ? Math.min(e.children.length, T) : e.children.length;
1133
+ if (v > 0) {
1134
+ const c = (p - v * O - O) / v;
1135
+ L.debug("abc95 (growing to fit) width", e.id, p, (b = e.size) == null ? void 0 : b.width, c);
1136
+ for (const _ of e.children)
1137
+ _.size && (_.size.width = c);
1138
+ }
1139
+ }
1140
+ e.size = {
1141
+ width: p,
1142
+ height: w,
1143
+ x: 0,
1144
+ y: 0
1145
+ };
1146
+ }
1147
+ L.debug(
1148
+ "setBlockSizes abc94 (done)",
1149
+ e.id,
1150
+ (m = e == null ? void 0 : e.size) == null ? void 0 : m.x,
1151
+ (S = e == null ? void 0 : e.size) == null ? void 0 : S.width,
1152
+ (k = e == null ? void 0 : e.size) == null ? void 0 : k.y,
1153
+ (E = e == null ? void 0 : e.size) == null ? void 0 : E.height
1154
+ );
1155
+ }
1156
+ g(dt, "setBlockSizes");
1157
+ function Ct(e, t) {
1158
+ var i, l, s, r, n, o, d, h, x, b, m, S, k, E, N, T, D;
1159
+ L.debug(
1160
+ `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(i = e == null ? void 0 : e.size) == null ? void 0 : i.x} y: ${(l = e == null ? void 0 : e.size) == null ? void 0 : l.y} width: ${(s = e == null ? void 0 : e.size) == null ? void 0 : s.width}`
1161
+ );
1162
+ const a = e.columns ?? -1;
1163
+ if (L.debug("layoutBlocks columns abc95", e.id, "=>", a, e), e.children && // find max width of children
1164
+ e.children.length > 0) {
1165
+ const y = ((n = (r = e == null ? void 0 : e.children[0]) == null ? void 0 : r.size) == null ? void 0 : n.width) ?? 0, u = e.children.length * y + (e.children.length - 1) * O;
1166
+ L.debug("widthOfChildren 88", u, "posX");
1167
+ let p = 0;
1168
+ L.debug("abc91 block?.size?.x", e.id, (o = e == null ? void 0 : e.size) == null ? void 0 : o.x);
1169
+ let w = (d = e == null ? void 0 : e.size) != null && d.x ? ((h = e == null ? void 0 : e.size) == null ? void 0 : h.x) + (-((x = e == null ? void 0 : e.size) == null ? void 0 : x.width) / 2 || 0) : -O, v = 0;
1170
+ for (const c of e.children) {
1171
+ const _ = e;
1172
+ if (!c.size)
1173
+ continue;
1174
+ const { width: f, height: M } = c.size, { px: A, py: H } = de(a, p);
1175
+ if (H != v && (v = H, w = (b = e == null ? void 0 : e.size) != null && b.x ? ((m = e == null ? void 0 : e.size) == null ? void 0 : m.x) + (-((S = e == null ? void 0 : e.size) == null ? void 0 : S.width) / 2 || 0) : -O, L.debug("New row in layout for block", e.id, " and child ", c.id, v)), L.debug(
1176
+ `abc89 layout blocks (child) id: ${c.id} Pos: ${p} (px, py) ${A},${H} (${(k = _ == null ? void 0 : _.size) == null ? void 0 : k.x},${(E = _ == null ? void 0 : _.size) == null ? void 0 : E.y}) parent: ${_.id} width: ${f}${O}`
1177
+ ), _.size) {
1178
+ const J = f / 2;
1179
+ c.size.x = w + O + J, L.debug(
1180
+ `abc91 layout blocks (calc) px, pyid:${c.id} startingPos=X${w} new startingPosX${c.size.x} ${J} padding=${O} width=${f} halfWidth=${J} => x:${c.size.x} y:${c.size.y} ${c.widthInColumns} (width * (child?.w || 1)) / 2 ${f * ((c == null ? void 0 : c.widthInColumns) ?? 1) / 2}`
1181
+ ), w = c.size.x + J, c.size.y = _.size.y - _.size.height / 2 + H * (M + O) + M / 2 + O, L.debug(
1182
+ `abc88 layout blocks (calc) px, pyid:${c.id}startingPosX${w}${O}${J}=>x:${c.size.x}y:${c.size.y}${c.widthInColumns}(width * (child?.w || 1)) / 2${f * ((c == null ? void 0 : c.widthInColumns) ?? 1) / 2}`
1183
+ );
1184
+ }
1185
+ c.children && Ct(c);
1186
+ let W = (c == null ? void 0 : c.widthInColumns) ?? 1;
1187
+ a > 0 && (W = Math.min(W, a - p % a)), p += W, L.debug("abc88 columnsPos", c, p);
1188
+ }
1189
+ }
1190
+ L.debug(
1191
+ `layout blocks (<==layoutBlocks) ${e.id} x: ${(N = e == null ? void 0 : e.size) == null ? void 0 : N.x} y: ${(T = e == null ? void 0 : e.size) == null ? void 0 : T.y} width: ${(D = e == null ? void 0 : e.size) == null ? void 0 : D.width}`
1192
+ );
1193
+ }
1194
+ g(Ct, "layoutBlocks");
1195
+ function It(e, { minX: t, minY: a, maxX: i, maxY: l } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1196
+ if (e.size && e.id !== "root") {
1197
+ const { x: s, y: r, width: n, height: o } = e.size;
1198
+ s - n / 2 < t && (t = s - n / 2), r - o / 2 < a && (a = r - o / 2), s + n / 2 > i && (i = s + n / 2), r + o / 2 > l && (l = r + o / 2);
1199
+ }
1200
+ if (e.children)
1201
+ for (const s of e.children)
1202
+ ({ minX: t, minY: a, maxX: i, maxY: l } = It(s, { minX: t, minY: a, maxX: i, maxY: l }));
1203
+ return { minX: t, minY: a, maxX: i, maxY: l };
1204
+ }
1205
+ g(It, "findBounds");
1206
+ function pe(e) {
1207
+ const t = e.getBlock("root");
1208
+ if (!t)
1209
+ return;
1210
+ dt(t, e, 0, 0), Ct(t), L.debug("getBlocks", JSON.stringify(t, null, 2));
1211
+ const { minX: a, minY: i, maxX: l, maxY: s } = It(t), r = s - i, n = l - a;
1212
+ return { x: a, y: i, width: n, height: r };
1213
+ }
1214
+ g(pe, "layout");
1215
+ function Et(e, t) {
1216
+ t && e.attr("style", t);
1217
+ }
1218
+ g(Et, "applyStyle");
1219
+ function fe(e, t) {
1220
+ const a = R(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), i = a.append("xhtml:div"), l = e.label, s = e.isNode ? "nodeLabel" : "edgeLabel", r = i.append("span");
1221
+ return r.html(Lt(l, t)), Et(r, e.labelStyle), r.attr("class", s), Et(i, e.labelStyle), i.style("display", "inline-block"), i.style("white-space", "nowrap"), i.attr("xmlns", "http://www.w3.org/1999/xhtml"), a.node();
1222
+ }
1223
+ g(fe, "addHtmlLabel");
1224
+ var Ja = /* @__PURE__ */ g(async (e, t, a, i) => {
1225
+ let l = e || "";
1226
+ typeof l == "object" && (l = l[0]);
1227
+ const s = z();
1228
+ if (Z(s.flowchart.htmlLabels)) {
1229
+ l = l.replace(/\\n|\n/g, "<br />"), L.debug("vertexText" + l);
1230
+ const r = await Je(mt(l)), n = {
1231
+ isNode: i,
1232
+ label: r,
1233
+ labelStyle: t.replace("fill:", "color:")
1234
+ };
1235
+ return fe(n, s);
1236
+ } else {
1237
+ const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
1238
+ r.setAttribute("style", t.replace("color:", "fill:"));
1239
+ let n = [];
1240
+ typeof l == "string" ? n = l.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(l) ? n = l : n = [];
1241
+ for (const o of n) {
1242
+ const d = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
1243
+ d.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), d.setAttribute("dy", "1em"), d.setAttribute("x", "0"), a ? d.setAttribute("class", "title-row") : d.setAttribute("class", "row"), d.textContent = o.trim(), r.appendChild(d);
1244
+ }
1245
+ return r;
1246
+ }
1247
+ }, "createLabel"), V = Ja, Qa = /* @__PURE__ */ g((e, t, a, i, l) => {
1248
+ t.arrowTypeStart && Ut(e, "start", t.arrowTypeStart, a, i, l), t.arrowTypeEnd && Ut(e, "end", t.arrowTypeEnd, a, i, l);
1249
+ }, "addEdgeMarkers"), ts = {
1250
+ arrow_cross: "cross",
1251
+ arrow_point: "point",
1252
+ arrow_barb: "barb",
1253
+ arrow_circle: "circle",
1254
+ aggregation: "aggregation",
1255
+ extension: "extension",
1256
+ composition: "composition",
1257
+ dependency: "dependency",
1258
+ lollipop: "lollipop"
1259
+ }, Ut = /* @__PURE__ */ g((e, t, a, i, l, s) => {
1260
+ const r = ts[a];
1261
+ if (!r) {
1262
+ L.warn(`Unknown arrow type: ${a}`);
1263
+ return;
1264
+ }
1265
+ const n = t === "start" ? "Start" : "End";
1266
+ e.attr(`marker-${t}`, `url(${i}#${l}_${s}-${r}${n})`);
1267
+ }, "addEdgeMarker"), _t = {}, P = {}, es = /* @__PURE__ */ g(async (e, t) => {
1268
+ const a = z(), i = Z(a.flowchart.htmlLabels), l = t.labelType === "markdown" ? re(
1269
+ e,
1270
+ t.label,
1271
+ {
1272
+ style: t.labelStyle,
1273
+ useHtmlLabels: i,
1274
+ addSvgBackground: !0
1275
+ },
1276
+ a
1277
+ ) : await V(t.label, t.labelStyle), s = e.insert("g").attr("class", "edgeLabel"), r = s.insert("g").attr("class", "label");
1278
+ r.node().appendChild(l);
1279
+ let n = l.getBBox();
1280
+ if (i) {
1281
+ const d = l.children[0], h = R(l);
1282
+ n = d.getBoundingClientRect(), h.attr("width", n.width), h.attr("height", n.height);
1283
+ }
1284
+ r.attr("transform", "translate(" + -n.width / 2 + ", " + -n.height / 2 + ")"), _t[t.id] = s, t.width = n.width, t.height = n.height;
1285
+ let o;
1286
+ if (t.startLabelLeft) {
1287
+ const d = await V(t.startLabelLeft, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), x = h.insert("g").attr("class", "inner");
1288
+ o = x.node().appendChild(d);
1289
+ const b = d.getBBox();
1290
+ x.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), P[t.id] || (P[t.id] = {}), P[t.id].startLeft = h, at(o, t.startLabelLeft);
1291
+ }
1292
+ if (t.startLabelRight) {
1293
+ const d = await V(t.startLabelRight, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), x = h.insert("g").attr("class", "inner");
1294
+ o = h.node().appendChild(d), x.node().appendChild(d);
1295
+ const b = d.getBBox();
1296
+ x.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), P[t.id] || (P[t.id] = {}), P[t.id].startRight = h, at(o, t.startLabelRight);
1297
+ }
1298
+ if (t.endLabelLeft) {
1299
+ const d = await V(t.endLabelLeft, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), x = h.insert("g").attr("class", "inner");
1300
+ o = x.node().appendChild(d);
1301
+ const b = d.getBBox();
1302
+ x.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), h.node().appendChild(d), P[t.id] || (P[t.id] = {}), P[t.id].endLeft = h, at(o, t.endLabelLeft);
1303
+ }
1304
+ if (t.endLabelRight) {
1305
+ const d = await V(t.endLabelRight, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), x = h.insert("g").attr("class", "inner");
1306
+ o = x.node().appendChild(d);
1307
+ const b = d.getBBox();
1308
+ x.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), h.node().appendChild(d), P[t.id] || (P[t.id] = {}), P[t.id].endRight = h, at(o, t.endLabelRight);
1309
+ }
1310
+ return l;
1311
+ }, "insertEdgeLabel");
1312
+ function at(e, t) {
1313
+ z().flowchart.htmlLabels && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1314
+ }
1315
+ g(at, "setTerminalWidth");
1316
+ var rs = /* @__PURE__ */ g((e, t) => {
1317
+ L.debug("Moving label abc88 ", e.id, e.label, _t[e.id], t);
1318
+ let a = t.updatedPath ? t.updatedPath : t.originalPath;
1319
+ const i = z(), { subGraphTitleTotalMargin: l } = Ze(i);
1320
+ if (e.label) {
1321
+ const s = _t[e.id];
1322
+ let r = e.x, n = e.y;
1323
+ if (a) {
1324
+ const o = rt.calcLabelPosition(a);
1325
+ L.debug(
1326
+ "Moving label " + e.label + " from (",
1327
+ r,
1328
+ ",",
1329
+ n,
1330
+ ") to (",
1331
+ o.x,
1332
+ ",",
1333
+ o.y,
1334
+ ") abc88"
1335
+ ), t.updatedPath && (r = o.x, n = o.y);
1336
+ }
1337
+ s.attr("transform", `translate(${r}, ${n + l / 2})`);
1338
+ }
1339
+ if (e.startLabelLeft) {
1340
+ const s = P[e.id].startLeft;
1341
+ let r = e.x, n = e.y;
1342
+ if (a) {
1343
+ const o = rt.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
1344
+ r = o.x, n = o.y;
1345
+ }
1346
+ s.attr("transform", `translate(${r}, ${n})`);
1347
+ }
1348
+ if (e.startLabelRight) {
1349
+ const s = P[e.id].startRight;
1350
+ let r = e.x, n = e.y;
1351
+ if (a) {
1352
+ const o = rt.calcTerminalLabelPosition(
1353
+ e.arrowTypeStart ? 10 : 0,
1354
+ "start_right",
1355
+ a
1356
+ );
1357
+ r = o.x, n = o.y;
1358
+ }
1359
+ s.attr("transform", `translate(${r}, ${n})`);
1360
+ }
1361
+ if (e.endLabelLeft) {
1362
+ const s = P[e.id].endLeft;
1363
+ let r = e.x, n = e.y;
1364
+ if (a) {
1365
+ const o = rt.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
1366
+ r = o.x, n = o.y;
1367
+ }
1368
+ s.attr("transform", `translate(${r}, ${n})`);
1369
+ }
1370
+ if (e.endLabelRight) {
1371
+ const s = P[e.id].endRight;
1372
+ let r = e.x, n = e.y;
1373
+ if (a) {
1374
+ const o = rt.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
1375
+ r = o.x, n = o.y;
1376
+ }
1377
+ s.attr("transform", `translate(${r}, ${n})`);
1378
+ }
1379
+ }, "positionEdgeLabel"), as = /* @__PURE__ */ g((e, t) => {
1380
+ const a = e.x, i = e.y, l = Math.abs(t.x - a), s = Math.abs(t.y - i), r = e.width / 2, n = e.height / 2;
1381
+ return l >= r || s >= n;
1382
+ }, "outsideNode"), ss = /* @__PURE__ */ g((e, t, a) => {
1383
+ L.debug(`intersection calc abc89:
1384
+ outsidePoint: ${JSON.stringify(t)}
1385
+ insidePoint : ${JSON.stringify(a)}
1386
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1387
+ const i = e.x, l = e.y, s = Math.abs(i - a.x), r = e.width / 2;
1388
+ let n = a.x < t.x ? r - s : r + s;
1389
+ const o = e.height / 2, d = Math.abs(t.y - a.y), h = Math.abs(t.x - a.x);
1390
+ if (Math.abs(l - t.y) * r > Math.abs(i - t.x) * o) {
1391
+ let x = a.y < t.y ? t.y - o - l : l - o - t.y;
1392
+ n = h * x / d;
1393
+ const b = {
1394
+ x: a.x < t.x ? a.x + n : a.x - h + n,
1395
+ y: a.y < t.y ? a.y + d - x : a.y - d + x
1396
+ };
1397
+ return n === 0 && (b.x = t.x, b.y = t.y), h === 0 && (b.x = t.x), d === 0 && (b.y = t.y), L.debug(`abc89 topp/bott calc, Q ${d}, q ${x}, R ${h}, r ${n}`, b), b;
1398
+ } else {
1399
+ a.x < t.x ? n = t.x - r - i : n = i - r - t.x;
1400
+ let x = d * n / h, b = a.x < t.x ? a.x + h - n : a.x - h + n, m = a.y < t.y ? a.y + x : a.y - x;
1401
+ return L.debug(`sides calc abc89, Q ${d}, q ${x}, R ${h}, r ${n}`, { _x: b, _y: m }), n === 0 && (b = t.x, m = t.y), h === 0 && (b = t.x), d === 0 && (m = t.y), { x: b, y: m };
1402
+ }
1403
+ }, "intersection"), Ht = /* @__PURE__ */ g((e, t) => {
1404
+ L.debug("abc88 cutPathAtIntersect", e, t);
1405
+ let a = [], i = e[0], l = !1;
1406
+ return e.forEach((s) => {
1407
+ if (!as(t, s) && !l) {
1408
+ const r = ss(t, i, s);
1409
+ let n = !1;
1410
+ a.forEach((o) => {
1411
+ n = n || o.x === r.x && o.y === r.y;
1412
+ }), a.some((o) => o.x === r.x && o.y === r.y) || a.push(r), l = !0;
1413
+ } else
1414
+ i = s, l || a.push(s);
1415
+ }), a;
1416
+ }, "cutPathAtIntersect"), is = /* @__PURE__ */ g(function(e, t, a, i, l, s, r) {
1417
+ let n = a.points;
1418
+ L.debug("abc88 InsertEdge: edge=", a, "e=", t);
1419
+ let o = !1;
1420
+ const d = s.node(t.v);
1421
+ var h = s.node(t.w);
1422
+ h != null && h.intersect && (d != null && d.intersect) && (n = n.slice(1, a.points.length - 1), n.unshift(d.intersect(n[0])), n.push(h.intersect(n[n.length - 1]))), a.toCluster && (L.debug("to cluster abc88", i[a.toCluster]), n = Ht(a.points, i[a.toCluster].node), o = !0), a.fromCluster && (L.debug("from cluster abc88", i[a.fromCluster]), n = Ht(n.reverse(), i[a.fromCluster].node).reverse(), o = !0);
1423
+ const x = n.filter((y) => !Number.isNaN(y.y));
1424
+ let b = Ge;
1425
+ a.curve && (l === "graph" || l === "flowchart") && (b = a.curve);
1426
+ const { x: m, y: S } = Xe(a), k = Ve().x(m).y(S).curve(b);
1427
+ let E;
1428
+ switch (a.thickness) {
1429
+ case "normal":
1430
+ E = "edge-thickness-normal";
1431
+ break;
1432
+ case "thick":
1433
+ E = "edge-thickness-thick";
1434
+ break;
1435
+ case "invisible":
1436
+ E = "edge-thickness-thick";
1437
+ break;
1438
+ default:
1439
+ E = "";
1440
+ }
1441
+ switch (a.pattern) {
1442
+ case "solid":
1443
+ E += " edge-pattern-solid";
1444
+ break;
1445
+ case "dotted":
1446
+ E += " edge-pattern-dotted";
1447
+ break;
1448
+ case "dashed":
1449
+ E += " edge-pattern-dashed";
1450
+ break;
1451
+ }
1452
+ const N = e.append("path").attr("d", k(x)).attr("id", a.id).attr("class", " " + E + (a.classes ? " " + a.classes : "")).attr("style", a.style);
1453
+ let T = "";
1454
+ (z().flowchart.arrowMarkerAbsolute || z().state.arrowMarkerAbsolute) && (T = $e(!0)), Qa(N, a, T, r, l);
1455
+ let D = {};
1456
+ return o && (D.updatedPath = n), D.originalPath = a.points, D;
1457
+ }, "insertEdge"), ns = /* @__PURE__ */ g((e) => {
1458
+ const t = /* @__PURE__ */ new Set();
1459
+ for (const a of e)
1460
+ switch (a) {
1461
+ case "x":
1462
+ t.add("right"), t.add("left");
1463
+ break;
1464
+ case "y":
1465
+ t.add("up"), t.add("down");
1466
+ break;
1467
+ default:
1468
+ t.add(a);
1469
+ break;
1470
+ }
1471
+ return t;
1472
+ }, "expandAndDeduplicateDirections"), ls = /* @__PURE__ */ g((e, t, a) => {
1473
+ const i = ns(e), l = 2, s = t.height + 2 * a.padding, r = s / l, n = t.width + 2 * r + a.padding, o = a.padding / 2;
1474
+ return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
1475
+ // Bottom
1476
+ { x: 0, y: 0 },
1477
+ { x: r, y: 0 },
1478
+ { x: n / 2, y: 2 * o },
1479
+ { x: n - r, y: 0 },
1480
+ { x: n, y: 0 },
1481
+ // Right
1482
+ { x: n, y: -s / 3 },
1483
+ { x: n + 2 * o, y: -s / 2 },
1484
+ { x: n, y: -2 * s / 3 },
1485
+ { x: n, y: -s },
1486
+ // Top
1487
+ { x: n - r, y: -s },
1488
+ { x: n / 2, y: -s - 2 * o },
1489
+ { x: r, y: -s },
1490
+ // Left
1491
+ { x: 0, y: -s },
1492
+ { x: 0, y: -2 * s / 3 },
1493
+ { x: -2 * o, y: -s / 2 },
1494
+ { x: 0, y: -s / 3 }
1495
+ ] : i.has("right") && i.has("left") && i.has("up") ? [
1496
+ { x: r, y: 0 },
1497
+ { x: n - r, y: 0 },
1498
+ { x: n, y: -s / 2 },
1499
+ { x: n - r, y: -s },
1500
+ { x: r, y: -s },
1501
+ { x: 0, y: -s / 2 }
1502
+ ] : i.has("right") && i.has("left") && i.has("down") ? [
1503
+ { x: 0, y: 0 },
1504
+ { x: r, y: -s },
1505
+ { x: n - r, y: -s },
1506
+ { x: n, y: 0 }
1507
+ ] : i.has("right") && i.has("up") && i.has("down") ? [
1508
+ { x: 0, y: 0 },
1509
+ { x: n, y: -r },
1510
+ { x: n, y: -s + r },
1511
+ { x: 0, y: -s }
1512
+ ] : i.has("left") && i.has("up") && i.has("down") ? [
1513
+ { x: n, y: 0 },
1514
+ { x: 0, y: -r },
1515
+ { x: 0, y: -s + r },
1516
+ { x: n, y: -s }
1517
+ ] : i.has("right") && i.has("left") ? [
1518
+ { x: r, y: 0 },
1519
+ { x: r, y: -o },
1520
+ { x: n - r, y: -o },
1521
+ { x: n - r, y: 0 },
1522
+ { x: n, y: -s / 2 },
1523
+ { x: n - r, y: -s },
1524
+ { x: n - r, y: -s + o },
1525
+ { x: r, y: -s + o },
1526
+ { x: r, y: -s },
1527
+ { x: 0, y: -s / 2 }
1528
+ ] : i.has("up") && i.has("down") ? [
1529
+ // Bottom center
1530
+ { x: n / 2, y: 0 },
1531
+ // Left pont of bottom arrow
1532
+ { x: 0, y: -o },
1533
+ { x: r, y: -o },
1534
+ // Left top over vertical section
1535
+ { x: r, y: -s + o },
1536
+ { x: 0, y: -s + o },
1537
+ // Top of arrow
1538
+ { x: n / 2, y: -s },
1539
+ { x: n, y: -s + o },
1540
+ // Top of right vertical bar
1541
+ { x: n - r, y: -s + o },
1542
+ { x: n - r, y: -o },
1543
+ { x: n, y: -o }
1544
+ ] : i.has("right") && i.has("up") ? [
1545
+ { x: 0, y: 0 },
1546
+ { x: n, y: -r },
1547
+ { x: 0, y: -s }
1548
+ ] : i.has("right") && i.has("down") ? [
1549
+ { x: 0, y: 0 },
1550
+ { x: n, y: 0 },
1551
+ { x: 0, y: -s }
1552
+ ] : i.has("left") && i.has("up") ? [
1553
+ { x: n, y: 0 },
1554
+ { x: 0, y: -r },
1555
+ { x: n, y: -s }
1556
+ ] : i.has("left") && i.has("down") ? [
1557
+ { x: n, y: 0 },
1558
+ { x: 0, y: 0 },
1559
+ { x: n, y: -s }
1560
+ ] : i.has("right") ? [
1561
+ { x: r, y: -o },
1562
+ { x: r, y: -o },
1563
+ { x: n - r, y: -o },
1564
+ { x: n - r, y: 0 },
1565
+ { x: n, y: -s / 2 },
1566
+ { x: n - r, y: -s },
1567
+ { x: n - r, y: -s + o },
1568
+ // top left corner of arrow
1569
+ { x: r, y: -s + o },
1570
+ { x: r, y: -s + o }
1571
+ ] : i.has("left") ? [
1572
+ { x: r, y: 0 },
1573
+ { x: r, y: -o },
1574
+ // Two points, the right corners
1575
+ { x: n - r, y: -o },
1576
+ { x: n - r, y: -s + o },
1577
+ { x: r, y: -s + o },
1578
+ { x: r, y: -s },
1579
+ { x: 0, y: -s / 2 }
1580
+ ] : i.has("up") ? [
1581
+ // Bottom center
1582
+ { x: r, y: -o },
1583
+ // Left top over vertical section
1584
+ { x: r, y: -s + o },
1585
+ { x: 0, y: -s + o },
1586
+ // Top of arrow
1587
+ { x: n / 2, y: -s },
1588
+ { x: n, y: -s + o },
1589
+ // Top of right vertical bar
1590
+ { x: n - r, y: -s + o },
1591
+ { x: n - r, y: -o }
1592
+ ] : i.has("down") ? [
1593
+ // Bottom center
1594
+ { x: n / 2, y: 0 },
1595
+ // Left pont of bottom arrow
1596
+ { x: 0, y: -o },
1597
+ { x: r, y: -o },
1598
+ // Left top over vertical section
1599
+ { x: r, y: -s + o },
1600
+ { x: n - r, y: -s + o },
1601
+ { x: n - r, y: -o },
1602
+ { x: n, y: -o }
1603
+ ] : [{ x: 0, y: 0 }];
1604
+ }, "getArrowPoints");
1605
+ function ye(e, t) {
1606
+ return e.intersect(t);
1607
+ }
1608
+ g(ye, "intersectNode");
1609
+ var cs = ye;
1610
+ function xe(e, t, a, i) {
1611
+ var l = e.x, s = e.y, r = l - i.x, n = s - i.y, o = Math.sqrt(t * t * n * n + a * a * r * r), d = Math.abs(t * a * r / o);
1612
+ i.x < l && (d = -d);
1613
+ var h = Math.abs(t * a * n / o);
1614
+ return i.y < s && (h = -h), { x: l + d, y: s + h };
1615
+ }
1616
+ g(xe, "intersectEllipse");
1617
+ var be = xe;
1618
+ function we(e, t, a) {
1619
+ return be(e, t, t, a);
1620
+ }
1621
+ g(we, "intersectCircle");
1622
+ var os = we;
1623
+ function me(e, t, a, i) {
1624
+ var l, s, r, n, o, d, h, x, b, m, S, k, E, N, T;
1625
+ if (l = t.y - e.y, r = e.x - t.x, o = t.x * e.y - e.x * t.y, b = l * a.x + r * a.y + o, m = l * i.x + r * i.y + o, !(b !== 0 && m !== 0 && kt(b, m)) && (s = i.y - a.y, n = a.x - i.x, d = i.x * a.y - a.x * i.y, h = s * e.x + n * e.y + d, x = s * t.x + n * t.y + d, !(h !== 0 && x !== 0 && kt(h, x)) && (S = l * n - s * r, S !== 0)))
1626
+ return k = Math.abs(S / 2), E = r * d - n * o, N = E < 0 ? (E - k) / S : (E + k) / S, E = s * o - l * d, T = E < 0 ? (E - k) / S : (E + k) / S, { x: N, y: T };
1627
+ }
1628
+ g(me, "intersectLine");
1629
+ function kt(e, t) {
1630
+ return e * t > 0;
1631
+ }
1632
+ g(kt, "sameSign");
1633
+ var hs = me, gs = Le;
1634
+ function Le(e, t, a) {
1635
+ var i = e.x, l = e.y, s = [], r = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY;
1636
+ typeof t.forEach == "function" ? t.forEach(function(S) {
1637
+ r = Math.min(r, S.x), n = Math.min(n, S.y);
1638
+ }) : (r = Math.min(r, t.x), n = Math.min(n, t.y));
1639
+ for (var o = i - e.width / 2 - r, d = l - e.height / 2 - n, h = 0; h < t.length; h++) {
1640
+ var x = t[h], b = t[h < t.length - 1 ? h + 1 : 0], m = hs(
1641
+ e,
1642
+ a,
1643
+ { x: o + x.x, y: d + x.y },
1644
+ { x: o + b.x, y: d + b.y }
1645
+ );
1646
+ m && s.push(m);
1647
+ }
1648
+ return s.length ? (s.length > 1 && s.sort(function(S, k) {
1649
+ var E = S.x - a.x, N = S.y - a.y, T = Math.sqrt(E * E + N * N), D = k.x - a.x, y = k.y - a.y, u = Math.sqrt(D * D + y * y);
1650
+ return T < u ? -1 : T === u ? 0 : 1;
1651
+ }), s[0]) : e;
1652
+ }
1653
+ g(Le, "intersectPolygon");
1654
+ var us = /* @__PURE__ */ g((e, t) => {
1655
+ var a = e.x, i = e.y, l = t.x - a, s = t.y - i, r = e.width / 2, n = e.height / 2, o, d;
1656
+ return Math.abs(s) * r > Math.abs(l) * n ? (s < 0 && (n = -n), o = s === 0 ? 0 : n * l / s, d = n) : (l < 0 && (r = -r), o = r, d = l === 0 ? 0 : r * s / l), { x: a + o, y: i + d };
1657
+ }, "intersectRect"), ds = us, I = {
1658
+ node: cs,
1659
+ circle: os,
1660
+ ellipse: be,
1661
+ polygon: gs,
1662
+ rect: ds
1663
+ }, F = /* @__PURE__ */ g(async (e, t, a, i) => {
1664
+ const l = z();
1665
+ let s;
1666
+ const r = t.useHtmlLabels || Z(l.flowchart.htmlLabels);
1667
+ a ? s = a : s = "node default";
1668
+ const n = e.insert("g").attr("class", s).attr("id", t.domId || t.id), o = n.insert("g").attr("class", "label").attr("style", t.labelStyle);
1669
+ let d;
1670
+ t.labelText === void 0 ? d = "" : d = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
1671
+ const h = o.node();
1672
+ let x;
1673
+ t.labelType === "markdown" ? x = re(
1674
+ o,
1675
+ Lt(mt(d), l),
1676
+ {
1677
+ useHtmlLabels: r,
1678
+ width: t.width || l.flowchart.wrappingWidth,
1679
+ classes: "markdown-node-label"
1680
+ },
1681
+ l
1682
+ ) : x = h.appendChild(
1683
+ await V(
1684
+ Lt(mt(d), l),
1685
+ t.labelStyle,
1686
+ !1,
1687
+ i
1688
+ )
1689
+ );
1690
+ let b = x.getBBox();
1691
+ const m = t.padding / 2;
1692
+ if (Z(l.flowchart.htmlLabels)) {
1693
+ const S = x.children[0], k = R(x), E = S.getElementsByTagName("img");
1694
+ if (E) {
1695
+ const N = d.replace(/<img[^>]*>/g, "").trim() === "";
1696
+ await Promise.all(
1697
+ [...E].map(
1698
+ (T) => new Promise((D) => {
1699
+ function y() {
1700
+ if (T.style.display = "flex", T.style.flexDirection = "column", N) {
1701
+ const u = l.fontSize ? l.fontSize : window.getComputedStyle(document.body).fontSize, w = parseInt(u, 10) * 5 + "px";
1702
+ T.style.minWidth = w, T.style.maxWidth = w;
1703
+ } else
1704
+ T.style.width = "100%";
1705
+ D(T);
1706
+ }
1707
+ g(y, "setupImage"), setTimeout(() => {
1708
+ T.complete && y();
1709
+ }), T.addEventListener("error", y), T.addEventListener("load", y);
1710
+ })
1711
+ )
1712
+ );
1713
+ }
1714
+ b = S.getBoundingClientRect(), k.attr("width", b.width), k.attr("height", b.height);
1715
+ }
1716
+ return r ? o.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")") : o.attr("transform", "translate(0, " + -b.height / 2 + ")"), t.centerLabel && o.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), o.insert("rect", ":first-child"), { shapeSvg: n, bbox: b, halfPadding: m, label: o };
1717
+ }, "labelHelper"), B = /* @__PURE__ */ g((e, t) => {
1718
+ const a = t.node().getBBox();
1719
+ e.width = a.width, e.height = a.height;
1720
+ }, "updateNodeBounds");
1721
+ function $(e, t, a, i) {
1722
+ return e.insert("polygon", ":first-child").attr(
1723
+ "points",
1724
+ i.map(function(l) {
1725
+ return l.x + "," + l.y;
1726
+ }).join(" ")
1727
+ ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")");
1728
+ }
1729
+ g($, "insertPolygonShape");
1730
+ var ps = /* @__PURE__ */ g(async (e, t) => {
1731
+ t.useHtmlLabels || z().flowchart.htmlLabels || (t.centerLabel = !0);
1732
+ const { shapeSvg: i, bbox: l, halfPadding: s } = await F(
1733
+ e,
1734
+ t,
1735
+ "node " + t.classes,
1736
+ !0
1737
+ );
1738
+ L.info("Classes = ", t.classes);
1739
+ const r = i.insert("rect", ":first-child");
1740
+ return r.attr("rx", t.rx).attr("ry", t.ry).attr("x", -l.width / 2 - s).attr("y", -l.height / 2 - s).attr("width", l.width + t.padding).attr("height", l.height + t.padding), B(t, r), t.intersect = function(n) {
1741
+ return I.rect(t, n);
1742
+ }, i;
1743
+ }, "note"), fs = ps, Xt = /* @__PURE__ */ g((e) => e ? " " + e : "", "formatClass"), U = /* @__PURE__ */ g((e, t) => `${t || "node default"}${Xt(e.classes)} ${Xt(
1744
+ e.class
1745
+ )}`, "getClassesFromNode"), Vt = /* @__PURE__ */ g(async (e, t) => {
1746
+ const { shapeSvg: a, bbox: i } = await F(
1747
+ e,
1748
+ t,
1749
+ U(t, void 0),
1750
+ !0
1751
+ ), l = i.width + t.padding, s = i.height + t.padding, r = l + s, n = [
1752
+ { x: r / 2, y: 0 },
1753
+ { x: r, y: -r / 2 },
1754
+ { x: r / 2, y: -r },
1755
+ { x: 0, y: -r / 2 }
1756
+ ];
1757
+ L.info("Question main (Circle)");
1758
+ const o = $(a, r, r, n);
1759
+ return o.attr("style", t.style), B(t, o), t.intersect = function(d) {
1760
+ return L.warn("Intersect called"), I.polygon(t, n, d);
1761
+ }, a;
1762
+ }, "question"), ys = /* @__PURE__ */ g((e, t) => {
1763
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 28, l = [
1764
+ { x: 0, y: i / 2 },
1765
+ { x: i / 2, y: 0 },
1766
+ { x: 0, y: -i / 2 },
1767
+ { x: -i / 2, y: 0 }
1768
+ ];
1769
+ return a.insert("polygon", ":first-child").attr(
1770
+ "points",
1771
+ l.map(function(r) {
1772
+ return r.x + "," + r.y;
1773
+ }).join(" ")
1774
+ ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(r) {
1775
+ return I.circle(t, 14, r);
1776
+ }, a;
1777
+ }, "choice"), xs = /* @__PURE__ */ g(async (e, t) => {
1778
+ const { shapeSvg: a, bbox: i } = await F(
1779
+ e,
1780
+ t,
1781
+ U(t, void 0),
1782
+ !0
1783
+ ), l = 4, s = i.height + t.padding, r = s / l, n = i.width + 2 * r + t.padding, o = [
1784
+ { x: r, y: 0 },
1785
+ { x: n - r, y: 0 },
1786
+ { x: n, y: -s / 2 },
1787
+ { x: n - r, y: -s },
1788
+ { x: r, y: -s },
1789
+ { x: 0, y: -s / 2 }
1790
+ ], d = $(a, n, s, o);
1791
+ return d.attr("style", t.style), B(t, d), t.intersect = function(h) {
1792
+ return I.polygon(t, o, h);
1793
+ }, a;
1794
+ }, "hexagon"), bs = /* @__PURE__ */ g(async (e, t) => {
1795
+ const { shapeSvg: a, bbox: i } = await F(e, t, void 0, !0), l = 2, s = i.height + 2 * t.padding, r = s / l, n = i.width + 2 * r + t.padding, o = ls(t.directions, i, t), d = $(a, n, s, o);
1796
+ return d.attr("style", t.style), B(t, d), t.intersect = function(h) {
1797
+ return I.polygon(t, o, h);
1798
+ }, a;
1799
+ }, "block_arrow"), ws = /* @__PURE__ */ g(async (e, t) => {
1800
+ const { shapeSvg: a, bbox: i } = await F(
1801
+ e,
1802
+ t,
1803
+ U(t, void 0),
1804
+ !0
1805
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1806
+ { x: -s / 2, y: 0 },
1807
+ { x: l, y: 0 },
1808
+ { x: l, y: -s },
1809
+ { x: -s / 2, y: -s },
1810
+ { x: 0, y: -s / 2 }
1811
+ ];
1812
+ return $(a, l, s, r).attr("style", t.style), t.width = l + s, t.height = s, t.intersect = function(o) {
1813
+ return I.polygon(t, r, o);
1814
+ }, a;
1815
+ }, "rect_left_inv_arrow"), ms = /* @__PURE__ */ g(async (e, t) => {
1816
+ const { shapeSvg: a, bbox: i } = await F(e, t, U(t), !0), l = i.width + t.padding, s = i.height + t.padding, r = [
1817
+ { x: -2 * s / 6, y: 0 },
1818
+ { x: l - s / 6, y: 0 },
1819
+ { x: l + 2 * s / 6, y: -s },
1820
+ { x: s / 6, y: -s }
1821
+ ], n = $(a, l, s, r);
1822
+ return n.attr("style", t.style), B(t, n), t.intersect = function(o) {
1823
+ return I.polygon(t, r, o);
1824
+ }, a;
1825
+ }, "lean_right"), Ls = /* @__PURE__ */ g(async (e, t) => {
1826
+ const { shapeSvg: a, bbox: i } = await F(
1827
+ e,
1828
+ t,
1829
+ U(t, void 0),
1830
+ !0
1831
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1832
+ { x: 2 * s / 6, y: 0 },
1833
+ { x: l + s / 6, y: 0 },
1834
+ { x: l - 2 * s / 6, y: -s },
1835
+ { x: -s / 6, y: -s }
1836
+ ], n = $(a, l, s, r);
1837
+ return n.attr("style", t.style), B(t, n), t.intersect = function(o) {
1838
+ return I.polygon(t, r, o);
1839
+ }, a;
1840
+ }, "lean_left"), Ss = /* @__PURE__ */ g(async (e, t) => {
1841
+ const { shapeSvg: a, bbox: i } = await F(
1842
+ e,
1843
+ t,
1844
+ U(t, void 0),
1845
+ !0
1846
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1847
+ { x: -2 * s / 6, y: 0 },
1848
+ { x: l + 2 * s / 6, y: 0 },
1849
+ { x: l - s / 6, y: -s },
1850
+ { x: s / 6, y: -s }
1851
+ ], n = $(a, l, s, r);
1852
+ return n.attr("style", t.style), B(t, n), t.intersect = function(o) {
1853
+ return I.polygon(t, r, o);
1854
+ }, a;
1855
+ }, "trapezoid"), vs = /* @__PURE__ */ g(async (e, t) => {
1856
+ const { shapeSvg: a, bbox: i } = await F(
1857
+ e,
1858
+ t,
1859
+ U(t, void 0),
1860
+ !0
1861
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1862
+ { x: s / 6, y: 0 },
1863
+ { x: l - s / 6, y: 0 },
1864
+ { x: l + 2 * s / 6, y: -s },
1865
+ { x: -2 * s / 6, y: -s }
1866
+ ], n = $(a, l, s, r);
1867
+ return n.attr("style", t.style), B(t, n), t.intersect = function(o) {
1868
+ return I.polygon(t, r, o);
1869
+ }, a;
1870
+ }, "inv_trapezoid"), Es = /* @__PURE__ */ g(async (e, t) => {
1871
+ const { shapeSvg: a, bbox: i } = await F(
1872
+ e,
1873
+ t,
1874
+ U(t, void 0),
1875
+ !0
1876
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1877
+ { x: 0, y: 0 },
1878
+ { x: l + s / 2, y: 0 },
1879
+ { x: l, y: -s / 2 },
1880
+ { x: l + s / 2, y: -s },
1881
+ { x: 0, y: -s }
1882
+ ], n = $(a, l, s, r);
1883
+ return n.attr("style", t.style), B(t, n), t.intersect = function(o) {
1884
+ return I.polygon(t, r, o);
1885
+ }, a;
1886
+ }, "rect_right_inv_arrow"), _s = /* @__PURE__ */ g(async (e, t) => {
1887
+ const { shapeSvg: a, bbox: i } = await F(
1888
+ e,
1889
+ t,
1890
+ U(t, void 0),
1891
+ !0
1892
+ ), l = i.width + t.padding, s = l / 2, r = s / (2.5 + l / 50), n = i.height + r + t.padding, o = "M 0," + r + " a " + s + "," + r + " 0,0,0 " + l + " 0 a " + s + "," + r + " 0,0,0 " + -l + " 0 l 0," + n + " a " + s + "," + r + " 0,0,0 " + l + " 0 l 0," + -n, d = a.attr("label-offset-y", r).insert("path", ":first-child").attr("style", t.style).attr("d", o).attr("transform", "translate(" + -l / 2 + "," + -(n / 2 + r) + ")");
1893
+ return B(t, d), t.intersect = function(h) {
1894
+ const x = I.rect(t, h), b = x.x - t.x;
1895
+ if (s != 0 && (Math.abs(b) < t.width / 2 || Math.abs(b) == t.width / 2 && Math.abs(x.y - t.y) > t.height / 2 - r)) {
1896
+ let m = r * r * (1 - b * b / (s * s));
1897
+ m != 0 && (m = Math.sqrt(m)), m = r - m, h.y - t.y > 0 && (m = -m), x.y += m;
1898
+ }
1899
+ return x;
1900
+ }, a;
1901
+ }, "cylinder"), ks = /* @__PURE__ */ g(async (e, t) => {
1902
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await F(
1903
+ e,
1904
+ t,
1905
+ "node " + t.classes + " " + t.class,
1906
+ !0
1907
+ ), s = a.insert("rect", ":first-child"), r = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, o = t.positioned ? -r / 2 : -i.width / 2 - l, d = t.positioned ? -n / 2 : -i.height / 2 - l;
1908
+ if (s.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", d).attr("width", r).attr("height", n), t.props) {
1909
+ const h = new Set(Object.keys(t.props));
1910
+ t.props.borders && (pt(s, t.props.borders, r, n), h.delete("borders")), h.forEach((x) => {
1911
+ L.warn(`Unknown node property ${x}`);
1912
+ });
1913
+ }
1914
+ return B(t, s), t.intersect = function(h) {
1915
+ return I.rect(t, h);
1916
+ }, a;
1917
+ }, "rect"), Ts = /* @__PURE__ */ g(async (e, t) => {
1918
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await F(
1919
+ e,
1920
+ t,
1921
+ "node " + t.classes,
1922
+ !0
1923
+ ), s = a.insert("rect", ":first-child"), r = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, o = t.positioned ? -r / 2 : -i.width / 2 - l, d = t.positioned ? -n / 2 : -i.height / 2 - l;
1924
+ if (s.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", d).attr("width", r).attr("height", n), t.props) {
1925
+ const h = new Set(Object.keys(t.props));
1926
+ t.props.borders && (pt(s, t.props.borders, r, n), h.delete("borders")), h.forEach((x) => {
1927
+ L.warn(`Unknown node property ${x}`);
1928
+ });
1929
+ }
1930
+ return B(t, s), t.intersect = function(h) {
1931
+ return I.rect(t, h);
1932
+ }, a;
1933
+ }, "composite"), Ds = /* @__PURE__ */ g(async (e, t) => {
1934
+ const { shapeSvg: a } = await F(e, t, "label", !0);
1935
+ L.trace("Classes = ", t.class);
1936
+ const i = a.insert("rect", ":first-child"), l = 0, s = 0;
1937
+ if (i.attr("width", l).attr("height", s), a.attr("class", "label edgeLabel"), t.props) {
1938
+ const r = new Set(Object.keys(t.props));
1939
+ t.props.borders && (pt(i, t.props.borders, l, s), r.delete("borders")), r.forEach((n) => {
1940
+ L.warn(`Unknown node property ${n}`);
1941
+ });
1942
+ }
1943
+ return B(t, i), t.intersect = function(r) {
1944
+ return I.rect(t, r);
1945
+ }, a;
1946
+ }, "labelRect");
1947
+ function pt(e, t, a, i) {
1948
+ const l = [], s = /* @__PURE__ */ g((n) => {
1949
+ l.push(n, 0);
1950
+ }, "addBorder"), r = /* @__PURE__ */ g((n) => {
1951
+ l.push(0, n);
1952
+ }, "skipBorder");
1953
+ t.includes("t") ? (L.debug("add top border"), s(a)) : r(a), t.includes("r") ? (L.debug("add right border"), s(i)) : r(i), t.includes("b") ? (L.debug("add bottom border"), s(a)) : r(a), t.includes("l") ? (L.debug("add left border"), s(i)) : r(i), e.attr("stroke-dasharray", l.join(" "));
1954
+ }
1955
+ g(pt, "applyNodePropertyBorders");
1956
+ var Ns = /* @__PURE__ */ g(async (e, t) => {
1957
+ let a;
1958
+ t.classes ? a = "node " + t.classes : a = "node default";
1959
+ const i = e.insert("g").attr("class", a).attr("id", t.domId || t.id), l = i.insert("rect", ":first-child"), s = i.insert("line"), r = i.insert("g").attr("class", "label"), n = t.labelText.flat ? t.labelText.flat() : t.labelText;
1960
+ let o = "";
1961
+ typeof n == "object" ? o = n[0] : o = n, L.info("Label text abc79", o, n, typeof n == "object");
1962
+ const d = r.node().appendChild(await V(o, t.labelStyle, !0, !0));
1963
+ let h = { width: 0, height: 0 };
1964
+ if (Z(z().flowchart.htmlLabels)) {
1965
+ const k = d.children[0], E = R(d);
1966
+ h = k.getBoundingClientRect(), E.attr("width", h.width), E.attr("height", h.height);
1967
+ }
1968
+ L.info("Text 2", n);
1969
+ const x = n.slice(1, n.length);
1970
+ let b = d.getBBox();
1971
+ const m = r.node().appendChild(
1972
+ await V(
1973
+ x.join ? x.join("<br/>") : x,
1974
+ t.labelStyle,
1975
+ !0,
1976
+ !0
1977
+ )
1978
+ );
1979
+ if (Z(z().flowchart.htmlLabels)) {
1980
+ const k = m.children[0], E = R(m);
1981
+ h = k.getBoundingClientRect(), E.attr("width", h.width), E.attr("height", h.height);
1982
+ }
1983
+ const S = t.padding / 2;
1984
+ return R(m).attr(
1985
+ "transform",
1986
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1987
+ (h.width > b.width ? 0 : (b.width - h.width) / 2) + ", " + (b.height + S + 5) + ")"
1988
+ ), R(d).attr(
1989
+ "transform",
1990
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1991
+ (h.width < b.width ? 0 : -(b.width - h.width) / 2) + ", 0)"
1992
+ ), h = r.node().getBBox(), r.attr(
1993
+ "transform",
1994
+ "translate(" + -h.width / 2 + ", " + (-h.height / 2 - S + 3) + ")"
1995
+ ), l.attr("class", "outer title-state").attr("x", -h.width / 2 - S).attr("y", -h.height / 2 - S).attr("width", h.width + t.padding).attr("height", h.height + t.padding), s.attr("class", "divider").attr("x1", -h.width / 2 - S).attr("x2", h.width / 2 + S).attr("y1", -h.height / 2 - S + b.height + S).attr("y2", -h.height / 2 - S + b.height + S), B(t, l), t.intersect = function(k) {
1996
+ return I.rect(t, k);
1997
+ }, i;
1998
+ }, "rectWithTitle"), Cs = /* @__PURE__ */ g(async (e, t) => {
1999
+ const { shapeSvg: a, bbox: i } = await F(
2000
+ e,
2001
+ t,
2002
+ U(t, void 0),
2003
+ !0
2004
+ ), l = i.height + t.padding, s = i.width + l / 4 + t.padding, r = a.insert("rect", ":first-child").attr("style", t.style).attr("rx", l / 2).attr("ry", l / 2).attr("x", -s / 2).attr("y", -l / 2).attr("width", s).attr("height", l);
2005
+ return B(t, r), t.intersect = function(n) {
2006
+ return I.rect(t, n);
2007
+ }, a;
2008
+ }, "stadium"), Is = /* @__PURE__ */ g(async (e, t) => {
2009
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await F(
2010
+ e,
2011
+ t,
2012
+ U(t, void 0),
2013
+ !0
2014
+ ), s = a.insert("circle", ":first-child");
2015
+ return s.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), L.info("Circle main"), B(t, s), t.intersect = function(r) {
2016
+ return L.info("Circle intersect", t, i.width / 2 + l, r), I.circle(t, i.width / 2 + l, r);
2017
+ }, a;
2018
+ }, "circle"), Bs = /* @__PURE__ */ g(async (e, t) => {
2019
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await F(
2020
+ e,
2021
+ t,
2022
+ U(t, void 0),
2023
+ !0
2024
+ ), s = 5, r = a.insert("g", ":first-child"), n = r.insert("circle"), o = r.insert("circle");
2025
+ return r.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l + s).attr("width", i.width + t.padding + s * 2).attr("height", i.height + t.padding + s * 2), o.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), L.info("DoubleCircle main"), B(t, n), t.intersect = function(d) {
2026
+ return L.info("DoubleCircle intersect", t, i.width / 2 + l + s, d), I.circle(t, i.width / 2 + l + s, d);
2027
+ }, a;
2028
+ }, "doublecircle"), Os = /* @__PURE__ */ g(async (e, t) => {
2029
+ const { shapeSvg: a, bbox: i } = await F(
2030
+ e,
2031
+ t,
2032
+ U(t, void 0),
2033
+ !0
2034
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
2035
+ { x: 0, y: 0 },
2036
+ { x: l, y: 0 },
2037
+ { x: l, y: -s },
2038
+ { x: 0, y: -s },
2039
+ { x: 0, y: 0 },
2040
+ { x: -8, y: 0 },
2041
+ { x: l + 8, y: 0 },
2042
+ { x: l + 8, y: -s },
2043
+ { x: -8, y: -s },
2044
+ { x: -8, y: 0 }
2045
+ ], n = $(a, l, s, r);
2046
+ return n.attr("style", t.style), B(t, n), t.intersect = function(o) {
2047
+ return I.polygon(t, r, o);
2048
+ }, a;
2049
+ }, "subroutine"), As = /* @__PURE__ */ g((e, t) => {
2050
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = a.insert("circle", ":first-child");
2051
+ return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), B(t, i), t.intersect = function(l) {
2052
+ return I.circle(t, 7, l);
2053
+ }, a;
2054
+ }, "start"), Gt = /* @__PURE__ */ g((e, t, a) => {
2055
+ const i = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
2056
+ let l = 70, s = 10;
2057
+ a === "LR" && (l = 10, s = 70);
2058
+ const r = i.append("rect").attr("x", -1 * l / 2).attr("y", -1 * s / 2).attr("width", l).attr("height", s).attr("class", "fork-join");
2059
+ return B(t, r), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(n) {
2060
+ return I.rect(t, n);
2061
+ }, i;
2062
+ }, "forkJoin"), Rs = /* @__PURE__ */ g((e, t) => {
2063
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = a.insert("circle", ":first-child"), l = a.insert("circle", ":first-child");
2064
+ return l.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), i.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), B(t, l), t.intersect = function(s) {
2065
+ return I.circle(t, 7, s);
2066
+ }, a;
2067
+ }, "end"), zs = /* @__PURE__ */ g(async (e, t) => {
2068
+ var v;
2069
+ const a = t.padding / 2, i = 4, l = 8;
2070
+ let s;
2071
+ t.classes ? s = "node " + t.classes : s = "node default";
2072
+ const r = e.insert("g").attr("class", s).attr("id", t.domId || t.id), n = r.insert("rect", ":first-child"), o = r.insert("line"), d = r.insert("line");
2073
+ let h = 0, x = i;
2074
+ const b = r.insert("g").attr("class", "label");
2075
+ let m = 0;
2076
+ const S = (v = t.classData.annotations) == null ? void 0 : v[0], k = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", E = b.node().appendChild(await V(k, t.labelStyle, !0, !0));
2077
+ let N = E.getBBox();
2078
+ if (Z(z().flowchart.htmlLabels)) {
2079
+ const c = E.children[0], _ = R(E);
2080
+ N = c.getBoundingClientRect(), _.attr("width", N.width), _.attr("height", N.height);
2081
+ }
2082
+ t.classData.annotations[0] && (x += N.height + i, h += N.width);
2083
+ let T = t.classData.label;
2084
+ t.classData.type !== void 0 && t.classData.type !== "" && (z().flowchart.htmlLabels ? T += "&lt;" + t.classData.type + "&gt;" : T += "<" + t.classData.type + ">");
2085
+ const D = b.node().appendChild(await V(T, t.labelStyle, !0, !0));
2086
+ R(D).attr("class", "classTitle");
2087
+ let y = D.getBBox();
2088
+ if (Z(z().flowchart.htmlLabels)) {
2089
+ const c = D.children[0], _ = R(D);
2090
+ y = c.getBoundingClientRect(), _.attr("width", y.width), _.attr("height", y.height);
2091
+ }
2092
+ x += y.height + i, y.width > h && (h = y.width);
2093
+ const u = [];
2094
+ t.classData.members.forEach(async (c) => {
2095
+ const _ = c.getDisplayDetails();
2096
+ let f = _.displayText;
2097
+ z().flowchart.htmlLabels && (f = f.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2098
+ const M = b.node().appendChild(
2099
+ await V(
2100
+ f,
2101
+ _.cssStyle ? _.cssStyle : t.labelStyle,
2102
+ !0,
2103
+ !0
2104
+ )
2105
+ );
2106
+ let A = M.getBBox();
2107
+ if (Z(z().flowchart.htmlLabels)) {
2108
+ const H = M.children[0], W = R(M);
2109
+ A = H.getBoundingClientRect(), W.attr("width", A.width), W.attr("height", A.height);
2110
+ }
2111
+ A.width > h && (h = A.width), x += A.height + i, u.push(M);
2112
+ }), x += l;
2113
+ const p = [];
2114
+ if (t.classData.methods.forEach(async (c) => {
2115
+ const _ = c.getDisplayDetails();
2116
+ let f = _.displayText;
2117
+ z().flowchart.htmlLabels && (f = f.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2118
+ const M = b.node().appendChild(
2119
+ await V(
2120
+ f,
2121
+ _.cssStyle ? _.cssStyle : t.labelStyle,
2122
+ !0,
2123
+ !0
2124
+ )
2125
+ );
2126
+ let A = M.getBBox();
2127
+ if (Z(z().flowchart.htmlLabels)) {
2128
+ const H = M.children[0], W = R(M);
2129
+ A = H.getBoundingClientRect(), W.attr("width", A.width), W.attr("height", A.height);
2130
+ }
2131
+ A.width > h && (h = A.width), x += A.height + i, p.push(M);
2132
+ }), x += l, S) {
2133
+ let c = (h - N.width) / 2;
2134
+ R(E).attr(
2135
+ "transform",
2136
+ "translate( " + (-1 * h / 2 + c) + ", " + -1 * x / 2 + ")"
2137
+ ), m = N.height + i;
2138
+ }
2139
+ let w = (h - y.width) / 2;
2140
+ return R(D).attr(
2141
+ "transform",
2142
+ "translate( " + (-1 * h / 2 + w) + ", " + (-1 * x / 2 + m) + ")"
2143
+ ), m += y.height + i, o.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -x / 2 - a + l + m).attr("y2", -x / 2 - a + l + m), m += l, u.forEach((c) => {
2144
+ R(c).attr(
2145
+ "transform",
2146
+ "translate( " + -h / 2 + ", " + (-1 * x / 2 + m + l / 2) + ")"
2147
+ );
2148
+ const _ = c == null ? void 0 : c.getBBox();
2149
+ m += ((_ == null ? void 0 : _.height) ?? 0) + i;
2150
+ }), m += l, d.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -x / 2 - a + l + m).attr("y2", -x / 2 - a + l + m), m += l, p.forEach((c) => {
2151
+ R(c).attr(
2152
+ "transform",
2153
+ "translate( " + -h / 2 + ", " + (-1 * x / 2 + m) + ")"
2154
+ );
2155
+ const _ = c == null ? void 0 : c.getBBox();
2156
+ m += ((_ == null ? void 0 : _.height) ?? 0) + i;
2157
+ }), n.attr("style", t.style).attr("class", "outer title-state").attr("x", -h / 2 - a).attr("y", -(x / 2) - a).attr("width", h + t.padding).attr("height", x + t.padding), B(t, n), t.intersect = function(c) {
2158
+ return I.rect(t, c);
2159
+ }, r;
2160
+ }, "class_box"), $t = {
2161
+ rhombus: Vt,
2162
+ composite: Ts,
2163
+ question: Vt,
2164
+ rect: ks,
2165
+ labelRect: Ds,
2166
+ rectWithTitle: Ns,
2167
+ choice: ys,
2168
+ circle: Is,
2169
+ doublecircle: Bs,
2170
+ stadium: Cs,
2171
+ hexagon: xs,
2172
+ block_arrow: bs,
2173
+ rect_left_inv_arrow: ws,
2174
+ lean_right: ms,
2175
+ lean_left: Ls,
2176
+ trapezoid: Ss,
2177
+ inv_trapezoid: vs,
2178
+ rect_right_inv_arrow: Es,
2179
+ cylinder: _s,
2180
+ start: As,
2181
+ end: Rs,
2182
+ note: fs,
2183
+ subroutine: Os,
2184
+ fork: Gt,
2185
+ join: Gt,
2186
+ class_box: zs
2187
+ }, ht = {}, Se = /* @__PURE__ */ g(async (e, t, a) => {
2188
+ let i, l;
2189
+ if (t.link) {
2190
+ let s;
2191
+ z().securityLevel === "sandbox" ? s = "_top" : t.linkTarget && (s = t.linkTarget || "_blank"), i = e.insert("svg:a").attr("xlink:href", t.link).attr("target", s), l = await $t[t.shape](i, t, a);
2192
+ } else
2193
+ l = await $t[t.shape](e, t, a), i = l;
2194
+ return t.tooltip && l.attr("title", t.tooltip), t.class && l.attr("class", "node default " + t.class), ht[t.id] = i, t.haveCallback && ht[t.id].attr("class", ht[t.id].attr("class") + " clickable"), i;
2195
+ }, "insertNode"), Ms = /* @__PURE__ */ g((e) => {
2196
+ const t = ht[e.id];
2197
+ L.trace(
2198
+ "Transforming node",
2199
+ e.diff,
2200
+ e,
2201
+ "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")"
2202
+ );
2203
+ const a = 8, i = e.diff || 0;
2204
+ return e.clusterNode ? t.attr(
2205
+ "transform",
2206
+ "translate(" + (e.x + i - e.width / 2) + ", " + (e.y - e.height / 2 - a) + ")"
2207
+ ) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), i;
2208
+ }, "positionNode");
2209
+ function Bt(e, t, a = !1) {
2210
+ var b, m, S;
2211
+ const i = e;
2212
+ let l = "default";
2213
+ (((b = i == null ? void 0 : i.classes) == null ? void 0 : b.length) || 0) > 0 && (l = ((i == null ? void 0 : i.classes) ?? []).join(" ")), l = l + " flowchart-label";
2214
+ let s = 0, r = "", n;
2215
+ switch (i.type) {
2216
+ case "round":
2217
+ s = 5, r = "rect";
2218
+ break;
2219
+ case "composite":
2220
+ s = 0, r = "composite", n = 0;
2221
+ break;
2222
+ case "square":
2223
+ r = "rect";
2224
+ break;
2225
+ case "diamond":
2226
+ r = "question";
2227
+ break;
2228
+ case "hexagon":
2229
+ r = "hexagon";
2230
+ break;
2231
+ case "block_arrow":
2232
+ r = "block_arrow";
2233
+ break;
2234
+ case "odd":
2235
+ r = "rect_left_inv_arrow";
2236
+ break;
2237
+ case "lean_right":
2238
+ r = "lean_right";
2239
+ break;
2240
+ case "lean_left":
2241
+ r = "lean_left";
2242
+ break;
2243
+ case "trapezoid":
2244
+ r = "trapezoid";
2245
+ break;
2246
+ case "inv_trapezoid":
2247
+ r = "inv_trapezoid";
2248
+ break;
2249
+ case "rect_left_inv_arrow":
2250
+ r = "rect_left_inv_arrow";
2251
+ break;
2252
+ case "circle":
2253
+ r = "circle";
2254
+ break;
2255
+ case "ellipse":
2256
+ r = "ellipse";
2257
+ break;
2258
+ case "stadium":
2259
+ r = "stadium";
2260
+ break;
2261
+ case "subroutine":
2262
+ r = "subroutine";
2263
+ break;
2264
+ case "cylinder":
2265
+ r = "cylinder";
2266
+ break;
2267
+ case "group":
2268
+ r = "rect";
2269
+ break;
2270
+ case "doublecircle":
2271
+ r = "doublecircle";
2272
+ break;
2273
+ default:
2274
+ r = "rect";
2275
+ }
2276
+ const o = Qe((i == null ? void 0 : i.styles) ?? []), d = i.label, h = i.size ?? { width: 0, height: 0, x: 0, y: 0 };
2277
+ return {
2278
+ labelStyle: o.labelStyle,
2279
+ shape: r,
2280
+ labelText: d,
2281
+ rx: s,
2282
+ ry: s,
2283
+ class: l,
2284
+ style: o.style,
2285
+ id: i.id,
2286
+ directions: i.directions,
2287
+ width: h.width,
2288
+ height: h.height,
2289
+ x: h.x,
2290
+ y: h.y,
2291
+ positioned: a,
2292
+ intersect: void 0,
2293
+ type: i.type,
2294
+ padding: n ?? ((S = (m = it()) == null ? void 0 : m.block) == null ? void 0 : S.padding) ?? 0
2295
+ };
2296
+ }
2297
+ g(Bt, "getNodeFromBlock");
2298
+ async function ve(e, t, a) {
2299
+ const i = Bt(t, a, !1);
2300
+ if (i.type === "group")
2301
+ return;
2302
+ const l = it(), s = await Se(e, i, { config: l }), r = s.node().getBBox(), n = a.getBlock(i.id);
2303
+ n.size = { width: r.width, height: r.height, x: 0, y: 0, node: s }, a.setBlock(n), s.remove();
2304
+ }
2305
+ g(ve, "calculateBlockSize");
2306
+ async function Ee(e, t, a) {
2307
+ const i = Bt(t, a, !0);
2308
+ if (a.getBlock(i.id).type !== "space") {
2309
+ const s = it();
2310
+ await Se(e, i, { config: s }), t.intersect = i == null ? void 0 : i.intersect, Ms(i);
2311
+ }
2312
+ }
2313
+ g(Ee, "insertBlockPositioned");
2314
+ async function ft(e, t, a, i) {
2315
+ for (const l of t)
2316
+ await i(e, l, a), l.children && await ft(e, l.children, a, i);
2317
+ }
2318
+ g(ft, "performOperations");
2319
+ async function _e(e, t, a) {
2320
+ await ft(e, t, a, ve);
2321
+ }
2322
+ g(_e, "calculateBlockSizes");
2323
+ async function ke(e, t, a) {
2324
+ await ft(e, t, a, Ee);
2325
+ }
2326
+ g(ke, "insertBlocks");
2327
+ async function Te(e, t, a, i, l) {
2328
+ const s = new tr({
2329
+ multigraph: !0,
2330
+ compound: !0
2331
+ });
2332
+ s.setGraph({
2333
+ rankdir: "TB",
2334
+ nodesep: 10,
2335
+ ranksep: 10,
2336
+ marginx: 8,
2337
+ marginy: 8
2338
+ });
2339
+ for (const r of a)
2340
+ r.size && s.setNode(r.id, {
2341
+ width: r.size.width,
2342
+ height: r.size.height,
2343
+ intersect: r.intersect
2344
+ });
2345
+ for (const r of t)
2346
+ if (r.start && r.end) {
2347
+ const n = i.getBlock(r.start), o = i.getBlock(r.end);
2348
+ if (n != null && n.size && (o != null && o.size)) {
2349
+ const d = n.size, h = o.size, x = [
2350
+ { x: d.x, y: d.y },
2351
+ { x: d.x + (h.x - d.x) / 2, y: d.y + (h.y - d.y) / 2 },
2352
+ { x: h.x, y: h.y }
2353
+ ];
2354
+ is(
2355
+ e,
2356
+ { v: r.start, w: r.end, name: r.id },
2357
+ {
2358
+ ...r,
2359
+ arrowTypeEnd: r.arrowTypeEnd,
2360
+ arrowTypeStart: r.arrowTypeStart,
2361
+ points: x,
2362
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2363
+ },
2364
+ void 0,
2365
+ "block",
2366
+ s,
2367
+ l
2368
+ ), r.label && (await es(e, {
2369
+ ...r,
2370
+ label: r.label,
2371
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
2372
+ arrowTypeEnd: r.arrowTypeEnd,
2373
+ arrowTypeStart: r.arrowTypeStart,
2374
+ points: x,
2375
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2376
+ }), rs(
2377
+ { ...r, x: x[1].x, y: x[1].y },
2378
+ {
2379
+ originalPath: x
2380
+ }
2381
+ ));
2382
+ }
2383
+ }
2384
+ }
2385
+ g(Te, "insertEdges");
2386
+ var js = /* @__PURE__ */ g(function(e, t) {
2387
+ return t.db.getClasses();
2388
+ }, "getClasses"), Fs = /* @__PURE__ */ g(async function(e, t, a, i) {
2389
+ const { securityLevel: l, block: s } = it(), r = i.db;
2390
+ let n;
2391
+ l === "sandbox" && (n = R("#i" + t));
2392
+ const o = l === "sandbox" ? R(n.nodes()[0].contentDocument.body) : R("body"), d = l === "sandbox" ? o.select(`[id="${t}"]`) : R(`[id="${t}"]`);
2393
+ Za(d, ["point", "circle", "cross"], i.type, t);
2394
+ const x = r.getBlocks(), b = r.getBlocksFlat(), m = r.getEdges(), S = d.insert("g").attr("class", "block");
2395
+ await _e(S, x, r);
2396
+ const k = pe(r);
2397
+ if (await ke(S, x, r), await Te(S, m, b, r, t), k) {
2398
+ const E = k, N = Math.max(1, Math.round(0.125 * (E.width / E.height))), T = E.height + N + 10, D = E.width + 10, { useMaxWidth: y } = s;
2399
+ Ke(d, T, D, !!y), L.debug("Here Bounds", k, E), d.attr(
2400
+ "viewBox",
2401
+ `${E.x - 5} ${E.y - 5} ${E.width + 10} ${E.height + 10}`
2402
+ );
2403
+ }
2404
+ }, "draw"), Ps = {
2405
+ draw: Fs,
2406
+ getClasses: js
2407
+ }, ri = {
2408
+ parser: xa,
2409
+ db: za,
2410
+ renderer: Ps,
2411
+ styles: ja
2412
+ };
2413
+ export {
2414
+ ri as diagram
2415
+ };