@foris/ai-agent 0.1.1 → 0.3.0

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