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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/dist/abap-Y8Dl9g_6.js +6 -0
  2. package/dist/actionscript-3-DZzbMeqX.js +6 -0
  3. package/dist/ada-vP6ak0IW.js +6 -0
  4. package/dist/ai-agent.es.js +14 -2779
  5. package/dist/ai-agent.umd.js +3213 -4
  6. package/dist/andromeeda-BIpZ7gaU.js +4 -0
  7. package/dist/angular-html-CHuhdNYa.js +32 -0
  8. package/dist/angular-ts-CkwnAxZa.js +32 -0
  9. package/dist/apache-BUjz-sD2.js +6 -0
  10. package/dist/apex-oLhhs58q.js +6 -0
  11. package/dist/apl-C8FRyJIY.js +24 -0
  12. package/dist/applescript-BPx7YFFu.js +6 -0
  13. package/dist/ara-Z2fSOxSw.js +6 -0
  14. package/dist/arc-BzRDGNYi.js +85 -0
  15. package/dist/architectureDiagram-VXUJARFQ-jlW87y1j.js +4682 -0
  16. package/dist/asciidoc-B-pCoB3G.js +6 -0
  17. package/dist/asm-BTWLY5ym.js +6 -0
  18. package/dist/astro-CAC4-sRr.js +25 -0
  19. package/dist/aurora-x-BwoVEUWZ.js +4 -0
  20. package/dist/awk-Fb0P9dkn.js +6 -0
  21. package/dist/ayu-dark-CxPZkpb2.js +4 -0
  22. package/dist/ballerina-oZK-YekG.js +6 -0
  23. package/dist/bat-0FvbqU9S.js +6 -0
  24. package/dist/beancount-DqJEb89h.js +6 -0
  25. package/dist/berry-DODBq_Ff.js +6 -0
  26. package/dist/bibtex-EULQRLY5.js +6 -0
  27. package/dist/bicep-BorU73w0.js +6 -0
  28. package/dist/blade-Bwl5-ENK.js +27 -0
  29. package/dist/blockDiagram-VD42YOAC-P4woNHAr.js +2415 -0
  30. package/dist/bsl-NkNNwerW.js +8 -0
  31. package/dist/c-eeMepfLm.js +6 -0
  32. package/dist/c4Diagram-YG6GDRKO-CB9WFLmJ.js +1593 -0
  33. package/dist/cadence-02UX7mW8.js +6 -0
  34. package/dist/cairo-Cp116741.js +18 -0
  35. package/dist/catppuccin-frappe-D3cH2rXe.js +4 -0
  36. package/dist/catppuccin-latte-C0LRGUW4.js +4 -0
  37. package/dist/catppuccin-macchiato-c5wQ11TT.js +4 -0
  38. package/dist/catppuccin-mocha-WMD6Qvya.js +4 -0
  39. package/dist/channel-B-TkD8Bv.js +5 -0
  40. package/dist/chunk-4BX2VUAB-DCjARiNr.js +9 -0
  41. package/dist/chunk-55IACEB6-DvmPHLo5.js +8 -0
  42. package/dist/chunk-B4BG7PRW-L08cVxNP.js +1377 -0
  43. package/dist/chunk-DI55MBZ5-zkyTO7pn.js +1383 -0
  44. package/dist/chunk-FMBD7UC4-BkpbM-uP.js +19 -0
  45. package/dist/chunk-QN33PNHL-DSFN3Uoh.js +20 -0
  46. package/dist/chunk-QZHKN3VN-CAgMv7Xo.js +15 -0
  47. package/dist/chunk-TZMSLE5B-B6GY_sBW.js +64 -0
  48. package/dist/clarity-PKm5CwqM.js +6 -0
  49. package/dist/classDiagram-2ON5EDUG-KqDAjO33.js +30 -0
  50. package/dist/classDiagram-v2-WZHVMYZB-KqDAjO33.js +30 -0
  51. package/dist/clojure-CXJfHrL3.js +6 -0
  52. package/dist/cmake-BJz8BOTU.js +6 -0
  53. package/dist/cobol-DNTp9HAy.js +20 -0
  54. package/dist/code-block-QI2IAROF-Culy9AKV.js +2042 -0
  55. package/dist/codeowners-Bt9yU6NX.js +6 -0
  56. package/dist/codeql-DHkodjjI.js +6 -0
  57. package/dist/coffee-BrprHIxF.js +18 -0
  58. package/dist/common-lisp-EVqT9Zhp.js +6 -0
  59. package/dist/coq-B0L9upzn.js +6 -0
  60. package/dist/cose-bilkent-S5V4N54A-DtppvcNV.js +2620 -0
  61. package/dist/cpp-CwJ5QP3s.js +29 -0
  62. package/dist/crystal-DWRgWI1Z.js +24 -0
  63. package/dist/csv-CmYOceLb.js +6 -0
  64. package/dist/cue-ZzumE7IT.js +6 -0
  65. package/dist/cypher-jpdmjtA6.js +6 -0
  66. package/dist/cytoscape.esm-ClN43hhW.js +18846 -0
  67. package/dist/d-CBagWSwH.js +6 -0
  68. package/dist/dagre-6UL2VRFP-BfvQz4N-.js +459 -0
  69. package/dist/dark-plus-pUHDTVV0.js +4 -0
  70. package/dist/dart-6ObCrKr9.js +6 -0
  71. package/dist/dax-CcDT-8dH.js +6 -0
  72. package/dist/defaultLocale-D1piDxzZ.js +177 -0
  73. package/dist/desktop-B93p9R9O.js +6 -0
  74. package/dist/diagram-PSM6KHXK-ka-cDwC2.js +552 -0
  75. package/dist/diagram-QEK2KX5R-BW-yTygZ.js +232 -0
  76. package/dist/diagram-S2PKOQOG-j24g_p7y.js +154 -0
  77. package/dist/diff-BxzP2J8R.js +6 -0
  78. package/dist/docker-CsHqm9tx.js +6 -0
  79. package/dist/dotenv-BMjVjUL1.js +6 -0
  80. package/dist/dracula-BtZx2Kac.js +4 -0
  81. package/dist/dracula-soft-BKa-aqBv.js +4 -0
  82. package/dist/dream-maker-PAx17jaB.js +6 -0
  83. package/dist/edge-B5_tHZZy.js +21 -0
  84. package/dist/elixir-Dj_1qPNg.js +18 -0
  85. package/dist/elm-DZPAA5Qn.js +9 -0
  86. package/dist/emacs-lisp-Cfxdx5D-.js +6 -0
  87. package/dist/erDiagram-Q2GNP2WA-BoiJgXhe.js +854 -0
  88. package/dist/erb-DiYOU0he.js +31 -0
  89. package/dist/erlang-CNRRyeIc.js +18 -0
  90. package/dist/everforest-dark-DMCBqXCK.js +4 -0
  91. package/dist/everforest-light-BbXl82Em.js +4 -0
  92. package/dist/fennel-N4WcXuKx.js +6 -0
  93. package/dist/fish-BTDEUgqH.js +6 -0
  94. package/dist/flowDiagram-NV44I4VS-BHGntIlE.js +1639 -0
  95. package/dist/fluent-BMXUxfv1.js +6 -0
  96. package/dist/fortran-fixed-form-DUsA-VGo.js +8 -0
  97. package/dist/fortran-free-form-DPIT_jbP.js +6 -0
  98. package/dist/fsharp-yevJ8DSS.js +18 -0
  99. package/dist/ganttDiagram-JELNMOA3-Ce8NwhCP.js +2710 -0
  100. package/dist/gdresource-BwtMIoBm.js +10 -0
  101. package/dist/gdscript-BifyeYhI.js +6 -0
  102. package/dist/gdshader-Bk8fF6yr.js +6 -0
  103. package/dist/genie-DzUvd7U9.js +6 -0
  104. package/dist/gherkin-DHRaV0YP.js +6 -0
  105. package/dist/git-commit-Bd32YZ0K.js +8 -0
  106. package/dist/git-rebase-BWMiWxYf.js +18 -0
  107. package/dist/gitGraphDiagram-NY62KEGX-DxoN7y5T.js +723 -0
  108. package/dist/github-dark-DenFmJkN.js +4 -0
  109. package/dist/github-dark-default-BJPUVz4H.js +4 -0
  110. package/dist/github-dark-dimmed-DUshB20C.js +4 -0
  111. package/dist/github-dark-high-contrast-D3aGCnF8.js +4 -0
  112. package/dist/github-light-JYsPkUQd.js +4 -0
  113. package/dist/github-light-default-D99KPAby.js +4 -0
  114. package/dist/github-light-high-contrast-BbmZE-Mp.js +4 -0
  115. package/dist/gleam-Bv284lvN.js +6 -0
  116. package/dist/glimmer-js-Nc7Kk_CN.js +21 -0
  117. package/dist/glimmer-ts-DLoneyA9.js +21 -0
  118. package/dist/glsl-CkUcVZNK.js +8 -0
  119. package/dist/gnuplot-yPG9-sE_.js +6 -0
  120. package/dist/graph-C-gpLwEq.js +1189 -0
  121. package/dist/graphql-CB9Yiq18.js +23 -0
  122. package/dist/groovy-CJQTphOW.js +6 -0
  123. package/dist/gruvbox-dark-hard-C5HOtKIh.js +4 -0
  124. package/dist/gruvbox-dark-medium-FVgwJHuz.js +4 -0
  125. package/dist/gruvbox-dark-soft-B46F314v.js +4 -0
  126. package/dist/gruvbox-light-hard-CJD38wDZ.js +4 -0
  127. package/dist/gruvbox-light-medium-BlIhMYTA.js +4 -0
  128. package/dist/gruvbox-light-soft-DoPHyLVZ.js +4 -0
  129. package/dist/hack-dNZDE7CK.js +19 -0
  130. package/dist/haml-CIHYN_l8.js +19 -0
  131. package/dist/handlebars-5wdAGqTJ.js +21 -0
  132. package/dist/haskell-WeIwNIP6.js +6 -0
  133. package/dist/haxe-TztHsm5T.js +6 -0
  134. package/dist/hcl-D438OF-I.js +6 -0
  135. package/dist/hjson-DYBUbqOl.js +6 -0
  136. package/dist/hlsl-Bk8TCZNL.js +6 -0
  137. package/dist/houston-BDYrDoDW.js +4 -0
  138. package/dist/html-derivative-89LwIO26.js +18 -0
  139. package/dist/http-Dsh8rSJR.js +26 -0
  140. package/dist/hurl-NdmqbL7E.js +26 -0
  141. package/dist/hxml-GbqSQCLa.js +8 -0
  142. package/dist/hy-Brt5EZ7-.js +6 -0
  143. package/dist/imba-CimUv-Uh.js +6 -0
  144. package/dist/index-C3mwt8G1.js +67982 -0
  145. package/dist/infoDiagram-WHAUD3N6-DdxAG2VL.js +35 -0
  146. package/dist/ini-BZIuRIvJ.js +6 -0
  147. package/dist/init-DjUOC4st.js +16 -0
  148. package/dist/java-DY6VlHhP.js +6 -0
  149. package/dist/jinja-BuwNoMI4.js +21 -0
  150. package/dist/jison-_q6rTsMi.js +18 -0
  151. package/dist/journeyDiagram-XKPGCS4Q-CT5Fbg6c.js +848 -0
  152. package/dist/json5-BT4Fjg39.js +6 -0
  153. package/dist/jsonc-CHjZD8gR.js +6 -0
  154. package/dist/jsonl-BGuvDmy9.js +6 -0
  155. package/dist/jsonnet-Bx2cfsXg.js +6 -0
  156. package/dist/jssm-BcADi6EI.js +6 -0
  157. package/dist/jsx-BtKADgXT.js +6 -0
  158. package/dist/julia-BCBeSq7V.js +27 -0
  159. package/dist/kanagawa-dragon-CiKur4Hl.js +4 -0
  160. package/dist/kanagawa-lotus-BKu-smKu.js +4 -0
  161. package/dist/kanagawa-wave-CQwozSzG.js +4 -0
  162. package/dist/kanban-definition-3W4ZIXB7-CxtMdkvq.js +732 -0
  163. package/dist/katex.min-l0sNRNKZ.js +1 -0
  164. package/dist/kdl-BNOv9TC3.js +6 -0
  165. package/dist/kotlin-ByBMgTeR.js +6 -0
  166. package/dist/kusto-VWFLl2T0.js +6 -0
  167. package/dist/laserwave-6a00oqik.js +4 -0
  168. package/dist/latex-DF20280u.js +9 -0
  169. package/dist/layout-D2NtTgFh.js +1730 -0
  170. package/dist/lean-D5yRrexI.js +6 -0
  171. package/dist/less-B1GLI2Di.js +6 -0
  172. package/dist/light-plus-CZuVqSLX.js +4 -0
  173. package/dist/linear-sERCAB61.js +277 -0
  174. package/dist/liquid-CFYzC-s7.js +21 -0
  175. package/dist/llvm-co1rIKs3.js +6 -0
  176. package/dist/log-Al8wyEFV.js +6 -0
  177. package/dist/logo-DBa4JDzV.js +6 -0
  178. package/dist/lua-kX5WP_P5.js +8 -0
  179. package/dist/luau-DtBSxLyz.js +6 -0
  180. package/dist/make-CsMclxtr.js +6 -0
  181. package/dist/marko-OTJE9YCh.js +23 -0
  182. package/dist/material-theme-D6KBX41T.js +4 -0
  183. package/dist/material-theme-darker-CkRroheE.js +4 -0
  184. package/dist/material-theme-lighter-BUBw43Yz.js +4 -0
  185. package/dist/material-theme-ocean-ClGX14Ja.js +4 -0
  186. package/dist/material-theme-palenight-C1RVm8K1.js +4 -0
  187. package/dist/matlab-BOAaUVP0.js +6 -0
  188. package/dist/mdc-tFNBAW39.js +21 -0
  189. package/dist/mdx-BOhZZUJ8.js +6 -0
  190. package/dist/mermaid-B0ixDHKN.js +6 -0
  191. package/dist/mermaid-NA5CF7SZ-620UJKEg.js +14 -0
  192. package/dist/mermaid.core-08D5Vldk.js +14401 -0
  193. package/dist/min-dark-C7ak0t6c.js +4 -0
  194. package/dist/min-light-CKFxVcPp.js +4 -0
  195. package/dist/mindmap-definition-VGOIOE7T-CTZ_Wx0b.js +798 -0
  196. package/dist/mipsasm-CTx18fBl.js +6 -0
  197. package/dist/mojo-BD611d7o.js +6 -0
  198. package/dist/monokai-C1KBYcO0.js +4 -0
  199. package/dist/move-F-dICmj2.js +6 -0
  200. package/dist/narrat-DmhDCBs-.js +6 -0
  201. package/dist/nextflow-DmSVRGjG.js +6 -0
  202. package/dist/nginx-COxS3qoU.js +9 -0
  203. package/dist/night-owl-Bm2rzalh.js +4 -0
  204. package/dist/nim-CZHmlxcO.js +28 -0
  205. package/dist/nix-BZK5F767.js +9 -0
  206. package/dist/nord-CC5OiUXg.js +4 -0
  207. package/dist/nushell-D8j3dhT-.js +6 -0
  208. package/dist/objective-c-Itk8tzmv.js +6 -0
  209. package/dist/objective-cpp-DGt5UKRO.js +6 -0
  210. package/dist/ocaml-eSVK32Eg.js +6 -0
  211. package/dist/openscad-Sp5uZ6f2.js +6 -0
  212. package/dist/ordinal-MUacOSdK.js +65 -0
  213. package/dist/pascal-xy8pJNns.js +6 -0
  214. package/dist/perl-CvmtpKyV.js +24 -0
  215. package/dist/php-B1tFq0rn.js +25 -0
  216. package/dist/pieDiagram-ADFJNKIX-DtleX3ES.js +173 -0
  217. package/dist/pkl-C-zSNmaA.js +6 -0
  218. package/dist/plastic-CSTz3KZp.js +4 -0
  219. package/dist/plsql-pVbGZfOv.js +6 -0
  220. package/dist/po-BNfHvqmm.js +6 -0
  221. package/dist/poimandres-C-VADXHD.js +4 -0
  222. package/dist/polar-CAZahv3u.js +6 -0
  223. package/dist/postcss-05aHdL-n.js +6 -0
  224. package/dist/powerquery-DI9HkTvs.js +6 -0
  225. package/dist/powershell-Clc4ydu-.js +6 -0
  226. package/dist/prisma-FZjmVtSl.js +6 -0
  227. package/dist/prolog-C5-yg4TO.js +6 -0
  228. package/dist/proto-MmCPeFAD.js +6 -0
  229. package/dist/pug-xpTstXA9.js +20 -0
  230. package/dist/puppet-CUJHmnxV.js +6 -0
  231. package/dist/purescript-rUfGld-4.js +6 -0
  232. package/dist/qml-G4_KKZym.js +18 -0
  233. package/dist/qmldir-BInDYbpo.js +6 -0
  234. package/dist/qss-AeJTysr_.js +6 -0
  235. package/dist/quadrantDiagram-AYHSOK5B-D193y_DL.js +1038 -0
  236. package/dist/r-Bm0uF0U2.js +6 -0
  237. package/dist/racket-B83wSAja.js +6 -0
  238. package/dist/raku-nEQ4ZJJ7.js +6 -0
  239. package/dist/razor-BS4LwTsw.js +19 -0
  240. package/dist/red-7y8PH7HH.js +4 -0
  241. package/dist/reg-m_s_Kiip.js +6 -0
  242. package/dist/regexp-BazyLpPg.js +6 -0
  243. package/dist/rel-BcRfyd6Q.js +6 -0
  244. package/dist/requirementDiagram-UZGBJVZJ-DcSe-m6d.js +864 -0
  245. package/dist/riscv-Ce8MAQLP.js +6 -0
  246. package/dist/rose-pine-BKc3yVeu.js +4 -0
  247. package/dist/rose-pine-dawn-BulJcPZT.js +4 -0
  248. package/dist/rose-pine-moon-j6jiXKV8.js +4 -0
  249. package/dist/rosmsg-Cz0w1km8.js +6 -0
  250. package/dist/rst-BvkiqG_4.js +39 -0
  251. package/dist/ruby-CSrNBwZK.js +40 -0
  252. package/dist/sankeyDiagram-TZEHDZUN-HpXuokMl.js +838 -0
  253. package/dist/sas-DciBl6hq.js +18 -0
  254. package/dist/sass-DxHp5rTx.js +6 -0
  255. package/dist/scala-D4grkFkl.js +6 -0
  256. package/dist/scheme-BCRWuEm4.js +6 -0
  257. package/dist/scss-Sr5SHsiH.js +18 -0
  258. package/dist/sdbl-B7T8abf4.js +6 -0
  259. package/dist/sequenceDiagram-WL72ISMW-D_5I_YtC.js +2530 -0
  260. package/dist/shaderlab-Cr62-Wb4.js +8 -0
  261. package/dist/shellsession-B0YIY3D-.js +18 -0
  262. package/dist/slack-dark-i7wN4OET.js +4 -0
  263. package/dist/slack-ochin-ndHf0LoP.js +4 -0
  264. package/dist/smalltalk-BlI1_OkM.js +6 -0
  265. package/dist/snazzy-light-BlSJXAu4.js +4 -0
  266. package/dist/solarized-dark-UTmkh7lw.js +4 -0
  267. package/dist/solarized-light-BheCkDPT.js +4 -0
  268. package/dist/solidity-DUWnFhS6.js +6 -0
  269. package/dist/soy-I6L3jl3W.js +18 -0
  270. package/dist/sparql-B0KWFEri.js +8 -0
  271. package/dist/splunk-CRXR8A9s.js +6 -0
  272. package/dist/ssh-config-DP-hNVbF.js +6 -0
  273. package/dist/stata-BNwq7-ev.js +18 -0
  274. package/dist/stateDiagram-FKZM4ZOC-CRSpvNED.js +276 -0
  275. package/dist/stateDiagram-v2-4FDKWEC3-DfUK-Zbc.js +29 -0
  276. package/dist/style.css +1 -1
  277. package/dist/stylus-CyKEU1Ej.js +6 -0
  278. package/dist/svelte-Din0yw3u.js +22 -0
  279. package/dist/swift-9UzSvamq.js +6 -0
  280. package/dist/synthwave-84-NU3C_KFZ.js +4 -0
  281. package/dist/system-verilog-BCm7smPJ.js +6 -0
  282. package/dist/systemd-C-4qm6XH.js +6 -0
  283. package/dist/talonscript-CFF3LF_O.js +6 -0
  284. package/dist/tasl-Cg_WBUAe.js +6 -0
  285. package/dist/tcl-DN7buRTF.js +6 -0
  286. package/dist/templ-CBu7yCES.js +20 -0
  287. package/dist/terraform-DGvcn9zM.js +6 -0
  288. package/dist/tex-DpOayVob.js +8 -0
  289. package/dist/timeline-definition-IT6M3QCI-DaJ4iEOK.js +813 -0
  290. package/dist/tokyo-night-DP4TmcQl.js +4 -0
  291. package/dist/treemap-KMMF4GRG-C3Ab2yjL.js +16045 -0
  292. package/dist/ts-tags-3Kvfz4et.js +49 -0
  293. package/dist/tsv-BtvSkaG0.js +6 -0
  294. package/dist/tsx-B8rCNbgL.js +6 -0
  295. package/dist/turtle-_H59FV7D.js +6 -0
  296. package/dist/twig-3l_q-6xZ.js +37 -0
  297. package/dist/typespec-DWqp-kUU.js +6 -0
  298. package/dist/typst-D_1QKWns.js +6 -0
  299. package/dist/v-BPCNiyYe.js +6 -0
  300. package/dist/vala-uxaPR7d1.js +6 -0
  301. package/dist/vb-D8_c5-KN.js +6 -0
  302. package/dist/verilog-B-bybjPF.js +6 -0
  303. package/dist/vesper-BckBta1U.js +4 -0
  304. package/dist/vhdl-CUlNa8ac.js +6 -0
  305. package/dist/viml-DsfA-sWm.js +6 -0
  306. package/dist/vitesse-black-BoGvW84i.js +4 -0
  307. package/dist/vitesse-dark-Cym-eLtO.js +4 -0
  308. package/dist/vitesse-light-CcmG315c.js +4 -0
  309. package/dist/vue-BuFQ04-G.js +37 -0
  310. package/dist/vue-html-CyxHqgfT.js +21 -0
  311. package/dist/vue-vine-B_YNGutq.js +30 -0
  312. package/dist/vyper-CPQuu50u.js +6 -0
  313. package/dist/wasm-BBXxrAl7.js +6 -0
  314. package/dist/wasm-DQxwEHae.js +7 -0
  315. package/dist/wenyan-pbVjoM9_.js +6 -0
  316. package/dist/wgsl-DY4iK1q1.js +6 -0
  317. package/dist/wikitext-Z-MoUasO.js +6 -0
  318. package/dist/wit-CQMQOlTg.js +6 -0
  319. package/dist/wolfram-Dz4KXISs.js +6 -0
  320. package/dist/xml-C2J0sS9M.js +8 -0
  321. package/dist/xsl-CbTBIiv3.js +9 -0
  322. package/dist/xychartDiagram-PRI3JC2R-Cf2smXg5.js +1353 -0
  323. package/dist/zenscript-CxBjpf9c.js +6 -0
  324. package/dist/zig-Vm0PO9wB.js +6 -0
  325. package/package.json +25 -25
@@ -0,0 +1,2530 @@
1
+ import { a as we, b as Xt, g as ct, d as ve, c as Jt, e as Qt } from "./chunk-TZMSLE5B-B6GY_sBW.js";
2
+ import { _ as f, n as Ie, c as st, d as St, l as Q, j as re, e as Le, f as _e, k as I, b as se, s as Ae, p as ke, a as Pe, g as Ne, q as Se, t as Me, J as Re, y as De, i as Mt, u as F, L as z, M as _t, N as ie, Z as Ce, O as Oe, P as ne, F as Ht } from "./mermaid.core-08D5Vldk.js";
3
+ import { I as Be } from "./chunk-QZHKN3VN-CAgMv7Xo.js";
4
+ import "./index-C3mwt8G1.js";
5
+ import "react/jsx-runtime";
6
+ import "react";
7
+ import "class-variance-authority";
8
+ import "clsx";
9
+ import "tailwind-merge";
10
+ import "react-dom";
11
+ import "cmdk";
12
+ import "nanoid";
13
+ import "@foris/avocado-icons";
14
+ import "react-markdown";
15
+ var Ut = function() {
16
+ var e = /* @__PURE__ */ f(function(pt, v, A, L) {
17
+ for (A = A || {}, L = pt.length; L--; A[pt[L]] = v)
18
+ ;
19
+ return A;
20
+ }, "o"), t = [1, 2], n = [1, 3], s = [1, 4], r = [2, 4], i = [1, 9], c = [1, 11], h = [1, 13], o = [1, 14], a = [1, 16], p = [1, 17], g = [1, 18], x = [1, 24], y = [1, 25], b = [1, 26], w = [1, 27], k = [1, 28], N = [1, 29], S = [1, 30], M = [1, 31], C = [1, 32], Y = [1, 33], H = [1, 34], Z = [1, 35], at = [1, 36], U = [1, 37], G = [1, 38], q = [1, 39], O = [1, 41], $ = [1, 42], K = [1, 43], j = [1, 44], rt = [1, 45], D = [1, 46], E = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 55, 60, 61, 62, 63, 71], _ = [2, 71], X = [4, 5, 16, 50, 52, 53], tt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], R = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 55, 60, 61, 62, 63, 71], Vt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 55, 60, 61, 62, 63, 71], Zt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 55, 60, 61, 62, 63, 71], ot = [69, 70, 71], lt = [1, 127], Yt = {
21
+ trace: /* @__PURE__ */ f(function() {
22
+ }, "trace"),
23
+ yy: {},
24
+ symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, box_section: 10, box_line: 11, participant_statement: 12, create: 13, box: 14, restOfLine: 15, end: 16, signal: 17, autonumber: 18, NUM: 19, off: 20, activate: 21, actor: 22, deactivate: 23, note_statement: 24, links_statement: 25, link_statement: 26, properties_statement: 27, details_statement: 28, title: 29, legacy_title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, loop: 36, rect: 37, opt: 38, alt: 39, else_sections: 40, par: 41, par_sections: 42, par_over: 43, critical: 44, option_sections: 45, break: 46, option: 47, and: 48, else: 49, participant: 50, AS: 51, participant_actor: 52, destroy: 53, actor_with_config: 54, note: 55, placement: 56, text2: 57, over: 58, actor_pair: 59, links: 60, link: 61, properties: 62, details: 63, spaceList: 64, ",": 65, left_of: 66, right_of: 67, signaltype: 68, "+": 69, "-": 70, ACTOR: 71, config_object: 72, CONFIG_START: 73, CONFIG_CONTENT: 74, CONFIG_END: 75, SOLID_OPEN_ARROW: 76, DOTTED_OPEN_ARROW: 77, SOLID_ARROW: 78, BIDIRECTIONAL_SOLID_ARROW: 79, DOTTED_ARROW: 80, BIDIRECTIONAL_DOTTED_ARROW: 81, SOLID_CROSS: 82, DOTTED_CROSS: 83, SOLID_POINT: 84, DOTTED_POINT: 85, TXT: 86, $accept: 0, $end: 1 },
25
+ terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 55: "note", 58: "over", 60: "links", 61: "link", 62: "properties", 63: "details", 65: ",", 66: "left_of", 67: "right_of", 69: "+", 70: "-", 71: "ACTOR", 73: "CONFIG_START", 74: "CONFIG_CONTENT", 75: "CONFIG_END", 76: "SOLID_OPEN_ARROW", 77: "DOTTED_OPEN_ARROW", 78: "SOLID_ARROW", 79: "BIDIRECTIONAL_SOLID_ARROW", 80: "DOTTED_ARROW", 81: "BIDIRECTIONAL_DOTTED_ARROW", 82: "SOLID_CROSS", 83: "DOTTED_CROSS", 84: "SOLID_POINT", 85: "DOTTED_POINT", 86: "TXT" },
26
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [64, 2], [64, 1], [59, 3], [59, 1], [56, 1], [56, 1], [17, 5], [17, 5], [17, 4], [54, 2], [72, 3], [22, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [57, 1]],
27
+ performAction: /* @__PURE__ */ f(function(v, A, L, m, B, d, vt) {
28
+ var u = d.length - 1;
29
+ switch (B) {
30
+ case 3:
31
+ return m.apply(d[u]), d[u];
32
+ case 4:
33
+ case 9:
34
+ this.$ = [];
35
+ break;
36
+ case 5:
37
+ case 10:
38
+ d[u - 1].push(d[u]), this.$ = d[u - 1];
39
+ break;
40
+ case 6:
41
+ case 7:
42
+ case 11:
43
+ case 12:
44
+ this.$ = d[u];
45
+ break;
46
+ case 8:
47
+ case 13:
48
+ this.$ = [];
49
+ break;
50
+ case 15:
51
+ d[u].type = "createParticipant", this.$ = d[u];
52
+ break;
53
+ case 16:
54
+ d[u - 1].unshift({ type: "boxStart", boxData: m.parseBoxData(d[u - 2]) }), d[u - 1].push({ type: "boxEnd", boxText: d[u - 2] }), this.$ = d[u - 1];
55
+ break;
56
+ case 18:
57
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[u - 2]), sequenceIndexStep: Number(d[u - 1]), sequenceVisible: !0, signalType: m.LINETYPE.AUTONUMBER };
58
+ break;
59
+ case 19:
60
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[u - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: m.LINETYPE.AUTONUMBER };
61
+ break;
62
+ case 20:
63
+ this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: m.LINETYPE.AUTONUMBER };
64
+ break;
65
+ case 21:
66
+ this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: m.LINETYPE.AUTONUMBER };
67
+ break;
68
+ case 22:
69
+ this.$ = { type: "activeStart", signalType: m.LINETYPE.ACTIVE_START, actor: d[u - 1].actor };
70
+ break;
71
+ case 23:
72
+ this.$ = { type: "activeEnd", signalType: m.LINETYPE.ACTIVE_END, actor: d[u - 1].actor };
73
+ break;
74
+ case 29:
75
+ m.setDiagramTitle(d[u].substring(6)), this.$ = d[u].substring(6);
76
+ break;
77
+ case 30:
78
+ m.setDiagramTitle(d[u].substring(7)), this.$ = d[u].substring(7);
79
+ break;
80
+ case 31:
81
+ this.$ = d[u].trim(), m.setAccTitle(this.$);
82
+ break;
83
+ case 32:
84
+ case 33:
85
+ this.$ = d[u].trim(), m.setAccDescription(this.$);
86
+ break;
87
+ case 34:
88
+ d[u - 1].unshift({ type: "loopStart", loopText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.LOOP_START }), d[u - 1].push({ type: "loopEnd", loopText: d[u - 2], signalType: m.LINETYPE.LOOP_END }), this.$ = d[u - 1];
89
+ break;
90
+ case 35:
91
+ d[u - 1].unshift({ type: "rectStart", color: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.RECT_START }), d[u - 1].push({ type: "rectEnd", color: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.RECT_END }), this.$ = d[u - 1];
92
+ break;
93
+ case 36:
94
+ d[u - 1].unshift({ type: "optStart", optText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.OPT_START }), d[u - 1].push({ type: "optEnd", optText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.OPT_END }), this.$ = d[u - 1];
95
+ break;
96
+ case 37:
97
+ d[u - 1].unshift({ type: "altStart", altText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.ALT_START }), d[u - 1].push({ type: "altEnd", signalType: m.LINETYPE.ALT_END }), this.$ = d[u - 1];
98
+ break;
99
+ case 38:
100
+ d[u - 1].unshift({ type: "parStart", parText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.PAR_START }), d[u - 1].push({ type: "parEnd", signalType: m.LINETYPE.PAR_END }), this.$ = d[u - 1];
101
+ break;
102
+ case 39:
103
+ d[u - 1].unshift({ type: "parStart", parText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.PAR_OVER_START }), d[u - 1].push({ type: "parEnd", signalType: m.LINETYPE.PAR_END }), this.$ = d[u - 1];
104
+ break;
105
+ case 40:
106
+ d[u - 1].unshift({ type: "criticalStart", criticalText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.CRITICAL_START }), d[u - 1].push({ type: "criticalEnd", signalType: m.LINETYPE.CRITICAL_END }), this.$ = d[u - 1];
107
+ break;
108
+ case 41:
109
+ d[u - 1].unshift({ type: "breakStart", breakText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.BREAK_START }), d[u - 1].push({ type: "breakEnd", optText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.BREAK_END }), this.$ = d[u - 1];
110
+ break;
111
+ case 43:
112
+ this.$ = d[u - 3].concat([{ type: "option", optionText: m.parseMessage(d[u - 1]), signalType: m.LINETYPE.CRITICAL_OPTION }, d[u]]);
113
+ break;
114
+ case 45:
115
+ this.$ = d[u - 3].concat([{ type: "and", parText: m.parseMessage(d[u - 1]), signalType: m.LINETYPE.PAR_AND }, d[u]]);
116
+ break;
117
+ case 47:
118
+ this.$ = d[u - 3].concat([{ type: "else", altText: m.parseMessage(d[u - 1]), signalType: m.LINETYPE.ALT_ELSE }, d[u]]);
119
+ break;
120
+ case 48:
121
+ d[u - 3].draw = "participant", d[u - 3].type = "addParticipant", d[u - 3].description = m.parseMessage(d[u - 1]), this.$ = d[u - 3];
122
+ break;
123
+ case 49:
124
+ d[u - 1].draw = "participant", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
125
+ break;
126
+ case 50:
127
+ d[u - 3].draw = "actor", d[u - 3].type = "addParticipant", d[u - 3].description = m.parseMessage(d[u - 1]), this.$ = d[u - 3];
128
+ break;
129
+ case 51:
130
+ d[u - 1].draw = "actor", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
131
+ break;
132
+ case 52:
133
+ d[u - 1].type = "destroyParticipant", this.$ = d[u - 1];
134
+ break;
135
+ case 53:
136
+ d[u - 1].draw = "participant", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
137
+ break;
138
+ case 54:
139
+ this.$ = [d[u - 1], { type: "addNote", placement: d[u - 2], actor: d[u - 1].actor, text: d[u] }];
140
+ break;
141
+ case 55:
142
+ d[u - 2] = [].concat(d[u - 1], d[u - 1]).slice(0, 2), d[u - 2][0] = d[u - 2][0].actor, d[u - 2][1] = d[u - 2][1].actor, this.$ = [d[u - 1], { type: "addNote", placement: m.PLACEMENT.OVER, actor: d[u - 2].slice(0, 2), text: d[u] }];
143
+ break;
144
+ case 56:
145
+ this.$ = [d[u - 1], { type: "addLinks", actor: d[u - 1].actor, text: d[u] }];
146
+ break;
147
+ case 57:
148
+ this.$ = [d[u - 1], { type: "addALink", actor: d[u - 1].actor, text: d[u] }];
149
+ break;
150
+ case 58:
151
+ this.$ = [d[u - 1], { type: "addProperties", actor: d[u - 1].actor, text: d[u] }];
152
+ break;
153
+ case 59:
154
+ this.$ = [d[u - 1], { type: "addDetails", actor: d[u - 1].actor, text: d[u] }];
155
+ break;
156
+ case 62:
157
+ this.$ = [d[u - 2], d[u]];
158
+ break;
159
+ case 63:
160
+ this.$ = d[u];
161
+ break;
162
+ case 64:
163
+ this.$ = m.PLACEMENT.LEFTOF;
164
+ break;
165
+ case 65:
166
+ this.$ = m.PLACEMENT.RIGHTOF;
167
+ break;
168
+ case 66:
169
+ this.$ = [
170
+ d[u - 4],
171
+ d[u - 1],
172
+ { type: "addMessage", from: d[u - 4].actor, to: d[u - 1].actor, signalType: d[u - 3], msg: d[u], activate: !0 },
173
+ { type: "activeStart", signalType: m.LINETYPE.ACTIVE_START, actor: d[u - 1].actor }
174
+ ];
175
+ break;
176
+ case 67:
177
+ this.$ = [
178
+ d[u - 4],
179
+ d[u - 1],
180
+ { type: "addMessage", from: d[u - 4].actor, to: d[u - 1].actor, signalType: d[u - 3], msg: d[u] },
181
+ { type: "activeEnd", signalType: m.LINETYPE.ACTIVE_END, actor: d[u - 4].actor }
182
+ ];
183
+ break;
184
+ case 68:
185
+ this.$ = [d[u - 3], d[u - 1], { type: "addMessage", from: d[u - 3].actor, to: d[u - 1].actor, signalType: d[u - 2], msg: d[u] }];
186
+ break;
187
+ case 69:
188
+ this.$ = {
189
+ type: "addParticipant",
190
+ actor: d[u - 1],
191
+ config: d[u]
192
+ };
193
+ break;
194
+ case 70:
195
+ this.$ = d[u - 1].trim();
196
+ break;
197
+ case 71:
198
+ this.$ = { type: "addParticipant", actor: d[u] };
199
+ break;
200
+ case 72:
201
+ this.$ = m.LINETYPE.SOLID_OPEN;
202
+ break;
203
+ case 73:
204
+ this.$ = m.LINETYPE.DOTTED_OPEN;
205
+ break;
206
+ case 74:
207
+ this.$ = m.LINETYPE.SOLID;
208
+ break;
209
+ case 75:
210
+ this.$ = m.LINETYPE.BIDIRECTIONAL_SOLID;
211
+ break;
212
+ case 76:
213
+ this.$ = m.LINETYPE.DOTTED;
214
+ break;
215
+ case 77:
216
+ this.$ = m.LINETYPE.BIDIRECTIONAL_DOTTED;
217
+ break;
218
+ case 78:
219
+ this.$ = m.LINETYPE.SOLID_CROSS;
220
+ break;
221
+ case 79:
222
+ this.$ = m.LINETYPE.DOTTED_CROSS;
223
+ break;
224
+ case 80:
225
+ this.$ = m.LINETYPE.SOLID_POINT;
226
+ break;
227
+ case 81:
228
+ this.$ = m.LINETYPE.DOTTED_POINT;
229
+ break;
230
+ case 82:
231
+ this.$ = m.parseMessage(d[u].trim().substring(1));
232
+ break;
233
+ }
234
+ }, "anonymous"),
235
+ table: [{ 3: 1, 4: t, 5: n, 6: s }, { 1: [3] }, { 3: 5, 4: t, 5: n, 6: s }, { 3: 6, 4: t, 5: n, 6: s }, e([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], r, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, e(E, [2, 5]), { 9: 47, 12: 12, 13: h, 14: o, 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, e(E, [2, 7]), e(E, [2, 8]), e(E, [2, 14]), { 12: 48, 50: U, 52: G, 53: q }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 71: D }, { 22: 55, 71: D }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, e(E, [2, 29]), e(E, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, e(E, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 54: 72, 71: [1, 73] }, { 22: 74, 71: D }, { 22: 75, 71: D }, { 68: 76, 76: [1, 77], 77: [1, 78], 78: [1, 79], 79: [1, 80], 80: [1, 81], 81: [1, 82], 82: [1, 83], 83: [1, 84], 84: [1, 85], 85: [1, 86] }, { 56: 87, 58: [1, 88], 66: [1, 89], 67: [1, 90] }, { 22: 91, 71: D }, { 22: 92, 71: D }, { 22: 93, 71: D }, { 22: 94, 71: D }, e([5, 51, 65, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86], _), e(E, [2, 6]), e(E, [2, 15]), e(X, [2, 9], { 10: 95 }), e(E, [2, 17]), { 5: [1, 97], 19: [1, 96] }, { 5: [1, 98] }, e(E, [2, 21]), { 5: [1, 99] }, { 5: [1, 100] }, e(E, [2, 24]), e(E, [2, 25]), e(E, [2, 26]), e(E, [2, 27]), e(E, [2, 28]), e(E, [2, 31]), e(E, [2, 32]), e(tt, r, { 7: 101 }), e(tt, r, { 7: 102 }), e(tt, r, { 7: 103 }), e(R, r, { 40: 104, 7: 105 }), e(Vt, r, { 42: 106, 7: 107 }), e(Vt, r, { 7: 107, 42: 108 }), e(Zt, r, { 45: 109, 7: 110 }), e(tt, r, { 7: 111 }), { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, e([5, 51], _, { 72: 115, 73: [1, 116] }), { 5: [1, 118], 51: [1, 117] }, { 5: [1, 119] }, { 22: 122, 69: [1, 120], 70: [1, 121], 71: D }, e(ot, [2, 72]), e(ot, [2, 73]), e(ot, [2, 74]), e(ot, [2, 75]), e(ot, [2, 76]), e(ot, [2, 77]), e(ot, [2, 78]), e(ot, [2, 79]), e(ot, [2, 80]), e(ot, [2, 81]), { 22: 123, 71: D }, { 22: 125, 59: 124, 71: D }, { 71: [2, 64] }, { 71: [2, 65] }, { 57: 126, 86: lt }, { 57: 128, 86: lt }, { 57: 129, 86: lt }, { 57: 130, 86: lt }, { 4: [1, 133], 5: [1, 135], 11: 132, 12: 134, 16: [1, 131], 50: U, 52: G, 53: q }, { 5: [1, 136] }, e(E, [2, 19]), e(E, [2, 20]), e(E, [2, 22]), e(E, [2, 23]), { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 137], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 138], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 139], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 16: [1, 140] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 46], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 49: [1, 141], 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 16: [1, 142] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 44], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 48: [1, 143], 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 16: [1, 144] }, { 16: [1, 145] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 42], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 47: [1, 146], 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 147], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 15: [1, 148] }, e(E, [2, 49]), e(E, [2, 53]), { 5: [2, 69] }, { 74: [1, 149] }, { 15: [1, 150] }, e(E, [2, 51]), e(E, [2, 52]), { 22: 151, 71: D }, { 22: 152, 71: D }, { 57: 153, 86: lt }, { 57: 154, 86: lt }, { 57: 155, 86: lt }, { 65: [1, 156], 86: [2, 63] }, { 5: [2, 56] }, { 5: [2, 82] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: [2, 59] }, e(E, [2, 16]), e(X, [2, 10]), { 12: 157, 50: U, 52: G, 53: q }, e(X, [2, 12]), e(X, [2, 13]), e(E, [2, 18]), e(E, [2, 34]), e(E, [2, 35]), e(E, [2, 36]), e(E, [2, 37]), { 15: [1, 158] }, e(E, [2, 38]), { 15: [1, 159] }, e(E, [2, 39]), e(E, [2, 40]), { 15: [1, 160] }, e(E, [2, 41]), { 5: [1, 161] }, { 75: [1, 162] }, { 5: [1, 163] }, { 57: 164, 86: lt }, { 57: 165, 86: lt }, { 5: [2, 68] }, { 5: [2, 54] }, { 5: [2, 55] }, { 22: 166, 71: D }, e(X, [2, 11]), e(R, r, { 7: 105, 40: 167 }), e(Vt, r, { 7: 107, 42: 168 }), e(Zt, r, { 7: 110, 45: 169 }), e(E, [2, 48]), { 5: [2, 70] }, e(E, [2, 50]), { 5: [2, 66] }, { 5: [2, 67] }, { 86: [2, 62] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
236
+ defaultActions: { 5: [2, 1], 6: [2, 2], 89: [2, 64], 90: [2, 65], 115: [2, 69], 126: [2, 56], 127: [2, 82], 128: [2, 57], 129: [2, 58], 130: [2, 59], 153: [2, 68], 154: [2, 54], 155: [2, 55], 162: [2, 70], 164: [2, 66], 165: [2, 67], 166: [2, 62], 167: [2, 47], 168: [2, 45], 169: [2, 43] },
237
+ parseError: /* @__PURE__ */ f(function(v, A) {
238
+ if (A.recoverable)
239
+ this.trace(v);
240
+ else {
241
+ var L = new Error(v);
242
+ throw L.hash = A, L;
243
+ }
244
+ }, "parseError"),
245
+ parse: /* @__PURE__ */ f(function(v) {
246
+ var A = this, L = [0], m = [], B = [null], d = [], vt = this.table, u = "", kt = 0, $t = 0, Te = 2, jt = 1, Ee = d.slice.call(arguments, 1), W = Object.create(this.lexer), ft = { yy: {} };
247
+ for (var Wt in this.yy)
248
+ Object.prototype.hasOwnProperty.call(this.yy, Wt) && (ft.yy[Wt] = this.yy[Wt]);
249
+ W.setInput(v, ft.yy), ft.yy.lexer = W, ft.yy.parser = this, typeof W.yylloc > "u" && (W.yylloc = {});
250
+ var Ft = W.yylloc;
251
+ d.push(Ft);
252
+ var be = W.options && W.options.ranges;
253
+ typeof ft.yy.parseError == "function" ? this.parseError = ft.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
254
+ function me(et) {
255
+ L.length = L.length - 2 * et, B.length = B.length - et, d.length = d.length - et;
256
+ }
257
+ f(me, "popStack");
258
+ function te() {
259
+ var et;
260
+ return et = m.pop() || W.lex() || jt, typeof et != "number" && (et instanceof Array && (m = et, et = m.pop()), et = A.symbols_[et] || et), et;
261
+ }
262
+ f(te, "lex");
263
+ for (var J, yt, it, qt, bt = {}, Pt, ht, ee, Nt; ; ) {
264
+ if (yt = L[L.length - 1], this.defaultActions[yt] ? it = this.defaultActions[yt] : ((J === null || typeof J > "u") && (J = te()), it = vt[yt] && vt[yt][J]), typeof it > "u" || !it.length || !it[0]) {
265
+ var zt = "";
266
+ Nt = [];
267
+ for (Pt in vt[yt])
268
+ this.terminals_[Pt] && Pt > Te && Nt.push("'" + this.terminals_[Pt] + "'");
269
+ W.showPosition ? zt = "Parse error on line " + (kt + 1) + `:
270
+ ` + W.showPosition() + `
271
+ Expecting ` + Nt.join(", ") + ", got '" + (this.terminals_[J] || J) + "'" : zt = "Parse error on line " + (kt + 1) + ": Unexpected " + (J == jt ? "end of input" : "'" + (this.terminals_[J] || J) + "'"), this.parseError(zt, {
272
+ text: W.match,
273
+ token: this.terminals_[J] || J,
274
+ line: W.yylineno,
275
+ loc: Ft,
276
+ expected: Nt
277
+ });
278
+ }
279
+ if (it[0] instanceof Array && it.length > 1)
280
+ throw new Error("Parse Error: multiple actions possible at state: " + yt + ", token: " + J);
281
+ switch (it[0]) {
282
+ case 1:
283
+ L.push(J), B.push(W.yytext), d.push(W.yylloc), L.push(it[1]), J = null, $t = W.yyleng, u = W.yytext, kt = W.yylineno, Ft = W.yylloc;
284
+ break;
285
+ case 2:
286
+ if (ht = this.productions_[it[1]][1], bt.$ = B[B.length - ht], bt._$ = {
287
+ first_line: d[d.length - (ht || 1)].first_line,
288
+ last_line: d[d.length - 1].last_line,
289
+ first_column: d[d.length - (ht || 1)].first_column,
290
+ last_column: d[d.length - 1].last_column
291
+ }, be && (bt._$.range = [
292
+ d[d.length - (ht || 1)].range[0],
293
+ d[d.length - 1].range[1]
294
+ ]), qt = this.performAction.apply(bt, [
295
+ u,
296
+ $t,
297
+ kt,
298
+ ft.yy,
299
+ it[1],
300
+ B,
301
+ d
302
+ ].concat(Ee)), typeof qt < "u")
303
+ return qt;
304
+ ht && (L = L.slice(0, -1 * ht * 2), B = B.slice(0, -1 * ht), d = d.slice(0, -1 * ht)), L.push(this.productions_[it[1]][0]), B.push(bt.$), d.push(bt._$), ee = vt[L[L.length - 2]][L[L.length - 1]], L.push(ee);
305
+ break;
306
+ case 3:
307
+ return !0;
308
+ }
309
+ }
310
+ return !0;
311
+ }, "parse")
312
+ }, ye = /* @__PURE__ */ function() {
313
+ var pt = {
314
+ EOF: 1,
315
+ parseError: /* @__PURE__ */ f(function(A, L) {
316
+ if (this.yy.parser)
317
+ this.yy.parser.parseError(A, L);
318
+ else
319
+ throw new Error(A);
320
+ }, "parseError"),
321
+ // resets the lexer, sets new input
322
+ setInput: /* @__PURE__ */ f(function(v, A) {
323
+ return this.yy = A || this.yy || {}, this._input = v, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
324
+ first_line: 1,
325
+ first_column: 0,
326
+ last_line: 1,
327
+ last_column: 0
328
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
329
+ }, "setInput"),
330
+ // consumes and returns one char from the input
331
+ input: /* @__PURE__ */ f(function() {
332
+ var v = this._input[0];
333
+ this.yytext += v, this.yyleng++, this.offset++, this.match += v, this.matched += v;
334
+ var A = v.match(/(?:\r\n?|\n).*/g);
335
+ return A ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), v;
336
+ }, "input"),
337
+ // unshifts one char (or a string) into the input
338
+ unput: /* @__PURE__ */ f(function(v) {
339
+ var A = v.length, L = v.split(/(?:\r\n?|\n)/g);
340
+ this._input = v + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - A), this.offset -= A;
341
+ var m = this.match.split(/(?:\r\n?|\n)/g);
342
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), L.length - 1 && (this.yylineno -= L.length - 1);
343
+ var B = this.yylloc.range;
344
+ return this.yylloc = {
345
+ first_line: this.yylloc.first_line,
346
+ last_line: this.yylineno + 1,
347
+ first_column: this.yylloc.first_column,
348
+ last_column: L ? (L.length === m.length ? this.yylloc.first_column : 0) + m[m.length - L.length].length - L[0].length : this.yylloc.first_column - A
349
+ }, this.options.ranges && (this.yylloc.range = [B[0], B[0] + this.yyleng - A]), this.yyleng = this.yytext.length, this;
350
+ }, "unput"),
351
+ // When called from action, caches matched text and appends it on next action
352
+ more: /* @__PURE__ */ f(function() {
353
+ return this._more = !0, this;
354
+ }, "more"),
355
+ // 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.
356
+ reject: /* @__PURE__ */ f(function() {
357
+ if (this.options.backtrack_lexer)
358
+ this._backtrack = !0;
359
+ else
360
+ 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).
361
+ ` + this.showPosition(), {
362
+ text: "",
363
+ token: null,
364
+ line: this.yylineno
365
+ });
366
+ return this;
367
+ }, "reject"),
368
+ // retain first n characters of the match
369
+ less: /* @__PURE__ */ f(function(v) {
370
+ this.unput(this.match.slice(v));
371
+ }, "less"),
372
+ // displays already matched input, i.e. for error messages
373
+ pastInput: /* @__PURE__ */ f(function() {
374
+ var v = this.matched.substr(0, this.matched.length - this.match.length);
375
+ return (v.length > 20 ? "..." : "") + v.substr(-20).replace(/\n/g, "");
376
+ }, "pastInput"),
377
+ // displays upcoming input, i.e. for error messages
378
+ upcomingInput: /* @__PURE__ */ f(function() {
379
+ var v = this.match;
380
+ return v.length < 20 && (v += this._input.substr(0, 20 - v.length)), (v.substr(0, 20) + (v.length > 20 ? "..." : "")).replace(/\n/g, "");
381
+ }, "upcomingInput"),
382
+ // displays the character position where the lexing error occurred, i.e. for error messages
383
+ showPosition: /* @__PURE__ */ f(function() {
384
+ var v = this.pastInput(), A = new Array(v.length + 1).join("-");
385
+ return v + this.upcomingInput() + `
386
+ ` + A + "^";
387
+ }, "showPosition"),
388
+ // test the lexed token: return FALSE when not a match, otherwise return token
389
+ test_match: /* @__PURE__ */ f(function(v, A) {
390
+ var L, m, B;
391
+ if (this.options.backtrack_lexer && (B = {
392
+ yylineno: this.yylineno,
393
+ yylloc: {
394
+ first_line: this.yylloc.first_line,
395
+ last_line: this.last_line,
396
+ first_column: this.yylloc.first_column,
397
+ last_column: this.yylloc.last_column
398
+ },
399
+ yytext: this.yytext,
400
+ match: this.match,
401
+ matches: this.matches,
402
+ matched: this.matched,
403
+ yyleng: this.yyleng,
404
+ offset: this.offset,
405
+ _more: this._more,
406
+ _input: this._input,
407
+ yy: this.yy,
408
+ conditionStack: this.conditionStack.slice(0),
409
+ done: this.done
410
+ }, this.options.ranges && (B.yylloc.range = this.yylloc.range.slice(0))), m = v[0].match(/(?:\r\n?|\n).*/g), m && (this.yylineno += m.length), this.yylloc = {
411
+ first_line: this.yylloc.last_line,
412
+ last_line: this.yylineno + 1,
413
+ first_column: this.yylloc.last_column,
414
+ last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + v[0].length
415
+ }, this.yytext += v[0], this.match += v[0], this.matches = v, 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(v[0].length), this.matched += v[0], L = this.performAction.call(this, this.yy, this, A, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), L)
416
+ return L;
417
+ if (this._backtrack) {
418
+ for (var d in B)
419
+ this[d] = B[d];
420
+ return !1;
421
+ }
422
+ return !1;
423
+ }, "test_match"),
424
+ // return next match in input
425
+ next: /* @__PURE__ */ f(function() {
426
+ if (this.done)
427
+ return this.EOF;
428
+ this._input || (this.done = !0);
429
+ var v, A, L, m;
430
+ this._more || (this.yytext = "", this.match = "");
431
+ for (var B = this._currentRules(), d = 0; d < B.length; d++)
432
+ if (L = this._input.match(this.rules[B[d]]), L && (!A || L[0].length > A[0].length)) {
433
+ if (A = L, m = d, this.options.backtrack_lexer) {
434
+ if (v = this.test_match(L, B[d]), v !== !1)
435
+ return v;
436
+ if (this._backtrack) {
437
+ A = !1;
438
+ continue;
439
+ } else
440
+ return !1;
441
+ } else if (!this.options.flex)
442
+ break;
443
+ }
444
+ return A ? (v = this.test_match(A, B[m]), v !== !1 ? v : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
445
+ ` + this.showPosition(), {
446
+ text: "",
447
+ token: null,
448
+ line: this.yylineno
449
+ });
450
+ }, "next"),
451
+ // return next match that has a token
452
+ lex: /* @__PURE__ */ f(function() {
453
+ var A = this.next();
454
+ return A || this.lex();
455
+ }, "lex"),
456
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
457
+ begin: /* @__PURE__ */ f(function(A) {
458
+ this.conditionStack.push(A);
459
+ }, "begin"),
460
+ // pop the previously active lexer condition state off the condition stack
461
+ popState: /* @__PURE__ */ f(function() {
462
+ var A = this.conditionStack.length - 1;
463
+ return A > 0 ? this.conditionStack.pop() : this.conditionStack[0];
464
+ }, "popState"),
465
+ // produce the lexer rule set which is active for the currently active lexer condition state
466
+ _currentRules: /* @__PURE__ */ f(function() {
467
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
468
+ }, "_currentRules"),
469
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
470
+ topState: /* @__PURE__ */ f(function(A) {
471
+ return A = this.conditionStack.length - 1 - Math.abs(A || 0), A >= 0 ? this.conditionStack[A] : "INITIAL";
472
+ }, "topState"),
473
+ // alias for begin(condition)
474
+ pushState: /* @__PURE__ */ f(function(A) {
475
+ this.begin(A);
476
+ }, "pushState"),
477
+ // return the number of states currently on the stack
478
+ stateStackSize: /* @__PURE__ */ f(function() {
479
+ return this.conditionStack.length;
480
+ }, "stateStackSize"),
481
+ options: { "case-insensitive": !0 },
482
+ performAction: /* @__PURE__ */ f(function(A, L, m, B) {
483
+ switch (m) {
484
+ case 0:
485
+ return 5;
486
+ case 1:
487
+ break;
488
+ case 2:
489
+ break;
490
+ case 3:
491
+ break;
492
+ case 4:
493
+ break;
494
+ case 5:
495
+ break;
496
+ case 6:
497
+ return 19;
498
+ case 7:
499
+ return this.begin("CONFIG"), 73;
500
+ case 8:
501
+ return 74;
502
+ case 9:
503
+ return this.popState(), this.popState(), 75;
504
+ case 10:
505
+ return L.yytext = L.yytext.trim(), 71;
506
+ case 11:
507
+ return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 71;
508
+ case 12:
509
+ return this.begin("LINE"), 14;
510
+ case 13:
511
+ return this.begin("ID"), 50;
512
+ case 14:
513
+ return this.begin("ID"), 52;
514
+ case 15:
515
+ return 13;
516
+ case 16:
517
+ return this.begin("ID"), 53;
518
+ case 17:
519
+ return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 71;
520
+ case 18:
521
+ return this.popState(), this.popState(), this.begin("LINE"), 51;
522
+ case 19:
523
+ return this.popState(), this.popState(), 5;
524
+ case 20:
525
+ return this.begin("LINE"), 36;
526
+ case 21:
527
+ return this.begin("LINE"), 37;
528
+ case 22:
529
+ return this.begin("LINE"), 38;
530
+ case 23:
531
+ return this.begin("LINE"), 39;
532
+ case 24:
533
+ return this.begin("LINE"), 49;
534
+ case 25:
535
+ return this.begin("LINE"), 41;
536
+ case 26:
537
+ return this.begin("LINE"), 43;
538
+ case 27:
539
+ return this.begin("LINE"), 48;
540
+ case 28:
541
+ return this.begin("LINE"), 44;
542
+ case 29:
543
+ return this.begin("LINE"), 47;
544
+ case 30:
545
+ return this.begin("LINE"), 46;
546
+ case 31:
547
+ return this.popState(), 15;
548
+ case 32:
549
+ return 16;
550
+ case 33:
551
+ return 66;
552
+ case 34:
553
+ return 67;
554
+ case 35:
555
+ return 60;
556
+ case 36:
557
+ return 61;
558
+ case 37:
559
+ return 62;
560
+ case 38:
561
+ return 63;
562
+ case 39:
563
+ return 58;
564
+ case 40:
565
+ return 55;
566
+ case 41:
567
+ return this.begin("ID"), 21;
568
+ case 42:
569
+ return this.begin("ID"), 23;
570
+ case 43:
571
+ return 29;
572
+ case 44:
573
+ return 30;
574
+ case 45:
575
+ return this.begin("acc_title"), 31;
576
+ case 46:
577
+ return this.popState(), "acc_title_value";
578
+ case 47:
579
+ return this.begin("acc_descr"), 33;
580
+ case 48:
581
+ return this.popState(), "acc_descr_value";
582
+ case 49:
583
+ this.begin("acc_descr_multiline");
584
+ break;
585
+ case 50:
586
+ this.popState();
587
+ break;
588
+ case 51:
589
+ return "acc_descr_multiline_value";
590
+ case 52:
591
+ return 6;
592
+ case 53:
593
+ return 18;
594
+ case 54:
595
+ return 20;
596
+ case 55:
597
+ return 65;
598
+ case 56:
599
+ return 5;
600
+ case 57:
601
+ return L.yytext = L.yytext.trim(), 71;
602
+ case 58:
603
+ return 78;
604
+ case 59:
605
+ return 79;
606
+ case 60:
607
+ return 80;
608
+ case 61:
609
+ return 81;
610
+ case 62:
611
+ return 76;
612
+ case 63:
613
+ return 77;
614
+ case 64:
615
+ return 82;
616
+ case 65:
617
+ return 83;
618
+ case 66:
619
+ return 84;
620
+ case 67:
621
+ return 85;
622
+ case 68:
623
+ return 86;
624
+ case 69:
625
+ return 86;
626
+ case 70:
627
+ return 69;
628
+ case 71:
629
+ return 70;
630
+ case 72:
631
+ return 5;
632
+ case 73:
633
+ return "INVALID";
634
+ }
635
+ }, "anonymous"),
636
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:@\{)/i, /^(?:[^\}]+)/i, /^(?:\})/i, /^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i, /^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:<<->>)/i, /^(?:-->>)/i, /^(?:<<-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i, /^(?::)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
637
+ conditions: { acc_descr_multiline: { rules: [50, 51], inclusive: !1 }, acc_descr: { rules: [48], inclusive: !1 }, acc_title: { rules: [46], inclusive: !1 }, ID: { rules: [2, 3, 7, 10, 11, 17], inclusive: !1 }, ALIAS: { rules: [2, 3, 18, 19], inclusive: !1 }, LINE: { rules: [2, 3, 31], inclusive: !1 }, CONFIG: { rules: [8, 9], inclusive: !1 }, CONFIG_DATA: { rules: [], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 49, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], inclusive: !0 } }
638
+ };
639
+ return pt;
640
+ }();
641
+ Yt.lexer = ye;
642
+ function At() {
643
+ this.yy = {};
644
+ }
645
+ return f(At, "Parser"), At.prototype = Yt, Yt.Parser = At, new At();
646
+ }();
647
+ Ut.parser = Ut;
648
+ var Ve = Ut, Ye = {
649
+ SOLID: 0,
650
+ DOTTED: 1,
651
+ NOTE: 2,
652
+ SOLID_CROSS: 3,
653
+ DOTTED_CROSS: 4,
654
+ SOLID_OPEN: 5,
655
+ DOTTED_OPEN: 6,
656
+ LOOP_START: 10,
657
+ LOOP_END: 11,
658
+ ALT_START: 12,
659
+ ALT_ELSE: 13,
660
+ ALT_END: 14,
661
+ OPT_START: 15,
662
+ OPT_END: 16,
663
+ ACTIVE_START: 17,
664
+ ACTIVE_END: 18,
665
+ PAR_START: 19,
666
+ PAR_AND: 20,
667
+ PAR_END: 21,
668
+ RECT_START: 22,
669
+ RECT_END: 23,
670
+ SOLID_POINT: 24,
671
+ DOTTED_POINT: 25,
672
+ AUTONUMBER: 26,
673
+ CRITICAL_START: 27,
674
+ CRITICAL_OPTION: 28,
675
+ CRITICAL_END: 29,
676
+ BREAK_START: 30,
677
+ BREAK_END: 31,
678
+ PAR_OVER_START: 32,
679
+ BIDIRECTIONAL_SOLID: 33,
680
+ BIDIRECTIONAL_DOTTED: 34
681
+ }, We = {
682
+ FILLED: 0,
683
+ OPEN: 1
684
+ }, Fe = {
685
+ LEFTOF: 0,
686
+ RIGHTOF: 1,
687
+ OVER: 2
688
+ }, Rt = {
689
+ ACTOR: "actor",
690
+ CONTROL: "control",
691
+ DATABASE: "database",
692
+ ENTITY: "entity"
693
+ }, Lt, qe = (Lt = class {
694
+ constructor() {
695
+ this.state = new Be(() => ({
696
+ prevActor: void 0,
697
+ actors: /* @__PURE__ */ new Map(),
698
+ createdActors: /* @__PURE__ */ new Map(),
699
+ destroyedActors: /* @__PURE__ */ new Map(),
700
+ boxes: [],
701
+ messages: [],
702
+ notes: [],
703
+ sequenceNumbersEnabled: !1,
704
+ wrapEnabled: void 0,
705
+ currentBox: void 0,
706
+ lastCreated: void 0,
707
+ lastDestroyed: void 0
708
+ })), this.setAccTitle = se, this.setAccDescription = Ae, this.setDiagramTitle = ke, this.getAccTitle = Pe, this.getAccDescription = Ne, this.getDiagramTitle = Se, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(st().wrap), this.LINETYPE = Ye, this.ARROWTYPE = We, this.PLACEMENT = Fe;
709
+ }
710
+ addBox(t) {
711
+ this.state.records.boxes.push({
712
+ name: t.text,
713
+ wrap: t.wrap ?? this.autoWrap(),
714
+ fill: t.color,
715
+ actorKeys: []
716
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
717
+ }
718
+ addActor(t, n, s, r, i) {
719
+ let c = this.state.records.currentBox, h;
720
+ if (i !== void 0) {
721
+ let a;
722
+ i.includes(`
723
+ `) ? a = i + `
724
+ ` : a = `{
725
+ ` + i + `
726
+ }`, h = Me(a, { schema: Re });
727
+ }
728
+ r = (h == null ? void 0 : h.type) ?? r;
729
+ const o = this.state.records.actors.get(t);
730
+ if (o) {
731
+ if (this.state.records.currentBox && o.box && this.state.records.currentBox !== o.box)
732
+ throw new Error(
733
+ `A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
734
+ );
735
+ if (c = o.box ? o.box : this.state.records.currentBox, o.box = c, o && n === o.name && s == null)
736
+ return;
737
+ }
738
+ if ((s == null ? void 0 : s.text) == null && (s = { text: n, type: r }), (r == null || s.text == null) && (s = { text: n, type: r }), this.state.records.actors.set(t, {
739
+ box: c,
740
+ name: n,
741
+ description: s.text,
742
+ wrap: s.wrap ?? this.autoWrap(),
743
+ prevActor: this.state.records.prevActor,
744
+ links: {},
745
+ properties: {},
746
+ actorCnt: null,
747
+ rectData: null,
748
+ type: r ?? "participant"
749
+ }), this.state.records.prevActor) {
750
+ const a = this.state.records.actors.get(this.state.records.prevActor);
751
+ a && (a.nextActor = t);
752
+ }
753
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(t), this.state.records.prevActor = t;
754
+ }
755
+ activationCount(t) {
756
+ let n, s = 0;
757
+ if (!t)
758
+ return 0;
759
+ for (n = 0; n < this.state.records.messages.length; n++)
760
+ this.state.records.messages[n].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[n].from === t && s++, this.state.records.messages[n].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[n].from === t && s--;
761
+ return s;
762
+ }
763
+ addMessage(t, n, s, r) {
764
+ this.state.records.messages.push({
765
+ id: this.state.records.messages.length.toString(),
766
+ from: t,
767
+ to: n,
768
+ message: s.text,
769
+ wrap: s.wrap ?? this.autoWrap(),
770
+ answer: r
771
+ });
772
+ }
773
+ addSignal(t, n, s, r, i = !1) {
774
+ if (r === this.LINETYPE.ACTIVE_END && this.activationCount(t ?? "") < 1) {
775
+ const h = new Error("Trying to inactivate an inactive participant (" + t + ")");
776
+ throw h.hash = {
777
+ text: "->>-",
778
+ token: "->>-",
779
+ line: "1",
780
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
781
+ expected: ["'ACTIVE_PARTICIPANT'"]
782
+ }, h;
783
+ }
784
+ return this.state.records.messages.push({
785
+ id: this.state.records.messages.length.toString(),
786
+ from: t,
787
+ to: n,
788
+ message: (s == null ? void 0 : s.text) ?? "",
789
+ wrap: (s == null ? void 0 : s.wrap) ?? this.autoWrap(),
790
+ type: r,
791
+ activate: i
792
+ }), !0;
793
+ }
794
+ hasAtLeastOneBox() {
795
+ return this.state.records.boxes.length > 0;
796
+ }
797
+ hasAtLeastOneBoxWithTitle() {
798
+ return this.state.records.boxes.some((t) => t.name);
799
+ }
800
+ getMessages() {
801
+ return this.state.records.messages;
802
+ }
803
+ getBoxes() {
804
+ return this.state.records.boxes;
805
+ }
806
+ getActors() {
807
+ return this.state.records.actors;
808
+ }
809
+ getCreatedActors() {
810
+ return this.state.records.createdActors;
811
+ }
812
+ getDestroyedActors() {
813
+ return this.state.records.destroyedActors;
814
+ }
815
+ getActor(t) {
816
+ return this.state.records.actors.get(t);
817
+ }
818
+ getActorKeys() {
819
+ return [...this.state.records.actors.keys()];
820
+ }
821
+ enableSequenceNumbers() {
822
+ this.state.records.sequenceNumbersEnabled = !0;
823
+ }
824
+ disableSequenceNumbers() {
825
+ this.state.records.sequenceNumbersEnabled = !1;
826
+ }
827
+ showSequenceNumbers() {
828
+ return this.state.records.sequenceNumbersEnabled;
829
+ }
830
+ setWrap(t) {
831
+ this.state.records.wrapEnabled = t;
832
+ }
833
+ extractWrap(t) {
834
+ if (t === void 0)
835
+ return {};
836
+ t = t.trim();
837
+ const n = /^:?wrap:/.exec(t) !== null ? !0 : /^:?nowrap:/.exec(t) !== null ? !1 : void 0;
838
+ return { cleanedText: (n === void 0 ? t : t.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: n };
839
+ }
840
+ autoWrap() {
841
+ var t;
842
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : ((t = st().sequence) == null ? void 0 : t.wrap) ?? !1;
843
+ }
844
+ clear() {
845
+ this.state.reset(), De();
846
+ }
847
+ parseMessage(t) {
848
+ const n = t.trim(), { wrap: s, cleanedText: r } = this.extractWrap(n), i = {
849
+ text: r,
850
+ wrap: s
851
+ };
852
+ return Q.debug(`parseMessage: ${JSON.stringify(i)}`), i;
853
+ }
854
+ // We expect the box statement to be color first then description
855
+ // The color can be rgb,rgba,hsl,hsla, or css code names #hex codes are not supported for now because of the way the char # is handled
856
+ // We extract first segment as color, the rest of the line is considered as text
857
+ parseBoxData(t) {
858
+ const n = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);
859
+ let s = n != null && n[1] ? n[1].trim() : "transparent", r = n != null && n[2] ? n[2].trim() : void 0;
860
+ if (window != null && window.CSS)
861
+ window.CSS.supports("color", s) || (s = "transparent", r = t.trim());
862
+ else {
863
+ const h = new Option().style;
864
+ h.color = s, h.color !== s && (s = "transparent", r = t.trim());
865
+ }
866
+ const { wrap: i, cleanedText: c } = this.extractWrap(r);
867
+ return {
868
+ text: c ? Mt(c, st()) : void 0,
869
+ color: s,
870
+ wrap: i
871
+ };
872
+ }
873
+ addNote(t, n, s) {
874
+ const r = {
875
+ actor: t,
876
+ placement: n,
877
+ message: s.text,
878
+ wrap: s.wrap ?? this.autoWrap()
879
+ }, i = [].concat(t, t);
880
+ this.state.records.notes.push(r), this.state.records.messages.push({
881
+ id: this.state.records.messages.length.toString(),
882
+ from: i[0],
883
+ to: i[1],
884
+ message: s.text,
885
+ wrap: s.wrap ?? this.autoWrap(),
886
+ type: this.LINETYPE.NOTE,
887
+ placement: n
888
+ });
889
+ }
890
+ addLinks(t, n) {
891
+ const s = this.getActor(t);
892
+ try {
893
+ let r = Mt(n.text, st());
894
+ r = r.replace(/&equals;/g, "="), r = r.replace(/&amp;/g, "&");
895
+ const i = JSON.parse(r);
896
+ this.insertLinks(s, i);
897
+ } catch (r) {
898
+ Q.error("error while parsing actor link text", r);
899
+ }
900
+ }
901
+ addALink(t, n) {
902
+ const s = this.getActor(t);
903
+ try {
904
+ const r = {};
905
+ let i = Mt(n.text, st());
906
+ const c = i.indexOf("@");
907
+ i = i.replace(/&equals;/g, "="), i = i.replace(/&amp;/g, "&");
908
+ const h = i.slice(0, c - 1).trim(), o = i.slice(c + 1).trim();
909
+ r[h] = o, this.insertLinks(s, r);
910
+ } catch (r) {
911
+ Q.error("error while parsing actor link text", r);
912
+ }
913
+ }
914
+ insertLinks(t, n) {
915
+ if (t.links == null)
916
+ t.links = n;
917
+ else
918
+ for (const s in n)
919
+ t.links[s] = n[s];
920
+ }
921
+ addProperties(t, n) {
922
+ const s = this.getActor(t);
923
+ try {
924
+ const r = Mt(n.text, st()), i = JSON.parse(r);
925
+ this.insertProperties(s, i);
926
+ } catch (r) {
927
+ Q.error("error while parsing actor properties text", r);
928
+ }
929
+ }
930
+ insertProperties(t, n) {
931
+ if (t.properties == null)
932
+ t.properties = n;
933
+ else
934
+ for (const s in n)
935
+ t.properties[s] = n[s];
936
+ }
937
+ boxEnd() {
938
+ this.state.records.currentBox = void 0;
939
+ }
940
+ addDetails(t, n) {
941
+ const s = this.getActor(t), r = document.getElementById(n.text);
942
+ try {
943
+ const i = r.innerHTML, c = JSON.parse(i);
944
+ c.properties && this.insertProperties(s, c.properties), c.links && this.insertLinks(s, c.links);
945
+ } catch (i) {
946
+ Q.error("error while parsing actor details text", i);
947
+ }
948
+ }
949
+ getActorProperty(t, n) {
950
+ if ((t == null ? void 0 : t.properties) !== void 0)
951
+ return t.properties[n];
952
+ }
953
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
954
+ apply(t) {
955
+ if (Array.isArray(t))
956
+ t.forEach((n) => {
957
+ this.apply(n);
958
+ });
959
+ else
960
+ switch (t.type) {
961
+ case "sequenceIndex":
962
+ this.state.records.messages.push({
963
+ id: this.state.records.messages.length.toString(),
964
+ from: void 0,
965
+ to: void 0,
966
+ message: {
967
+ start: t.sequenceIndex,
968
+ step: t.sequenceIndexStep,
969
+ visible: t.sequenceVisible
970
+ },
971
+ wrap: !1,
972
+ type: t.signalType
973
+ });
974
+ break;
975
+ case "addParticipant":
976
+ this.addActor(t.actor, t.actor, t.description, t.draw, t.config);
977
+ break;
978
+ case "createParticipant":
979
+ if (this.state.records.actors.has(t.actor))
980
+ throw new Error(
981
+ "It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior"
982
+ );
983
+ this.state.records.lastCreated = t.actor, this.addActor(t.actor, t.actor, t.description, t.draw, t.config), this.state.records.createdActors.set(t.actor, this.state.records.messages.length);
984
+ break;
985
+ case "destroyParticipant":
986
+ this.state.records.lastDestroyed = t.actor, this.state.records.destroyedActors.set(t.actor, this.state.records.messages.length);
987
+ break;
988
+ case "activeStart":
989
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
990
+ break;
991
+ case "activeEnd":
992
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
993
+ break;
994
+ case "addNote":
995
+ this.addNote(t.actor, t.placement, t.text);
996
+ break;
997
+ case "addLinks":
998
+ this.addLinks(t.actor, t.text);
999
+ break;
1000
+ case "addALink":
1001
+ this.addALink(t.actor, t.text);
1002
+ break;
1003
+ case "addProperties":
1004
+ this.addProperties(t.actor, t.text);
1005
+ break;
1006
+ case "addDetails":
1007
+ this.addDetails(t.actor, t.text);
1008
+ break;
1009
+ case "addMessage":
1010
+ if (this.state.records.lastCreated) {
1011
+ if (t.to !== this.state.records.lastCreated)
1012
+ throw new Error(
1013
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1014
+ );
1015
+ this.state.records.lastCreated = void 0;
1016
+ } else if (this.state.records.lastDestroyed) {
1017
+ if (t.to !== this.state.records.lastDestroyed && t.from !== this.state.records.lastDestroyed)
1018
+ throw new Error(
1019
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1020
+ );
1021
+ this.state.records.lastDestroyed = void 0;
1022
+ }
1023
+ this.addSignal(t.from, t.to, t.msg, t.signalType, t.activate);
1024
+ break;
1025
+ case "boxStart":
1026
+ this.addBox(t.boxData);
1027
+ break;
1028
+ case "boxEnd":
1029
+ this.boxEnd();
1030
+ break;
1031
+ case "loopStart":
1032
+ this.addSignal(void 0, void 0, t.loopText, t.signalType);
1033
+ break;
1034
+ case "loopEnd":
1035
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1036
+ break;
1037
+ case "rectStart":
1038
+ this.addSignal(void 0, void 0, t.color, t.signalType);
1039
+ break;
1040
+ case "rectEnd":
1041
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1042
+ break;
1043
+ case "optStart":
1044
+ this.addSignal(void 0, void 0, t.optText, t.signalType);
1045
+ break;
1046
+ case "optEnd":
1047
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1048
+ break;
1049
+ case "altStart":
1050
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1051
+ break;
1052
+ case "else":
1053
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1054
+ break;
1055
+ case "altEnd":
1056
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1057
+ break;
1058
+ case "setAccTitle":
1059
+ se(t.text);
1060
+ break;
1061
+ case "parStart":
1062
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1063
+ break;
1064
+ case "and":
1065
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1066
+ break;
1067
+ case "parEnd":
1068
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1069
+ break;
1070
+ case "criticalStart":
1071
+ this.addSignal(void 0, void 0, t.criticalText, t.signalType);
1072
+ break;
1073
+ case "option":
1074
+ this.addSignal(void 0, void 0, t.optionText, t.signalType);
1075
+ break;
1076
+ case "criticalEnd":
1077
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1078
+ break;
1079
+ case "breakStart":
1080
+ this.addSignal(void 0, void 0, t.breakText, t.signalType);
1081
+ break;
1082
+ case "breakEnd":
1083
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1084
+ break;
1085
+ }
1086
+ }
1087
+ getConfig() {
1088
+ return st().sequence;
1089
+ }
1090
+ }, f(Lt, "SequenceDB"), Lt), ze = /* @__PURE__ */ f((e) => `.actor {
1091
+ stroke: ${e.actorBorder};
1092
+ fill: ${e.actorBkg};
1093
+ }
1094
+
1095
+ text.actor > tspan {
1096
+ fill: ${e.actorTextColor};
1097
+ stroke: none;
1098
+ }
1099
+
1100
+ .actor-line {
1101
+ stroke: ${e.actorLineColor};
1102
+ }
1103
+
1104
+ .innerArc {
1105
+ stroke-width: 1.5;
1106
+ stroke-dasharray: none;
1107
+ }
1108
+
1109
+ .messageLine0 {
1110
+ stroke-width: 1.5;
1111
+ stroke-dasharray: none;
1112
+ stroke: ${e.signalColor};
1113
+ }
1114
+
1115
+ .messageLine1 {
1116
+ stroke-width: 1.5;
1117
+ stroke-dasharray: 2, 2;
1118
+ stroke: ${e.signalColor};
1119
+ }
1120
+
1121
+ #arrowhead path {
1122
+ fill: ${e.signalColor};
1123
+ stroke: ${e.signalColor};
1124
+ }
1125
+
1126
+ .sequenceNumber {
1127
+ fill: ${e.sequenceNumberColor};
1128
+ }
1129
+
1130
+ #sequencenumber {
1131
+ fill: ${e.signalColor};
1132
+ }
1133
+
1134
+ #crosshead path {
1135
+ fill: ${e.signalColor};
1136
+ stroke: ${e.signalColor};
1137
+ }
1138
+
1139
+ .messageText {
1140
+ fill: ${e.signalTextColor};
1141
+ stroke: none;
1142
+ }
1143
+
1144
+ .labelBox {
1145
+ stroke: ${e.labelBoxBorderColor};
1146
+ fill: ${e.labelBoxBkgColor};
1147
+ }
1148
+
1149
+ .labelText, .labelText > tspan {
1150
+ fill: ${e.labelTextColor};
1151
+ stroke: none;
1152
+ }
1153
+
1154
+ .loopText, .loopText > tspan {
1155
+ fill: ${e.loopTextColor};
1156
+ stroke: none;
1157
+ }
1158
+
1159
+ .loopLine {
1160
+ stroke-width: 2px;
1161
+ stroke-dasharray: 2, 2;
1162
+ stroke: ${e.labelBoxBorderColor};
1163
+ fill: ${e.labelBoxBorderColor};
1164
+ }
1165
+
1166
+ .note {
1167
+ //stroke: #decc93;
1168
+ stroke: ${e.noteBorderColor};
1169
+ fill: ${e.noteBkgColor};
1170
+ }
1171
+
1172
+ .noteText, .noteText > tspan {
1173
+ fill: ${e.noteTextColor};
1174
+ stroke: none;
1175
+ }
1176
+
1177
+ .activation0 {
1178
+ fill: ${e.activationBkgColor};
1179
+ stroke: ${e.activationBorderColor};
1180
+ }
1181
+
1182
+ .activation1 {
1183
+ fill: ${e.activationBkgColor};
1184
+ stroke: ${e.activationBorderColor};
1185
+ }
1186
+
1187
+ .activation2 {
1188
+ fill: ${e.activationBkgColor};
1189
+ stroke: ${e.activationBorderColor};
1190
+ }
1191
+
1192
+ .actorPopupMenu {
1193
+ position: absolute;
1194
+ }
1195
+
1196
+ .actorPopupMenuPanel {
1197
+ position: absolute;
1198
+ fill: ${e.actorBkg};
1199
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1200
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1201
+ }
1202
+ .actor-man line {
1203
+ stroke: ${e.actorBorder};
1204
+ fill: ${e.actorBkg};
1205
+ }
1206
+ .actor-man circle, line {
1207
+ stroke: ${e.actorBorder};
1208
+ fill: ${e.actorBkg};
1209
+ stroke-width: 2px;
1210
+ }
1211
+
1212
+ `, "getStyles"), He = ze, Tt = 18 * 2, gt = "actor-top", xt = "actor-bottom", Ct = "actor-box", ut = "actor-man", It = /* @__PURE__ */ f(function(e, t) {
1213
+ return ve(e, t);
1214
+ }, "drawRect"), Ue = /* @__PURE__ */ f(function(e, t, n, s, r) {
1215
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1216
+ return { height: 0, width: 0 };
1217
+ const i = t.links, c = t.actorCnt, h = t.rectData;
1218
+ var o = "none";
1219
+ r && (o = "block !important");
1220
+ const a = e.append("g");
1221
+ a.attr("id", "actor" + c + "_popup"), a.attr("class", "actorPopupMenu"), a.attr("display", o);
1222
+ var p = "";
1223
+ h.class !== void 0 && (p = " " + h.class);
1224
+ let g = h.width > n ? h.width : n;
1225
+ const x = a.append("rect");
1226
+ if (x.attr("class", "actorPopupMenuPanel" + p), x.attr("x", h.x), x.attr("y", h.height), x.attr("fill", h.fill), x.attr("stroke", h.stroke), x.attr("width", g), x.attr("height", h.height), x.attr("rx", h.rx), x.attr("ry", h.ry), i != null) {
1227
+ var y = 20;
1228
+ for (let k in i) {
1229
+ var b = a.append("a"), w = re(i[k]);
1230
+ b.attr("xlink:href", w), b.attr("target", "_blank"), us(s)(
1231
+ k,
1232
+ b,
1233
+ h.x + 10,
1234
+ h.height + y,
1235
+ g,
1236
+ 20,
1237
+ { class: "actor" },
1238
+ s
1239
+ ), y += 30;
1240
+ }
1241
+ }
1242
+ return x.attr("height", y), { height: h.height + y, width: g };
1243
+ }, "drawPopup"), Ot = /* @__PURE__ */ f(function(e) {
1244
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1245
+ }, "popupMenuToggle"), Dt = /* @__PURE__ */ f(async function(e, t, n = null) {
1246
+ let s = e.append("foreignObject");
1247
+ const r = await ne(t.text, Ht()), c = s.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();
1248
+ if (s.attr("height", Math.round(c.height)).attr("width", Math.round(c.width)), t.class === "noteText") {
1249
+ const h = e.node().firstChild;
1250
+ h.setAttribute("height", c.height + 2 * t.textMargin);
1251
+ const o = h.getBBox();
1252
+ s.attr("x", Math.round(o.x + o.width / 2 - c.width / 2)).attr("y", Math.round(o.y + o.height / 2 - c.height / 2));
1253
+ } else if (n) {
1254
+ let { startx: h, stopx: o, starty: a } = n;
1255
+ if (h > o) {
1256
+ const p = h;
1257
+ h = o, o = p;
1258
+ }
1259
+ s.attr("x", Math.round(h + Math.abs(h - o) / 2 - c.width / 2)), t.class === "loopText" ? s.attr("y", Math.round(a)) : s.attr("y", Math.round(a - c.height));
1260
+ }
1261
+ return [s];
1262
+ }, "drawKatex"), wt = /* @__PURE__ */ f(function(e, t) {
1263
+ let n = 0, s = 0;
1264
+ const r = t.text.split(I.lineBreakRegex), [i, c] = ie(t.fontSize);
1265
+ let h = [], o = 0, a = /* @__PURE__ */ f(() => t.y, "yfunc");
1266
+ if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1267
+ switch (t.valign) {
1268
+ case "top":
1269
+ case "start":
1270
+ a = /* @__PURE__ */ f(() => Math.round(t.y + t.textMargin), "yfunc");
1271
+ break;
1272
+ case "middle":
1273
+ case "center":
1274
+ a = /* @__PURE__ */ f(() => Math.round(t.y + (n + s + t.textMargin) / 2), "yfunc");
1275
+ break;
1276
+ case "bottom":
1277
+ case "end":
1278
+ a = /* @__PURE__ */ f(() => Math.round(
1279
+ t.y + (n + s + 2 * t.textMargin) - t.textMargin
1280
+ ), "yfunc");
1281
+ break;
1282
+ }
1283
+ if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1284
+ switch (t.anchor) {
1285
+ case "left":
1286
+ case "start":
1287
+ t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1288
+ break;
1289
+ case "middle":
1290
+ case "center":
1291
+ t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1292
+ break;
1293
+ case "right":
1294
+ case "end":
1295
+ t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1296
+ break;
1297
+ }
1298
+ for (let [p, g] of r.entries()) {
1299
+ t.textMargin !== void 0 && t.textMargin === 0 && i !== void 0 && (o = p * i);
1300
+ const x = e.append("text");
1301
+ x.attr("x", t.x), x.attr("y", a()), t.anchor !== void 0 && x.attr("text-anchor", t.anchor).attr("dominant-baseline", t.dominantBaseline).attr("alignment-baseline", t.alignmentBaseline), t.fontFamily !== void 0 && x.style("font-family", t.fontFamily), c !== void 0 && x.style("font-size", c), t.fontWeight !== void 0 && x.style("font-weight", t.fontWeight), t.fill !== void 0 && x.attr("fill", t.fill), t.class !== void 0 && x.attr("class", t.class), t.dy !== void 0 ? x.attr("dy", t.dy) : o !== 0 && x.attr("dy", o);
1302
+ const y = g || Ce;
1303
+ if (t.tspan) {
1304
+ const b = x.append("tspan");
1305
+ b.attr("x", t.x), t.fill !== void 0 && b.attr("fill", t.fill), b.text(y);
1306
+ } else
1307
+ x.text(y);
1308
+ t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (s += (x._groups || x)[0][0].getBBox().height, n = s), h.push(x);
1309
+ }
1310
+ return h;
1311
+ }, "drawText"), oe = /* @__PURE__ */ f(function(e, t) {
1312
+ function n(r, i, c, h, o) {
1313
+ return r + "," + i + " " + (r + c) + "," + i + " " + (r + c) + "," + (i + h - o) + " " + (r + c - o * 1.2) + "," + (i + h) + " " + r + "," + (i + h);
1314
+ }
1315
+ f(n, "genPoints");
1316
+ const s = e.append("polygon");
1317
+ return s.attr("points", n(t.x, t.y, t.width, t.height, 7)), s.attr("class", "labelBox"), t.y = t.y + t.height / 2, wt(e, t), s;
1318
+ }, "drawLabel"), P = -1, ce = /* @__PURE__ */ f((e, t, n, s) => {
1319
+ e.select && n.forEach((r) => {
1320
+ const i = t.get(r), c = e.select("#actor" + i.actorCnt);
1321
+ !s.mirrorActors && i.stopy ? c.attr("y2", i.stopy + i.height / 2) : s.mirrorActors && c.attr("y2", i.stopy);
1322
+ });
1323
+ }, "fixLifeLineHeights"), Ge = /* @__PURE__ */ f(function(e, t, n, s) {
1324
+ var y, b;
1325
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1326
+ var o = h;
1327
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1328
+ const a = ct();
1329
+ var p = "actor";
1330
+ (y = t.properties) != null && y.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.rx = 3, a.ry = 3, a.name = t.name;
1331
+ const g = It(o, a);
1332
+ if (t.rectData = a, (b = t.properties) != null && b.icon) {
1333
+ const w = t.properties.icon.trim();
1334
+ w.charAt(0) === "@" ? Jt(o, a.x + a.width - 20, a.y + 10, w.substr(1)) : Qt(o, a.x + a.width - 20, a.y + 10, w);
1335
+ }
1336
+ dt(n, z(t.description))(
1337
+ t.description,
1338
+ o,
1339
+ a.x,
1340
+ a.y,
1341
+ a.width,
1342
+ a.height,
1343
+ { class: `actor ${Ct}` },
1344
+ n
1345
+ );
1346
+ let x = t.height;
1347
+ if (g.node) {
1348
+ const w = g.node().getBBox();
1349
+ t.height = w.height, x = w.height;
1350
+ }
1351
+ return x;
1352
+ }, "drawActorTypeParticipant"), Ke = /* @__PURE__ */ f(function(e, t, n, s) {
1353
+ var w, k;
1354
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1355
+ var o = h;
1356
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1357
+ const a = ct();
1358
+ var p = "actor";
1359
+ (w = t.properties) != null && w.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name;
1360
+ const g = 6, x = {
1361
+ ...a,
1362
+ x: a.x + -g,
1363
+ y: a.y + +g,
1364
+ class: "actor"
1365
+ }, y = It(o, a);
1366
+ if (It(o, x), t.rectData = a, (k = t.properties) != null && k.icon) {
1367
+ const N = t.properties.icon.trim();
1368
+ N.charAt(0) === "@" ? Jt(o, a.x + a.width - 20, a.y + 10, N.substr(1)) : Qt(o, a.x + a.width - 20, a.y + 10, N);
1369
+ }
1370
+ dt(n, z(t.description))(
1371
+ t.description,
1372
+ o,
1373
+ a.x - g,
1374
+ a.y + g,
1375
+ a.width,
1376
+ a.height,
1377
+ { class: `actor ${Ct}` },
1378
+ n
1379
+ );
1380
+ let b = t.height;
1381
+ if (y.node) {
1382
+ const N = y.node().getBBox();
1383
+ t.height = N.height, b = N.height;
1384
+ }
1385
+ return b;
1386
+ }, "drawActorTypeCollections"), Xe = /* @__PURE__ */ f(function(e, t, n, s) {
1387
+ var N, S;
1388
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1389
+ let o = h;
1390
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1391
+ const a = ct();
1392
+ let p = "actor";
1393
+ (N = t.properties) != null && N.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name;
1394
+ const g = a.height / 2, x = g / (2.5 + a.height / 50), y = o.append("g"), b = o.append("g");
1395
+ if (y.append("path").attr(
1396
+ "d",
1397
+ `M ${a.x},${a.y + g}
1398
+ a ${x},${g} 0 0 0 0,${a.height}
1399
+ h ${a.width - 2 * x}
1400
+ a ${x},${g} 0 0 0 0,-${a.height}
1401
+ Z
1402
+ `
1403
+ ).attr("class", p), b.append("path").attr(
1404
+ "d",
1405
+ `M ${a.x},${a.y + g}
1406
+ a ${x},${g} 0 0 0 0,${a.height}`
1407
+ ).attr("stroke", "#666").attr("stroke-width", "1px").attr("class", p), y.attr("transform", `translate(${x}, ${-(a.height / 2)})`), b.attr("transform", `translate(${a.width - x}, ${-a.height / 2})`), t.rectData = a, (S = t.properties) != null && S.icon) {
1408
+ const M = t.properties.icon.trim(), C = a.x + a.width - 20, Y = a.y + 10;
1409
+ M.charAt(0) === "@" ? Jt(o, C, Y, M.substr(1)) : Qt(o, C, Y, M);
1410
+ }
1411
+ dt(n, z(t.description))(
1412
+ t.description,
1413
+ o,
1414
+ a.x,
1415
+ a.y,
1416
+ a.width,
1417
+ a.height,
1418
+ { class: `actor ${Ct}` },
1419
+ n
1420
+ );
1421
+ let w = t.height;
1422
+ const k = y.select("path:last-child");
1423
+ if (k.node()) {
1424
+ const M = k.node().getBBox();
1425
+ t.height = M.height, w = M.height;
1426
+ }
1427
+ return w;
1428
+ }, "drawActorTypeQueue"), Je = /* @__PURE__ */ f(function(e, t, n, s) {
1429
+ var w;
1430
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 75, h = e.append("g").lower();
1431
+ s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1432
+ const o = e.append("g");
1433
+ let a = ut;
1434
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1435
+ const p = ct();
1436
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor";
1437
+ const g = t.x + t.width / 2, x = r + 30, y = 18;
1438
+ o.append("defs").append("marker").attr("id", "filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").append("path").attr("d", "M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"), o.append("circle").attr("cx", g).attr("cy", x).attr("r", y).attr("fill", "#eaeaf7").attr("stroke", "#666").attr("stroke-width", 1.2), o.append("line").attr("marker-end", "url(#filled-head-control)").attr("transform", `translate(${g}, ${x - y})`);
1439
+ const b = o.node().getBBox();
1440
+ return t.height = b.height + 2 * (((w = n == null ? void 0 : n.sequence) == null ? void 0 : w.labelBoxHeight) ?? 0), dt(n, z(t.description))(
1441
+ t.description,
1442
+ o,
1443
+ p.x,
1444
+ p.y + y + (s ? 5 : 10),
1445
+ p.width,
1446
+ p.height,
1447
+ { class: `actor ${ut}` },
1448
+ n
1449
+ ), t.height;
1450
+ }, "drawActorTypeControl"), Qe = /* @__PURE__ */ f(function(e, t, n, s) {
1451
+ var w;
1452
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 75, h = e.append("g").lower(), o = e.append("g");
1453
+ let a = ut;
1454
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1455
+ const p = ct();
1456
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor";
1457
+ const g = t.x + t.width / 2, x = r + (s ? 10 : 25), y = 18;
1458
+ o.append("circle").attr("cx", g).attr("cy", x).attr("r", y).attr("width", t.width).attr("height", t.height), o.append("line").attr("x1", g - y).attr("x2", g + y).attr("y1", x + y).attr("y2", x + y).attr("stroke", "#333").attr("stroke-width", 2);
1459
+ const b = o.node().getBBox();
1460
+ return t.height = b.height + (((w = n == null ? void 0 : n.sequence) == null ? void 0 : w.labelBoxHeight) ?? 0), s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P), dt(n, z(t.description))(
1461
+ t.description,
1462
+ o,
1463
+ p.x,
1464
+ p.y + (s ? (x - r + y - 5) / 2 : (x + y - r) / 2),
1465
+ p.width,
1466
+ p.height,
1467
+ { class: `actor ${ut}` },
1468
+ n
1469
+ ), s ? o.attr("transform", `translate(0, ${y / 2})`) : o.attr("transform", `translate(0, ${y / 2})`), t.height;
1470
+ }, "drawActorTypeEntity"), Ze = /* @__PURE__ */ f(function(e, t, n, s) {
1471
+ var S;
1472
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height + 2 * n.boxTextMargin, h = e.append("g").lower();
1473
+ let o = h;
1474
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1475
+ const a = ct();
1476
+ let p = "actor";
1477
+ (S = t.properties) != null && S.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name, a.x = t.x, a.y = r;
1478
+ const g = a.width / 4, x = a.width / 4, y = g / 2, b = y / (2.5 + g / 50), w = o.append("g"), k = `
1479
+ M ${a.x},${a.y + b}
1480
+ a ${y},${b} 0 0 0 ${g},0
1481
+ a ${y},${b} 0 0 0 -${g},0
1482
+ l 0,${x - 2 * b}
1483
+ a ${y},${b} 0 0 0 ${g},0
1484
+ l 0,-${x - 2 * b}
1485
+ `;
1486
+ w.append("path").attr("d", k).attr("fill", "#eaeaea").attr("stroke", "#000").attr("stroke-width", 1).attr("class", p), s ? w.attr("transform", `translate(${g * 1.5}, ${a.height / 4 - 2 * b})`) : w.attr("transform", `translate(${g * 1.5}, ${(a.height + b) / 4})`), t.rectData = a, dt(n, z(t.description))(
1487
+ t.description,
1488
+ o,
1489
+ a.x,
1490
+ a.y + (s ? (a.height + x) / 4 : (a.height + b) / 2),
1491
+ a.width,
1492
+ a.height,
1493
+ { class: `actor ${Ct}` },
1494
+ n
1495
+ );
1496
+ const N = w.select("path:last-child");
1497
+ if (N.node()) {
1498
+ const M = N.node().getBBox();
1499
+ t.height = M.height + (n.sequence.labelBoxHeight ?? 0);
1500
+ }
1501
+ return t.height;
1502
+ }, "drawActorTypeDatabase"), $e = /* @__PURE__ */ f(function(e, t, n, s) {
1503
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 80, h = 30, o = e.append("g").lower();
1504
+ s || (P++, o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1505
+ const a = e.append("g");
1506
+ let p = ut;
1507
+ s ? p += ` ${xt}` : p += ` ${gt}`, a.attr("class", p), a.attr("name", t.name);
1508
+ const g = ct();
1509
+ g.x = t.x, g.y = r, g.fill = "#eaeaea", g.width = t.width, g.height = t.height, g.class = "actor", a.append("line").attr("id", "actor-man-torso" + P).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 10).attr("x2", t.x + t.width / 2 - 15).attr("y2", r + 10), a.append("line").attr("id", "actor-man-arms" + P).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 0).attr("x2", t.x + t.width / 2 - h * 2.5).attr("y2", r + 20), a.append("circle").attr("cx", t.x + t.width / 2).attr("cy", r + 10).attr("r", h);
1510
+ const x = a.node().getBBox();
1511
+ return t.height = x.height + (n.sequence.labelBoxHeight ?? 0), dt(n, z(t.description))(
1512
+ t.description,
1513
+ a,
1514
+ g.x,
1515
+ g.y + (s ? h / 2 - 4 : h / 2 + 3),
1516
+ g.width,
1517
+ g.height,
1518
+ { class: `actor ${ut}` },
1519
+ n
1520
+ ), s ? a.attr("transform", `translate(0,${h / 2 + 7})`) : a.attr("transform", `translate(0,${h / 2 + 7})`), t.height;
1521
+ }, "drawActorTypeBoundary"), je = /* @__PURE__ */ f(function(e, t, n, s) {
1522
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 80, h = e.append("g").lower();
1523
+ s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1524
+ const o = e.append("g");
1525
+ let a = ut;
1526
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1527
+ const p = ct();
1528
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor", p.rx = 3, p.ry = 3, o.append("line").attr("id", "actor-man-torso" + P).attr("x1", i).attr("y1", r + 25).attr("x2", i).attr("y2", r + 45), o.append("line").attr("id", "actor-man-arms" + P).attr("x1", i - Tt / 2).attr("y1", r + 33).attr("x2", i + Tt / 2).attr("y2", r + 33), o.append("line").attr("x1", i - Tt / 2).attr("y1", r + 60).attr("x2", i).attr("y2", r + 45), o.append("line").attr("x1", i).attr("y1", r + 45).attr("x2", i + Tt / 2 - 2).attr("y2", r + 60);
1529
+ const g = o.append("circle");
1530
+ g.attr("cx", t.x + t.width / 2), g.attr("cy", r + 10), g.attr("r", 15), g.attr("width", t.width), g.attr("height", t.height);
1531
+ const x = o.node().getBBox();
1532
+ return t.height = x.height, dt(n, z(t.description))(
1533
+ t.description,
1534
+ o,
1535
+ p.x,
1536
+ p.y + 35,
1537
+ p.width,
1538
+ p.height,
1539
+ { class: `actor ${ut}` },
1540
+ n
1541
+ ), t.height;
1542
+ }, "drawActorTypeActor"), ts = /* @__PURE__ */ f(async function(e, t, n, s) {
1543
+ switch (t.type) {
1544
+ case "actor":
1545
+ return await je(e, t, n, s);
1546
+ case "participant":
1547
+ return await Ge(e, t, n, s);
1548
+ case "boundary":
1549
+ return await $e(e, t, n, s);
1550
+ case "control":
1551
+ return await Je(e, t, n, s);
1552
+ case "entity":
1553
+ return await Qe(e, t, n, s);
1554
+ case "database":
1555
+ return await Ze(e, t, n, s);
1556
+ case "collections":
1557
+ return await Ke(e, t, n, s);
1558
+ case "queue":
1559
+ return await Xe(e, t, n, s);
1560
+ }
1561
+ }, "drawActor"), es = /* @__PURE__ */ f(function(e, t, n) {
1562
+ const r = e.append("g");
1563
+ le(r, t), t.name && dt(n)(
1564
+ t.name,
1565
+ r,
1566
+ t.x,
1567
+ t.y + n.boxTextMargin + (t.textMaxHeight || 0) / 2,
1568
+ t.width,
1569
+ 0,
1570
+ { class: "text" },
1571
+ n
1572
+ ), r.lower();
1573
+ }, "drawBox"), ss = /* @__PURE__ */ f(function(e) {
1574
+ return e.append("g");
1575
+ }, "anchorElement"), as = /* @__PURE__ */ f(function(e, t, n, s, r) {
1576
+ const i = ct(), c = t.anchored;
1577
+ i.x = t.startx, i.y = t.starty, i.class = "activation" + r % 3, i.width = t.stopx - t.startx, i.height = n - t.starty, It(c, i);
1578
+ }, "drawActivation"), rs = /* @__PURE__ */ f(async function(e, t, n, s) {
1579
+ const {
1580
+ boxMargin: r,
1581
+ boxTextMargin: i,
1582
+ labelBoxHeight: c,
1583
+ labelBoxWidth: h,
1584
+ messageFontFamily: o,
1585
+ messageFontSize: a,
1586
+ messageFontWeight: p
1587
+ } = s, g = e.append("g"), x = /* @__PURE__ */ f(function(w, k, N, S) {
1588
+ return g.append("line").attr("x1", w).attr("y1", k).attr("x2", N).attr("y2", S).attr("class", "loopLine");
1589
+ }, "drawLoopLine");
1590
+ x(t.startx, t.starty, t.stopx, t.starty), x(t.stopx, t.starty, t.stopx, t.stopy), x(t.startx, t.stopy, t.stopx, t.stopy), x(t.startx, t.starty, t.startx, t.stopy), t.sections !== void 0 && t.sections.forEach(function(w) {
1591
+ x(t.startx, w.y, t.stopx, w.y).style(
1592
+ "stroke-dasharray",
1593
+ "3, 3"
1594
+ );
1595
+ });
1596
+ let y = Xt();
1597
+ y.text = n, y.x = t.startx, y.y = t.starty, y.fontFamily = o, y.fontSize = a, y.fontWeight = p, y.anchor = "middle", y.valign = "middle", y.tspan = !1, y.width = h || 50, y.height = c || 20, y.textMargin = i, y.class = "labelText", oe(g, y), y = he(), y.text = t.title, y.x = t.startx + h / 2 + (t.stopx - t.startx) / 2, y.y = t.starty + r + i, y.anchor = "middle", y.valign = "middle", y.textMargin = i, y.class = "loopText", y.fontFamily = o, y.fontSize = a, y.fontWeight = p, y.wrap = !0;
1598
+ let b = z(y.text) ? await Dt(g, y, t) : wt(g, y);
1599
+ if (t.sectionTitles !== void 0) {
1600
+ for (const [w, k] of Object.entries(t.sectionTitles))
1601
+ if (k.message) {
1602
+ y.text = k.message, y.x = t.startx + (t.stopx - t.startx) / 2, y.y = t.sections[w].y + r + i, y.class = "loopText", y.anchor = "middle", y.valign = "middle", y.tspan = !1, y.fontFamily = o, y.fontSize = a, y.fontWeight = p, y.wrap = t.wrap, z(y.text) ? (t.starty = t.sections[w].y, await Dt(g, y, t)) : wt(g, y);
1603
+ let N = Math.round(
1604
+ b.map((S) => (S._groups || S)[0][0].getBBox().height).reduce((S, M) => S + M)
1605
+ );
1606
+ t.sections[w].height += N - (r + i);
1607
+ }
1608
+ }
1609
+ return t.height = Math.round(t.stopy - t.starty), g;
1610
+ }, "drawLoop"), le = /* @__PURE__ */ f(function(e, t) {
1611
+ we(e, t);
1612
+ }, "drawBackgroundRect"), is = /* @__PURE__ */ f(function(e) {
1613
+ e.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1614
+ "d",
1615
+ "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z"
1616
+ );
1617
+ }, "insertDatabaseIcon"), ns = /* @__PURE__ */ f(function(e) {
1618
+ e.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1619
+ "d",
1620
+ "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z"
1621
+ );
1622
+ }, "insertComputerIcon"), os = /* @__PURE__ */ f(function(e) {
1623
+ e.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1624
+ "d",
1625
+ "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z"
1626
+ );
1627
+ }, "insertClockIcon"), cs = /* @__PURE__ */ f(function(e) {
1628
+ e.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M -1 0 L 10 5 L 0 10 z");
1629
+ }, "insertArrowHead"), ls = /* @__PURE__ */ f(function(e) {
1630
+ e.append("defs").append("marker").attr("id", "filled-head").attr("refX", 15.5).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");
1631
+ }, "insertArrowFilledHead"), hs = /* @__PURE__ */ f(function(e) {
1632
+ e.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1633
+ }, "insertSequenceNumber"), ds = /* @__PURE__ */ f(function(e) {
1634
+ e.append("defs").append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5).append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7");
1635
+ }, "insertArrowCrossHead"), he = /* @__PURE__ */ f(function() {
1636
+ return {
1637
+ x: 0,
1638
+ y: 0,
1639
+ fill: void 0,
1640
+ anchor: void 0,
1641
+ style: "#666",
1642
+ width: void 0,
1643
+ height: void 0,
1644
+ textMargin: 0,
1645
+ rx: 0,
1646
+ ry: 0,
1647
+ tspan: !0,
1648
+ valign: void 0
1649
+ };
1650
+ }, "getTextObj"), ps = /* @__PURE__ */ f(function() {
1651
+ return {
1652
+ x: 0,
1653
+ y: 0,
1654
+ fill: "#EDF2AE",
1655
+ stroke: "#666",
1656
+ width: 100,
1657
+ anchor: "start",
1658
+ height: 100,
1659
+ rx: 0,
1660
+ ry: 0
1661
+ };
1662
+ }, "getNoteRect"), dt = /* @__PURE__ */ function() {
1663
+ function e(i, c, h, o, a, p, g) {
1664
+ const x = c.append("text").attr("x", h + a / 2).attr("y", o + p / 2 + 5).style("text-anchor", "middle").text(i);
1665
+ r(x, g);
1666
+ }
1667
+ f(e, "byText");
1668
+ function t(i, c, h, o, a, p, g, x) {
1669
+ const { actorFontSize: y, actorFontFamily: b, actorFontWeight: w } = x, [k, N] = ie(y), S = i.split(I.lineBreakRegex);
1670
+ for (let M = 0; M < S.length; M++) {
1671
+ const C = M * k - k * (S.length - 1) / 2, Y = c.append("text").attr("x", h + a / 2).attr("y", o).style("text-anchor", "middle").style("font-size", N).style("font-weight", w).style("font-family", b);
1672
+ Y.append("tspan").attr("x", h + a / 2).attr("dy", C).text(S[M]), Y.attr("y", o + p / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(Y, g);
1673
+ }
1674
+ }
1675
+ f(t, "byTspan");
1676
+ function n(i, c, h, o, a, p, g, x) {
1677
+ const y = c.append("switch"), w = y.append("foreignObject").attr("x", h).attr("y", o).attr("width", a).attr("height", p).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1678
+ w.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, y, h, o, a, p, g, x), r(w, g);
1679
+ }
1680
+ f(n, "byFo");
1681
+ async function s(i, c, h, o, a, p, g, x) {
1682
+ const y = await _t(i, Ht()), b = c.append("switch"), k = b.append("foreignObject").attr("x", h + a / 2 - y.width / 2).attr("y", o + p / 2 - y.height / 2).attr("width", y.width).attr("height", y.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1683
+ k.append("div").style("text-align", "center").style("vertical-align", "middle").html(await ne(i, Ht())), t(i, b, h, o, a, p, g, x), r(k, g);
1684
+ }
1685
+ f(s, "byKatex");
1686
+ function r(i, c) {
1687
+ for (const h in c)
1688
+ c.hasOwnProperty(h) && i.attr(h, c[h]);
1689
+ }
1690
+ return f(r, "_setTextAttrs"), function(i, c = !1) {
1691
+ return c ? s : i.textPlacement === "fo" ? n : i.textPlacement === "old" ? e : t;
1692
+ };
1693
+ }(), us = /* @__PURE__ */ function() {
1694
+ function e(r, i, c, h, o, a, p) {
1695
+ const g = i.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").text(r);
1696
+ s(g, p);
1697
+ }
1698
+ f(e, "byText");
1699
+ function t(r, i, c, h, o, a, p, g) {
1700
+ const { actorFontSize: x, actorFontFamily: y, actorFontWeight: b } = g, w = r.split(I.lineBreakRegex);
1701
+ for (let k = 0; k < w.length; k++) {
1702
+ const N = k * x - x * (w.length - 1) / 2, S = i.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").style("font-size", x).style("font-weight", b).style("font-family", y);
1703
+ S.append("tspan").attr("x", c).attr("dy", N).text(w[k]), S.attr("y", h + a / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(S, p);
1704
+ }
1705
+ }
1706
+ f(t, "byTspan");
1707
+ function n(r, i, c, h, o, a, p, g) {
1708
+ const x = i.append("switch"), b = x.append("foreignObject").attr("x", c).attr("y", h).attr("width", o).attr("height", a).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1709
+ b.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), t(r, x, c, h, o, a, p, g), s(b, p);
1710
+ }
1711
+ f(n, "byFo");
1712
+ function s(r, i) {
1713
+ for (const c in i)
1714
+ i.hasOwnProperty(c) && r.attr(c, i[c]);
1715
+ }
1716
+ return f(s, "_setTextAttrs"), function(r) {
1717
+ return r.textPlacement === "fo" ? n : r.textPlacement === "old" ? e : t;
1718
+ };
1719
+ }(), V = {
1720
+ drawRect: It,
1721
+ drawText: wt,
1722
+ drawLabel: oe,
1723
+ drawActor: ts,
1724
+ drawBox: es,
1725
+ drawPopup: Ue,
1726
+ anchorElement: ss,
1727
+ drawActivation: as,
1728
+ drawLoop: rs,
1729
+ drawBackgroundRect: le,
1730
+ insertArrowHead: cs,
1731
+ insertArrowFilledHead: ls,
1732
+ insertSequenceNumber: hs,
1733
+ insertArrowCrossHead: ds,
1734
+ insertDatabaseIcon: is,
1735
+ insertComputerIcon: ns,
1736
+ insertClockIcon: os,
1737
+ getTextObj: he,
1738
+ getNoteRect: ps,
1739
+ fixLifeLineHeights: ce,
1740
+ sanitizeUrl: re
1741
+ }, l = {}, T = {
1742
+ data: {
1743
+ startx: void 0,
1744
+ stopx: void 0,
1745
+ starty: void 0,
1746
+ stopy: void 0
1747
+ },
1748
+ verticalPos: 0,
1749
+ sequenceItems: [],
1750
+ activations: [],
1751
+ models: {
1752
+ getHeight: /* @__PURE__ */ f(function() {
1753
+ return Math.max.apply(
1754
+ null,
1755
+ this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
1756
+ ) + (this.loops.length === 0 ? 0 : this.loops.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.messages.length === 0 ? 0 : this.messages.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.notes.length === 0 ? 0 : this.notes.map((e) => e.height || 0).reduce((e, t) => e + t));
1757
+ }, "getHeight"),
1758
+ clear: /* @__PURE__ */ f(function() {
1759
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1760
+ }, "clear"),
1761
+ addBox: /* @__PURE__ */ f(function(e) {
1762
+ this.boxes.push(e);
1763
+ }, "addBox"),
1764
+ addActor: /* @__PURE__ */ f(function(e) {
1765
+ this.actors.push(e);
1766
+ }, "addActor"),
1767
+ addLoop: /* @__PURE__ */ f(function(e) {
1768
+ this.loops.push(e);
1769
+ }, "addLoop"),
1770
+ addMessage: /* @__PURE__ */ f(function(e) {
1771
+ this.messages.push(e);
1772
+ }, "addMessage"),
1773
+ addNote: /* @__PURE__ */ f(function(e) {
1774
+ this.notes.push(e);
1775
+ }, "addNote"),
1776
+ lastActor: /* @__PURE__ */ f(function() {
1777
+ return this.actors[this.actors.length - 1];
1778
+ }, "lastActor"),
1779
+ lastLoop: /* @__PURE__ */ f(function() {
1780
+ return this.loops[this.loops.length - 1];
1781
+ }, "lastLoop"),
1782
+ lastMessage: /* @__PURE__ */ f(function() {
1783
+ return this.messages[this.messages.length - 1];
1784
+ }, "lastMessage"),
1785
+ lastNote: /* @__PURE__ */ f(function() {
1786
+ return this.notes[this.notes.length - 1];
1787
+ }, "lastNote"),
1788
+ actors: [],
1789
+ boxes: [],
1790
+ loops: [],
1791
+ messages: [],
1792
+ notes: []
1793
+ },
1794
+ init: /* @__PURE__ */ f(function() {
1795
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1796
+ startx: void 0,
1797
+ stopx: void 0,
1798
+ starty: void 0,
1799
+ stopy: void 0
1800
+ }, this.verticalPos = 0, ue(st());
1801
+ }, "init"),
1802
+ updateVal: /* @__PURE__ */ f(function(e, t, n, s) {
1803
+ e[t] === void 0 ? e[t] = n : e[t] = s(n, e[t]);
1804
+ }, "updateVal"),
1805
+ updateBounds: /* @__PURE__ */ f(function(e, t, n, s) {
1806
+ const r = this;
1807
+ let i = 0;
1808
+ function c(h) {
1809
+ return /* @__PURE__ */ f(function(a) {
1810
+ i++;
1811
+ const p = r.sequenceItems.length - i + 1;
1812
+ r.updateVal(a, "starty", t - p * l.boxMargin, Math.min), r.updateVal(a, "stopy", s + p * l.boxMargin, Math.max), r.updateVal(T.data, "startx", e - p * l.boxMargin, Math.min), r.updateVal(T.data, "stopx", n + p * l.boxMargin, Math.max), h !== "activation" && (r.updateVal(a, "startx", e - p * l.boxMargin, Math.min), r.updateVal(a, "stopx", n + p * l.boxMargin, Math.max), r.updateVal(T.data, "starty", t - p * l.boxMargin, Math.min), r.updateVal(T.data, "stopy", s + p * l.boxMargin, Math.max));
1813
+ }, "updateItemBounds");
1814
+ }
1815
+ f(c, "updateFn"), this.sequenceItems.forEach(c()), this.activations.forEach(c("activation"));
1816
+ }, "updateBounds"),
1817
+ insert: /* @__PURE__ */ f(function(e, t, n, s) {
1818
+ const r = I.getMin(e, n), i = I.getMax(e, n), c = I.getMin(t, s), h = I.getMax(t, s);
1819
+ this.updateVal(T.data, "startx", r, Math.min), this.updateVal(T.data, "starty", c, Math.min), this.updateVal(T.data, "stopx", i, Math.max), this.updateVal(T.data, "stopy", h, Math.max), this.updateBounds(r, c, i, h);
1820
+ }, "insert"),
1821
+ newActivation: /* @__PURE__ */ f(function(e, t, n) {
1822
+ const s = n.get(e.from), r = Bt(e.from).length || 0, i = s.x + s.width / 2 + (r - 1) * l.activationWidth / 2;
1823
+ this.activations.push({
1824
+ startx: i,
1825
+ starty: this.verticalPos + 2,
1826
+ stopx: i + l.activationWidth,
1827
+ stopy: void 0,
1828
+ actor: e.from,
1829
+ anchored: V.anchorElement(t)
1830
+ });
1831
+ }, "newActivation"),
1832
+ endActivation: /* @__PURE__ */ f(function(e) {
1833
+ const t = this.activations.map(function(n) {
1834
+ return n.actor;
1835
+ }).lastIndexOf(e.from);
1836
+ return this.activations.splice(t, 1)[0];
1837
+ }, "endActivation"),
1838
+ createLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
1839
+ return {
1840
+ startx: void 0,
1841
+ starty: this.verticalPos,
1842
+ stopx: void 0,
1843
+ stopy: void 0,
1844
+ title: e.message,
1845
+ wrap: e.wrap,
1846
+ width: e.width,
1847
+ height: 0,
1848
+ fill: t
1849
+ };
1850
+ }, "createLoop"),
1851
+ newLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
1852
+ this.sequenceItems.push(this.createLoop(e, t));
1853
+ }, "newLoop"),
1854
+ endLoop: /* @__PURE__ */ f(function() {
1855
+ return this.sequenceItems.pop();
1856
+ }, "endLoop"),
1857
+ isLoopOverlap: /* @__PURE__ */ f(function() {
1858
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
1859
+ }, "isLoopOverlap"),
1860
+ addSectionToLoop: /* @__PURE__ */ f(function(e) {
1861
+ const t = this.sequenceItems.pop();
1862
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: T.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
1863
+ }, "addSectionToLoop"),
1864
+ saveVerticalPos: /* @__PURE__ */ f(function() {
1865
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1866
+ }, "saveVerticalPos"),
1867
+ resetVerticalPos: /* @__PURE__ */ f(function() {
1868
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1869
+ }, "resetVerticalPos"),
1870
+ bumpVerticalPos: /* @__PURE__ */ f(function(e) {
1871
+ this.verticalPos = this.verticalPos + e, this.data.stopy = I.getMax(this.data.stopy, this.verticalPos);
1872
+ }, "bumpVerticalPos"),
1873
+ getVerticalPos: /* @__PURE__ */ f(function() {
1874
+ return this.verticalPos;
1875
+ }, "getVerticalPos"),
1876
+ getBounds: /* @__PURE__ */ f(function() {
1877
+ return { bounds: this.data, models: this.models };
1878
+ }, "getBounds")
1879
+ }, gs = /* @__PURE__ */ f(async function(e, t) {
1880
+ T.bumpVerticalPos(l.boxMargin), t.height = l.boxMargin, t.starty = T.getVerticalPos();
1881
+ const n = ct();
1882
+ n.x = t.startx, n.y = t.starty, n.width = t.width || l.width, n.class = "note";
1883
+ const s = e.append("g"), r = V.drawRect(s, n), i = Xt();
1884
+ i.x = t.startx, i.y = t.starty, i.width = n.width, i.dy = "1em", i.text = t.message, i.class = "noteText", i.fontFamily = l.noteFontFamily, i.fontSize = l.noteFontSize, i.fontWeight = l.noteFontWeight, i.anchor = l.noteAlign, i.textMargin = l.noteMargin, i.valign = "center";
1885
+ const c = z(i.text) ? await Dt(s, i) : wt(s, i), h = Math.round(
1886
+ c.map((o) => (o._groups || o)[0][0].getBBox().height).reduce((o, a) => o + a)
1887
+ );
1888
+ r.attr("height", h + 2 * l.noteMargin), t.height += h + 2 * l.noteMargin, T.bumpVerticalPos(h + 2 * l.noteMargin), t.stopy = t.starty + h + 2 * l.noteMargin, t.stopx = t.startx + n.width, T.insert(t.startx, t.starty, t.stopx, t.stopy), T.models.addNote(t);
1889
+ }, "drawNote"), Et = /* @__PURE__ */ f((e) => ({
1890
+ fontFamily: e.messageFontFamily,
1891
+ fontSize: e.messageFontSize,
1892
+ fontWeight: e.messageFontWeight
1893
+ }), "messageFont"), mt = /* @__PURE__ */ f((e) => ({
1894
+ fontFamily: e.noteFontFamily,
1895
+ fontSize: e.noteFontSize,
1896
+ fontWeight: e.noteFontWeight
1897
+ }), "noteFont"), Gt = /* @__PURE__ */ f((e) => ({
1898
+ fontFamily: e.actorFontFamily,
1899
+ fontSize: e.actorFontSize,
1900
+ fontWeight: e.actorFontWeight
1901
+ }), "actorFont");
1902
+ async function de(e, t) {
1903
+ T.bumpVerticalPos(10);
1904
+ const { startx: n, stopx: s, message: r } = t, i = I.splitBreaks(r).length, c = z(r), h = c ? await _t(r, st()) : F.calculateTextDimensions(r, Et(l));
1905
+ if (!c) {
1906
+ const g = h.height / i;
1907
+ t.height += g, T.bumpVerticalPos(g);
1908
+ }
1909
+ let o, a = h.height - 10;
1910
+ const p = h.width;
1911
+ if (n === s) {
1912
+ o = T.getVerticalPos() + a, l.rightAngles || (a += l.boxMargin, o = T.getVerticalPos() + a), a += 30;
1913
+ const g = I.getMax(p / 2, l.width / 2);
1914
+ T.insert(
1915
+ n - g,
1916
+ T.getVerticalPos() - 10 + a,
1917
+ s + g,
1918
+ T.getVerticalPos() + 30 + a
1919
+ );
1920
+ } else
1921
+ a += l.boxMargin, o = T.getVerticalPos() + a, T.insert(n, o - 10, s, o);
1922
+ return T.bumpVerticalPos(a), t.height += a, t.stopy = t.starty + t.height, T.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), o;
1923
+ }
1924
+ f(de, "boundMessage");
1925
+ var xs = /* @__PURE__ */ f(async function(e, t, n, s) {
1926
+ const { startx: r, stopx: i, starty: c, message: h, type: o, sequenceIndex: a, sequenceVisible: p } = t, g = F.calculateTextDimensions(h, Et(l)), x = Xt();
1927
+ x.x = r, x.y = c + 10, x.width = i - r, x.class = "messageText", x.dy = "1em", x.text = h, x.fontFamily = l.messageFontFamily, x.fontSize = l.messageFontSize, x.fontWeight = l.messageFontWeight, x.anchor = l.messageAlign, x.valign = "center", x.textMargin = l.wrapPadding, x.tspan = !1, z(x.text) ? await Dt(e, x, { startx: r, stopx: i, starty: n }) : wt(e, x);
1928
+ const y = g.width;
1929
+ let b;
1930
+ r === i ? l.rightAngles ? b = e.append("path").attr(
1931
+ "d",
1932
+ `M ${r},${n} H ${r + I.getMax(l.width / 2, y / 2)} V ${n + 25} H ${r}`
1933
+ ) : b = e.append("path").attr(
1934
+ "d",
1935
+ "M " + r + "," + n + " C " + (r + 60) + "," + (n - 10) + " " + (r + 60) + "," + (n + 30) + " " + r + "," + (n + 20)
1936
+ ) : (b = e.append("line"), b.attr("x1", r), b.attr("y1", n), b.attr("x2", i), b.attr("y2", n)), o === s.db.LINETYPE.DOTTED || o === s.db.LINETYPE.DOTTED_CROSS || o === s.db.LINETYPE.DOTTED_POINT || o === s.db.LINETYPE.DOTTED_OPEN || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED ? (b.style("stroke-dasharray", "3, 3"), b.attr("class", "messageLine1")) : b.attr("class", "messageLine0");
1937
+ let w = "";
1938
+ l.arrowMarkerAbsolute && (w = Oe(!0)), b.attr("stroke-width", 2), b.attr("stroke", "none"), b.style("fill", "none"), (o === s.db.LINETYPE.SOLID || o === s.db.LINETYPE.DOTTED) && b.attr("marker-end", "url(" + w + "#arrowhead)"), (o === s.db.LINETYPE.BIDIRECTIONAL_SOLID || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (b.attr("marker-start", "url(" + w + "#arrowhead)"), b.attr("marker-end", "url(" + w + "#arrowhead)")), (o === s.db.LINETYPE.SOLID_POINT || o === s.db.LINETYPE.DOTTED_POINT) && b.attr("marker-end", "url(" + w + "#filled-head)"), (o === s.db.LINETYPE.SOLID_CROSS || o === s.db.LINETYPE.DOTTED_CROSS) && b.attr("marker-end", "url(" + w + "#crosshead)"), (p || l.showSequenceNumbers) && ((o === s.db.LINETYPE.BIDIRECTIONAL_SOLID || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (r < i ? b.attr("x1", r + 2 * 6) : b.attr("x1", r + 6)), e.append("line").attr("x1", r).attr("y1", n).attr("x2", r).attr("y2", n).attr("stroke-width", 0).attr("marker-start", "url(" + w + "#sequencenumber)"), e.append("text").attr("x", r).attr("y", n + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(a));
1939
+ }, "drawMessage"), fs = /* @__PURE__ */ f(function(e, t, n, s, r, i, c) {
1940
+ let h = 0, o = 0, a, p = 0;
1941
+ for (const g of s) {
1942
+ const x = t.get(g), y = x.box;
1943
+ a && a != y && (c || T.models.addBox(a), o += l.boxMargin + a.margin), y && y != a && (c || (y.x = h + o, y.y = r), o += y.margin), x.width = x.width || l.width, x.height = I.getMax(x.height || l.height, l.height), x.margin = x.margin || l.actorMargin, p = I.getMax(p, x.height), n.get(x.name) && (o += x.width / 2), x.x = h + o, x.starty = T.getVerticalPos(), T.insert(x.x, r, x.x + x.width, x.height), h += x.width + o, x.box && (x.box.width = h + y.margin - x.box.x), o = x.margin, a = x.box, T.models.addActor(x);
1944
+ }
1945
+ a && !c && T.models.addBox(a), T.bumpVerticalPos(p);
1946
+ }, "addActorRenderingData"), Kt = /* @__PURE__ */ f(async function(e, t, n, s) {
1947
+ if (s) {
1948
+ let r = 0;
1949
+ T.bumpVerticalPos(l.boxMargin * 2);
1950
+ for (const i of n) {
1951
+ const c = t.get(i);
1952
+ c.stopy || (c.stopy = T.getVerticalPos());
1953
+ const h = await V.drawActor(e, c, l, !0);
1954
+ r = I.getMax(r, h);
1955
+ }
1956
+ T.bumpVerticalPos(r + l.boxMargin);
1957
+ } else
1958
+ for (const r of n) {
1959
+ const i = t.get(r);
1960
+ await V.drawActor(e, i, l, !1);
1961
+ }
1962
+ }, "drawActors"), pe = /* @__PURE__ */ f(function(e, t, n, s) {
1963
+ let r = 0, i = 0;
1964
+ for (const c of n) {
1965
+ const h = t.get(c), o = Ts(h), a = V.drawPopup(
1966
+ e,
1967
+ h,
1968
+ o,
1969
+ l,
1970
+ l.forceMenus,
1971
+ s
1972
+ );
1973
+ a.height > r && (r = a.height), a.width + h.x > i && (i = a.width + h.x);
1974
+ }
1975
+ return { maxHeight: r, maxWidth: i };
1976
+ }, "drawActorsPopup"), ue = /* @__PURE__ */ f(function(e) {
1977
+ _e(l, e), e.fontFamily && (l.actorFontFamily = l.noteFontFamily = l.messageFontFamily = e.fontFamily), e.fontSize && (l.actorFontSize = l.noteFontSize = l.messageFontSize = e.fontSize), e.fontWeight && (l.actorFontWeight = l.noteFontWeight = l.messageFontWeight = e.fontWeight);
1978
+ }, "setConf"), Bt = /* @__PURE__ */ f(function(e) {
1979
+ return T.activations.filter(function(t) {
1980
+ return t.actor === e;
1981
+ });
1982
+ }, "actorActivations"), ae = /* @__PURE__ */ f(function(e, t) {
1983
+ const n = t.get(e), s = Bt(e), r = s.reduce(
1984
+ function(c, h) {
1985
+ return I.getMin(c, h.startx);
1986
+ },
1987
+ n.x + n.width / 2 - 1
1988
+ ), i = s.reduce(
1989
+ function(c, h) {
1990
+ return I.getMax(c, h.stopx);
1991
+ },
1992
+ n.x + n.width / 2 + 1
1993
+ );
1994
+ return [r, i];
1995
+ }, "activationBounds");
1996
+ function nt(e, t, n, s, r) {
1997
+ T.bumpVerticalPos(n);
1998
+ let i = s;
1999
+ if (t.id && t.message && e[t.id]) {
2000
+ const c = e[t.id].width, h = Et(l);
2001
+ t.message = F.wrapLabel(`[${t.message}]`, c - 2 * l.wrapPadding, h), t.width = c, t.wrap = !0;
2002
+ const o = F.calculateTextDimensions(t.message, h), a = I.getMax(o.height, l.labelBoxHeight);
2003
+ i = s + a, Q.debug(`${a} - ${t.message}`);
2004
+ }
2005
+ r(t), T.bumpVerticalPos(i);
2006
+ }
2007
+ f(nt, "adjustLoopHeightForWrap");
2008
+ function ge(e, t, n, s, r, i, c) {
2009
+ function h(p, g) {
2010
+ p.x < r.get(e.from).x ? (T.insert(
2011
+ t.stopx - g,
2012
+ t.starty,
2013
+ t.startx,
2014
+ t.stopy + p.height / 2 + l.noteMargin
2015
+ ), t.stopx = t.stopx + g) : (T.insert(
2016
+ t.startx,
2017
+ t.starty,
2018
+ t.stopx + g,
2019
+ t.stopy + p.height / 2 + l.noteMargin
2020
+ ), t.stopx = t.stopx - g);
2021
+ }
2022
+ f(h, "receiverAdjustment");
2023
+ function o(p, g) {
2024
+ p.x < r.get(e.to).x ? (T.insert(
2025
+ t.startx - g,
2026
+ t.starty,
2027
+ t.stopx,
2028
+ t.stopy + p.height / 2 + l.noteMargin
2029
+ ), t.startx = t.startx + g) : (T.insert(
2030
+ t.stopx,
2031
+ t.starty,
2032
+ t.startx + g,
2033
+ t.stopy + p.height / 2 + l.noteMargin
2034
+ ), t.startx = t.startx - g);
2035
+ }
2036
+ f(o, "senderAdjustment");
2037
+ const a = [
2038
+ Rt.ACTOR,
2039
+ Rt.CONTROL,
2040
+ Rt.ENTITY,
2041
+ Rt.DATABASE
2042
+ ];
2043
+ if (i.get(e.to) == s) {
2044
+ const p = r.get(e.to), g = a.includes(p.type) ? Tt / 2 + 3 : p.width / 2 + 3;
2045
+ h(p, g), p.starty = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2046
+ } else if (c.get(e.from) == s) {
2047
+ const p = r.get(e.from);
2048
+ if (l.mirrorActors) {
2049
+ const g = a.includes(p.type) ? Tt / 2 : p.width / 2;
2050
+ o(p, g);
2051
+ }
2052
+ p.stopy = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2053
+ } else if (c.get(e.to) == s) {
2054
+ const p = r.get(e.to);
2055
+ if (l.mirrorActors) {
2056
+ const g = a.includes(p.type) ? Tt / 2 + 3 : p.width / 2 + 3;
2057
+ h(p, g);
2058
+ }
2059
+ p.stopy = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2060
+ }
2061
+ }
2062
+ f(ge, "adjustCreatedDestroyedData");
2063
+ var ys = /* @__PURE__ */ f(async function(e, t, n, s) {
2064
+ const { securityLevel: r, sequence: i } = st();
2065
+ l = i;
2066
+ let c;
2067
+ r === "sandbox" && (c = St("#i" + t));
2068
+ const h = r === "sandbox" ? St(c.nodes()[0].contentDocument.body) : St("body"), o = r === "sandbox" ? c.nodes()[0].contentDocument : document;
2069
+ T.init(), Q.debug(s.db);
2070
+ const a = r === "sandbox" ? h.select(`[id="${t}"]`) : St(`[id="${t}"]`), p = s.db.getActors(), g = s.db.getCreatedActors(), x = s.db.getDestroyedActors(), y = s.db.getBoxes();
2071
+ let b = s.db.getActorKeys();
2072
+ const w = s.db.getMessages(), k = s.db.getDiagramTitle(), N = s.db.hasAtLeastOneBox(), S = s.db.hasAtLeastOneBoxWithTitle(), M = await xe(p, w, s);
2073
+ if (l.height = await fe(p, M, y), V.insertComputerIcon(a), V.insertDatabaseIcon(a), V.insertClockIcon(a), N && (T.bumpVerticalPos(l.boxMargin), S && T.bumpVerticalPos(y[0].textMaxHeight)), l.hideUnusedParticipants === !0) {
2074
+ const E = /* @__PURE__ */ new Set();
2075
+ w.forEach((_) => {
2076
+ E.add(_.from), E.add(_.to);
2077
+ }), b = b.filter((_) => E.has(_));
2078
+ }
2079
+ fs(a, p, g, b, 0, w, !1);
2080
+ const C = await ms(w, p, M, s);
2081
+ V.insertArrowHead(a), V.insertArrowCrossHead(a), V.insertArrowFilledHead(a), V.insertSequenceNumber(a);
2082
+ function Y(E, _) {
2083
+ const X = T.endActivation(E);
2084
+ X.starty + 18 > _ && (X.starty = _ - 6, _ += 12), V.drawActivation(
2085
+ a,
2086
+ X,
2087
+ _,
2088
+ l,
2089
+ Bt(E.from).length
2090
+ ), T.insert(X.startx, _ - 10, X.stopx, _);
2091
+ }
2092
+ f(Y, "activeEnd");
2093
+ let H = 1, Z = 1;
2094
+ const at = [], U = [];
2095
+ let G = 0;
2096
+ for (const E of w) {
2097
+ let _, X, tt;
2098
+ switch (E.type) {
2099
+ case s.db.LINETYPE.NOTE:
2100
+ T.resetVerticalPos(), X = E.noteModel, await gs(a, X);
2101
+ break;
2102
+ case s.db.LINETYPE.ACTIVE_START:
2103
+ T.newActivation(E, a, p);
2104
+ break;
2105
+ case s.db.LINETYPE.ACTIVE_END:
2106
+ Y(E, T.getVerticalPos());
2107
+ break;
2108
+ case s.db.LINETYPE.LOOP_START:
2109
+ nt(
2110
+ C,
2111
+ E,
2112
+ l.boxMargin,
2113
+ l.boxMargin + l.boxTextMargin,
2114
+ (R) => T.newLoop(R)
2115
+ );
2116
+ break;
2117
+ case s.db.LINETYPE.LOOP_END:
2118
+ _ = T.endLoop(), await V.drawLoop(a, _, "loop", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2119
+ break;
2120
+ case s.db.LINETYPE.RECT_START:
2121
+ nt(
2122
+ C,
2123
+ E,
2124
+ l.boxMargin,
2125
+ l.boxMargin,
2126
+ (R) => T.newLoop(void 0, R.message)
2127
+ );
2128
+ break;
2129
+ case s.db.LINETYPE.RECT_END:
2130
+ _ = T.endLoop(), U.push(_), T.models.addLoop(_), T.bumpVerticalPos(_.stopy - T.getVerticalPos());
2131
+ break;
2132
+ case s.db.LINETYPE.OPT_START:
2133
+ nt(
2134
+ C,
2135
+ E,
2136
+ l.boxMargin,
2137
+ l.boxMargin + l.boxTextMargin,
2138
+ (R) => T.newLoop(R)
2139
+ );
2140
+ break;
2141
+ case s.db.LINETYPE.OPT_END:
2142
+ _ = T.endLoop(), await V.drawLoop(a, _, "opt", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2143
+ break;
2144
+ case s.db.LINETYPE.ALT_START:
2145
+ nt(
2146
+ C,
2147
+ E,
2148
+ l.boxMargin,
2149
+ l.boxMargin + l.boxTextMargin,
2150
+ (R) => T.newLoop(R)
2151
+ );
2152
+ break;
2153
+ case s.db.LINETYPE.ALT_ELSE:
2154
+ nt(
2155
+ C,
2156
+ E,
2157
+ l.boxMargin + l.boxTextMargin,
2158
+ l.boxMargin,
2159
+ (R) => T.addSectionToLoop(R)
2160
+ );
2161
+ break;
2162
+ case s.db.LINETYPE.ALT_END:
2163
+ _ = T.endLoop(), await V.drawLoop(a, _, "alt", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2164
+ break;
2165
+ case s.db.LINETYPE.PAR_START:
2166
+ case s.db.LINETYPE.PAR_OVER_START:
2167
+ nt(
2168
+ C,
2169
+ E,
2170
+ l.boxMargin,
2171
+ l.boxMargin + l.boxTextMargin,
2172
+ (R) => T.newLoop(R)
2173
+ ), T.saveVerticalPos();
2174
+ break;
2175
+ case s.db.LINETYPE.PAR_AND:
2176
+ nt(
2177
+ C,
2178
+ E,
2179
+ l.boxMargin + l.boxTextMargin,
2180
+ l.boxMargin,
2181
+ (R) => T.addSectionToLoop(R)
2182
+ );
2183
+ break;
2184
+ case s.db.LINETYPE.PAR_END:
2185
+ _ = T.endLoop(), await V.drawLoop(a, _, "par", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2186
+ break;
2187
+ case s.db.LINETYPE.AUTONUMBER:
2188
+ H = E.message.start || H, Z = E.message.step || Z, E.message.visible ? s.db.enableSequenceNumbers() : s.db.disableSequenceNumbers();
2189
+ break;
2190
+ case s.db.LINETYPE.CRITICAL_START:
2191
+ nt(
2192
+ C,
2193
+ E,
2194
+ l.boxMargin,
2195
+ l.boxMargin + l.boxTextMargin,
2196
+ (R) => T.newLoop(R)
2197
+ );
2198
+ break;
2199
+ case s.db.LINETYPE.CRITICAL_OPTION:
2200
+ nt(
2201
+ C,
2202
+ E,
2203
+ l.boxMargin + l.boxTextMargin,
2204
+ l.boxMargin,
2205
+ (R) => T.addSectionToLoop(R)
2206
+ );
2207
+ break;
2208
+ case s.db.LINETYPE.CRITICAL_END:
2209
+ _ = T.endLoop(), await V.drawLoop(a, _, "critical", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2210
+ break;
2211
+ case s.db.LINETYPE.BREAK_START:
2212
+ nt(
2213
+ C,
2214
+ E,
2215
+ l.boxMargin,
2216
+ l.boxMargin + l.boxTextMargin,
2217
+ (R) => T.newLoop(R)
2218
+ );
2219
+ break;
2220
+ case s.db.LINETYPE.BREAK_END:
2221
+ _ = T.endLoop(), await V.drawLoop(a, _, "break", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2222
+ break;
2223
+ default:
2224
+ try {
2225
+ tt = E.msgModel, tt.starty = T.getVerticalPos(), tt.sequenceIndex = H, tt.sequenceVisible = s.db.showSequenceNumbers();
2226
+ const R = await de(a, tt);
2227
+ ge(
2228
+ E,
2229
+ tt,
2230
+ R,
2231
+ G,
2232
+ p,
2233
+ g,
2234
+ x
2235
+ ), at.push({ messageModel: tt, lineStartY: R }), T.models.addMessage(tt);
2236
+ } catch (R) {
2237
+ Q.error("error while drawing message", R);
2238
+ }
2239
+ }
2240
+ [
2241
+ s.db.LINETYPE.SOLID_OPEN,
2242
+ s.db.LINETYPE.DOTTED_OPEN,
2243
+ s.db.LINETYPE.SOLID,
2244
+ s.db.LINETYPE.DOTTED,
2245
+ s.db.LINETYPE.SOLID_CROSS,
2246
+ s.db.LINETYPE.DOTTED_CROSS,
2247
+ s.db.LINETYPE.SOLID_POINT,
2248
+ s.db.LINETYPE.DOTTED_POINT,
2249
+ s.db.LINETYPE.BIDIRECTIONAL_SOLID,
2250
+ s.db.LINETYPE.BIDIRECTIONAL_DOTTED
2251
+ ].includes(E.type) && (H = H + Z), G++;
2252
+ }
2253
+ Q.debug("createdActors", g), Q.debug("destroyedActors", x), await Kt(a, p, b, !1);
2254
+ for (const E of at)
2255
+ await xs(a, E.messageModel, E.lineStartY, s);
2256
+ l.mirrorActors && await Kt(a, p, b, !0), U.forEach((E) => V.drawBackgroundRect(a, E)), ce(a, p, b, l);
2257
+ for (const E of T.models.boxes) {
2258
+ E.height = T.getVerticalPos() - E.y, T.insert(E.x, E.y, E.x + E.width, E.height);
2259
+ const _ = l.boxMargin * 2;
2260
+ E.startx = E.x - _, E.starty = E.y - _ * 0.25, E.stopx = E.startx + E.width + 2 * _, E.stopy = E.starty + E.height + _ * 0.75, E.stroke = "rgb(0,0,0, 0.5)", V.drawBox(a, E, l);
2261
+ }
2262
+ N && T.bumpVerticalPos(l.boxMargin);
2263
+ const q = pe(a, p, b, o), { bounds: O } = T.getBounds();
2264
+ O.startx === void 0 && (O.startx = 0), O.starty === void 0 && (O.starty = 0), O.stopx === void 0 && (O.stopx = 0), O.stopy === void 0 && (O.stopy = 0);
2265
+ let $ = O.stopy - O.starty;
2266
+ $ < q.maxHeight && ($ = q.maxHeight);
2267
+ let K = $ + 2 * l.diagramMarginY;
2268
+ l.mirrorActors && (K = K - l.boxMargin + l.bottomMarginAdj);
2269
+ let j = O.stopx - O.startx;
2270
+ j < q.maxWidth && (j = q.maxWidth);
2271
+ const rt = j + 2 * l.diagramMarginX;
2272
+ k && a.append("text").text(k).attr("x", (O.stopx - O.startx) / 2 - 2 * l.diagramMarginX).attr("y", -25), Le(a, K, rt, l.useMaxWidth);
2273
+ const D = k ? 40 : 0;
2274
+ a.attr(
2275
+ "viewBox",
2276
+ O.startx - l.diagramMarginX + " -" + (l.diagramMarginY + D) + " " + rt + " " + (K + D)
2277
+ ), Q.debug("models:", T.models);
2278
+ }, "draw");
2279
+ async function xe(e, t, n) {
2280
+ const s = {};
2281
+ for (const r of t)
2282
+ if (e.get(r.to) && e.get(r.from)) {
2283
+ const i = e.get(r.to);
2284
+ if (r.placement === n.db.PLACEMENT.LEFTOF && !i.prevActor || r.placement === n.db.PLACEMENT.RIGHTOF && !i.nextActor)
2285
+ continue;
2286
+ const c = r.placement !== void 0, h = !c, o = c ? mt(l) : Et(l), a = r.wrap ? F.wrapLabel(r.message, l.width - 2 * l.wrapPadding, o) : r.message, g = (z(a) ? await _t(r.message, st()) : F.calculateTextDimensions(a, o)).width + 2 * l.wrapPadding;
2287
+ h && r.from === i.nextActor ? s[r.to] = I.getMax(
2288
+ s[r.to] || 0,
2289
+ g
2290
+ ) : h && r.from === i.prevActor ? s[r.from] = I.getMax(
2291
+ s[r.from] || 0,
2292
+ g
2293
+ ) : h && r.from === r.to ? (s[r.from] = I.getMax(
2294
+ s[r.from] || 0,
2295
+ g / 2
2296
+ ), s[r.to] = I.getMax(
2297
+ s[r.to] || 0,
2298
+ g / 2
2299
+ )) : r.placement === n.db.PLACEMENT.RIGHTOF ? s[r.from] = I.getMax(
2300
+ s[r.from] || 0,
2301
+ g
2302
+ ) : r.placement === n.db.PLACEMENT.LEFTOF ? s[i.prevActor] = I.getMax(
2303
+ s[i.prevActor] || 0,
2304
+ g
2305
+ ) : r.placement === n.db.PLACEMENT.OVER && (i.prevActor && (s[i.prevActor] = I.getMax(
2306
+ s[i.prevActor] || 0,
2307
+ g / 2
2308
+ )), i.nextActor && (s[r.from] = I.getMax(
2309
+ s[r.from] || 0,
2310
+ g / 2
2311
+ )));
2312
+ }
2313
+ return Q.debug("maxMessageWidthPerActor:", s), s;
2314
+ }
2315
+ f(xe, "getMaxMessageWidthPerActor");
2316
+ var Ts = /* @__PURE__ */ f(function(e) {
2317
+ let t = 0;
2318
+ const n = Gt(l);
2319
+ for (const s in e.links) {
2320
+ const i = F.calculateTextDimensions(s, n).width + 2 * l.wrapPadding + 2 * l.boxMargin;
2321
+ t < i && (t = i);
2322
+ }
2323
+ return t;
2324
+ }, "getRequiredPopupWidth");
2325
+ async function fe(e, t, n) {
2326
+ let s = 0;
2327
+ for (const i of e.keys()) {
2328
+ const c = e.get(i);
2329
+ c.wrap && (c.description = F.wrapLabel(
2330
+ c.description,
2331
+ l.width - 2 * l.wrapPadding,
2332
+ Gt(l)
2333
+ ));
2334
+ const h = z(c.description) ? await _t(c.description, st()) : F.calculateTextDimensions(c.description, Gt(l));
2335
+ c.width = c.wrap ? l.width : I.getMax(l.width, h.width + 2 * l.wrapPadding), c.height = c.wrap ? I.getMax(h.height, l.height) : l.height, s = I.getMax(s, c.height);
2336
+ }
2337
+ for (const i in t) {
2338
+ const c = e.get(i);
2339
+ if (!c)
2340
+ continue;
2341
+ const h = e.get(c.nextActor);
2342
+ if (!h) {
2343
+ const g = t[i] + l.actorMargin - c.width / 2;
2344
+ c.margin = I.getMax(g, l.actorMargin);
2345
+ continue;
2346
+ }
2347
+ const a = t[i] + l.actorMargin - c.width / 2 - h.width / 2;
2348
+ c.margin = I.getMax(a, l.actorMargin);
2349
+ }
2350
+ let r = 0;
2351
+ return n.forEach((i) => {
2352
+ const c = Et(l);
2353
+ let h = i.actorKeys.reduce((g, x) => g += e.get(x).width + (e.get(x).margin || 0), 0);
2354
+ const o = l.boxMargin * 8;
2355
+ h += o, h -= 2 * l.boxTextMargin, i.wrap && (i.name = F.wrapLabel(i.name, h - 2 * l.wrapPadding, c));
2356
+ const a = F.calculateTextDimensions(i.name, c);
2357
+ r = I.getMax(a.height, r);
2358
+ const p = I.getMax(h, a.width + 2 * l.wrapPadding);
2359
+ if (i.margin = l.boxTextMargin, h < p) {
2360
+ const g = (p - h) / 2;
2361
+ i.margin += g;
2362
+ }
2363
+ }), n.forEach((i) => i.textMaxHeight = r), I.getMax(s, l.height);
2364
+ }
2365
+ f(fe, "calculateActorMargins");
2366
+ var Es = /* @__PURE__ */ f(async function(e, t, n) {
2367
+ const s = t.get(e.from), r = t.get(e.to), i = s.x, c = r.x, h = e.wrap && e.message;
2368
+ let o = z(e.message) ? await _t(e.message, st()) : F.calculateTextDimensions(
2369
+ h ? F.wrapLabel(e.message, l.width, mt(l)) : e.message,
2370
+ mt(l)
2371
+ );
2372
+ const a = {
2373
+ width: h ? l.width : I.getMax(l.width, o.width + 2 * l.noteMargin),
2374
+ height: 0,
2375
+ startx: s.x,
2376
+ stopx: 0,
2377
+ starty: 0,
2378
+ stopy: 0,
2379
+ message: e.message
2380
+ };
2381
+ return e.placement === n.db.PLACEMENT.RIGHTOF ? (a.width = h ? I.getMax(l.width, o.width) : I.getMax(
2382
+ s.width / 2 + r.width / 2,
2383
+ o.width + 2 * l.noteMargin
2384
+ ), a.startx = i + (s.width + l.actorMargin) / 2) : e.placement === n.db.PLACEMENT.LEFTOF ? (a.width = h ? I.getMax(l.width, o.width + 2 * l.noteMargin) : I.getMax(
2385
+ s.width / 2 + r.width / 2,
2386
+ o.width + 2 * l.noteMargin
2387
+ ), a.startx = i - a.width + (s.width - l.actorMargin) / 2) : e.to === e.from ? (o = F.calculateTextDimensions(
2388
+ h ? F.wrapLabel(e.message, I.getMax(l.width, s.width), mt(l)) : e.message,
2389
+ mt(l)
2390
+ ), a.width = h ? I.getMax(l.width, s.width) : I.getMax(s.width, l.width, o.width + 2 * l.noteMargin), a.startx = i + (s.width - a.width) / 2) : (a.width = Math.abs(i + s.width / 2 - (c + r.width / 2)) + l.actorMargin, a.startx = i < c ? i + s.width / 2 - l.actorMargin / 2 : c + r.width / 2 - l.actorMargin / 2), h && (a.message = F.wrapLabel(
2391
+ e.message,
2392
+ a.width - 2 * l.wrapPadding,
2393
+ mt(l)
2394
+ )), Q.debug(
2395
+ `NM:[${a.startx},${a.stopx},${a.starty},${a.stopy}:${a.width},${a.height}=${e.message}]`
2396
+ ), a;
2397
+ }, "buildNoteModel"), bs = /* @__PURE__ */ f(function(e, t, n) {
2398
+ if (![
2399
+ n.db.LINETYPE.SOLID_OPEN,
2400
+ n.db.LINETYPE.DOTTED_OPEN,
2401
+ n.db.LINETYPE.SOLID,
2402
+ n.db.LINETYPE.DOTTED,
2403
+ n.db.LINETYPE.SOLID_CROSS,
2404
+ n.db.LINETYPE.DOTTED_CROSS,
2405
+ n.db.LINETYPE.SOLID_POINT,
2406
+ n.db.LINETYPE.DOTTED_POINT,
2407
+ n.db.LINETYPE.BIDIRECTIONAL_SOLID,
2408
+ n.db.LINETYPE.BIDIRECTIONAL_DOTTED
2409
+ ].includes(e.type))
2410
+ return {};
2411
+ const [s, r] = ae(e.from, t), [i, c] = ae(e.to, t), h = s <= i;
2412
+ let o = h ? r : s, a = h ? i : c;
2413
+ const p = Math.abs(i - c) > 2, g = /* @__PURE__ */ f((w) => h ? -w : w, "adjustValue");
2414
+ e.from === e.to ? a = o : (e.activate && !p && (a += g(l.activationWidth / 2 - 1)), [n.db.LINETYPE.SOLID_OPEN, n.db.LINETYPE.DOTTED_OPEN].includes(e.type) || (a += g(3)), [n.db.LINETYPE.BIDIRECTIONAL_SOLID, n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
2415
+ e.type
2416
+ ) && (o -= g(3)));
2417
+ const x = [s, r, i, c], y = Math.abs(o - a);
2418
+ e.wrap && e.message && (e.message = F.wrapLabel(
2419
+ e.message,
2420
+ I.getMax(y + 2 * l.wrapPadding, l.width),
2421
+ Et(l)
2422
+ ));
2423
+ const b = F.calculateTextDimensions(e.message, Et(l));
2424
+ return {
2425
+ width: I.getMax(
2426
+ e.wrap ? 0 : b.width + 2 * l.wrapPadding,
2427
+ y + 2 * l.wrapPadding,
2428
+ l.width
2429
+ ),
2430
+ height: 0,
2431
+ startx: o,
2432
+ stopx: a,
2433
+ starty: 0,
2434
+ stopy: 0,
2435
+ message: e.message,
2436
+ type: e.type,
2437
+ wrap: e.wrap,
2438
+ fromBounds: Math.min.apply(null, x),
2439
+ toBounds: Math.max.apply(null, x)
2440
+ };
2441
+ }, "buildMessageModel"), ms = /* @__PURE__ */ f(async function(e, t, n, s) {
2442
+ const r = {}, i = [];
2443
+ let c, h, o;
2444
+ for (const a of e) {
2445
+ switch (a.type) {
2446
+ case s.db.LINETYPE.LOOP_START:
2447
+ case s.db.LINETYPE.ALT_START:
2448
+ case s.db.LINETYPE.OPT_START:
2449
+ case s.db.LINETYPE.PAR_START:
2450
+ case s.db.LINETYPE.PAR_OVER_START:
2451
+ case s.db.LINETYPE.CRITICAL_START:
2452
+ case s.db.LINETYPE.BREAK_START:
2453
+ i.push({
2454
+ id: a.id,
2455
+ msg: a.message,
2456
+ from: Number.MAX_SAFE_INTEGER,
2457
+ to: Number.MIN_SAFE_INTEGER,
2458
+ width: 0
2459
+ });
2460
+ break;
2461
+ case s.db.LINETYPE.ALT_ELSE:
2462
+ case s.db.LINETYPE.PAR_AND:
2463
+ case s.db.LINETYPE.CRITICAL_OPTION:
2464
+ a.message && (c = i.pop(), r[c.id] = c, r[a.id] = c, i.push(c));
2465
+ break;
2466
+ case s.db.LINETYPE.LOOP_END:
2467
+ case s.db.LINETYPE.ALT_END:
2468
+ case s.db.LINETYPE.OPT_END:
2469
+ case s.db.LINETYPE.PAR_END:
2470
+ case s.db.LINETYPE.CRITICAL_END:
2471
+ case s.db.LINETYPE.BREAK_END:
2472
+ c = i.pop(), r[c.id] = c;
2473
+ break;
2474
+ case s.db.LINETYPE.ACTIVE_START:
2475
+ {
2476
+ const g = t.get(a.from ? a.from : a.to.actor), x = Bt(a.from ? a.from : a.to.actor).length, y = g.x + g.width / 2 + (x - 1) * l.activationWidth / 2, b = {
2477
+ startx: y,
2478
+ stopx: y + l.activationWidth,
2479
+ actor: a.from,
2480
+ enabled: !0
2481
+ };
2482
+ T.activations.push(b);
2483
+ }
2484
+ break;
2485
+ case s.db.LINETYPE.ACTIVE_END:
2486
+ {
2487
+ const g = T.activations.map((x) => x.actor).lastIndexOf(a.from);
2488
+ T.activations.splice(g, 1).splice(0, 1);
2489
+ }
2490
+ break;
2491
+ }
2492
+ a.placement !== void 0 ? (h = await Es(a, t, s), a.noteModel = h, i.forEach((g) => {
2493
+ c = g, c.from = I.getMin(c.from, h.startx), c.to = I.getMax(c.to, h.startx + h.width), c.width = I.getMax(c.width, Math.abs(c.from - c.to)) - l.labelBoxWidth;
2494
+ })) : (o = bs(a, t, s), a.msgModel = o, o.startx && o.stopx && i.length > 0 && i.forEach((g) => {
2495
+ if (c = g, o.startx === o.stopx) {
2496
+ const x = t.get(a.from), y = t.get(a.to);
2497
+ c.from = I.getMin(
2498
+ x.x - o.width / 2,
2499
+ x.x - x.width / 2,
2500
+ c.from
2501
+ ), c.to = I.getMax(
2502
+ y.x + o.width / 2,
2503
+ y.x + x.width / 2,
2504
+ c.to
2505
+ ), c.width = I.getMax(c.width, Math.abs(c.to - c.from)) - l.labelBoxWidth;
2506
+ } else
2507
+ c.from = I.getMin(o.startx, c.from), c.to = I.getMax(o.stopx, c.to), c.width = I.getMax(c.width, o.width) - l.labelBoxWidth;
2508
+ }));
2509
+ }
2510
+ return T.activations = [], Q.debug("Loop type widths:", r), r;
2511
+ }, "calculateLoopBounds"), ws = {
2512
+ bounds: T,
2513
+ drawActors: Kt,
2514
+ drawActorsPopup: pe,
2515
+ setConf: ue,
2516
+ draw: ys
2517
+ }, Bs = {
2518
+ parser: Ve,
2519
+ get db() {
2520
+ return new qe();
2521
+ },
2522
+ renderer: ws,
2523
+ styles: He,
2524
+ init: /* @__PURE__ */ f((e) => {
2525
+ e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, Ie({ sequence: { wrap: e.wrap } }));
2526
+ }, "init")
2527
+ };
2528
+ export {
2529
+ Bs as diagram
2530
+ };