@vunk/plus 1.10.0 → 1.10.2

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 (312) hide show
  1. package/components/bubble-list/index.css +0 -22
  2. package/components/bubble-list/index.mjs +413 -9
  3. package/components/bubble-list/src/core/index.vue.d.ts +57 -0
  4. package/components/bubble-list/src/index.vue.d.ts +57 -0
  5. package/components/chat-independent/src/index.vue.d.ts +57 -0
  6. package/components/drawer/index.mjs +1 -1
  7. package/components/index3.mjs +20 -79450
  8. package/components/scrollbar/index.mjs +89 -15
  9. package/components/scrollbar/src/bar.d.ts +4 -0
  10. package/components/scrollbar/src/bar.vue.d.ts +26 -0
  11. package/components/scrollbar/src/index.vue.d.ts +57 -0
  12. package/components/scrollbar/src/thumb.d.ts +4 -0
  13. package/components/scrollbar/src/thumb.vue.d.ts +13 -0
  14. package/components/scrollbar/src/types.d.ts +5 -1
  15. package/components/tables-v1/src/ctx.d.ts +2 -2
  16. package/components/tables-v1/src/index.vue.d.ts +6 -6
  17. package/components/tables-v1-checkbox/src/ctx.d.ts +2 -2
  18. package/components/tables-v1-checkbox/src/index.vue.d.ts +12 -12
  19. package/components/text/src/ctx.d.ts +1 -1
  20. package/components/text/src/index.vue.d.ts +2 -2
  21. package/components/xgplayer/index.mjs +2 -16357
  22. package/index.css +0 -22
  23. package/package.json +1 -1
  24. package/components/_baseUniq-BXtq6_NW.mjs +0 -239
  25. package/components/abap-B7h4dtBh.mjs +0 -6
  26. package/components/actionscript-3-Bmm7RA3Y.mjs +0 -6
  27. package/components/ada-BZS802Se.mjs +0 -6
  28. package/components/andromeeda-CrngpmZk.mjs +0 -3
  29. package/components/apache-D4roVlsU.mjs +0 -6
  30. package/components/apex-D6mfw0H5.mjs +0 -6
  31. package/components/apl-DDK-VObo.mjs +0 -18
  32. package/components/applescript-C43Knf0G.mjs +0 -6
  33. package/components/ara-DRBH84ND.mjs +0 -6
  34. package/components/arc-Js_tyW10.mjs +0 -131
  35. package/components/architecture-O4VJ6CD3-ZoZ2IAk2.mjs +0 -15
  36. package/components/architectureDiagram-SUXI7LT5-kyYGGrHN.mjs +0 -8678
  37. package/components/asm-3tg4MVib.mjs +0 -6
  38. package/components/astro-v4FYbRud.mjs +0 -19
  39. package/components/aurora-x-wJ4-eM2h.mjs +0 -3
  40. package/components/awk-ChreaG-G.mjs +0 -6
  41. package/components/ayu-dark-BEKp3oqs.mjs +0 -3
  42. package/components/ballerina-B0yt0TYU.mjs +0 -6
  43. package/components/batch-Ce_EX3Sx.mjs +0 -14
  44. package/components/beancount-BRIsdQEB.mjs +0 -6
  45. package/components/berry-Brv4WWdL.mjs +0 -14
  46. package/components/bibtex-BLeFwAes.mjs +0 -6
  47. package/components/bicep-BVrgfErX.mjs +0 -6
  48. package/components/blade-By3Sw_Ex.mjs +0 -22
  49. package/components/blockDiagram-6J76NXCF-IAr4zDV3.mjs +0 -3610
  50. package/components/c-C4VtT7JA.mjs +0 -6
  51. package/components/c4Diagram-6F6E4RAY-Dv27rXcJ.mjs +0 -2492
  52. package/components/catppuccin-frappe-zLMNRRUx.mjs +0 -3
  53. package/components/catppuccin-latte-CdF5jC3c.mjs +0 -3
  54. package/components/catppuccin-macchiato-DyjXeyRt.mjs +0 -3
  55. package/components/catppuccin-mocha-66IdYxR8.mjs +0 -3
  56. package/components/cdc-30ktANo3.mjs +0 -14
  57. package/components/channel-BBZy6zOT.mjs +0 -7
  58. package/components/chunk-353BL4L5-Dn_Y_Yna.mjs +0 -17
  59. package/components/chunk-67H74DCK-Br5U8bfD.mjs +0 -102
  60. package/components/chunk-AACKK3MU-DH_MKxca.mjs +0 -17
  61. package/components/chunk-BFAMUDN2-DHLCoYMN.mjs +0 -13
  62. package/components/chunk-E2GYISFI-DQPHyyga.mjs +0 -19
  63. package/components/chunk-OW32GOEJ-CQOSE6Bn.mjs +0 -1924
  64. package/components/chunk-SKB7J2MH-BlwHRDiW.mjs +0 -25
  65. package/components/chunk-SZ463SBG-DEp8buKJ.mjs +0 -1823
  66. package/components/clarity-6uBl6Vpb.mjs +0 -6
  67. package/components/classDiagram-M3E45YP4-D0ySDe-v.mjs +0 -32
  68. package/components/classDiagram-v2-YAWTLIQI-D0ySDe-v.mjs +0 -32
  69. package/components/clojure-COBRmwo8.mjs +0 -14
  70. package/components/clone-CEJtuQzg.mjs +0 -8
  71. package/components/cmake-CDfQILeU.mjs +0 -6
  72. package/components/cobol-BOOIiISO.mjs +0 -13
  73. package/components/coffee-DO_RGoZp.mjs +0 -9
  74. package/components/cpp-DAK8ktHO.mjs +0 -25
  75. package/components/crystal-CBGbbyVp.mjs +0 -19
  76. package/components/cs-h3ksD6-P.mjs +0 -14
  77. package/components/css-BtVcDqlU.mjs +0 -6
  78. package/components/cue-BFSVLV6N.mjs +0 -6
  79. package/components/cypher-Dl2CXoXF.mjs +0 -14
  80. package/components/cytoscape.esm-BojS1z60.mjs +0 -30216
  81. package/components/d-9qSZPw74.mjs +0 -6
  82. package/components/dagre-JOIXM2OF-5zx0JY2T.mjs +0 -707
  83. package/components/dark-plus-DmZ1Dzd4.mjs +0 -3
  84. package/components/dart-CCSsOg9l.mjs +0 -6
  85. package/components/dax-CvsmLV-B.mjs +0 -6
  86. package/components/defaultLocale-DVr69WTU.mjs +0 -202
  87. package/components/diagram-5UYTHUR4-C19nyAKc.mjs +0 -215
  88. package/components/diagram-VMROVX33-DkGwo-hj.mjs +0 -861
  89. package/components/diagram-ZTM2IBQH-CBgHCu9L.mjs +0 -317
  90. package/components/diff-BEdzuHlE.mjs +0 -6
  91. package/components/dockerfile-B3DP334t.mjs +0 -14
  92. package/components/dracula-B8-AVrwI.mjs +0 -3
  93. package/components/dracula-soft-BHeefow7.mjs +0 -3
  94. package/components/dream-maker-CNLQpoF-.mjs +0 -6
  95. package/components/elixir-0rTCSSfp.mjs +0 -11
  96. package/components/elm-BhwiZPvf.mjs +0 -10
  97. package/components/erDiagram-3M52JZNH-cttdAJXW.mjs +0 -1169
  98. package/components/erb-Lra8TlYM.mjs +0 -27
  99. package/components/erlang-D2NNgvtR.mjs +0 -17
  100. package/components/everforest-dark-Cg1xdODP.mjs +0 -3
  101. package/components/everforest-light-BmTD3bxe.mjs +0 -3
  102. package/components/fish-BU5HSdZy.mjs +0 -6
  103. package/components/flowDiagram-KYDEHFYC-9HpsqDdB.mjs +0 -2345
  104. package/components/fs-CdBSddpF.mjs +0 -17
  105. package/components/ganttDiagram-EK5VF46D-8QB3ofs6.mjs +0 -3497
  106. package/components/gdresource-CAbkn6H_.mjs +0 -11
  107. package/components/gdscript-Be_cubqt.mjs +0 -6
  108. package/components/gdshader-BEzE4j_3.mjs +0 -6
  109. package/components/gherkin-xCNF9gh8.mjs +0 -6
  110. package/components/git-commit-PP9xCApN.mjs +0 -9
  111. package/components/git-rebase-DqdGofLo.mjs +0 -9
  112. package/components/gitGraph-ZV4HHKMB-BSmtVGRu.mjs +0 -15
  113. package/components/gitGraphDiagram-GW3U2K7C-DNzc0Vx_.mjs +0 -1227
  114. package/components/github-dark-O22yVQaY.mjs +0 -3
  115. package/components/github-dark-default-DB2Hkvqn.mjs +0 -3
  116. package/components/github-dark-dimmed-CMZ_OfqC.mjs +0 -3
  117. package/components/github-dark-high-contrast-DmxWVmCU.mjs +0 -3
  118. package/components/github-light-BTbR9xVK.mjs +0 -3
  119. package/components/github-light-default-DWEonwFe.mjs +0 -3
  120. package/components/github-light-high-contrast-WJ_cPDts.mjs +0 -3
  121. package/components/glimmer-js-BkPYTyD4.mjs +0 -23
  122. package/components/glsl-CGsiYPcu.mjs +0 -9
  123. package/components/gnuplot-tV8vezdE.mjs +0 -6
  124. package/components/go-CBmVHZBz.mjs +0 -6
  125. package/components/graph-3zJxsO-i.mjs +0 -425
  126. package/components/graphql-D4pgneW3.mjs +0 -15
  127. package/components/groovy-Bn4MhXgW.mjs +0 -6
  128. package/components/gruvbox-dark-hard-C89wZ4s3.mjs +0 -3
  129. package/components/gruvbox-dark-medium-swz85q_b.mjs +0 -3
  130. package/components/gruvbox-dark-soft-BYHBHQJW.mjs +0 -3
  131. package/components/gruvbox-light-hard-DEF_ZxYZ.mjs +0 -3
  132. package/components/gruvbox-light-medium-ziUMnHJx.mjs +0 -3
  133. package/components/gruvbox-light-soft-Cuwp0tsB.mjs +0 -3
  134. package/components/gts-d3WsqAZM.mjs +0 -23
  135. package/components/hack-CwaBuF5l.mjs +0 -13
  136. package/components/haml-gLijj4rW.mjs +0 -11
  137. package/components/hbs-CFi5SpI3.mjs +0 -23
  138. package/components/hcl-axoq0Ycu.mjs +0 -6
  139. package/components/hjson-I7LcauIB.mjs +0 -6
  140. package/components/hlsl-TRzjajlb.mjs +0 -6
  141. package/components/houston-CF_ws8Cq.mjs +0 -3
  142. package/components/hs-DXSGqUFF.mjs +0 -14
  143. package/components/html-CLq-n30c.mjs +0 -11
  144. package/components/html-derivative-C8POX8SL.mjs +0 -9
  145. package/components/http-BYUKZ6kX.mjs +0 -20
  146. package/components/imba-C4923lSV.mjs +0 -6
  147. package/components/index4.mjs +0 -78
  148. package/components/info-63CPKGFF-C8sYWczU.mjs +0 -15
  149. package/components/infoDiagram-LHK5PUON-C-vFFPTf.mjs +0 -44
  150. package/components/init-ZxktEp_H.mjs +0 -15
  151. package/components/java-BfXh-0uJ.mjs +0 -6
  152. package/components/jinja-html-BmW4v_vu.mjs +0 -11
  153. package/components/jison-C9kAT_Oj.mjs +0 -9
  154. package/components/journeyDiagram-EWQZEKCU-BJrw4-AG.mjs +0 -1264
  155. package/components/js-CN_xSsjU.mjs +0 -14
  156. package/components/json-TjWBGEk1.mjs +0 -6
  157. package/components/json5-DCGCKrmX.mjs +0 -6
  158. package/components/jsonc-DLVLp8id.mjs +0 -6
  159. package/components/jsonl-B-R_pDGg.mjs +0 -6
  160. package/components/jsonnet-Cs8BnnC6.mjs +0 -6
  161. package/components/jssm-D_YBQ_cM.mjs +0 -14
  162. package/components/jsx-BPmvoin2.mjs +0 -6
  163. package/components/julia-C-JjBobP.mjs +0 -19
  164. package/components/kanagawa-dragon-DU8n2NNT.mjs +0 -3
  165. package/components/kanagawa-lotus-Byd0CDet.mjs +0 -3
  166. package/components/kanagawa-wave-DExoagcR.mjs +0 -3
  167. package/components/kanban-definition-ZSS6B67P-BptAnqU-.mjs +0 -1059
  168. package/components/kotlin-BM2ZNTMh.mjs +0 -6
  169. package/components/kusto-D9MF7CZf.mjs +0 -14
  170. package/components/laserwave-DF03wMlf.mjs +0 -3
  171. package/components/latex-BsqkLZB_.mjs +0 -10
  172. package/components/layout-sGZIJplX.mjs +0 -2043
  173. package/components/less-BAzLMJNR.mjs +0 -6
  174. package/components/light-plus-DS08Xg5J.mjs +0 -3
  175. package/components/linear-DqgVh5FN.mjs +0 -336
  176. package/components/liquid-f2VHt0dg.mjs +0 -15
  177. package/components/lisp-DAq1kaby.mjs +0 -6
  178. package/components/logo-D9l7oEJ8.mjs +0 -6
  179. package/components/lua-CH3ttzl_.mjs +0 -9
  180. package/components/makefile-D2qLe7q0.mjs +0 -14
  181. package/components/marko-DwRyI_--.mjs +0 -15
  182. package/components/material-theme-B8B2U48Q.mjs +0 -3
  183. package/components/material-theme-darker-BV0iY_T3.mjs +0 -3
  184. package/components/material-theme-lighter-DrzybSTF.mjs +0 -3
  185. package/components/material-theme-ocean-BRPLVReX.mjs +0 -3
  186. package/components/material-theme-palenight-DSJwsR_D.mjs +0 -3
  187. package/components/matlab-7XHduepk.mjs +0 -6
  188. package/components/md-BIvDPr-W.mjs +0 -14
  189. package/components/mdc-Rx6hWSHn.mjs +0 -16
  190. package/components/mdx-D5wExp-O.mjs +0 -6
  191. package/components/mermaid-CUjtoYEe.mjs +0 -6
  192. package/components/mermaid-parser.core-CH9ryA1K.mjs +0 -16987
  193. package/components/mermaid.core-CAqkCmS1.mjs +0 -20977
  194. package/components/min-BngCxx8g.mjs +0 -109
  195. package/components/min-dark-BNaN9fWk.mjs +0 -3
  196. package/components/min-light-CMrjentn.mjs +0 -3
  197. package/components/mindmap-definition-6CBA2TL7-Cp_EeEsh.mjs +0 -5856
  198. package/components/mojo-CrbF881p.mjs +0 -6
  199. package/components/monokai-DelygWXa.mjs +0 -3
  200. package/components/narrat-DOwkIbBe.mjs +0 -14
  201. package/components/nf-DHfvJ2gH.mjs +0 -14
  202. package/components/nginx-B_jWsywZ.mjs +0 -10
  203. package/components/night-owl-DSS199ra.mjs +0 -3
  204. package/components/nim-yzbnZKJd.mjs +0 -22
  205. package/components/nix--3K2gyjg.mjs +0 -6
  206. package/components/nord-CvDbBq5M.mjs +0 -3
  207. package/components/objective-c-DkOBZg1J.mjs +0 -14
  208. package/components/objective-cpp-DEoN9Fe5.mjs +0 -6
  209. package/components/ocaml-B1kfGk9Y.mjs +0 -6
  210. package/components/one-dark-pro-CsMf0BoJ.mjs +0 -3
  211. package/components/one-light-BwwAsfsj.mjs +0 -3
  212. package/components/ordinal-DSZU4PqD.mjs +0 -76
  213. package/components/packet-HUATNLJX-bfFWFja0.mjs +0 -15
  214. package/components/pascal-CU8Kjkr_.mjs +0 -6
  215. package/components/perl-FH6su6vZ.mjs +0 -18
  216. package/components/php-Dnl1TfYH.mjs +0 -20
  217. package/components/pie-WTHONI2E-QPrWs3SR.mjs +0 -15
  218. package/components/pieDiagram-NIOCPIFQ-C46Y_4C6.mjs +0 -250
  219. package/components/plastic-BjwMpBc0.mjs +0 -3
  220. package/components/plsql-B3Na24V4.mjs +0 -6
  221. package/components/poimandres-ChWyhPrn.mjs +0 -3
  222. package/components/postcss-kj1IbjVd.mjs +0 -6
  223. package/components/powerquery-B-e1fO-k.mjs +0 -6
  224. package/components/prisma-bmxcSDxq.mjs +0 -6
  225. package/components/prolog-BT9GCzqD.mjs +0 -6
  226. package/components/properties-D6yKO1eW.mjs +0 -14
  227. package/components/proto-BIXM0k1a.mjs +0 -6
  228. package/components/ps1-aFyNx8UH.mjs +0 -18
  229. package/components/pug-BrOx0bSt.mjs +0 -21
  230. package/components/puppet-N15G4Usj.mjs +0 -6
  231. package/components/purescript-DrwsEYNH.mjs +0 -6
  232. package/components/python-D2s92fRP.mjs +0 -14
  233. package/components/ql-DTm-NCRo.mjs +0 -14
  234. package/components/quadrantDiagram-2OG54O6I-Dgf6d6F_.mjs +0 -1349
  235. package/components/r-oprfD2-9.mjs +0 -6
  236. package/components/radar-NJJJXTRR-BnUCJhQL.mjs +0 -15
  237. package/components/raku-xArQd_rF.mjs +0 -14
  238. package/components/razor-BoXCAbWQ.mjs +0 -13
  239. package/components/red-DByOl5N0.mjs +0 -3
  240. package/components/reg-CULnG2WX.mjs +0 -6
  241. package/components/rel-CHRwzjd4.mjs +0 -6
  242. package/components/requirementDiagram-QOLK2EJ7-CSF6N7HA.mjs +0 -1173
  243. package/components/riscv-BNQ9cVpw.mjs +0 -6
  244. package/components/rose-pine-LL9gXmP2.mjs +0 -3
  245. package/components/rose-pine-dawn-CH9zdisO.mjs +0 -3
  246. package/components/rose-pine-moon-B1oKSfEJ.mjs +0 -3
  247. package/components/rst-bEtD1v7N.mjs +0 -36
  248. package/components/ruby-BmfBy6EV.mjs +0 -44
  249. package/components/rust-Bf_fdNdL.mjs +0 -14
  250. package/components/sankeyDiagram-4UZDY2LN-BAHB7dMS.mjs +0 -1201
  251. package/components/sas-BLBgC3TA.mjs +0 -9
  252. package/components/sass-BheygBdF.mjs +0 -6
  253. package/components/scala-B-_7vFVn.mjs +0 -6
  254. package/components/scheme-BSHdPinv.mjs +0 -6
  255. package/components/scss-Dq-LbI_c.mjs +0 -9
  256. package/components/sequenceDiagram-SKLFT4DO-10gLJ50N.mjs +0 -3424
  257. package/components/shaderlab-BOQRTiQi.mjs +0 -17
  258. package/components/shellsession-Cu3c0QAc.mjs +0 -17
  259. package/components/slack-dark-BEe10hxO.mjs +0 -3
  260. package/components/slack-ochin-BKmu9pBc.mjs +0 -3
  261. package/components/smalltalk-qxcGy4fT.mjs +0 -6
  262. package/components/snazzy-light-Dcvd-ZyI.mjs +0 -3
  263. package/components/solarized-dark-BBl5y5sR.mjs +0 -3
  264. package/components/solarized-light-DW9b_AY8.mjs +0 -3
  265. package/components/solidity-CewKZgp-.mjs +0 -6
  266. package/components/sparql-DswowMAp.mjs +0 -9
  267. package/components/splunk-gK6Iw_P9.mjs +0 -14
  268. package/components/sql-DzUuSofg.mjs +0 -6
  269. package/components/ssh-config-Bk_I5wDR.mjs +0 -6
  270. package/components/stata-Dl7wDdBE.mjs +0 -9
  271. package/components/stateDiagram-MI5ZYTHO-D6p6nCaj.mjs +0 -461
  272. package/components/stateDiagram-v2-5AN5P6BG-DaN5hC-t.mjs +0 -31
  273. package/components/stylus-qRNkxrFU.mjs +0 -14
  274. package/components/svelte-B9qv3vkS.mjs +0 -15
  275. package/components/swift-BRQRsam8.mjs +0 -6
  276. package/components/synthwave-84-CoUef9sh.mjs +0 -3
  277. package/components/system-verilog-BcESSvRn.mjs +0 -6
  278. package/components/tasl-DfOr2qHi.mjs +0 -6
  279. package/components/tcl-CTsc4-t7.mjs +0 -6
  280. package/components/tex-CumJx1zu.mjs +0 -9
  281. package/components/timeline-definition-MYPXXCX6-gLqnWxDu.mjs +0 -1236
  282. package/components/tokyo-night-DjtLpAEY.mjs +0 -3
  283. package/components/toml-vHPzWDj6.mjs +0 -6
  284. package/components/treemap-75Q7IDZK-B2atdfMH.mjs +0 -15
  285. package/components/tsx-CmGGo4Hm.mjs +0 -6
  286. package/components/turtle-BnC7StHY.mjs +0 -6
  287. package/components/twig-0XKNpXN1.mjs +0 -35
  288. package/components/typescript-CgxwwAuC.mjs +0 -14
  289. package/components/v-Bmdjo9cy.mjs +0 -6
  290. package/components/vb-DuF6ZenW.mjs +0 -14
  291. package/components/verilog-CCb_iTfF.mjs +0 -6
  292. package/components/vesper-4Q1cEwPL.mjs +0 -3
  293. package/components/vhdl-DMqk4T2s.mjs +0 -6
  294. package/components/vimscript-aKp9YbYm.mjs +0 -18
  295. package/components/vitesse-black-BqNLki8b.mjs +0 -3
  296. package/components/vitesse-dark-jJ32WhwH.mjs +0 -3
  297. package/components/vitesse-light-476zM4e6.mjs +0 -3
  298. package/components/vue-DVNNTw2l.mjs +0 -40
  299. package/components/vue-html-Cr5wciIP.mjs +0 -16
  300. package/components/vyper-DYedWgAE.mjs +0 -14
  301. package/components/wasm-BBh6f151.mjs +0 -6
  302. package/components/wasm-DDgzZJey.mjs +0 -7
  303. package/components/wenyan-BdqozpMZ.mjs +0 -6
  304. package/components/wgsl-Vo-hHVWH.mjs +0 -6
  305. package/components/wolfram-CRmjUoI4.mjs +0 -6
  306. package/components/xml-BMzZeaqs.mjs +0 -9
  307. package/components/xsl-CAhvzxWv.mjs +0 -10
  308. package/components/xychartDiagram-H2YORKM3-Whqa4ezL.mjs +0 -1895
  309. package/components/yml-BhSrWWMS.mjs +0 -14
  310. package/components/zenscript-DFINJL6j.mjs +0 -6
  311. package/components/zig-CS4FMAZp.mjs +0 -6
  312. package/components/zsh-hcK4TBd7.mjs +0 -26
@@ -1,3424 +0,0 @@
1
- import { d as drawRect, g as getNoteRect, a as getTextObj, b as drawBackgroundRect, c as drawEmbeddedImage, e as drawImage } from './chunk-67H74DCK-Br5U8bfD.mjs';
2
- import { I as ImperativeState } from './chunk-AACKK3MU-DH_MKxca.mjs';
3
- import { _ as __name, j as distExports, o as setConfig2, b as setAccTitle, s as setAccDescription, q as setDiagramTitle, a as getAccTitle, g as getAccDescription, t as getDiagramTitle, c as getConfig2, z as clear$2, l as log, i as sanitizeText, k as common_default, a4 as parseFontSize, a2 as hasKatex, a3 as calculateMathMLDimensions, u as utils_default, a7 as renderKatex, G as getConfig, a5 as ZERO_WIDTH_SPACE, f as assignWithDepth_default, d as select, e as configureSvgSize, a6 as getUrl } from './mermaid.core-CAqkCmS1.mjs';
4
- import './index3.mjs';
5
- import 'vue';
6
- import '@vunk/plus/components/bubble-templates';
7
- import 'element-plus';
8
- import './index4.mjs';
9
- import '@vueuse/core';
10
- import '@vunk/plus/components/scrollbar';
11
- import './_plugin-vue_export-helper.mjs';
12
- import '@vunk/shared/function';
13
- import '@vunk/plus/components/agent-chat-provider';
14
-
15
- var _a;
16
- var parser = function() {
17
- var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
18
- for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
19
- return o2;
20
- }, "o"), $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 4], $V3 = [2, 4], $V4 = [1, 9], $V5 = [1, 11], $V6 = [1, 13], $V7 = [1, 14], $V8 = [1, 16], $V9 = [1, 17], $Va = [1, 18], $Vb = [1, 24], $Vc = [1, 25], $Vd = [1, 26], $Ve = [1, 27], $Vf = [1, 28], $Vg = [1, 29], $Vh = [1, 30], $Vi = [1, 31], $Vj = [1, 32], $Vk = [1, 33], $Vl = [1, 34], $Vm = [1, 35], $Vn = [1, 36], $Vo = [1, 37], $Vp = [1, 38], $Vq = [1, 39], $Vr = [1, 41], $Vs = [1, 42], $Vt = [1, 43], $Vu = [1, 44], $Vv = [1, 45], $Vw = [1, 46], $Vx = [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, 54, 59, 60, 61, 62, 70], $Vy = [4, 5, 16, 50, 52, 53], $Vz = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], $VA = [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, 54, 59, 60, 61, 62, 70], $VB = [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, 54, 59, 60, 61, 62, 70], $VC = [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, 54, 59, 60, 61, 62, 70], $VD = [68, 69, 70], $VE = [1, 122];
21
- var parser2 = {
22
- trace: /* @__PURE__ */ __name(function trace() {
23
- }, "trace"),
24
- yy: {},
25
- 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, "note": 54, "placement": 55, "text2": 56, "over": 57, "actor_pair": 58, "links": 59, "link": 60, "properties": 61, "details": 62, "spaceList": 63, ",": 64, "left_of": 65, "right_of": 66, "signaltype": 67, "+": 68, "-": 69, "ACTOR": 70, "SOLID_OPEN_ARROW": 71, "DOTTED_OPEN_ARROW": 72, "SOLID_ARROW": 73, "BIDIRECTIONAL_SOLID_ARROW": 74, "DOTTED_ARROW": 75, "BIDIRECTIONAL_DOTTED_ARROW": 76, "SOLID_CROSS": 77, "DOTTED_CROSS": 78, "SOLID_POINT": 79, "DOTTED_POINT": 80, "TXT": 81, "$accept": 0, "$end": 1 },
26
- 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", 54: "note", 57: "over", 59: "links", 60: "link", 61: "properties", 62: "details", 64: ",", 65: "left_of", 66: "right_of", 68: "+", 69: "-", 70: "ACTOR", 71: "SOLID_OPEN_ARROW", 72: "DOTTED_OPEN_ARROW", 73: "SOLID_ARROW", 74: "BIDIRECTIONAL_SOLID_ARROW", 75: "DOTTED_ARROW", 76: "BIDIRECTIONAL_DOTTED_ARROW", 77: "SOLID_CROSS", 78: "DOTTED_CROSS", 79: "SOLID_POINT", 80: "DOTTED_POINT", 81: "TXT" },
27
- 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], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [63, 2], [63, 1], [58, 3], [58, 1], [55, 1], [55, 1], [17, 5], [17, 5], [17, 4], [22, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [56, 1]],
28
- performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
29
- var $0 = $$.length - 1;
30
- switch (yystate) {
31
- case 3:
32
- yy.apply($$[$0]);
33
- return $$[$0];
34
- case 4:
35
- case 9:
36
- this.$ = [];
37
- break;
38
- case 5:
39
- case 10:
40
- $$[$0 - 1].push($$[$0]);
41
- this.$ = $$[$0 - 1];
42
- break;
43
- case 6:
44
- case 7:
45
- case 11:
46
- case 12:
47
- this.$ = $$[$0];
48
- break;
49
- case 8:
50
- case 13:
51
- this.$ = [];
52
- break;
53
- case 15:
54
- $$[$0].type = "createParticipant";
55
- this.$ = $$[$0];
56
- break;
57
- case 16:
58
- $$[$0 - 1].unshift({ type: "boxStart", boxData: yy.parseBoxData($$[$0 - 2]) });
59
- $$[$0 - 1].push({ type: "boxEnd", boxText: $$[$0 - 2] });
60
- this.$ = $$[$0 - 1];
61
- break;
62
- case 18:
63
- this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 2]), sequenceIndexStep: Number($$[$0 - 1]), sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER };
64
- break;
65
- case 19:
66
- this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 1]), sequenceIndexStep: 1, sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER };
67
- break;
68
- case 20:
69
- this.$ = { type: "sequenceIndex", sequenceVisible: false, signalType: yy.LINETYPE.AUTONUMBER };
70
- break;
71
- case 21:
72
- this.$ = { type: "sequenceIndex", sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER };
73
- break;
74
- case 22:
75
- this.$ = { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1].actor };
76
- break;
77
- case 23:
78
- this.$ = { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1].actor };
79
- break;
80
- case 29:
81
- yy.setDiagramTitle($$[$0].substring(6));
82
- this.$ = $$[$0].substring(6);
83
- break;
84
- case 30:
85
- yy.setDiagramTitle($$[$0].substring(7));
86
- this.$ = $$[$0].substring(7);
87
- break;
88
- case 31:
89
- this.$ = $$[$0].trim();
90
- yy.setAccTitle(this.$);
91
- break;
92
- case 32:
93
- case 33:
94
- this.$ = $$[$0].trim();
95
- yy.setAccDescription(this.$);
96
- break;
97
- case 34:
98
- $$[$0 - 1].unshift({ type: "loopStart", loopText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.LOOP_START });
99
- $$[$0 - 1].push({ type: "loopEnd", loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END });
100
- this.$ = $$[$0 - 1];
101
- break;
102
- case 35:
103
- $$[$0 - 1].unshift({ type: "rectStart", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_START });
104
- $$[$0 - 1].push({ type: "rectEnd", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_END });
105
- this.$ = $$[$0 - 1];
106
- break;
107
- case 36:
108
- $$[$0 - 1].unshift({ type: "optStart", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_START });
109
- $$[$0 - 1].push({ type: "optEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_END });
110
- this.$ = $$[$0 - 1];
111
- break;
112
- case 37:
113
- $$[$0 - 1].unshift({ type: "altStart", altText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.ALT_START });
114
- $$[$0 - 1].push({ type: "altEnd", signalType: yy.LINETYPE.ALT_END });
115
- this.$ = $$[$0 - 1];
116
- break;
117
- case 38:
118
- $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_START });
119
- $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END });
120
- this.$ = $$[$0 - 1];
121
- break;
122
- case 39:
123
- $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_OVER_START });
124
- $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END });
125
- this.$ = $$[$0 - 1];
126
- break;
127
- case 40:
128
- $$[$0 - 1].unshift({ type: "criticalStart", criticalText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.CRITICAL_START });
129
- $$[$0 - 1].push({ type: "criticalEnd", signalType: yy.LINETYPE.CRITICAL_END });
130
- this.$ = $$[$0 - 1];
131
- break;
132
- case 41:
133
- $$[$0 - 1].unshift({ type: "breakStart", breakText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_START });
134
- $$[$0 - 1].push({ type: "breakEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_END });
135
- this.$ = $$[$0 - 1];
136
- break;
137
- case 43:
138
- this.$ = $$[$0 - 3].concat([{ type: "option", optionText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.CRITICAL_OPTION }, $$[$0]]);
139
- break;
140
- case 45:
141
- this.$ = $$[$0 - 3].concat([{ type: "and", parText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.PAR_AND }, $$[$0]]);
142
- break;
143
- case 47:
144
- this.$ = $$[$0 - 3].concat([{ type: "else", altText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.ALT_ELSE }, $$[$0]]);
145
- break;
146
- case 48:
147
- $$[$0 - 3].draw = "participant";
148
- $$[$0 - 3].type = "addParticipant";
149
- $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]);
150
- this.$ = $$[$0 - 3];
151
- break;
152
- case 49:
153
- $$[$0 - 1].draw = "participant";
154
- $$[$0 - 1].type = "addParticipant";
155
- this.$ = $$[$0 - 1];
156
- break;
157
- case 50:
158
- $$[$0 - 3].draw = "actor";
159
- $$[$0 - 3].type = "addParticipant";
160
- $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]);
161
- this.$ = $$[$0 - 3];
162
- break;
163
- case 51:
164
- $$[$0 - 1].draw = "actor";
165
- $$[$0 - 1].type = "addParticipant";
166
- this.$ = $$[$0 - 1];
167
- break;
168
- case 52:
169
- $$[$0 - 1].type = "destroyParticipant";
170
- this.$ = $$[$0 - 1];
171
- break;
172
- case 53:
173
- this.$ = [$$[$0 - 1], { type: "addNote", placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }];
174
- break;
175
- case 54:
176
- $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2);
177
- $$[$0 - 2][0] = $$[$0 - 2][0].actor;
178
- $$[$0 - 2][1] = $$[$0 - 2][1].actor;
179
- this.$ = [$$[$0 - 1], { type: "addNote", placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }];
180
- break;
181
- case 55:
182
- this.$ = [$$[$0 - 1], { type: "addLinks", actor: $$[$0 - 1].actor, text: $$[$0] }];
183
- break;
184
- case 56:
185
- this.$ = [$$[$0 - 1], { type: "addALink", actor: $$[$0 - 1].actor, text: $$[$0] }];
186
- break;
187
- case 57:
188
- this.$ = [$$[$0 - 1], { type: "addProperties", actor: $$[$0 - 1].actor, text: $$[$0] }];
189
- break;
190
- case 58:
191
- this.$ = [$$[$0 - 1], { type: "addDetails", actor: $$[$0 - 1].actor, text: $$[$0] }];
192
- break;
193
- case 61:
194
- this.$ = [$$[$0 - 2], $$[$0]];
195
- break;
196
- case 62:
197
- this.$ = $$[$0];
198
- break;
199
- case 63:
200
- this.$ = yy.PLACEMENT.LEFTOF;
201
- break;
202
- case 64:
203
- this.$ = yy.PLACEMENT.RIGHTOF;
204
- break;
205
- case 65:
206
- this.$ = [
207
- $$[$0 - 4],
208
- $$[$0 - 1],
209
- { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0], activate: true },
210
- { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1].actor }
211
- ];
212
- break;
213
- case 66:
214
- this.$ = [
215
- $$[$0 - 4],
216
- $$[$0 - 1],
217
- { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] },
218
- { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4].actor }
219
- ];
220
- break;
221
- case 67:
222
- this.$ = [$$[$0 - 3], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }];
223
- break;
224
- case 68:
225
- this.$ = { type: "addParticipant", actor: $$[$0] };
226
- break;
227
- case 69:
228
- this.$ = yy.LINETYPE.SOLID_OPEN;
229
- break;
230
- case 70:
231
- this.$ = yy.LINETYPE.DOTTED_OPEN;
232
- break;
233
- case 71:
234
- this.$ = yy.LINETYPE.SOLID;
235
- break;
236
- case 72:
237
- this.$ = yy.LINETYPE.BIDIRECTIONAL_SOLID;
238
- break;
239
- case 73:
240
- this.$ = yy.LINETYPE.DOTTED;
241
- break;
242
- case 74:
243
- this.$ = yy.LINETYPE.BIDIRECTIONAL_DOTTED;
244
- break;
245
- case 75:
246
- this.$ = yy.LINETYPE.SOLID_CROSS;
247
- break;
248
- case 76:
249
- this.$ = yy.LINETYPE.DOTTED_CROSS;
250
- break;
251
- case 77:
252
- this.$ = yy.LINETYPE.SOLID_POINT;
253
- break;
254
- case 78:
255
- this.$ = yy.LINETYPE.DOTTED_POINT;
256
- break;
257
- case 79:
258
- this.$ = yy.parseMessage($$[$0].trim().substring(1));
259
- break;
260
- }
261
- }, "anonymous"),
262
- table: [{ 3: 1, 4: $V0, 5: $V1, 6: $V2 }, { 1: [3] }, { 3: 5, 4: $V0, 5: $V1, 6: $V2 }, { 3: 6, 4: $V0, 5: $V1, 6: $V2 }, o([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], $V3, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, o($Vx, [2, 5]), { 9: 47, 12: 12, 13: $V6, 14: $V7, 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, o($Vx, [2, 7]), o($Vx, [2, 8]), o($Vx, [2, 14]), { 12: 48, 50: $Vo, 52: $Vp, 53: $Vq }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: $Vw }, { 22: 55, 70: $Vw }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, o($Vx, [2, 29]), o($Vx, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, o($Vx, [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, 70: $Vw }, { 22: 72, 70: $Vw }, { 22: 73, 70: $Vw }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82], 79: [1, 83], 80: [1, 84] }, { 55: 85, 57: [1, 86], 65: [1, 87], 66: [1, 88] }, { 22: 89, 70: $Vw }, { 22: 90, 70: $Vw }, { 22: 91, 70: $Vw }, { 22: 92, 70: $Vw }, o([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], [2, 68]), o($Vx, [2, 6]), o($Vx, [2, 15]), o($Vy, [2, 9], { 10: 93 }), o($Vx, [2, 17]), { 5: [1, 95], 19: [1, 94] }, { 5: [1, 96] }, o($Vx, [2, 21]), { 5: [1, 97] }, { 5: [1, 98] }, o($Vx, [2, 24]), o($Vx, [2, 25]), o($Vx, [2, 26]), o($Vx, [2, 27]), o($Vx, [2, 28]), o($Vx, [2, 31]), o($Vx, [2, 32]), o($Vz, $V3, { 7: 99 }), o($Vz, $V3, { 7: 100 }), o($Vz, $V3, { 7: 101 }), o($VA, $V3, { 40: 102, 7: 103 }), o($VB, $V3, { 42: 104, 7: 105 }), o($VB, $V3, { 7: 105, 42: 106 }), o($VC, $V3, { 45: 107, 7: 108 }), o($Vz, $V3, { 7: 109 }), { 5: [1, 111], 51: [1, 110] }, { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, { 22: 117, 68: [1, 115], 69: [1, 116], 70: $Vw }, o($VD, [2, 69]), o($VD, [2, 70]), o($VD, [2, 71]), o($VD, [2, 72]), o($VD, [2, 73]), o($VD, [2, 74]), o($VD, [2, 75]), o($VD, [2, 76]), o($VD, [2, 77]), o($VD, [2, 78]), { 22: 118, 70: $Vw }, { 22: 120, 58: 119, 70: $Vw }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 121, 81: $VE }, { 56: 123, 81: $VE }, { 56: 124, 81: $VE }, { 56: 125, 81: $VE }, { 4: [1, 128], 5: [1, 130], 11: 127, 12: 129, 16: [1, 126], 50: $Vo, 52: $Vp, 53: $Vq }, { 5: [1, 131] }, o($Vx, [2, 19]), o($Vx, [2, 20]), o($Vx, [2, 22]), o($Vx, [2, 23]), { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 132], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 133], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 134], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 135] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 46], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 49: [1, 136], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 137] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 44], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 48: [1, 138], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 16: [1, 139] }, { 16: [1, 140] }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [2, 42], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 47: [1, 141], 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 4: $V4, 5: $V5, 8: 8, 9: 10, 12: 12, 13: $V6, 14: $V7, 16: [1, 142], 17: 15, 18: $V8, 21: $V9, 22: 40, 23: $Va, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: $Vb, 30: $Vc, 31: $Vd, 33: $Ve, 35: $Vf, 36: $Vg, 37: $Vh, 38: $Vi, 39: $Vj, 41: $Vk, 43: $Vl, 44: $Vm, 46: $Vn, 50: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 59: $Vs, 60: $Vt, 61: $Vu, 62: $Vv, 70: $Vw }, { 15: [1, 143] }, o($Vx, [2, 49]), { 15: [1, 144] }, o($Vx, [2, 51]), o($Vx, [2, 52]), { 22: 145, 70: $Vw }, { 22: 146, 70: $Vw }, { 56: 147, 81: $VE }, { 56: 148, 81: $VE }, { 56: 149, 81: $VE }, { 64: [1, 150], 81: [2, 62] }, { 5: [2, 55] }, { 5: [2, 79] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, o($Vx, [2, 16]), o($Vy, [2, 10]), { 12: 151, 50: $Vo, 52: $Vp, 53: $Vq }, o($Vy, [2, 12]), o($Vy, [2, 13]), o($Vx, [2, 18]), o($Vx, [2, 34]), o($Vx, [2, 35]), o($Vx, [2, 36]), o($Vx, [2, 37]), { 15: [1, 152] }, o($Vx, [2, 38]), { 15: [1, 153] }, o($Vx, [2, 39]), o($Vx, [2, 40]), { 15: [1, 154] }, o($Vx, [2, 41]), { 5: [1, 155] }, { 5: [1, 156] }, { 56: 157, 81: $VE }, { 56: 158, 81: $VE }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 159, 70: $Vw }, o($Vy, [2, 11]), o($VA, $V3, { 7: 103, 40: 160 }), o($VB, $V3, { 7: 105, 42: 161 }), o($VC, $V3, { 7: 108, 45: 162 }), o($Vx, [2, 48]), o($Vx, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 81: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
263
- defaultActions: { 5: [2, 1], 6: [2, 2], 87: [2, 63], 88: [2, 64], 121: [2, 55], 122: [2, 79], 123: [2, 56], 124: [2, 57], 125: [2, 58], 147: [2, 67], 148: [2, 53], 149: [2, 54], 157: [2, 65], 158: [2, 66], 159: [2, 61], 160: [2, 47], 161: [2, 45], 162: [2, 43] },
264
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
265
- if (hash.recoverable) {
266
- this.trace(str);
267
- } else {
268
- var error = new Error(str);
269
- error.hash = hash;
270
- throw error;
271
- }
272
- }, "parseError"),
273
- parse: /* @__PURE__ */ __name(function parse(input) {
274
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
275
- var args = lstack.slice.call(arguments, 1);
276
- var lexer2 = Object.create(this.lexer);
277
- var sharedState = { yy: {} };
278
- for (var k in this.yy) {
279
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
280
- sharedState.yy[k] = this.yy[k];
281
- }
282
- }
283
- lexer2.setInput(input, sharedState.yy);
284
- sharedState.yy.lexer = lexer2;
285
- sharedState.yy.parser = this;
286
- if (typeof lexer2.yylloc == "undefined") {
287
- lexer2.yylloc = {};
288
- }
289
- var yyloc = lexer2.yylloc;
290
- lstack.push(yyloc);
291
- var ranges = lexer2.options && lexer2.options.ranges;
292
- if (typeof sharedState.yy.parseError === "function") {
293
- this.parseError = sharedState.yy.parseError;
294
- } else {
295
- this.parseError = Object.getPrototypeOf(this).parseError;
296
- }
297
- function popStack(n) {
298
- stack.length = stack.length - 2 * n;
299
- vstack.length = vstack.length - n;
300
- lstack.length = lstack.length - n;
301
- }
302
- __name(popStack, "popStack");
303
- function lex() {
304
- var token;
305
- token = tstack.pop() || lexer2.lex() || EOF;
306
- if (typeof token !== "number") {
307
- if (token instanceof Array) {
308
- tstack = token;
309
- token = tstack.pop();
310
- }
311
- token = self.symbols_[token] || token;
312
- }
313
- return token;
314
- }
315
- __name(lex, "lex");
316
- var symbol, state, action, r, yyval = {}, p, len, newState, expected;
317
- while (true) {
318
- state = stack[stack.length - 1];
319
- if (this.defaultActions[state]) {
320
- action = this.defaultActions[state];
321
- } else {
322
- if (symbol === null || typeof symbol == "undefined") {
323
- symbol = lex();
324
- }
325
- action = table[state] && table[state][symbol];
326
- }
327
- if (typeof action === "undefined" || !action.length || !action[0]) {
328
- var errStr = "";
329
- expected = [];
330
- for (p in table[state]) {
331
- if (this.terminals_[p] && p > TERROR) {
332
- expected.push("'" + this.terminals_[p] + "'");
333
- }
334
- }
335
- if (lexer2.showPosition) {
336
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
337
- } else {
338
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
339
- }
340
- this.parseError(errStr, {
341
- text: lexer2.match,
342
- token: this.terminals_[symbol] || symbol,
343
- line: lexer2.yylineno,
344
- loc: yyloc,
345
- expected
346
- });
347
- }
348
- if (action[0] instanceof Array && action.length > 1) {
349
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
350
- }
351
- switch (action[0]) {
352
- case 1:
353
- stack.push(symbol);
354
- vstack.push(lexer2.yytext);
355
- lstack.push(lexer2.yylloc);
356
- stack.push(action[1]);
357
- symbol = null;
358
- {
359
- yyleng = lexer2.yyleng;
360
- yytext = lexer2.yytext;
361
- yylineno = lexer2.yylineno;
362
- yyloc = lexer2.yylloc;
363
- }
364
- break;
365
- case 2:
366
- len = this.productions_[action[1]][1];
367
- yyval.$ = vstack[vstack.length - len];
368
- yyval._$ = {
369
- first_line: lstack[lstack.length - (len || 1)].first_line,
370
- last_line: lstack[lstack.length - 1].last_line,
371
- first_column: lstack[lstack.length - (len || 1)].first_column,
372
- last_column: lstack[lstack.length - 1].last_column
373
- };
374
- if (ranges) {
375
- yyval._$.range = [
376
- lstack[lstack.length - (len || 1)].range[0],
377
- lstack[lstack.length - 1].range[1]
378
- ];
379
- }
380
- r = this.performAction.apply(yyval, [
381
- yytext,
382
- yyleng,
383
- yylineno,
384
- sharedState.yy,
385
- action[1],
386
- vstack,
387
- lstack
388
- ].concat(args));
389
- if (typeof r !== "undefined") {
390
- return r;
391
- }
392
- if (len) {
393
- stack = stack.slice(0, -1 * len * 2);
394
- vstack = vstack.slice(0, -1 * len);
395
- lstack = lstack.slice(0, -1 * len);
396
- }
397
- stack.push(this.productions_[action[1]][0]);
398
- vstack.push(yyval.$);
399
- lstack.push(yyval._$);
400
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
401
- stack.push(newState);
402
- break;
403
- case 3:
404
- return true;
405
- }
406
- }
407
- return true;
408
- }, "parse")
409
- };
410
- var lexer = /* @__PURE__ */ function() {
411
- var lexer2 = {
412
- EOF: 1,
413
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
414
- if (this.yy.parser) {
415
- this.yy.parser.parseError(str, hash);
416
- } else {
417
- throw new Error(str);
418
- }
419
- }, "parseError"),
420
- // resets the lexer, sets new input
421
- setInput: /* @__PURE__ */ __name(function(input, yy) {
422
- this.yy = yy || this.yy || {};
423
- this._input = input;
424
- this._more = this._backtrack = this.done = false;
425
- this.yylineno = this.yyleng = 0;
426
- this.yytext = this.matched = this.match = "";
427
- this.conditionStack = ["INITIAL"];
428
- this.yylloc = {
429
- first_line: 1,
430
- first_column: 0,
431
- last_line: 1,
432
- last_column: 0
433
- };
434
- if (this.options.ranges) {
435
- this.yylloc.range = [0, 0];
436
- }
437
- this.offset = 0;
438
- return this;
439
- }, "setInput"),
440
- // consumes and returns one char from the input
441
- input: /* @__PURE__ */ __name(function() {
442
- var ch = this._input[0];
443
- this.yytext += ch;
444
- this.yyleng++;
445
- this.offset++;
446
- this.match += ch;
447
- this.matched += ch;
448
- var lines = ch.match(/(?:\r\n?|\n).*/g);
449
- if (lines) {
450
- this.yylineno++;
451
- this.yylloc.last_line++;
452
- } else {
453
- this.yylloc.last_column++;
454
- }
455
- if (this.options.ranges) {
456
- this.yylloc.range[1]++;
457
- }
458
- this._input = this._input.slice(1);
459
- return ch;
460
- }, "input"),
461
- // unshifts one char (or a string) into the input
462
- unput: /* @__PURE__ */ __name(function(ch) {
463
- var len = ch.length;
464
- var lines = ch.split(/(?:\r\n?|\n)/g);
465
- this._input = ch + this._input;
466
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
467
- this.offset -= len;
468
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
469
- this.match = this.match.substr(0, this.match.length - 1);
470
- this.matched = this.matched.substr(0, this.matched.length - 1);
471
- if (lines.length - 1) {
472
- this.yylineno -= lines.length - 1;
473
- }
474
- var r = this.yylloc.range;
475
- this.yylloc = {
476
- first_line: this.yylloc.first_line,
477
- last_line: this.yylineno + 1,
478
- first_column: this.yylloc.first_column,
479
- last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
480
- };
481
- if (this.options.ranges) {
482
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
483
- }
484
- this.yyleng = this.yytext.length;
485
- return this;
486
- }, "unput"),
487
- // When called from action, caches matched text and appends it on next action
488
- more: /* @__PURE__ */ __name(function() {
489
- this._more = true;
490
- return this;
491
- }, "more"),
492
- // 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.
493
- reject: /* @__PURE__ */ __name(function() {
494
- if (this.options.backtrack_lexer) {
495
- this._backtrack = true;
496
- } else {
497
- 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).\n" + this.showPosition(), {
498
- text: "",
499
- token: null,
500
- line: this.yylineno
501
- });
502
- }
503
- return this;
504
- }, "reject"),
505
- // retain first n characters of the match
506
- less: /* @__PURE__ */ __name(function(n) {
507
- this.unput(this.match.slice(n));
508
- }, "less"),
509
- // displays already matched input, i.e. for error messages
510
- pastInput: /* @__PURE__ */ __name(function() {
511
- var past = this.matched.substr(0, this.matched.length - this.match.length);
512
- return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
513
- }, "pastInput"),
514
- // displays upcoming input, i.e. for error messages
515
- upcomingInput: /* @__PURE__ */ __name(function() {
516
- var next = this.match;
517
- if (next.length < 20) {
518
- next += this._input.substr(0, 20 - next.length);
519
- }
520
- return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
521
- }, "upcomingInput"),
522
- // displays the character position where the lexing error occurred, i.e. for error messages
523
- showPosition: /* @__PURE__ */ __name(function() {
524
- var pre = this.pastInput();
525
- var c = new Array(pre.length + 1).join("-");
526
- return pre + this.upcomingInput() + "\n" + c + "^";
527
- }, "showPosition"),
528
- // test the lexed token: return FALSE when not a match, otherwise return token
529
- test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
530
- var token, lines, backup;
531
- if (this.options.backtrack_lexer) {
532
- backup = {
533
- yylineno: this.yylineno,
534
- yylloc: {
535
- first_line: this.yylloc.first_line,
536
- last_line: this.last_line,
537
- first_column: this.yylloc.first_column,
538
- last_column: this.yylloc.last_column
539
- },
540
- yytext: this.yytext,
541
- match: this.match,
542
- matches: this.matches,
543
- matched: this.matched,
544
- yyleng: this.yyleng,
545
- offset: this.offset,
546
- _more: this._more,
547
- _input: this._input,
548
- yy: this.yy,
549
- conditionStack: this.conditionStack.slice(0),
550
- done: this.done
551
- };
552
- if (this.options.ranges) {
553
- backup.yylloc.range = this.yylloc.range.slice(0);
554
- }
555
- }
556
- lines = match[0].match(/(?:\r\n?|\n).*/g);
557
- if (lines) {
558
- this.yylineno += lines.length;
559
- }
560
- this.yylloc = {
561
- first_line: this.yylloc.last_line,
562
- last_line: this.yylineno + 1,
563
- first_column: this.yylloc.last_column,
564
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
565
- };
566
- this.yytext += match[0];
567
- this.match += match[0];
568
- this.matches = match;
569
- this.yyleng = this.yytext.length;
570
- if (this.options.ranges) {
571
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
572
- }
573
- this._more = false;
574
- this._backtrack = false;
575
- this._input = this._input.slice(match[0].length);
576
- this.matched += match[0];
577
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
578
- if (this.done && this._input) {
579
- this.done = false;
580
- }
581
- if (token) {
582
- return token;
583
- } else if (this._backtrack) {
584
- for (var k in backup) {
585
- this[k] = backup[k];
586
- }
587
- return false;
588
- }
589
- return false;
590
- }, "test_match"),
591
- // return next match in input
592
- next: /* @__PURE__ */ __name(function() {
593
- if (this.done) {
594
- return this.EOF;
595
- }
596
- if (!this._input) {
597
- this.done = true;
598
- }
599
- var token, match, tempMatch, index;
600
- if (!this._more) {
601
- this.yytext = "";
602
- this.match = "";
603
- }
604
- var rules = this._currentRules();
605
- for (var i = 0; i < rules.length; i++) {
606
- tempMatch = this._input.match(this.rules[rules[i]]);
607
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
608
- match = tempMatch;
609
- index = i;
610
- if (this.options.backtrack_lexer) {
611
- token = this.test_match(tempMatch, rules[i]);
612
- if (token !== false) {
613
- return token;
614
- } else if (this._backtrack) {
615
- match = false;
616
- continue;
617
- } else {
618
- return false;
619
- }
620
- } else if (!this.options.flex) {
621
- break;
622
- }
623
- }
624
- }
625
- if (match) {
626
- token = this.test_match(match, rules[index]);
627
- if (token !== false) {
628
- return token;
629
- }
630
- return false;
631
- }
632
- if (this._input === "") {
633
- return this.EOF;
634
- } else {
635
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
636
- text: "",
637
- token: null,
638
- line: this.yylineno
639
- });
640
- }
641
- }, "next"),
642
- // return next match that has a token
643
- lex: /* @__PURE__ */ __name(function lex() {
644
- var r = this.next();
645
- if (r) {
646
- return r;
647
- } else {
648
- return this.lex();
649
- }
650
- }, "lex"),
651
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
652
- begin: /* @__PURE__ */ __name(function begin(condition) {
653
- this.conditionStack.push(condition);
654
- }, "begin"),
655
- // pop the previously active lexer condition state off the condition stack
656
- popState: /* @__PURE__ */ __name(function popState() {
657
- var n = this.conditionStack.length - 1;
658
- if (n > 0) {
659
- return this.conditionStack.pop();
660
- } else {
661
- return this.conditionStack[0];
662
- }
663
- }, "popState"),
664
- // produce the lexer rule set which is active for the currently active lexer condition state
665
- _currentRules: /* @__PURE__ */ __name(function _currentRules() {
666
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
667
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
668
- } else {
669
- return this.conditions["INITIAL"].rules;
670
- }
671
- }, "_currentRules"),
672
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
673
- topState: /* @__PURE__ */ __name(function topState(n) {
674
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
675
- if (n >= 0) {
676
- return this.conditionStack[n];
677
- } else {
678
- return "INITIAL";
679
- }
680
- }, "topState"),
681
- // alias for begin(condition)
682
- pushState: /* @__PURE__ */ __name(function pushState(condition) {
683
- this.begin(condition);
684
- }, "pushState"),
685
- // return the number of states currently on the stack
686
- stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
687
- return this.conditionStack.length;
688
- }, "stateStackSize"),
689
- options: { "case-insensitive": true },
690
- performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
691
- switch ($avoiding_name_collisions) {
692
- case 0:
693
- return 5;
694
- case 1:
695
- break;
696
- case 2:
697
- break;
698
- case 3:
699
- break;
700
- case 4:
701
- break;
702
- case 5:
703
- break;
704
- case 6:
705
- return 19;
706
- case 7:
707
- this.begin("LINE");
708
- return 14;
709
- case 8:
710
- this.begin("ID");
711
- return 50;
712
- case 9:
713
- this.begin("ID");
714
- return 52;
715
- case 10:
716
- return 13;
717
- case 11:
718
- this.begin("ID");
719
- return 53;
720
- case 12:
721
- yy_.yytext = yy_.yytext.trim();
722
- this.begin("ALIAS");
723
- return 70;
724
- case 13:
725
- this.popState();
726
- this.popState();
727
- this.begin("LINE");
728
- return 51;
729
- case 14:
730
- this.popState();
731
- this.popState();
732
- return 5;
733
- case 15:
734
- this.begin("LINE");
735
- return 36;
736
- case 16:
737
- this.begin("LINE");
738
- return 37;
739
- case 17:
740
- this.begin("LINE");
741
- return 38;
742
- case 18:
743
- this.begin("LINE");
744
- return 39;
745
- case 19:
746
- this.begin("LINE");
747
- return 49;
748
- case 20:
749
- this.begin("LINE");
750
- return 41;
751
- case 21:
752
- this.begin("LINE");
753
- return 43;
754
- case 22:
755
- this.begin("LINE");
756
- return 48;
757
- case 23:
758
- this.begin("LINE");
759
- return 44;
760
- case 24:
761
- this.begin("LINE");
762
- return 47;
763
- case 25:
764
- this.begin("LINE");
765
- return 46;
766
- case 26:
767
- this.popState();
768
- return 15;
769
- case 27:
770
- return 16;
771
- case 28:
772
- return 65;
773
- case 29:
774
- return 66;
775
- case 30:
776
- return 59;
777
- case 31:
778
- return 60;
779
- case 32:
780
- return 61;
781
- case 33:
782
- return 62;
783
- case 34:
784
- return 57;
785
- case 35:
786
- return 54;
787
- case 36:
788
- this.begin("ID");
789
- return 21;
790
- case 37:
791
- this.begin("ID");
792
- return 23;
793
- case 38:
794
- return 29;
795
- case 39:
796
- return 30;
797
- case 40:
798
- this.begin("acc_title");
799
- return 31;
800
- case 41:
801
- this.popState();
802
- return "acc_title_value";
803
- case 42:
804
- this.begin("acc_descr");
805
- return 33;
806
- case 43:
807
- this.popState();
808
- return "acc_descr_value";
809
- case 44:
810
- this.begin("acc_descr_multiline");
811
- break;
812
- case 45:
813
- this.popState();
814
- break;
815
- case 46:
816
- return "acc_descr_multiline_value";
817
- case 47:
818
- return 6;
819
- case 48:
820
- return 18;
821
- case 49:
822
- return 20;
823
- case 50:
824
- return 64;
825
- case 51:
826
- return 5;
827
- case 52:
828
- yy_.yytext = yy_.yytext.trim();
829
- return 70;
830
- case 53:
831
- return 73;
832
- case 54:
833
- return 74;
834
- case 55:
835
- return 75;
836
- case 56:
837
- return 76;
838
- case 57:
839
- return 71;
840
- case 58:
841
- return 72;
842
- case 59:
843
- return 77;
844
- case 60:
845
- return 78;
846
- case 61:
847
- return 79;
848
- case 62:
849
- return 80;
850
- case 63:
851
- return 81;
852
- case 64:
853
- return 81;
854
- case 65:
855
- return 68;
856
- case 66:
857
- return 69;
858
- case 67:
859
- return 5;
860
- case 68:
861
- return "INVALID";
862
- }
863
- }, "anonymous"),
864
- rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \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],
865
- conditions: { "acc_descr_multiline": { "rules": [45, 46], "inclusive": false }, "acc_descr": { "rules": [43], "inclusive": false }, "acc_title": { "rules": [41], "inclusive": false }, "ID": { "rules": [2, 3, 12], "inclusive": false }, "ALIAS": { "rules": [2, 3, 13, 14], "inclusive": false }, "LINE": { "rules": [2, 3, 26], "inclusive": false }, "INITIAL": { "rules": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], "inclusive": true } }
866
- };
867
- return lexer2;
868
- }();
869
- parser2.lexer = lexer;
870
- function Parser() {
871
- this.yy = {};
872
- }
873
- __name(Parser, "Parser");
874
- Parser.prototype = parser2;
875
- parser2.Parser = Parser;
876
- return new Parser();
877
- }();
878
- parser.parser = parser;
879
- var sequenceDiagram_default = parser;
880
- var LINETYPE = {
881
- SOLID: 0,
882
- DOTTED: 1,
883
- NOTE: 2,
884
- SOLID_CROSS: 3,
885
- DOTTED_CROSS: 4,
886
- SOLID_OPEN: 5,
887
- DOTTED_OPEN: 6,
888
- LOOP_START: 10,
889
- LOOP_END: 11,
890
- ALT_START: 12,
891
- ALT_ELSE: 13,
892
- ALT_END: 14,
893
- OPT_START: 15,
894
- OPT_END: 16,
895
- ACTIVE_START: 17,
896
- ACTIVE_END: 18,
897
- PAR_START: 19,
898
- PAR_AND: 20,
899
- PAR_END: 21,
900
- RECT_START: 22,
901
- RECT_END: 23,
902
- SOLID_POINT: 24,
903
- DOTTED_POINT: 25,
904
- AUTONUMBER: 26,
905
- CRITICAL_START: 27,
906
- CRITICAL_OPTION: 28,
907
- CRITICAL_END: 29,
908
- BREAK_START: 30,
909
- BREAK_END: 31,
910
- PAR_OVER_START: 32,
911
- BIDIRECTIONAL_SOLID: 33,
912
- BIDIRECTIONAL_DOTTED: 34
913
- };
914
- var ARROWTYPE = {
915
- FILLED: 0,
916
- OPEN: 1
917
- };
918
- var PLACEMENT = {
919
- LEFTOF: 0,
920
- RIGHTOF: 1,
921
- OVER: 2
922
- };
923
- var SequenceDB = (_a = class {
924
- constructor() {
925
- this.state = new ImperativeState(() => ({
926
- prevActor: void 0,
927
- actors: /* @__PURE__ */ new Map(),
928
- createdActors: /* @__PURE__ */ new Map(),
929
- destroyedActors: /* @__PURE__ */ new Map(),
930
- boxes: [],
931
- messages: [],
932
- notes: [],
933
- sequenceNumbersEnabled: false,
934
- wrapEnabled: void 0,
935
- currentBox: void 0,
936
- lastCreated: void 0,
937
- lastDestroyed: void 0
938
- }));
939
- this.setAccTitle = setAccTitle;
940
- this.setAccDescription = setAccDescription;
941
- this.setDiagramTitle = setDiagramTitle;
942
- this.getAccTitle = getAccTitle;
943
- this.getAccDescription = getAccDescription;
944
- this.getDiagramTitle = getDiagramTitle;
945
- this.apply = this.apply.bind(this);
946
- this.parseBoxData = this.parseBoxData.bind(this);
947
- this.parseMessage = this.parseMessage.bind(this);
948
- this.clear();
949
- this.setWrap(getConfig2().wrap);
950
- this.LINETYPE = LINETYPE;
951
- this.ARROWTYPE = ARROWTYPE;
952
- this.PLACEMENT = PLACEMENT;
953
- }
954
- addBox(data) {
955
- this.state.records.boxes.push({
956
- name: data.text,
957
- wrap: data.wrap ?? this.autoWrap(),
958
- fill: data.color,
959
- actorKeys: []
960
- });
961
- this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
962
- }
963
- addActor(id, name, description, type) {
964
- let assignedBox = this.state.records.currentBox;
965
- const old = this.state.records.actors.get(id);
966
- if (old) {
967
- if (this.state.records.currentBox && old.box && this.state.records.currentBox !== old.box) {
968
- throw new Error(
969
- `A same participant should only be defined in one Box: ${old.name} can't be in '${old.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
970
- );
971
- }
972
- assignedBox = old.box ? old.box : this.state.records.currentBox;
973
- old.box = assignedBox;
974
- if (old && name === old.name && description == null) {
975
- return;
976
- }
977
- }
978
- if ((description == null ? void 0 : description.text) == null) {
979
- description = { text: name, type };
980
- }
981
- if (type == null || description.text == null) {
982
- description = { text: name, type };
983
- }
984
- this.state.records.actors.set(id, {
985
- box: assignedBox,
986
- name,
987
- description: description.text,
988
- wrap: description.wrap ?? this.autoWrap(),
989
- prevActor: this.state.records.prevActor,
990
- links: {},
991
- properties: {},
992
- actorCnt: null,
993
- rectData: null,
994
- type: type ?? "participant"
995
- });
996
- if (this.state.records.prevActor) {
997
- const prevActorInRecords = this.state.records.actors.get(this.state.records.prevActor);
998
- if (prevActorInRecords) {
999
- prevActorInRecords.nextActor = id;
1000
- }
1001
- }
1002
- if (this.state.records.currentBox) {
1003
- this.state.records.currentBox.actorKeys.push(id);
1004
- }
1005
- this.state.records.prevActor = id;
1006
- }
1007
- activationCount(part) {
1008
- let i;
1009
- let count = 0;
1010
- if (!part) {
1011
- return 0;
1012
- }
1013
- for (i = 0; i < this.state.records.messages.length; i++) {
1014
- if (this.state.records.messages[i].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[i].from === part) {
1015
- count++;
1016
- }
1017
- if (this.state.records.messages[i].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[i].from === part) {
1018
- count--;
1019
- }
1020
- }
1021
- return count;
1022
- }
1023
- addMessage(idFrom, idTo, message, answer) {
1024
- this.state.records.messages.push({
1025
- id: this.state.records.messages.length.toString(),
1026
- from: idFrom,
1027
- to: idTo,
1028
- message: message.text,
1029
- wrap: message.wrap ?? this.autoWrap(),
1030
- answer
1031
- });
1032
- }
1033
- addSignal(idFrom, idTo, message, messageType, activate = false) {
1034
- if (messageType === this.LINETYPE.ACTIVE_END) {
1035
- const cnt = this.activationCount(idFrom ?? "");
1036
- if (cnt < 1) {
1037
- const error = new Error("Trying to inactivate an inactive participant (" + idFrom + ")");
1038
- error.hash = {
1039
- text: "->>-",
1040
- token: "->>-",
1041
- line: "1",
1042
- loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
1043
- expected: ["'ACTIVE_PARTICIPANT'"]
1044
- };
1045
- throw error;
1046
- }
1047
- }
1048
- this.state.records.messages.push({
1049
- id: this.state.records.messages.length.toString(),
1050
- from: idFrom,
1051
- to: idTo,
1052
- message: (message == null ? void 0 : message.text) ?? "",
1053
- wrap: (message == null ? void 0 : message.wrap) ?? this.autoWrap(),
1054
- type: messageType,
1055
- activate
1056
- });
1057
- return true;
1058
- }
1059
- hasAtLeastOneBox() {
1060
- return this.state.records.boxes.length > 0;
1061
- }
1062
- hasAtLeastOneBoxWithTitle() {
1063
- return this.state.records.boxes.some((b) => b.name);
1064
- }
1065
- getMessages() {
1066
- return this.state.records.messages;
1067
- }
1068
- getBoxes() {
1069
- return this.state.records.boxes;
1070
- }
1071
- getActors() {
1072
- return this.state.records.actors;
1073
- }
1074
- getCreatedActors() {
1075
- return this.state.records.createdActors;
1076
- }
1077
- getDestroyedActors() {
1078
- return this.state.records.destroyedActors;
1079
- }
1080
- getActor(id) {
1081
- return this.state.records.actors.get(id);
1082
- }
1083
- getActorKeys() {
1084
- return [...this.state.records.actors.keys()];
1085
- }
1086
- enableSequenceNumbers() {
1087
- this.state.records.sequenceNumbersEnabled = true;
1088
- }
1089
- disableSequenceNumbers() {
1090
- this.state.records.sequenceNumbersEnabled = false;
1091
- }
1092
- showSequenceNumbers() {
1093
- return this.state.records.sequenceNumbersEnabled;
1094
- }
1095
- setWrap(wrapSetting) {
1096
- this.state.records.wrapEnabled = wrapSetting;
1097
- }
1098
- extractWrap(text) {
1099
- if (text === void 0) {
1100
- return {};
1101
- }
1102
- text = text.trim();
1103
- const wrap = /^:?wrap:/.exec(text) !== null ? true : /^:?nowrap:/.exec(text) !== null ? false : void 0;
1104
- const cleanedText = (wrap === void 0 ? text : text.replace(/^:?(?:no)?wrap:/, "")).trim();
1105
- return { cleanedText, wrap };
1106
- }
1107
- autoWrap() {
1108
- var _a2;
1109
- if (this.state.records.wrapEnabled !== void 0) {
1110
- return this.state.records.wrapEnabled;
1111
- }
1112
- return ((_a2 = getConfig2().sequence) == null ? void 0 : _a2.wrap) ?? false;
1113
- }
1114
- clear() {
1115
- this.state.reset();
1116
- clear$2();
1117
- }
1118
- parseMessage(str) {
1119
- const trimmedStr = str.trim();
1120
- const { wrap, cleanedText } = this.extractWrap(trimmedStr);
1121
- const message = {
1122
- text: cleanedText,
1123
- wrap
1124
- };
1125
- log.debug(`parseMessage: ${JSON.stringify(message)}`);
1126
- return message;
1127
- }
1128
- // We expect the box statement to be color first then description
1129
- // 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
1130
- // We extract first segment as color, the rest of the line is considered as text
1131
- parseBoxData(str) {
1132
- const match = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(str);
1133
- let color = (match == null ? void 0 : match[1]) ? match[1].trim() : "transparent";
1134
- let title = (match == null ? void 0 : match[2]) ? match[2].trim() : void 0;
1135
- if (window == null ? void 0 : window.CSS) {
1136
- if (!window.CSS.supports("color", color)) {
1137
- color = "transparent";
1138
- title = str.trim();
1139
- }
1140
- } else {
1141
- const style = new Option().style;
1142
- style.color = color;
1143
- if (style.color !== color) {
1144
- color = "transparent";
1145
- title = str.trim();
1146
- }
1147
- }
1148
- const { wrap, cleanedText } = this.extractWrap(title);
1149
- return {
1150
- text: cleanedText ? sanitizeText(cleanedText, getConfig2()) : void 0,
1151
- color,
1152
- wrap
1153
- };
1154
- }
1155
- addNote(actor, placement, message) {
1156
- const note = {
1157
- actor,
1158
- placement,
1159
- message: message.text,
1160
- wrap: message.wrap ?? this.autoWrap()
1161
- };
1162
- const actors = [].concat(actor, actor);
1163
- this.state.records.notes.push(note);
1164
- this.state.records.messages.push({
1165
- id: this.state.records.messages.length.toString(),
1166
- from: actors[0],
1167
- to: actors[1],
1168
- message: message.text,
1169
- wrap: message.wrap ?? this.autoWrap(),
1170
- type: this.LINETYPE.NOTE,
1171
- placement
1172
- });
1173
- }
1174
- addLinks(actorId, text) {
1175
- const actor = this.getActor(actorId);
1176
- try {
1177
- let sanitizedText = sanitizeText(text.text, getConfig2());
1178
- sanitizedText = sanitizedText.replace(/&equals;/g, "=");
1179
- sanitizedText = sanitizedText.replace(/&amp;/g, "&");
1180
- const links = JSON.parse(sanitizedText);
1181
- this.insertLinks(actor, links);
1182
- } catch (e) {
1183
- log.error("error while parsing actor link text", e);
1184
- }
1185
- }
1186
- addALink(actorId, text) {
1187
- const actor = this.getActor(actorId);
1188
- try {
1189
- const links = {};
1190
- let sanitizedText = sanitizeText(text.text, getConfig2());
1191
- const sep = sanitizedText.indexOf("@");
1192
- sanitizedText = sanitizedText.replace(/&equals;/g, "=");
1193
- sanitizedText = sanitizedText.replace(/&amp;/g, "&");
1194
- const label = sanitizedText.slice(0, sep - 1).trim();
1195
- const link = sanitizedText.slice(sep + 1).trim();
1196
- links[label] = link;
1197
- this.insertLinks(actor, links);
1198
- } catch (e) {
1199
- log.error("error while parsing actor link text", e);
1200
- }
1201
- }
1202
- insertLinks(actor, links) {
1203
- if (actor.links == null) {
1204
- actor.links = links;
1205
- } else {
1206
- for (const key in links) {
1207
- actor.links[key] = links[key];
1208
- }
1209
- }
1210
- }
1211
- addProperties(actorId, text) {
1212
- const actor = this.getActor(actorId);
1213
- try {
1214
- const sanitizedText = sanitizeText(text.text, getConfig2());
1215
- const properties = JSON.parse(sanitizedText);
1216
- this.insertProperties(actor, properties);
1217
- } catch (e) {
1218
- log.error("error while parsing actor properties text", e);
1219
- }
1220
- }
1221
- insertProperties(actor, properties) {
1222
- if (actor.properties == null) {
1223
- actor.properties = properties;
1224
- } else {
1225
- for (const key in properties) {
1226
- actor.properties[key] = properties[key];
1227
- }
1228
- }
1229
- }
1230
- boxEnd() {
1231
- this.state.records.currentBox = void 0;
1232
- }
1233
- addDetails(actorId, text) {
1234
- const actor = this.getActor(actorId);
1235
- const elem = document.getElementById(text.text);
1236
- try {
1237
- const text2 = elem.innerHTML;
1238
- const details = JSON.parse(text2);
1239
- if (details.properties) {
1240
- this.insertProperties(actor, details.properties);
1241
- }
1242
- if (details.links) {
1243
- this.insertLinks(actor, details.links);
1244
- }
1245
- } catch (e) {
1246
- log.error("error while parsing actor details text", e);
1247
- }
1248
- }
1249
- getActorProperty(actor, key) {
1250
- if ((actor == null ? void 0 : actor.properties) !== void 0) {
1251
- return actor.properties[key];
1252
- }
1253
- return void 0;
1254
- }
1255
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
1256
- apply(param) {
1257
- if (Array.isArray(param)) {
1258
- param.forEach((item) => {
1259
- this.apply(item);
1260
- });
1261
- } else {
1262
- switch (param.type) {
1263
- case "sequenceIndex":
1264
- this.state.records.messages.push({
1265
- id: this.state.records.messages.length.toString(),
1266
- from: void 0,
1267
- to: void 0,
1268
- message: {
1269
- start: param.sequenceIndex,
1270
- step: param.sequenceIndexStep,
1271
- visible: param.sequenceVisible
1272
- },
1273
- wrap: false,
1274
- type: param.signalType
1275
- });
1276
- break;
1277
- case "addParticipant":
1278
- this.addActor(param.actor, param.actor, param.description, param.draw);
1279
- break;
1280
- case "createParticipant":
1281
- if (this.state.records.actors.has(param.actor)) {
1282
- throw new Error(
1283
- "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"
1284
- );
1285
- }
1286
- this.state.records.lastCreated = param.actor;
1287
- this.addActor(param.actor, param.actor, param.description, param.draw);
1288
- this.state.records.createdActors.set(param.actor, this.state.records.messages.length);
1289
- break;
1290
- case "destroyParticipant":
1291
- this.state.records.lastDestroyed = param.actor;
1292
- this.state.records.destroyedActors.set(param.actor, this.state.records.messages.length);
1293
- break;
1294
- case "activeStart":
1295
- this.addSignal(param.actor, void 0, void 0, param.signalType);
1296
- break;
1297
- case "activeEnd":
1298
- this.addSignal(param.actor, void 0, void 0, param.signalType);
1299
- break;
1300
- case "addNote":
1301
- this.addNote(param.actor, param.placement, param.text);
1302
- break;
1303
- case "addLinks":
1304
- this.addLinks(param.actor, param.text);
1305
- break;
1306
- case "addALink":
1307
- this.addALink(param.actor, param.text);
1308
- break;
1309
- case "addProperties":
1310
- this.addProperties(param.actor, param.text);
1311
- break;
1312
- case "addDetails":
1313
- this.addDetails(param.actor, param.text);
1314
- break;
1315
- case "addMessage":
1316
- if (this.state.records.lastCreated) {
1317
- if (param.to !== this.state.records.lastCreated) {
1318
- throw new Error(
1319
- "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1320
- );
1321
- } else {
1322
- this.state.records.lastCreated = void 0;
1323
- }
1324
- } else if (this.state.records.lastDestroyed) {
1325
- if (param.to !== this.state.records.lastDestroyed && param.from !== this.state.records.lastDestroyed) {
1326
- throw new Error(
1327
- "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1328
- );
1329
- } else {
1330
- this.state.records.lastDestroyed = void 0;
1331
- }
1332
- }
1333
- this.addSignal(param.from, param.to, param.msg, param.signalType, param.activate);
1334
- break;
1335
- case "boxStart":
1336
- this.addBox(param.boxData);
1337
- break;
1338
- case "boxEnd":
1339
- this.boxEnd();
1340
- break;
1341
- case "loopStart":
1342
- this.addSignal(void 0, void 0, param.loopText, param.signalType);
1343
- break;
1344
- case "loopEnd":
1345
- this.addSignal(void 0, void 0, void 0, param.signalType);
1346
- break;
1347
- case "rectStart":
1348
- this.addSignal(void 0, void 0, param.color, param.signalType);
1349
- break;
1350
- case "rectEnd":
1351
- this.addSignal(void 0, void 0, void 0, param.signalType);
1352
- break;
1353
- case "optStart":
1354
- this.addSignal(void 0, void 0, param.optText, param.signalType);
1355
- break;
1356
- case "optEnd":
1357
- this.addSignal(void 0, void 0, void 0, param.signalType);
1358
- break;
1359
- case "altStart":
1360
- this.addSignal(void 0, void 0, param.altText, param.signalType);
1361
- break;
1362
- case "else":
1363
- this.addSignal(void 0, void 0, param.altText, param.signalType);
1364
- break;
1365
- case "altEnd":
1366
- this.addSignal(void 0, void 0, void 0, param.signalType);
1367
- break;
1368
- case "setAccTitle":
1369
- setAccTitle(param.text);
1370
- break;
1371
- case "parStart":
1372
- this.addSignal(void 0, void 0, param.parText, param.signalType);
1373
- break;
1374
- case "and":
1375
- this.addSignal(void 0, void 0, param.parText, param.signalType);
1376
- break;
1377
- case "parEnd":
1378
- this.addSignal(void 0, void 0, void 0, param.signalType);
1379
- break;
1380
- case "criticalStart":
1381
- this.addSignal(void 0, void 0, param.criticalText, param.signalType);
1382
- break;
1383
- case "option":
1384
- this.addSignal(void 0, void 0, param.optionText, param.signalType);
1385
- break;
1386
- case "criticalEnd":
1387
- this.addSignal(void 0, void 0, void 0, param.signalType);
1388
- break;
1389
- case "breakStart":
1390
- this.addSignal(void 0, void 0, param.breakText, param.signalType);
1391
- break;
1392
- case "breakEnd":
1393
- this.addSignal(void 0, void 0, void 0, param.signalType);
1394
- break;
1395
- }
1396
- }
1397
- }
1398
- getConfig() {
1399
- return getConfig2().sequence;
1400
- }
1401
- }, __name(_a, "SequenceDB"), _a);
1402
- var getStyles = /* @__PURE__ */ __name((options) => `.actor {
1403
- stroke: ${options.actorBorder};
1404
- fill: ${options.actorBkg};
1405
- }
1406
-
1407
- text.actor > tspan {
1408
- fill: ${options.actorTextColor};
1409
- stroke: none;
1410
- }
1411
-
1412
- .actor-line {
1413
- stroke: ${options.actorLineColor};
1414
- }
1415
-
1416
- .messageLine0 {
1417
- stroke-width: 1.5;
1418
- stroke-dasharray: none;
1419
- stroke: ${options.signalColor};
1420
- }
1421
-
1422
- .messageLine1 {
1423
- stroke-width: 1.5;
1424
- stroke-dasharray: 2, 2;
1425
- stroke: ${options.signalColor};
1426
- }
1427
-
1428
- #arrowhead path {
1429
- fill: ${options.signalColor};
1430
- stroke: ${options.signalColor};
1431
- }
1432
-
1433
- .sequenceNumber {
1434
- fill: ${options.sequenceNumberColor};
1435
- }
1436
-
1437
- #sequencenumber {
1438
- fill: ${options.signalColor};
1439
- }
1440
-
1441
- #crosshead path {
1442
- fill: ${options.signalColor};
1443
- stroke: ${options.signalColor};
1444
- }
1445
-
1446
- .messageText {
1447
- fill: ${options.signalTextColor};
1448
- stroke: none;
1449
- }
1450
-
1451
- .labelBox {
1452
- stroke: ${options.labelBoxBorderColor};
1453
- fill: ${options.labelBoxBkgColor};
1454
- }
1455
-
1456
- .labelText, .labelText > tspan {
1457
- fill: ${options.labelTextColor};
1458
- stroke: none;
1459
- }
1460
-
1461
- .loopText, .loopText > tspan {
1462
- fill: ${options.loopTextColor};
1463
- stroke: none;
1464
- }
1465
-
1466
- .loopLine {
1467
- stroke-width: 2px;
1468
- stroke-dasharray: 2, 2;
1469
- stroke: ${options.labelBoxBorderColor};
1470
- fill: ${options.labelBoxBorderColor};
1471
- }
1472
-
1473
- .note {
1474
- //stroke: #decc93;
1475
- stroke: ${options.noteBorderColor};
1476
- fill: ${options.noteBkgColor};
1477
- }
1478
-
1479
- .noteText, .noteText > tspan {
1480
- fill: ${options.noteTextColor};
1481
- stroke: none;
1482
- }
1483
-
1484
- .activation0 {
1485
- fill: ${options.activationBkgColor};
1486
- stroke: ${options.activationBorderColor};
1487
- }
1488
-
1489
- .activation1 {
1490
- fill: ${options.activationBkgColor};
1491
- stroke: ${options.activationBorderColor};
1492
- }
1493
-
1494
- .activation2 {
1495
- fill: ${options.activationBkgColor};
1496
- stroke: ${options.activationBorderColor};
1497
- }
1498
-
1499
- .actorPopupMenu {
1500
- position: absolute;
1501
- }
1502
-
1503
- .actorPopupMenuPanel {
1504
- position: absolute;
1505
- fill: ${options.actorBkg};
1506
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1507
- filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1508
- }
1509
- .actor-man line {
1510
- stroke: ${options.actorBorder};
1511
- fill: ${options.actorBkg};
1512
- }
1513
- .actor-man circle, line {
1514
- stroke: ${options.actorBorder};
1515
- fill: ${options.actorBkg};
1516
- stroke-width: 2px;
1517
- }
1518
- `, "getStyles");
1519
- var styles_default = getStyles;
1520
- var ACTOR_TYPE_WIDTH = 18 * 2;
1521
- var TOP_ACTOR_CLASS = "actor-top";
1522
- var BOTTOM_ACTOR_CLASS = "actor-bottom";
1523
- var ACTOR_BOX_CLASS = "actor-box";
1524
- var ACTOR_MAN_FIGURE_CLASS = "actor-man";
1525
- var drawRect2 = /* @__PURE__ */ __name(function(elem, rectData) {
1526
- return drawRect(elem, rectData);
1527
- }, "drawRect");
1528
- var drawPopup = /* @__PURE__ */ __name(function(elem, actor, minMenuWidth, textAttrs, forceMenus) {
1529
- if (actor.links === void 0 || actor.links === null || Object.keys(actor.links).length === 0) {
1530
- return { height: 0, width: 0 };
1531
- }
1532
- const links = actor.links;
1533
- const actorCnt2 = actor.actorCnt;
1534
- const rectData = actor.rectData;
1535
- var displayValue = "none";
1536
- if (forceMenus) {
1537
- displayValue = "block !important";
1538
- }
1539
- const g = elem.append("g");
1540
- g.attr("id", "actor" + actorCnt2 + "_popup");
1541
- g.attr("class", "actorPopupMenu");
1542
- g.attr("display", displayValue);
1543
- var actorClass = "";
1544
- if (rectData.class !== void 0) {
1545
- actorClass = " " + rectData.class;
1546
- }
1547
- let menuWidth = rectData.width > minMenuWidth ? rectData.width : minMenuWidth;
1548
- const rectElem = g.append("rect");
1549
- rectElem.attr("class", "actorPopupMenuPanel" + actorClass);
1550
- rectElem.attr("x", rectData.x);
1551
- rectElem.attr("y", rectData.height);
1552
- rectElem.attr("fill", rectData.fill);
1553
- rectElem.attr("stroke", rectData.stroke);
1554
- rectElem.attr("width", menuWidth);
1555
- rectElem.attr("height", rectData.height);
1556
- rectElem.attr("rx", rectData.rx);
1557
- rectElem.attr("ry", rectData.ry);
1558
- if (links != null) {
1559
- var linkY = 20;
1560
- for (let key in links) {
1561
- var linkElem = g.append("a");
1562
- var sanitizedLink = distExports.sanitizeUrl(links[key]);
1563
- linkElem.attr("xlink:href", sanitizedLink);
1564
- linkElem.attr("target", "_blank");
1565
- _drawMenuItemTextCandidateFunc(textAttrs)(
1566
- key,
1567
- linkElem,
1568
- rectData.x + 10,
1569
- rectData.height + linkY,
1570
- menuWidth,
1571
- 20,
1572
- { class: "actor" },
1573
- textAttrs
1574
- );
1575
- linkY += 30;
1576
- }
1577
- }
1578
- rectElem.attr("height", linkY);
1579
- return { height: rectData.height + linkY, width: menuWidth };
1580
- }, "drawPopup");
1581
- var popupMenuToggle = /* @__PURE__ */ __name(function(popId) {
1582
- return "var pu = document.getElementById('" + popId + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1583
- }, "popupMenuToggle");
1584
- var drawKatex = /* @__PURE__ */ __name(async function(elem, textData, msgModel = null) {
1585
- let textElem = elem.append("foreignObject");
1586
- const lines = await renderKatex(textData.text, getConfig());
1587
- const divElem = textElem.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(lines);
1588
- const dim = divElem.node().getBoundingClientRect();
1589
- textElem.attr("height", Math.round(dim.height)).attr("width", Math.round(dim.width));
1590
- if (textData.class === "noteText") {
1591
- const rectElem = elem.node().firstChild;
1592
- rectElem.setAttribute("height", dim.height + 2 * textData.textMargin);
1593
- const rectDim = rectElem.getBBox();
1594
- textElem.attr("x", Math.round(rectDim.x + rectDim.width / 2 - dim.width / 2)).attr("y", Math.round(rectDim.y + rectDim.height / 2 - dim.height / 2));
1595
- } else if (msgModel) {
1596
- let { startx, stopx, starty } = msgModel;
1597
- if (startx > stopx) {
1598
- const temp = startx;
1599
- startx = stopx;
1600
- stopx = temp;
1601
- }
1602
- textElem.attr("x", Math.round(startx + Math.abs(startx - stopx) / 2 - dim.width / 2));
1603
- if (textData.class === "loopText") {
1604
- textElem.attr("y", Math.round(starty));
1605
- } else {
1606
- textElem.attr("y", Math.round(starty - dim.height));
1607
- }
1608
- }
1609
- return [textElem];
1610
- }, "drawKatex");
1611
- var drawText = /* @__PURE__ */ __name(function(elem, textData) {
1612
- let prevTextHeight = 0;
1613
- let textHeight = 0;
1614
- const lines = textData.text.split(common_default.lineBreakRegex);
1615
- const [_textFontSize, _textFontSizePx] = parseFontSize(textData.fontSize);
1616
- let textElems = [];
1617
- let dy = 0;
1618
- let yfunc = /* @__PURE__ */ __name(() => textData.y, "yfunc");
1619
- if (textData.valign !== void 0 && textData.textMargin !== void 0 && textData.textMargin > 0) {
1620
- switch (textData.valign) {
1621
- case "top":
1622
- case "start":
1623
- yfunc = /* @__PURE__ */ __name(() => Math.round(textData.y + textData.textMargin), "yfunc");
1624
- break;
1625
- case "middle":
1626
- case "center":
1627
- yfunc = /* @__PURE__ */ __name(() => Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2), "yfunc");
1628
- break;
1629
- case "bottom":
1630
- case "end":
1631
- yfunc = /* @__PURE__ */ __name(() => Math.round(
1632
- textData.y + (prevTextHeight + textHeight + 2 * textData.textMargin) - textData.textMargin
1633
- ), "yfunc");
1634
- break;
1635
- }
1636
- }
1637
- if (textData.anchor !== void 0 && textData.textMargin !== void 0 && textData.width !== void 0) {
1638
- switch (textData.anchor) {
1639
- case "left":
1640
- case "start":
1641
- textData.x = Math.round(textData.x + textData.textMargin);
1642
- textData.anchor = "start";
1643
- textData.dominantBaseline = "middle";
1644
- textData.alignmentBaseline = "middle";
1645
- break;
1646
- case "middle":
1647
- case "center":
1648
- textData.x = Math.round(textData.x + textData.width / 2);
1649
- textData.anchor = "middle";
1650
- textData.dominantBaseline = "middle";
1651
- textData.alignmentBaseline = "middle";
1652
- break;
1653
- case "right":
1654
- case "end":
1655
- textData.x = Math.round(textData.x + textData.width - textData.textMargin);
1656
- textData.anchor = "end";
1657
- textData.dominantBaseline = "middle";
1658
- textData.alignmentBaseline = "middle";
1659
- break;
1660
- }
1661
- }
1662
- for (let [i, line] of lines.entries()) {
1663
- if (textData.textMargin !== void 0 && textData.textMargin === 0 && _textFontSize !== void 0) {
1664
- dy = i * _textFontSize;
1665
- }
1666
- const textElem = elem.append("text");
1667
- textElem.attr("x", textData.x);
1668
- textElem.attr("y", yfunc());
1669
- if (textData.anchor !== void 0) {
1670
- textElem.attr("text-anchor", textData.anchor).attr("dominant-baseline", textData.dominantBaseline).attr("alignment-baseline", textData.alignmentBaseline);
1671
- }
1672
- if (textData.fontFamily !== void 0) {
1673
- textElem.style("font-family", textData.fontFamily);
1674
- }
1675
- if (_textFontSizePx !== void 0) {
1676
- textElem.style("font-size", _textFontSizePx);
1677
- }
1678
- if (textData.fontWeight !== void 0) {
1679
- textElem.style("font-weight", textData.fontWeight);
1680
- }
1681
- if (textData.fill !== void 0) {
1682
- textElem.attr("fill", textData.fill);
1683
- }
1684
- if (textData.class !== void 0) {
1685
- textElem.attr("class", textData.class);
1686
- }
1687
- if (textData.dy !== void 0) {
1688
- textElem.attr("dy", textData.dy);
1689
- } else if (dy !== 0) {
1690
- textElem.attr("dy", dy);
1691
- }
1692
- const text = line || ZERO_WIDTH_SPACE;
1693
- if (textData.tspan) {
1694
- const span = textElem.append("tspan");
1695
- span.attr("x", textData.x);
1696
- if (textData.fill !== void 0) {
1697
- span.attr("fill", textData.fill);
1698
- }
1699
- span.text(text);
1700
- } else {
1701
- textElem.text(text);
1702
- }
1703
- if (textData.valign !== void 0 && textData.textMargin !== void 0 && textData.textMargin > 0) {
1704
- textHeight += (textElem._groups || textElem)[0][0].getBBox().height;
1705
- prevTextHeight = textHeight;
1706
- }
1707
- textElems.push(textElem);
1708
- }
1709
- return textElems;
1710
- }, "drawText");
1711
- var drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) {
1712
- function genPoints(x, y, width, height, cut) {
1713
- return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
1714
- }
1715
- __name(genPoints, "genPoints");
1716
- const polygon = elem.append("polygon");
1717
- polygon.attr("points", genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7));
1718
- polygon.attr("class", "labelBox");
1719
- txtObject.y = txtObject.y + txtObject.height / 2;
1720
- drawText(elem, txtObject);
1721
- return polygon;
1722
- }, "drawLabel");
1723
- var actorCnt = -1;
1724
- var fixLifeLineHeights = /* @__PURE__ */ __name((diagram2, actors, actorKeys, conf2) => {
1725
- if (!diagram2.select) {
1726
- return;
1727
- }
1728
- actorKeys.forEach((actorKey) => {
1729
- const actor = actors.get(actorKey);
1730
- const actorDOM = diagram2.select("#actor" + actor.actorCnt);
1731
- if (!conf2.mirrorActors && actor.stopy) {
1732
- actorDOM.attr("y2", actor.stopy + actor.height / 2);
1733
- } else if (conf2.mirrorActors) {
1734
- actorDOM.attr("y2", actor.stopy);
1735
- }
1736
- });
1737
- }, "fixLifeLineHeights");
1738
- var drawActorTypeParticipant = /* @__PURE__ */ __name(function(elem, actor, conf2, isFooter) {
1739
- var _a2, _b;
1740
- const actorY = isFooter ? actor.stopy : actor.starty;
1741
- const center = actor.x + actor.width / 2;
1742
- const centerY = actorY + actor.height;
1743
- const boxplusLineGroup = elem.append("g").lower();
1744
- var g = boxplusLineGroup;
1745
- if (!isFooter) {
1746
- actorCnt++;
1747
- if (Object.keys(actor.links || {}).length && !conf2.forceMenus) {
1748
- g.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer");
1749
- }
1750
- g.append("line").attr("id", "actor" + actorCnt).attr("x1", center).attr("y1", centerY).attr("x2", center).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", actor.name);
1751
- g = boxplusLineGroup.append("g");
1752
- actor.actorCnt = actorCnt;
1753
- if (actor.links != null) {
1754
- g.attr("id", "root-" + actorCnt);
1755
- }
1756
- }
1757
- const rect = getNoteRect();
1758
- var cssclass = "actor";
1759
- if ((_a2 = actor.properties) == null ? void 0 : _a2.class) {
1760
- cssclass = actor.properties.class;
1761
- } else {
1762
- rect.fill = "#eaeaea";
1763
- }
1764
- if (isFooter) {
1765
- cssclass += ` ${BOTTOM_ACTOR_CLASS}`;
1766
- } else {
1767
- cssclass += ` ${TOP_ACTOR_CLASS}`;
1768
- }
1769
- rect.x = actor.x;
1770
- rect.y = actorY;
1771
- rect.width = actor.width;
1772
- rect.height = actor.height;
1773
- rect.class = cssclass;
1774
- rect.rx = 3;
1775
- rect.ry = 3;
1776
- rect.name = actor.name;
1777
- const rectElem = drawRect2(g, rect);
1778
- actor.rectData = rect;
1779
- if ((_b = actor.properties) == null ? void 0 : _b.icon) {
1780
- const iconSrc = actor.properties.icon.trim();
1781
- if (iconSrc.charAt(0) === "@") {
1782
- drawEmbeddedImage(g, rect.x + rect.width - 20, rect.y + 10, iconSrc.substr(1));
1783
- } else {
1784
- drawImage(g, rect.x + rect.width - 20, rect.y + 10, iconSrc);
1785
- }
1786
- }
1787
- _drawTextCandidateFunc(conf2, hasKatex(actor.description))(
1788
- actor.description,
1789
- g,
1790
- rect.x,
1791
- rect.y,
1792
- rect.width,
1793
- rect.height,
1794
- { class: `actor ${ACTOR_BOX_CLASS}` },
1795
- conf2
1796
- );
1797
- let height = actor.height;
1798
- if (rectElem.node) {
1799
- const bounds2 = rectElem.node().getBBox();
1800
- actor.height = bounds2.height;
1801
- height = bounds2.height;
1802
- }
1803
- return height;
1804
- }, "drawActorTypeParticipant");
1805
- var drawActorTypeActor = /* @__PURE__ */ __name(function(elem, actor, conf2, isFooter) {
1806
- const actorY = isFooter ? actor.stopy : actor.starty;
1807
- const center = actor.x + actor.width / 2;
1808
- const centerY = actorY + 80;
1809
- const line = elem.append("g").lower();
1810
- if (!isFooter) {
1811
- actorCnt++;
1812
- line.append("line").attr("id", "actor" + actorCnt).attr("x1", center).attr("y1", centerY).attr("x2", center).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", actor.name);
1813
- actor.actorCnt = actorCnt;
1814
- }
1815
- const actElem = elem.append("g");
1816
- let cssClass = ACTOR_MAN_FIGURE_CLASS;
1817
- if (isFooter) {
1818
- cssClass += ` ${BOTTOM_ACTOR_CLASS}`;
1819
- } else {
1820
- cssClass += ` ${TOP_ACTOR_CLASS}`;
1821
- }
1822
- actElem.attr("class", cssClass);
1823
- actElem.attr("name", actor.name);
1824
- const rect = getNoteRect();
1825
- rect.x = actor.x;
1826
- rect.y = actorY;
1827
- rect.fill = "#eaeaea";
1828
- rect.width = actor.width;
1829
- rect.height = actor.height;
1830
- rect.class = "actor";
1831
- rect.rx = 3;
1832
- rect.ry = 3;
1833
- actElem.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", center).attr("y1", actorY + 25).attr("x2", center).attr("y2", actorY + 45);
1834
- actElem.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", center - ACTOR_TYPE_WIDTH / 2).attr("y1", actorY + 33).attr("x2", center + ACTOR_TYPE_WIDTH / 2).attr("y2", actorY + 33);
1835
- actElem.append("line").attr("x1", center - ACTOR_TYPE_WIDTH / 2).attr("y1", actorY + 60).attr("x2", center).attr("y2", actorY + 45);
1836
- actElem.append("line").attr("x1", center).attr("y1", actorY + 45).attr("x2", center + ACTOR_TYPE_WIDTH / 2 - 2).attr("y2", actorY + 60);
1837
- const circle = actElem.append("circle");
1838
- circle.attr("cx", actor.x + actor.width / 2);
1839
- circle.attr("cy", actorY + 10);
1840
- circle.attr("r", 15);
1841
- circle.attr("width", actor.width);
1842
- circle.attr("height", actor.height);
1843
- const bounds2 = actElem.node().getBBox();
1844
- actor.height = bounds2.height;
1845
- _drawTextCandidateFunc(conf2, hasKatex(actor.description))(
1846
- actor.description,
1847
- actElem,
1848
- rect.x,
1849
- rect.y + 35,
1850
- rect.width,
1851
- rect.height,
1852
- { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` },
1853
- conf2
1854
- );
1855
- return actor.height;
1856
- }, "drawActorTypeActor");
1857
- var drawActor = /* @__PURE__ */ __name(async function(elem, actor, conf2, isFooter) {
1858
- switch (actor.type) {
1859
- case "actor":
1860
- return await drawActorTypeActor(elem, actor, conf2, isFooter);
1861
- case "participant":
1862
- return await drawActorTypeParticipant(elem, actor, conf2, isFooter);
1863
- }
1864
- }, "drawActor");
1865
- var drawBox = /* @__PURE__ */ __name(function(elem, box, conf2) {
1866
- const boxplusTextGroup = elem.append("g");
1867
- const g = boxplusTextGroup;
1868
- drawBackgroundRect2(g, box);
1869
- if (box.name) {
1870
- _drawTextCandidateFunc(conf2)(
1871
- box.name,
1872
- g,
1873
- box.x,
1874
- box.y + conf2.boxTextMargin + (box.textMaxHeight || 0) / 2,
1875
- box.width,
1876
- 0,
1877
- { class: "text" },
1878
- conf2
1879
- );
1880
- }
1881
- g.lower();
1882
- }, "drawBox");
1883
- var anchorElement = /* @__PURE__ */ __name(function(elem) {
1884
- return elem.append("g");
1885
- }, "anchorElement");
1886
- var drawActivation = /* @__PURE__ */ __name(function(elem, bounds2, verticalPos, conf2, actorActivations2) {
1887
- const rect = getNoteRect();
1888
- const g = bounds2.anchored;
1889
- rect.x = bounds2.startx;
1890
- rect.y = bounds2.starty;
1891
- rect.class = "activation" + actorActivations2 % 3;
1892
- rect.width = bounds2.stopx - bounds2.startx;
1893
- rect.height = verticalPos - bounds2.starty;
1894
- drawRect2(g, rect);
1895
- }, "drawActivation");
1896
- var drawLoop = /* @__PURE__ */ __name(async function(elem, loopModel, labelText, conf2) {
1897
- const {
1898
- boxMargin,
1899
- boxTextMargin,
1900
- labelBoxHeight,
1901
- labelBoxWidth,
1902
- messageFontFamily: fontFamily,
1903
- messageFontSize: fontSize,
1904
- messageFontWeight: fontWeight
1905
- } = conf2;
1906
- const g = elem.append("g");
1907
- const drawLoopLine = /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
1908
- return g.append("line").attr("x1", startx).attr("y1", starty).attr("x2", stopx).attr("y2", stopy).attr("class", "loopLine");
1909
- }, "drawLoopLine");
1910
- drawLoopLine(loopModel.startx, loopModel.starty, loopModel.stopx, loopModel.starty);
1911
- drawLoopLine(loopModel.stopx, loopModel.starty, loopModel.stopx, loopModel.stopy);
1912
- drawLoopLine(loopModel.startx, loopModel.stopy, loopModel.stopx, loopModel.stopy);
1913
- drawLoopLine(loopModel.startx, loopModel.starty, loopModel.startx, loopModel.stopy);
1914
- if (loopModel.sections !== void 0) {
1915
- loopModel.sections.forEach(function(item) {
1916
- drawLoopLine(loopModel.startx, item.y, loopModel.stopx, item.y).style(
1917
- "stroke-dasharray",
1918
- "3, 3"
1919
- );
1920
- });
1921
- }
1922
- let txt = getTextObj();
1923
- txt.text = labelText;
1924
- txt.x = loopModel.startx;
1925
- txt.y = loopModel.starty;
1926
- txt.fontFamily = fontFamily;
1927
- txt.fontSize = fontSize;
1928
- txt.fontWeight = fontWeight;
1929
- txt.anchor = "middle";
1930
- txt.valign = "middle";
1931
- txt.tspan = false;
1932
- txt.width = labelBoxWidth || 50;
1933
- txt.height = labelBoxHeight || 20;
1934
- txt.textMargin = boxTextMargin;
1935
- txt.class = "labelText";
1936
- drawLabel(g, txt);
1937
- txt = getTextObj2();
1938
- txt.text = loopModel.title;
1939
- txt.x = loopModel.startx + labelBoxWidth / 2 + (loopModel.stopx - loopModel.startx) / 2;
1940
- txt.y = loopModel.starty + boxMargin + boxTextMargin;
1941
- txt.anchor = "middle";
1942
- txt.valign = "middle";
1943
- txt.textMargin = boxTextMargin;
1944
- txt.class = "loopText";
1945
- txt.fontFamily = fontFamily;
1946
- txt.fontSize = fontSize;
1947
- txt.fontWeight = fontWeight;
1948
- txt.wrap = true;
1949
- let textElem = hasKatex(txt.text) ? await drawKatex(g, txt, loopModel) : drawText(g, txt);
1950
- if (loopModel.sectionTitles !== void 0) {
1951
- for (const [idx, item] of Object.entries(loopModel.sectionTitles)) {
1952
- if (item.message) {
1953
- txt.text = item.message;
1954
- txt.x = loopModel.startx + (loopModel.stopx - loopModel.startx) / 2;
1955
- txt.y = loopModel.sections[idx].y + boxMargin + boxTextMargin;
1956
- txt.class = "loopText";
1957
- txt.anchor = "middle";
1958
- txt.valign = "middle";
1959
- txt.tspan = false;
1960
- txt.fontFamily = fontFamily;
1961
- txt.fontSize = fontSize;
1962
- txt.fontWeight = fontWeight;
1963
- txt.wrap = loopModel.wrap;
1964
- if (hasKatex(txt.text)) {
1965
- loopModel.starty = loopModel.sections[idx].y;
1966
- await drawKatex(g, txt, loopModel);
1967
- } else {
1968
- drawText(g, txt);
1969
- }
1970
- let sectionHeight = Math.round(
1971
- textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr)
1972
- );
1973
- loopModel.sections[idx].height += sectionHeight - (boxMargin + boxTextMargin);
1974
- }
1975
- }
1976
- }
1977
- loopModel.height = Math.round(loopModel.stopy - loopModel.starty);
1978
- return g;
1979
- }, "drawLoop");
1980
- var drawBackgroundRect2 = /* @__PURE__ */ __name(function(elem, bounds2) {
1981
- drawBackgroundRect(elem, bounds2);
1982
- }, "drawBackgroundRect");
1983
- var insertDatabaseIcon = /* @__PURE__ */ __name(function(elem) {
1984
- elem.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1985
- "d",
1986
- "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"
1987
- );
1988
- }, "insertDatabaseIcon");
1989
- var insertComputerIcon = /* @__PURE__ */ __name(function(elem) {
1990
- elem.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1991
- "d",
1992
- "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"
1993
- );
1994
- }, "insertComputerIcon");
1995
- var insertClockIcon = /* @__PURE__ */ __name(function(elem) {
1996
- elem.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1997
- "d",
1998
- "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"
1999
- );
2000
- }, "insertClockIcon");
2001
- var insertArrowHead = /* @__PURE__ */ __name(function(elem) {
2002
- elem.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");
2003
- }, "insertArrowHead");
2004
- var insertArrowFilledHead = /* @__PURE__ */ __name(function(elem) {
2005
- elem.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");
2006
- }, "insertArrowFilledHead");
2007
- var insertSequenceNumber = /* @__PURE__ */ __name(function(elem) {
2008
- elem.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);
2009
- }, "insertSequenceNumber");
2010
- var insertArrowCrossHead = /* @__PURE__ */ __name(function(elem) {
2011
- const defs = elem.append("defs");
2012
- const marker = defs.append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5);
2013
- marker.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");
2014
- }, "insertArrowCrossHead");
2015
- var getTextObj2 = /* @__PURE__ */ __name(function() {
2016
- return {
2017
- x: 0,
2018
- y: 0,
2019
- fill: void 0,
2020
- anchor: void 0,
2021
- style: "#666",
2022
- width: void 0,
2023
- height: void 0,
2024
- textMargin: 0,
2025
- rx: 0,
2026
- ry: 0,
2027
- tspan: true,
2028
- valign: void 0
2029
- };
2030
- }, "getTextObj");
2031
- var getNoteRect2 = /* @__PURE__ */ __name(function() {
2032
- return {
2033
- x: 0,
2034
- y: 0,
2035
- fill: "#EDF2AE",
2036
- stroke: "#666",
2037
- width: 100,
2038
- anchor: "start",
2039
- height: 100,
2040
- rx: 0,
2041
- ry: 0
2042
- };
2043
- }, "getNoteRect");
2044
- var _drawTextCandidateFunc = /* @__PURE__ */ function() {
2045
- function byText(content, g, x, y, width, height, textAttrs) {
2046
- const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("text-anchor", "middle").text(content);
2047
- _setTextAttrs(text, textAttrs);
2048
- }
2049
- __name(byText, "byText");
2050
- function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
2051
- const { actorFontSize, actorFontFamily, actorFontWeight } = conf2;
2052
- const [_actorFontSize, _actorFontSizePx] = parseFontSize(actorFontSize);
2053
- const lines = content.split(common_default.lineBreakRegex);
2054
- for (let i = 0; i < lines.length; i++) {
2055
- const dy = i * _actorFontSize - _actorFontSize * (lines.length - 1) / 2;
2056
- const text = g.append("text").attr("x", x + width / 2).attr("y", y).style("text-anchor", "middle").style("font-size", _actorFontSizePx).style("font-weight", actorFontWeight).style("font-family", actorFontFamily);
2057
- text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
2058
- text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
2059
- _setTextAttrs(text, textAttrs);
2060
- }
2061
- }
2062
- __name(byTspan, "byTspan");
2063
- function byFo(content, g, x, y, width, height, textAttrs, conf2) {
2064
- const s = g.append("switch");
2065
- const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
2066
- const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
2067
- text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
2068
- byTspan(content, s, x, y, width, height, textAttrs, conf2);
2069
- _setTextAttrs(text, textAttrs);
2070
- }
2071
- __name(byFo, "byFo");
2072
- async function byKatex(content, g, x, y, width, height, textAttrs, conf2) {
2073
- const dim = await calculateMathMLDimensions(content, getConfig());
2074
- const s = g.append("switch");
2075
- const f = s.append("foreignObject").attr("x", x + width / 2 - dim.width / 2).attr("y", y + height / 2 - dim.height / 2).attr("width", dim.width).attr("height", dim.height);
2076
- const text = f.append("xhtml:div").style("height", "100%").style("width", "100%");
2077
- text.append("div").style("text-align", "center").style("vertical-align", "middle").html(await renderKatex(content, getConfig()));
2078
- byTspan(content, s, x, y, width, height, textAttrs, conf2);
2079
- _setTextAttrs(text, textAttrs);
2080
- }
2081
- __name(byKatex, "byKatex");
2082
- function _setTextAttrs(toText, fromTextAttrsDict) {
2083
- for (const key in fromTextAttrsDict) {
2084
- if (fromTextAttrsDict.hasOwnProperty(key)) {
2085
- toText.attr(key, fromTextAttrsDict[key]);
2086
- }
2087
- }
2088
- }
2089
- __name(_setTextAttrs, "_setTextAttrs");
2090
- return function(conf2, hasKatex2 = false) {
2091
- if (hasKatex2) {
2092
- return byKatex;
2093
- }
2094
- return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
2095
- };
2096
- }();
2097
- var _drawMenuItemTextCandidateFunc = /* @__PURE__ */ function() {
2098
- function byText(content, g, x, y, width, height, textAttrs) {
2099
- const text = g.append("text").attr("x", x).attr("y", y).style("text-anchor", "start").text(content);
2100
- _setTextAttrs(text, textAttrs);
2101
- }
2102
- __name(byText, "byText");
2103
- function byTspan(content, g, x, y, width, height, textAttrs, conf2) {
2104
- const { actorFontSize, actorFontFamily, actorFontWeight } = conf2;
2105
- const lines = content.split(common_default.lineBreakRegex);
2106
- for (let i = 0; i < lines.length; i++) {
2107
- const dy = i * actorFontSize - actorFontSize * (lines.length - 1) / 2;
2108
- const text = g.append("text").attr("x", x).attr("y", y).style("text-anchor", "start").style("font-size", actorFontSize).style("font-weight", actorFontWeight).style("font-family", actorFontFamily);
2109
- text.append("tspan").attr("x", x).attr("dy", dy).text(lines[i]);
2110
- text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
2111
- _setTextAttrs(text, textAttrs);
2112
- }
2113
- }
2114
- __name(byTspan, "byTspan");
2115
- function byFo(content, g, x, y, width, height, textAttrs, conf2) {
2116
- const s = g.append("switch");
2117
- const f = s.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height);
2118
- const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
2119
- text.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
2120
- byTspan(content, s, x, y, width, height, textAttrs, conf2);
2121
- _setTextAttrs(text, textAttrs);
2122
- }
2123
- __name(byFo, "byFo");
2124
- function _setTextAttrs(toText, fromTextAttrsDict) {
2125
- for (const key in fromTextAttrsDict) {
2126
- if (fromTextAttrsDict.hasOwnProperty(key)) {
2127
- toText.attr(key, fromTextAttrsDict[key]);
2128
- }
2129
- }
2130
- }
2131
- __name(_setTextAttrs, "_setTextAttrs");
2132
- return function(conf2) {
2133
- return conf2.textPlacement === "fo" ? byFo : conf2.textPlacement === "old" ? byText : byTspan;
2134
- };
2135
- }();
2136
- var svgDraw_default = {
2137
- drawRect: drawRect2,
2138
- drawText,
2139
- drawLabel,
2140
- drawActor,
2141
- drawBox,
2142
- drawPopup,
2143
- anchorElement,
2144
- drawActivation,
2145
- drawLoop,
2146
- drawBackgroundRect: drawBackgroundRect2,
2147
- insertArrowHead,
2148
- insertArrowFilledHead,
2149
- insertSequenceNumber,
2150
- insertArrowCrossHead,
2151
- insertDatabaseIcon,
2152
- insertComputerIcon,
2153
- insertClockIcon,
2154
- getTextObj: getTextObj2,
2155
- getNoteRect: getNoteRect2,
2156
- fixLifeLineHeights,
2157
- sanitizeUrl: distExports.sanitizeUrl
2158
- };
2159
- var conf = {};
2160
- var bounds = {
2161
- data: {
2162
- startx: void 0,
2163
- stopx: void 0,
2164
- starty: void 0,
2165
- stopy: void 0
2166
- },
2167
- verticalPos: 0,
2168
- sequenceItems: [],
2169
- activations: [],
2170
- models: {
2171
- getHeight: /* @__PURE__ */ __name(function() {
2172
- return Math.max.apply(
2173
- null,
2174
- this.actors.length === 0 ? [0] : this.actors.map((actor) => actor.height || 0)
2175
- ) + (this.loops.length === 0 ? 0 : this.loops.map((it) => it.height || 0).reduce((acc, h) => acc + h)) + (this.messages.length === 0 ? 0 : this.messages.map((it) => it.height || 0).reduce((acc, h) => acc + h)) + (this.notes.length === 0 ? 0 : this.notes.map((it) => it.height || 0).reduce((acc, h) => acc + h));
2176
- }, "getHeight"),
2177
- clear: /* @__PURE__ */ __name(function() {
2178
- this.actors = [];
2179
- this.boxes = [];
2180
- this.loops = [];
2181
- this.messages = [];
2182
- this.notes = [];
2183
- }, "clear"),
2184
- addBox: /* @__PURE__ */ __name(function(boxModel) {
2185
- this.boxes.push(boxModel);
2186
- }, "addBox"),
2187
- addActor: /* @__PURE__ */ __name(function(actorModel) {
2188
- this.actors.push(actorModel);
2189
- }, "addActor"),
2190
- addLoop: /* @__PURE__ */ __name(function(loopModel) {
2191
- this.loops.push(loopModel);
2192
- }, "addLoop"),
2193
- addMessage: /* @__PURE__ */ __name(function(msgModel) {
2194
- this.messages.push(msgModel);
2195
- }, "addMessage"),
2196
- addNote: /* @__PURE__ */ __name(function(noteModel) {
2197
- this.notes.push(noteModel);
2198
- }, "addNote"),
2199
- lastActor: /* @__PURE__ */ __name(function() {
2200
- return this.actors[this.actors.length - 1];
2201
- }, "lastActor"),
2202
- lastLoop: /* @__PURE__ */ __name(function() {
2203
- return this.loops[this.loops.length - 1];
2204
- }, "lastLoop"),
2205
- lastMessage: /* @__PURE__ */ __name(function() {
2206
- return this.messages[this.messages.length - 1];
2207
- }, "lastMessage"),
2208
- lastNote: /* @__PURE__ */ __name(function() {
2209
- return this.notes[this.notes.length - 1];
2210
- }, "lastNote"),
2211
- actors: [],
2212
- boxes: [],
2213
- loops: [],
2214
- messages: [],
2215
- notes: []
2216
- },
2217
- init: /* @__PURE__ */ __name(function() {
2218
- this.sequenceItems = [];
2219
- this.activations = [];
2220
- this.models.clear();
2221
- this.data = {
2222
- startx: void 0,
2223
- stopx: void 0,
2224
- starty: void 0,
2225
- stopy: void 0
2226
- };
2227
- this.verticalPos = 0;
2228
- setConf(getConfig2());
2229
- }, "init"),
2230
- updateVal: /* @__PURE__ */ __name(function(obj, key, val, fun) {
2231
- if (obj[key] === void 0) {
2232
- obj[key] = val;
2233
- } else {
2234
- obj[key] = fun(val, obj[key]);
2235
- }
2236
- }, "updateVal"),
2237
- updateBounds: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
2238
- const _self = this;
2239
- let cnt = 0;
2240
- function updateFn(type) {
2241
- return /* @__PURE__ */ __name(function updateItemBounds(item) {
2242
- cnt++;
2243
- const n = _self.sequenceItems.length - cnt + 1;
2244
- _self.updateVal(item, "starty", starty - n * conf.boxMargin, Math.min);
2245
- _self.updateVal(item, "stopy", stopy + n * conf.boxMargin, Math.max);
2246
- _self.updateVal(bounds.data, "startx", startx - n * conf.boxMargin, Math.min);
2247
- _self.updateVal(bounds.data, "stopx", stopx + n * conf.boxMargin, Math.max);
2248
- if (!(type === "activation")) {
2249
- _self.updateVal(item, "startx", startx - n * conf.boxMargin, Math.min);
2250
- _self.updateVal(item, "stopx", stopx + n * conf.boxMargin, Math.max);
2251
- _self.updateVal(bounds.data, "starty", starty - n * conf.boxMargin, Math.min);
2252
- _self.updateVal(bounds.data, "stopy", stopy + n * conf.boxMargin, Math.max);
2253
- }
2254
- }, "updateItemBounds");
2255
- }
2256
- __name(updateFn, "updateFn");
2257
- this.sequenceItems.forEach(updateFn());
2258
- this.activations.forEach(updateFn("activation"));
2259
- }, "updateBounds"),
2260
- insert: /* @__PURE__ */ __name(function(startx, starty, stopx, stopy) {
2261
- const _startx = common_default.getMin(startx, stopx);
2262
- const _stopx = common_default.getMax(startx, stopx);
2263
- const _starty = common_default.getMin(starty, stopy);
2264
- const _stopy = common_default.getMax(starty, stopy);
2265
- this.updateVal(bounds.data, "startx", _startx, Math.min);
2266
- this.updateVal(bounds.data, "starty", _starty, Math.min);
2267
- this.updateVal(bounds.data, "stopx", _stopx, Math.max);
2268
- this.updateVal(bounds.data, "stopy", _stopy, Math.max);
2269
- this.updateBounds(_startx, _starty, _stopx, _stopy);
2270
- }, "insert"),
2271
- newActivation: /* @__PURE__ */ __name(function(message, diagram2, actors) {
2272
- const actorRect = actors.get(message.from);
2273
- const stackedSize = actorActivations(message.from).length || 0;
2274
- const x = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf.activationWidth / 2;
2275
- this.activations.push({
2276
- startx: x,
2277
- starty: this.verticalPos + 2,
2278
- stopx: x + conf.activationWidth,
2279
- stopy: void 0,
2280
- actor: message.from,
2281
- anchored: svgDraw_default.anchorElement(diagram2)
2282
- });
2283
- }, "newActivation"),
2284
- endActivation: /* @__PURE__ */ __name(function(message) {
2285
- const lastActorActivationIdx = this.activations.map(function(activation) {
2286
- return activation.actor;
2287
- }).lastIndexOf(message.from);
2288
- return this.activations.splice(lastActorActivationIdx, 1)[0];
2289
- }, "endActivation"),
2290
- createLoop: /* @__PURE__ */ __name(function(title = { message: void 0, wrap: false, width: void 0 }, fill) {
2291
- return {
2292
- startx: void 0,
2293
- starty: this.verticalPos,
2294
- stopx: void 0,
2295
- stopy: void 0,
2296
- title: title.message,
2297
- wrap: title.wrap,
2298
- width: title.width,
2299
- height: 0,
2300
- fill
2301
- };
2302
- }, "createLoop"),
2303
- newLoop: /* @__PURE__ */ __name(function(title = { message: void 0, wrap: false, width: void 0 }, fill) {
2304
- this.sequenceItems.push(this.createLoop(title, fill));
2305
- }, "newLoop"),
2306
- endLoop: /* @__PURE__ */ __name(function() {
2307
- return this.sequenceItems.pop();
2308
- }, "endLoop"),
2309
- isLoopOverlap: /* @__PURE__ */ __name(function() {
2310
- return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : false;
2311
- }, "isLoopOverlap"),
2312
- addSectionToLoop: /* @__PURE__ */ __name(function(message) {
2313
- const loop = this.sequenceItems.pop();
2314
- loop.sections = loop.sections || [];
2315
- loop.sectionTitles = loop.sectionTitles || [];
2316
- loop.sections.push({ y: bounds.getVerticalPos(), height: 0 });
2317
- loop.sectionTitles.push(message);
2318
- this.sequenceItems.push(loop);
2319
- }, "addSectionToLoop"),
2320
- saveVerticalPos: /* @__PURE__ */ __name(function() {
2321
- if (this.isLoopOverlap()) {
2322
- this.savedVerticalPos = this.verticalPos;
2323
- }
2324
- }, "saveVerticalPos"),
2325
- resetVerticalPos: /* @__PURE__ */ __name(function() {
2326
- if (this.isLoopOverlap()) {
2327
- this.verticalPos = this.savedVerticalPos;
2328
- }
2329
- }, "resetVerticalPos"),
2330
- bumpVerticalPos: /* @__PURE__ */ __name(function(bump) {
2331
- this.verticalPos = this.verticalPos + bump;
2332
- this.data.stopy = common_default.getMax(this.data.stopy, this.verticalPos);
2333
- }, "bumpVerticalPos"),
2334
- getVerticalPos: /* @__PURE__ */ __name(function() {
2335
- return this.verticalPos;
2336
- }, "getVerticalPos"),
2337
- getBounds: /* @__PURE__ */ __name(function() {
2338
- return { bounds: this.data, models: this.models };
2339
- }, "getBounds")
2340
- };
2341
- var drawNote = /* @__PURE__ */ __name(async function(elem, noteModel) {
2342
- bounds.bumpVerticalPos(conf.boxMargin);
2343
- noteModel.height = conf.boxMargin;
2344
- noteModel.starty = bounds.getVerticalPos();
2345
- const rect = getNoteRect();
2346
- rect.x = noteModel.startx;
2347
- rect.y = noteModel.starty;
2348
- rect.width = noteModel.width || conf.width;
2349
- rect.class = "note";
2350
- const g = elem.append("g");
2351
- const rectElem = svgDraw_default.drawRect(g, rect);
2352
- const textObj = getTextObj();
2353
- textObj.x = noteModel.startx;
2354
- textObj.y = noteModel.starty;
2355
- textObj.width = rect.width;
2356
- textObj.dy = "1em";
2357
- textObj.text = noteModel.message;
2358
- textObj.class = "noteText";
2359
- textObj.fontFamily = conf.noteFontFamily;
2360
- textObj.fontSize = conf.noteFontSize;
2361
- textObj.fontWeight = conf.noteFontWeight;
2362
- textObj.anchor = conf.noteAlign;
2363
- textObj.textMargin = conf.noteMargin;
2364
- textObj.valign = "center";
2365
- const textElem = hasKatex(textObj.text) ? await drawKatex(g, textObj) : drawText(g, textObj);
2366
- const textHeight = Math.round(
2367
- textElem.map((te) => (te._groups || te)[0][0].getBBox().height).reduce((acc, curr) => acc + curr)
2368
- );
2369
- rectElem.attr("height", textHeight + 2 * conf.noteMargin);
2370
- noteModel.height += textHeight + 2 * conf.noteMargin;
2371
- bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin);
2372
- noteModel.stopy = noteModel.starty + textHeight + 2 * conf.noteMargin;
2373
- noteModel.stopx = noteModel.startx + rect.width;
2374
- bounds.insert(noteModel.startx, noteModel.starty, noteModel.stopx, noteModel.stopy);
2375
- bounds.models.addNote(noteModel);
2376
- }, "drawNote");
2377
- var messageFont = /* @__PURE__ */ __name((cnf) => {
2378
- return {
2379
- fontFamily: cnf.messageFontFamily,
2380
- fontSize: cnf.messageFontSize,
2381
- fontWeight: cnf.messageFontWeight
2382
- };
2383
- }, "messageFont");
2384
- var noteFont = /* @__PURE__ */ __name((cnf) => {
2385
- return {
2386
- fontFamily: cnf.noteFontFamily,
2387
- fontSize: cnf.noteFontSize,
2388
- fontWeight: cnf.noteFontWeight
2389
- };
2390
- }, "noteFont");
2391
- var actorFont = /* @__PURE__ */ __name((cnf) => {
2392
- return {
2393
- fontFamily: cnf.actorFontFamily,
2394
- fontSize: cnf.actorFontSize,
2395
- fontWeight: cnf.actorFontWeight
2396
- };
2397
- }, "actorFont");
2398
- async function boundMessage(_diagram, msgModel) {
2399
- bounds.bumpVerticalPos(10);
2400
- const { startx, stopx, message } = msgModel;
2401
- const lines = common_default.splitBreaks(message).length;
2402
- const isKatexMsg = hasKatex(message);
2403
- const textDims = isKatexMsg ? await calculateMathMLDimensions(message, getConfig2()) : utils_default.calculateTextDimensions(message, messageFont(conf));
2404
- if (!isKatexMsg) {
2405
- const lineHeight = textDims.height / lines;
2406
- msgModel.height += lineHeight;
2407
- bounds.bumpVerticalPos(lineHeight);
2408
- }
2409
- let lineStartY;
2410
- let totalOffset = textDims.height - 10;
2411
- const textWidth = textDims.width;
2412
- if (startx === stopx) {
2413
- lineStartY = bounds.getVerticalPos() + totalOffset;
2414
- if (!conf.rightAngles) {
2415
- totalOffset += conf.boxMargin;
2416
- lineStartY = bounds.getVerticalPos() + totalOffset;
2417
- }
2418
- totalOffset += 30;
2419
- const dx = common_default.getMax(textWidth / 2, conf.width / 2);
2420
- bounds.insert(
2421
- startx - dx,
2422
- bounds.getVerticalPos() - 10 + totalOffset,
2423
- stopx + dx,
2424
- bounds.getVerticalPos() + 30 + totalOffset
2425
- );
2426
- } else {
2427
- totalOffset += conf.boxMargin;
2428
- lineStartY = bounds.getVerticalPos() + totalOffset;
2429
- bounds.insert(startx, lineStartY - 10, stopx, lineStartY);
2430
- }
2431
- bounds.bumpVerticalPos(totalOffset);
2432
- msgModel.height += totalOffset;
2433
- msgModel.stopy = msgModel.starty + msgModel.height;
2434
- bounds.insert(msgModel.fromBounds, msgModel.starty, msgModel.toBounds, msgModel.stopy);
2435
- return lineStartY;
2436
- }
2437
- __name(boundMessage, "boundMessage");
2438
- var drawMessage = /* @__PURE__ */ __name(async function(diagram2, msgModel, lineStartY, diagObj) {
2439
- const { startx, stopx, starty, message, type, sequenceIndex, sequenceVisible } = msgModel;
2440
- const textDims = utils_default.calculateTextDimensions(message, messageFont(conf));
2441
- const textObj = getTextObj();
2442
- textObj.x = startx;
2443
- textObj.y = starty + 10;
2444
- textObj.width = stopx - startx;
2445
- textObj.class = "messageText";
2446
- textObj.dy = "1em";
2447
- textObj.text = message;
2448
- textObj.fontFamily = conf.messageFontFamily;
2449
- textObj.fontSize = conf.messageFontSize;
2450
- textObj.fontWeight = conf.messageFontWeight;
2451
- textObj.anchor = conf.messageAlign;
2452
- textObj.valign = "center";
2453
- textObj.textMargin = conf.wrapPadding;
2454
- textObj.tspan = false;
2455
- if (hasKatex(textObj.text)) {
2456
- await drawKatex(diagram2, textObj, { startx, stopx, starty: lineStartY });
2457
- } else {
2458
- drawText(diagram2, textObj);
2459
- }
2460
- const textWidth = textDims.width;
2461
- let line;
2462
- if (startx === stopx) {
2463
- if (conf.rightAngles) {
2464
- line = diagram2.append("path").attr(
2465
- "d",
2466
- `M ${startx},${lineStartY} H ${startx + common_default.getMax(conf.width / 2, textWidth / 2)} V ${lineStartY + 25} H ${startx}`
2467
- );
2468
- } else {
2469
- line = diagram2.append("path").attr(
2470
- "d",
2471
- "M " + startx + "," + lineStartY + " C " + (startx + 60) + "," + (lineStartY - 10) + " " + (startx + 60) + "," + (lineStartY + 30) + " " + startx + "," + (lineStartY + 20)
2472
- );
2473
- }
2474
- } else {
2475
- line = diagram2.append("line");
2476
- line.attr("x1", startx);
2477
- line.attr("y1", lineStartY);
2478
- line.attr("x2", stopx);
2479
- line.attr("y2", lineStartY);
2480
- }
2481
- if (type === diagObj.db.LINETYPE.DOTTED || type === diagObj.db.LINETYPE.DOTTED_CROSS || type === diagObj.db.LINETYPE.DOTTED_POINT || type === diagObj.db.LINETYPE.DOTTED_OPEN || type === diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED) {
2482
- line.style("stroke-dasharray", "3, 3");
2483
- line.attr("class", "messageLine1");
2484
- } else {
2485
- line.attr("class", "messageLine0");
2486
- }
2487
- let url = "";
2488
- if (conf.arrowMarkerAbsolute) {
2489
- url = getUrl(true);
2490
- }
2491
- line.attr("stroke-width", 2);
2492
- line.attr("stroke", "none");
2493
- line.style("fill", "none");
2494
- if (type === diagObj.db.LINETYPE.SOLID || type === diagObj.db.LINETYPE.DOTTED) {
2495
- line.attr("marker-end", "url(" + url + "#arrowhead)");
2496
- }
2497
- if (type === diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID || type === diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED) {
2498
- line.attr("marker-start", "url(" + url + "#arrowhead)");
2499
- line.attr("marker-end", "url(" + url + "#arrowhead)");
2500
- }
2501
- if (type === diagObj.db.LINETYPE.SOLID_POINT || type === diagObj.db.LINETYPE.DOTTED_POINT) {
2502
- line.attr("marker-end", "url(" + url + "#filled-head)");
2503
- }
2504
- if (type === diagObj.db.LINETYPE.SOLID_CROSS || type === diagObj.db.LINETYPE.DOTTED_CROSS) {
2505
- line.attr("marker-end", "url(" + url + "#crosshead)");
2506
- }
2507
- if (sequenceVisible || conf.showSequenceNumbers) {
2508
- line.attr("marker-start", "url(" + url + "#sequencenumber)");
2509
- diagram2.append("text").attr("x", startx).attr("y", lineStartY + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(sequenceIndex);
2510
- }
2511
- }, "drawMessage");
2512
- var addActorRenderingData = /* @__PURE__ */ __name(function(diagram2, actors, createdActors, actorKeys, verticalPos, messages, isFooter) {
2513
- let prevWidth = 0;
2514
- let prevMargin = 0;
2515
- let prevBox = void 0;
2516
- let maxHeight = 0;
2517
- for (const actorKey of actorKeys) {
2518
- const actor = actors.get(actorKey);
2519
- const box = actor.box;
2520
- if (prevBox && prevBox != box) {
2521
- if (!isFooter) {
2522
- bounds.models.addBox(prevBox);
2523
- }
2524
- prevMargin += conf.boxMargin + prevBox.margin;
2525
- }
2526
- if (box && box != prevBox) {
2527
- if (!isFooter) {
2528
- box.x = prevWidth + prevMargin;
2529
- box.y = verticalPos;
2530
- }
2531
- prevMargin += box.margin;
2532
- }
2533
- actor.width = actor.width || conf.width;
2534
- actor.height = common_default.getMax(actor.height || conf.height, conf.height);
2535
- actor.margin = actor.margin || conf.actorMargin;
2536
- maxHeight = common_default.getMax(maxHeight, actor.height);
2537
- if (createdActors.get(actor.name)) {
2538
- prevMargin += actor.width / 2;
2539
- }
2540
- actor.x = prevWidth + prevMargin;
2541
- actor.starty = bounds.getVerticalPos();
2542
- bounds.insert(actor.x, verticalPos, actor.x + actor.width, actor.height);
2543
- prevWidth += actor.width + prevMargin;
2544
- if (actor.box) {
2545
- actor.box.width = prevWidth + box.margin - actor.box.x;
2546
- }
2547
- prevMargin = actor.margin;
2548
- prevBox = actor.box;
2549
- bounds.models.addActor(actor);
2550
- }
2551
- if (prevBox && !isFooter) {
2552
- bounds.models.addBox(prevBox);
2553
- }
2554
- bounds.bumpVerticalPos(maxHeight);
2555
- }, "addActorRenderingData");
2556
- var drawActors = /* @__PURE__ */ __name(async function(diagram2, actors, actorKeys, isFooter) {
2557
- if (!isFooter) {
2558
- for (const actorKey of actorKeys) {
2559
- const actor = actors.get(actorKey);
2560
- await svgDraw_default.drawActor(diagram2, actor, conf, false);
2561
- }
2562
- } else {
2563
- let maxHeight = 0;
2564
- bounds.bumpVerticalPos(conf.boxMargin * 2);
2565
- for (const actorKey of actorKeys) {
2566
- const actor = actors.get(actorKey);
2567
- if (!actor.stopy) {
2568
- actor.stopy = bounds.getVerticalPos();
2569
- }
2570
- const height = await svgDraw_default.drawActor(diagram2, actor, conf, true);
2571
- maxHeight = common_default.getMax(maxHeight, height);
2572
- }
2573
- bounds.bumpVerticalPos(maxHeight + conf.boxMargin);
2574
- }
2575
- }, "drawActors");
2576
- var drawActorsPopup = /* @__PURE__ */ __name(function(diagram2, actors, actorKeys, doc) {
2577
- let maxHeight = 0;
2578
- let maxWidth = 0;
2579
- for (const actorKey of actorKeys) {
2580
- const actor = actors.get(actorKey);
2581
- const minMenuWidth = getRequiredPopupWidth(actor);
2582
- const menuDimensions = svgDraw_default.drawPopup(
2583
- diagram2,
2584
- actor,
2585
- minMenuWidth,
2586
- conf,
2587
- conf.forceMenus,
2588
- doc
2589
- );
2590
- if (menuDimensions.height > maxHeight) {
2591
- maxHeight = menuDimensions.height;
2592
- }
2593
- if (menuDimensions.width + actor.x > maxWidth) {
2594
- maxWidth = menuDimensions.width + actor.x;
2595
- }
2596
- }
2597
- return { maxHeight, maxWidth };
2598
- }, "drawActorsPopup");
2599
- var setConf = /* @__PURE__ */ __name(function(cnf) {
2600
- assignWithDepth_default(conf, cnf);
2601
- if (cnf.fontFamily) {
2602
- conf.actorFontFamily = conf.noteFontFamily = conf.messageFontFamily = cnf.fontFamily;
2603
- }
2604
- if (cnf.fontSize) {
2605
- conf.actorFontSize = conf.noteFontSize = conf.messageFontSize = cnf.fontSize;
2606
- }
2607
- if (cnf.fontWeight) {
2608
- conf.actorFontWeight = conf.noteFontWeight = conf.messageFontWeight = cnf.fontWeight;
2609
- }
2610
- }, "setConf");
2611
- var actorActivations = /* @__PURE__ */ __name(function(actor) {
2612
- return bounds.activations.filter(function(activation) {
2613
- return activation.actor === actor;
2614
- });
2615
- }, "actorActivations");
2616
- var activationBounds = /* @__PURE__ */ __name(function(actor, actors) {
2617
- const actorObj = actors.get(actor);
2618
- const activations = actorActivations(actor);
2619
- const left = activations.reduce(
2620
- function(acc, activation) {
2621
- return common_default.getMin(acc, activation.startx);
2622
- },
2623
- actorObj.x + actorObj.width / 2 - 1
2624
- );
2625
- const right = activations.reduce(
2626
- function(acc, activation) {
2627
- return common_default.getMax(acc, activation.stopx);
2628
- },
2629
- actorObj.x + actorObj.width / 2 + 1
2630
- );
2631
- return [left, right];
2632
- }, "activationBounds");
2633
- function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoopFn) {
2634
- bounds.bumpVerticalPos(preMargin);
2635
- let heightAdjust = postMargin;
2636
- if (msg.id && msg.message && loopWidths[msg.id]) {
2637
- const loopWidth = loopWidths[msg.id].width;
2638
- const textConf = messageFont(conf);
2639
- msg.message = utils_default.wrapLabel(`[${msg.message}]`, loopWidth - 2 * conf.wrapPadding, textConf);
2640
- msg.width = loopWidth;
2641
- msg.wrap = true;
2642
- const textDims = utils_default.calculateTextDimensions(msg.message, textConf);
2643
- const totalOffset = common_default.getMax(textDims.height, conf.labelBoxHeight);
2644
- heightAdjust = postMargin + totalOffset;
2645
- log.debug(`${totalOffset} - ${msg.message}`);
2646
- }
2647
- addLoopFn(msg);
2648
- bounds.bumpVerticalPos(heightAdjust);
2649
- }
2650
- __name(adjustLoopHeightForWrap, "adjustLoopHeightForWrap");
2651
- function adjustCreatedDestroyedData(msg, msgModel, lineStartY, index, actors, createdActors, destroyedActors) {
2652
- function receiverAdjustment(actor, adjustment) {
2653
- if (actor.x < actors.get(msg.from).x) {
2654
- bounds.insert(
2655
- msgModel.stopx - adjustment,
2656
- msgModel.starty,
2657
- msgModel.startx,
2658
- msgModel.stopy + actor.height / 2 + conf.noteMargin
2659
- );
2660
- msgModel.stopx = msgModel.stopx + adjustment;
2661
- } else {
2662
- bounds.insert(
2663
- msgModel.startx,
2664
- msgModel.starty,
2665
- msgModel.stopx + adjustment,
2666
- msgModel.stopy + actor.height / 2 + conf.noteMargin
2667
- );
2668
- msgModel.stopx = msgModel.stopx - adjustment;
2669
- }
2670
- }
2671
- __name(receiverAdjustment, "receiverAdjustment");
2672
- function senderAdjustment(actor, adjustment) {
2673
- if (actor.x < actors.get(msg.to).x) {
2674
- bounds.insert(
2675
- msgModel.startx - adjustment,
2676
- msgModel.starty,
2677
- msgModel.stopx,
2678
- msgModel.stopy + actor.height / 2 + conf.noteMargin
2679
- );
2680
- msgModel.startx = msgModel.startx + adjustment;
2681
- } else {
2682
- bounds.insert(
2683
- msgModel.stopx,
2684
- msgModel.starty,
2685
- msgModel.startx + adjustment,
2686
- msgModel.stopy + actor.height / 2 + conf.noteMargin
2687
- );
2688
- msgModel.startx = msgModel.startx - adjustment;
2689
- }
2690
- }
2691
- __name(senderAdjustment, "senderAdjustment");
2692
- if (createdActors.get(msg.to) == index) {
2693
- const actor = actors.get(msg.to);
2694
- const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 + 3 : actor.width / 2 + 3;
2695
- receiverAdjustment(actor, adjustment);
2696
- actor.starty = lineStartY - actor.height / 2;
2697
- bounds.bumpVerticalPos(actor.height / 2);
2698
- } else if (destroyedActors.get(msg.from) == index) {
2699
- const actor = actors.get(msg.from);
2700
- if (conf.mirrorActors) {
2701
- const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 : actor.width / 2;
2702
- senderAdjustment(actor, adjustment);
2703
- }
2704
- actor.stopy = lineStartY - actor.height / 2;
2705
- bounds.bumpVerticalPos(actor.height / 2);
2706
- } else if (destroyedActors.get(msg.to) == index) {
2707
- const actor = actors.get(msg.to);
2708
- if (conf.mirrorActors) {
2709
- const adjustment = actor.type == "actor" ? ACTOR_TYPE_WIDTH / 2 + 3 : actor.width / 2 + 3;
2710
- receiverAdjustment(actor, adjustment);
2711
- }
2712
- actor.stopy = lineStartY - actor.height / 2;
2713
- bounds.bumpVerticalPos(actor.height / 2);
2714
- }
2715
- }
2716
- __name(adjustCreatedDestroyedData, "adjustCreatedDestroyedData");
2717
- var draw = /* @__PURE__ */ __name(async function(_text, id, _version, diagObj) {
2718
- const { securityLevel, sequence } = getConfig2();
2719
- conf = sequence;
2720
- let sandboxElement;
2721
- if (securityLevel === "sandbox") {
2722
- sandboxElement = select("#i" + id);
2723
- }
2724
- const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
2725
- const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
2726
- bounds.init();
2727
- log.debug(diagObj.db);
2728
- const diagram2 = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : select(`[id="${id}"]`);
2729
- const actors = diagObj.db.getActors();
2730
- const createdActors = diagObj.db.getCreatedActors();
2731
- const destroyedActors = diagObj.db.getDestroyedActors();
2732
- const boxes = diagObj.db.getBoxes();
2733
- let actorKeys = diagObj.db.getActorKeys();
2734
- const messages = diagObj.db.getMessages();
2735
- const title = diagObj.db.getDiagramTitle();
2736
- const hasBoxes = diagObj.db.hasAtLeastOneBox();
2737
- const hasBoxTitles = diagObj.db.hasAtLeastOneBoxWithTitle();
2738
- const maxMessageWidthPerActor = await getMaxMessageWidthPerActor(actors, messages, diagObj);
2739
- conf.height = await calculateActorMargins(actors, maxMessageWidthPerActor, boxes);
2740
- svgDraw_default.insertComputerIcon(diagram2);
2741
- svgDraw_default.insertDatabaseIcon(diagram2);
2742
- svgDraw_default.insertClockIcon(diagram2);
2743
- if (hasBoxes) {
2744
- bounds.bumpVerticalPos(conf.boxMargin);
2745
- if (hasBoxTitles) {
2746
- bounds.bumpVerticalPos(boxes[0].textMaxHeight);
2747
- }
2748
- }
2749
- if (conf.hideUnusedParticipants === true) {
2750
- const newActors = /* @__PURE__ */ new Set();
2751
- messages.forEach((message) => {
2752
- newActors.add(message.from);
2753
- newActors.add(message.to);
2754
- });
2755
- actorKeys = actorKeys.filter((actorKey) => newActors.has(actorKey));
2756
- }
2757
- addActorRenderingData(diagram2, actors, createdActors, actorKeys, 0, messages, false);
2758
- const loopWidths = await calculateLoopBounds(messages, actors, maxMessageWidthPerActor, diagObj);
2759
- svgDraw_default.insertArrowHead(diagram2);
2760
- svgDraw_default.insertArrowCrossHead(diagram2);
2761
- svgDraw_default.insertArrowFilledHead(diagram2);
2762
- svgDraw_default.insertSequenceNumber(diagram2);
2763
- function activeEnd(msg, verticalPos) {
2764
- const activationData = bounds.endActivation(msg);
2765
- if (activationData.starty + 18 > verticalPos) {
2766
- activationData.starty = verticalPos - 6;
2767
- verticalPos += 12;
2768
- }
2769
- svgDraw_default.drawActivation(
2770
- diagram2,
2771
- activationData,
2772
- verticalPos,
2773
- conf,
2774
- actorActivations(msg.from).length
2775
- );
2776
- bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
2777
- }
2778
- __name(activeEnd, "activeEnd");
2779
- let sequenceIndex = 1;
2780
- let sequenceIndexStep = 1;
2781
- const messagesToDraw = [];
2782
- const backgrounds = [];
2783
- let index = 0;
2784
- for (const msg of messages) {
2785
- let loopModel, noteModel, msgModel;
2786
- switch (msg.type) {
2787
- case diagObj.db.LINETYPE.NOTE:
2788
- bounds.resetVerticalPos();
2789
- noteModel = msg.noteModel;
2790
- await drawNote(diagram2, noteModel);
2791
- break;
2792
- case diagObj.db.LINETYPE.ACTIVE_START:
2793
- bounds.newActivation(msg, diagram2, actors);
2794
- break;
2795
- case diagObj.db.LINETYPE.ACTIVE_END:
2796
- activeEnd(msg, bounds.getVerticalPos());
2797
- break;
2798
- case diagObj.db.LINETYPE.LOOP_START:
2799
- adjustLoopHeightForWrap(
2800
- loopWidths,
2801
- msg,
2802
- conf.boxMargin,
2803
- conf.boxMargin + conf.boxTextMargin,
2804
- (message) => bounds.newLoop(message)
2805
- );
2806
- break;
2807
- case diagObj.db.LINETYPE.LOOP_END:
2808
- loopModel = bounds.endLoop();
2809
- await svgDraw_default.drawLoop(diagram2, loopModel, "loop", conf);
2810
- bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
2811
- bounds.models.addLoop(loopModel);
2812
- break;
2813
- case diagObj.db.LINETYPE.RECT_START:
2814
- adjustLoopHeightForWrap(
2815
- loopWidths,
2816
- msg,
2817
- conf.boxMargin,
2818
- conf.boxMargin,
2819
- (message) => bounds.newLoop(void 0, message.message)
2820
- );
2821
- break;
2822
- case diagObj.db.LINETYPE.RECT_END:
2823
- loopModel = bounds.endLoop();
2824
- backgrounds.push(loopModel);
2825
- bounds.models.addLoop(loopModel);
2826
- bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
2827
- break;
2828
- case diagObj.db.LINETYPE.OPT_START:
2829
- adjustLoopHeightForWrap(
2830
- loopWidths,
2831
- msg,
2832
- conf.boxMargin,
2833
- conf.boxMargin + conf.boxTextMargin,
2834
- (message) => bounds.newLoop(message)
2835
- );
2836
- break;
2837
- case diagObj.db.LINETYPE.OPT_END:
2838
- loopModel = bounds.endLoop();
2839
- await svgDraw_default.drawLoop(diagram2, loopModel, "opt", conf);
2840
- bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
2841
- bounds.models.addLoop(loopModel);
2842
- break;
2843
- case diagObj.db.LINETYPE.ALT_START:
2844
- adjustLoopHeightForWrap(
2845
- loopWidths,
2846
- msg,
2847
- conf.boxMargin,
2848
- conf.boxMargin + conf.boxTextMargin,
2849
- (message) => bounds.newLoop(message)
2850
- );
2851
- break;
2852
- case diagObj.db.LINETYPE.ALT_ELSE:
2853
- adjustLoopHeightForWrap(
2854
- loopWidths,
2855
- msg,
2856
- conf.boxMargin + conf.boxTextMargin,
2857
- conf.boxMargin,
2858
- (message) => bounds.addSectionToLoop(message)
2859
- );
2860
- break;
2861
- case diagObj.db.LINETYPE.ALT_END:
2862
- loopModel = bounds.endLoop();
2863
- await svgDraw_default.drawLoop(diagram2, loopModel, "alt", conf);
2864
- bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
2865
- bounds.models.addLoop(loopModel);
2866
- break;
2867
- case diagObj.db.LINETYPE.PAR_START:
2868
- case diagObj.db.LINETYPE.PAR_OVER_START:
2869
- adjustLoopHeightForWrap(
2870
- loopWidths,
2871
- msg,
2872
- conf.boxMargin,
2873
- conf.boxMargin + conf.boxTextMargin,
2874
- (message) => bounds.newLoop(message)
2875
- );
2876
- bounds.saveVerticalPos();
2877
- break;
2878
- case diagObj.db.LINETYPE.PAR_AND:
2879
- adjustLoopHeightForWrap(
2880
- loopWidths,
2881
- msg,
2882
- conf.boxMargin + conf.boxTextMargin,
2883
- conf.boxMargin,
2884
- (message) => bounds.addSectionToLoop(message)
2885
- );
2886
- break;
2887
- case diagObj.db.LINETYPE.PAR_END:
2888
- loopModel = bounds.endLoop();
2889
- await svgDraw_default.drawLoop(diagram2, loopModel, "par", conf);
2890
- bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
2891
- bounds.models.addLoop(loopModel);
2892
- break;
2893
- case diagObj.db.LINETYPE.AUTONUMBER:
2894
- sequenceIndex = msg.message.start || sequenceIndex;
2895
- sequenceIndexStep = msg.message.step || sequenceIndexStep;
2896
- if (msg.message.visible) {
2897
- diagObj.db.enableSequenceNumbers();
2898
- } else {
2899
- diagObj.db.disableSequenceNumbers();
2900
- }
2901
- break;
2902
- case diagObj.db.LINETYPE.CRITICAL_START:
2903
- adjustLoopHeightForWrap(
2904
- loopWidths,
2905
- msg,
2906
- conf.boxMargin,
2907
- conf.boxMargin + conf.boxTextMargin,
2908
- (message) => bounds.newLoop(message)
2909
- );
2910
- break;
2911
- case diagObj.db.LINETYPE.CRITICAL_OPTION:
2912
- adjustLoopHeightForWrap(
2913
- loopWidths,
2914
- msg,
2915
- conf.boxMargin + conf.boxTextMargin,
2916
- conf.boxMargin,
2917
- (message) => bounds.addSectionToLoop(message)
2918
- );
2919
- break;
2920
- case diagObj.db.LINETYPE.CRITICAL_END:
2921
- loopModel = bounds.endLoop();
2922
- await svgDraw_default.drawLoop(diagram2, loopModel, "critical", conf);
2923
- bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
2924
- bounds.models.addLoop(loopModel);
2925
- break;
2926
- case diagObj.db.LINETYPE.BREAK_START:
2927
- adjustLoopHeightForWrap(
2928
- loopWidths,
2929
- msg,
2930
- conf.boxMargin,
2931
- conf.boxMargin + conf.boxTextMargin,
2932
- (message) => bounds.newLoop(message)
2933
- );
2934
- break;
2935
- case diagObj.db.LINETYPE.BREAK_END:
2936
- loopModel = bounds.endLoop();
2937
- await svgDraw_default.drawLoop(diagram2, loopModel, "break", conf);
2938
- bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());
2939
- bounds.models.addLoop(loopModel);
2940
- break;
2941
- default:
2942
- try {
2943
- msgModel = msg.msgModel;
2944
- msgModel.starty = bounds.getVerticalPos();
2945
- msgModel.sequenceIndex = sequenceIndex;
2946
- msgModel.sequenceVisible = diagObj.db.showSequenceNumbers();
2947
- const lineStartY = await boundMessage(diagram2, msgModel);
2948
- adjustCreatedDestroyedData(
2949
- msg,
2950
- msgModel,
2951
- lineStartY,
2952
- index,
2953
- actors,
2954
- createdActors,
2955
- destroyedActors
2956
- );
2957
- messagesToDraw.push({ messageModel: msgModel, lineStartY });
2958
- bounds.models.addMessage(msgModel);
2959
- } catch (e) {
2960
- log.error("error while drawing message", e);
2961
- }
2962
- }
2963
- if ([
2964
- diagObj.db.LINETYPE.SOLID_OPEN,
2965
- diagObj.db.LINETYPE.DOTTED_OPEN,
2966
- diagObj.db.LINETYPE.SOLID,
2967
- diagObj.db.LINETYPE.DOTTED,
2968
- diagObj.db.LINETYPE.SOLID_CROSS,
2969
- diagObj.db.LINETYPE.DOTTED_CROSS,
2970
- diagObj.db.LINETYPE.SOLID_POINT,
2971
- diagObj.db.LINETYPE.DOTTED_POINT,
2972
- diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID,
2973
- diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED
2974
- ].includes(msg.type)) {
2975
- sequenceIndex = sequenceIndex + sequenceIndexStep;
2976
- }
2977
- index++;
2978
- }
2979
- log.debug("createdActors", createdActors);
2980
- log.debug("destroyedActors", destroyedActors);
2981
- await drawActors(diagram2, actors, actorKeys, false);
2982
- for (const e of messagesToDraw) {
2983
- await drawMessage(diagram2, e.messageModel, e.lineStartY, diagObj);
2984
- }
2985
- if (conf.mirrorActors) {
2986
- await drawActors(diagram2, actors, actorKeys, true);
2987
- }
2988
- backgrounds.forEach((e) => svgDraw_default.drawBackgroundRect(diagram2, e));
2989
- fixLifeLineHeights(diagram2, actors, actorKeys, conf);
2990
- for (const box2 of bounds.models.boxes) {
2991
- box2.height = bounds.getVerticalPos() - box2.y;
2992
- bounds.insert(box2.x, box2.y, box2.x + box2.width, box2.height);
2993
- box2.startx = box2.x;
2994
- box2.starty = box2.y;
2995
- box2.stopx = box2.startx + box2.width;
2996
- box2.stopy = box2.starty + box2.height;
2997
- box2.stroke = "rgb(0,0,0, 0.5)";
2998
- svgDraw_default.drawBox(diagram2, box2, conf);
2999
- }
3000
- if (hasBoxes) {
3001
- bounds.bumpVerticalPos(conf.boxMargin);
3002
- }
3003
- const requiredBoxSize = drawActorsPopup(diagram2, actors, actorKeys, doc);
3004
- const { bounds: box } = bounds.getBounds();
3005
- if (box.startx === void 0) {
3006
- box.startx = 0;
3007
- }
3008
- if (box.starty === void 0) {
3009
- box.starty = 0;
3010
- }
3011
- if (box.stopx === void 0) {
3012
- box.stopx = 0;
3013
- }
3014
- if (box.stopy === void 0) {
3015
- box.stopy = 0;
3016
- }
3017
- let boxHeight = box.stopy - box.starty;
3018
- if (boxHeight < requiredBoxSize.maxHeight) {
3019
- boxHeight = requiredBoxSize.maxHeight;
3020
- }
3021
- let height = boxHeight + 2 * conf.diagramMarginY;
3022
- if (conf.mirrorActors) {
3023
- height = height - conf.boxMargin + conf.bottomMarginAdj;
3024
- }
3025
- let boxWidth = box.stopx - box.startx;
3026
- if (boxWidth < requiredBoxSize.maxWidth) {
3027
- boxWidth = requiredBoxSize.maxWidth;
3028
- }
3029
- const width = boxWidth + 2 * conf.diagramMarginX;
3030
- if (title) {
3031
- diagram2.append("text").text(title).attr("x", (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX).attr("y", -25);
3032
- }
3033
- configureSvgSize(diagram2, height, width, conf.useMaxWidth);
3034
- const extraVertForTitle = title ? 40 : 0;
3035
- diagram2.attr(
3036
- "viewBox",
3037
- box.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + extraVertForTitle) + " " + width + " " + (height + extraVertForTitle)
3038
- );
3039
- log.debug(`models:`, bounds.models);
3040
- }, "draw");
3041
- async function getMaxMessageWidthPerActor(actors, messages, diagObj) {
3042
- const maxMessageWidthPerActor = {};
3043
- for (const msg of messages) {
3044
- if (actors.get(msg.to) && actors.get(msg.from)) {
3045
- const actor = actors.get(msg.to);
3046
- if (msg.placement === diagObj.db.PLACEMENT.LEFTOF && !actor.prevActor) {
3047
- continue;
3048
- }
3049
- if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF && !actor.nextActor) {
3050
- continue;
3051
- }
3052
- const isNote = msg.placement !== void 0;
3053
- const isMessage = !isNote;
3054
- const textFont = isNote ? noteFont(conf) : messageFont(conf);
3055
- const wrappedMessage = msg.wrap ? utils_default.wrapLabel(msg.message, conf.width - 2 * conf.wrapPadding, textFont) : msg.message;
3056
- const messageDimensions = hasKatex(wrappedMessage) ? await calculateMathMLDimensions(msg.message, getConfig2()) : utils_default.calculateTextDimensions(wrappedMessage, textFont);
3057
- const messageWidth = messageDimensions.width + 2 * conf.wrapPadding;
3058
- if (isMessage && msg.from === actor.nextActor) {
3059
- maxMessageWidthPerActor[msg.to] = common_default.getMax(
3060
- maxMessageWidthPerActor[msg.to] || 0,
3061
- messageWidth
3062
- );
3063
- } else if (isMessage && msg.from === actor.prevActor) {
3064
- maxMessageWidthPerActor[msg.from] = common_default.getMax(
3065
- maxMessageWidthPerActor[msg.from] || 0,
3066
- messageWidth
3067
- );
3068
- } else if (isMessage && msg.from === msg.to) {
3069
- maxMessageWidthPerActor[msg.from] = common_default.getMax(
3070
- maxMessageWidthPerActor[msg.from] || 0,
3071
- messageWidth / 2
3072
- );
3073
- maxMessageWidthPerActor[msg.to] = common_default.getMax(
3074
- maxMessageWidthPerActor[msg.to] || 0,
3075
- messageWidth / 2
3076
- );
3077
- } else if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) {
3078
- maxMessageWidthPerActor[msg.from] = common_default.getMax(
3079
- maxMessageWidthPerActor[msg.from] || 0,
3080
- messageWidth
3081
- );
3082
- } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) {
3083
- maxMessageWidthPerActor[actor.prevActor] = common_default.getMax(
3084
- maxMessageWidthPerActor[actor.prevActor] || 0,
3085
- messageWidth
3086
- );
3087
- } else if (msg.placement === diagObj.db.PLACEMENT.OVER) {
3088
- if (actor.prevActor) {
3089
- maxMessageWidthPerActor[actor.prevActor] = common_default.getMax(
3090
- maxMessageWidthPerActor[actor.prevActor] || 0,
3091
- messageWidth / 2
3092
- );
3093
- }
3094
- if (actor.nextActor) {
3095
- maxMessageWidthPerActor[msg.from] = common_default.getMax(
3096
- maxMessageWidthPerActor[msg.from] || 0,
3097
- messageWidth / 2
3098
- );
3099
- }
3100
- }
3101
- }
3102
- }
3103
- log.debug("maxMessageWidthPerActor:", maxMessageWidthPerActor);
3104
- return maxMessageWidthPerActor;
3105
- }
3106
- __name(getMaxMessageWidthPerActor, "getMaxMessageWidthPerActor");
3107
- var getRequiredPopupWidth = /* @__PURE__ */ __name(function(actor) {
3108
- let requiredPopupWidth = 0;
3109
- const textFont = actorFont(conf);
3110
- for (const key in actor.links) {
3111
- const labelDimensions = utils_default.calculateTextDimensions(key, textFont);
3112
- const labelWidth = labelDimensions.width + 2 * conf.wrapPadding + 2 * conf.boxMargin;
3113
- if (requiredPopupWidth < labelWidth) {
3114
- requiredPopupWidth = labelWidth;
3115
- }
3116
- }
3117
- return requiredPopupWidth;
3118
- }, "getRequiredPopupWidth");
3119
- async function calculateActorMargins(actors, actorToMessageWidth, boxes) {
3120
- let maxHeight = 0;
3121
- for (const prop of actors.keys()) {
3122
- const actor = actors.get(prop);
3123
- if (actor.wrap) {
3124
- actor.description = utils_default.wrapLabel(
3125
- actor.description,
3126
- conf.width - 2 * conf.wrapPadding,
3127
- actorFont(conf)
3128
- );
3129
- }
3130
- const actDims = hasKatex(actor.description) ? await calculateMathMLDimensions(actor.description, getConfig2()) : utils_default.calculateTextDimensions(actor.description, actorFont(conf));
3131
- actor.width = actor.wrap ? conf.width : common_default.getMax(conf.width, actDims.width + 2 * conf.wrapPadding);
3132
- actor.height = actor.wrap ? common_default.getMax(actDims.height, conf.height) : conf.height;
3133
- maxHeight = common_default.getMax(maxHeight, actor.height);
3134
- }
3135
- for (const actorKey in actorToMessageWidth) {
3136
- const actor = actors.get(actorKey);
3137
- if (!actor) {
3138
- continue;
3139
- }
3140
- const nextActor = actors.get(actor.nextActor);
3141
- if (!nextActor) {
3142
- const messageWidth2 = actorToMessageWidth[actorKey];
3143
- const actorWidth2 = messageWidth2 + conf.actorMargin - actor.width / 2;
3144
- actor.margin = common_default.getMax(actorWidth2, conf.actorMargin);
3145
- continue;
3146
- }
3147
- const messageWidth = actorToMessageWidth[actorKey];
3148
- const actorWidth = messageWidth + conf.actorMargin - actor.width / 2 - nextActor.width / 2;
3149
- actor.margin = common_default.getMax(actorWidth, conf.actorMargin);
3150
- }
3151
- let maxBoxHeight = 0;
3152
- boxes.forEach((box) => {
3153
- const textFont = messageFont(conf);
3154
- let totalWidth = box.actorKeys.reduce((total, aKey) => {
3155
- return total += actors.get(aKey).width + (actors.get(aKey).margin || 0);
3156
- }, 0);
3157
- totalWidth -= 2 * conf.boxTextMargin;
3158
- if (box.wrap) {
3159
- box.name = utils_default.wrapLabel(box.name, totalWidth - 2 * conf.wrapPadding, textFont);
3160
- }
3161
- const boxMsgDimensions = utils_default.calculateTextDimensions(box.name, textFont);
3162
- maxBoxHeight = common_default.getMax(boxMsgDimensions.height, maxBoxHeight);
3163
- const minWidth = common_default.getMax(totalWidth, boxMsgDimensions.width + 2 * conf.wrapPadding);
3164
- box.margin = conf.boxTextMargin;
3165
- if (totalWidth < minWidth) {
3166
- const missing = (minWidth - totalWidth) / 2;
3167
- box.margin += missing;
3168
- }
3169
- });
3170
- boxes.forEach((box) => box.textMaxHeight = maxBoxHeight);
3171
- return common_default.getMax(maxHeight, conf.height);
3172
- }
3173
- __name(calculateActorMargins, "calculateActorMargins");
3174
- var buildNoteModel = /* @__PURE__ */ __name(async function(msg, actors, diagObj) {
3175
- const fromActor = actors.get(msg.from);
3176
- const toActor = actors.get(msg.to);
3177
- const startx = fromActor.x;
3178
- const stopx = toActor.x;
3179
- const shouldWrap = msg.wrap && msg.message;
3180
- let textDimensions = hasKatex(msg.message) ? await calculateMathMLDimensions(msg.message, getConfig2()) : utils_default.calculateTextDimensions(
3181
- shouldWrap ? utils_default.wrapLabel(msg.message, conf.width, noteFont(conf)) : msg.message,
3182
- noteFont(conf)
3183
- );
3184
- const noteModel = {
3185
- width: shouldWrap ? conf.width : common_default.getMax(conf.width, textDimensions.width + 2 * conf.noteMargin),
3186
- height: 0,
3187
- startx: fromActor.x,
3188
- stopx: 0,
3189
- starty: 0,
3190
- stopy: 0,
3191
- message: msg.message
3192
- };
3193
- if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) {
3194
- noteModel.width = shouldWrap ? common_default.getMax(conf.width, textDimensions.width) : common_default.getMax(
3195
- fromActor.width / 2 + toActor.width / 2,
3196
- textDimensions.width + 2 * conf.noteMargin
3197
- );
3198
- noteModel.startx = startx + (fromActor.width + conf.actorMargin) / 2;
3199
- } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) {
3200
- noteModel.width = shouldWrap ? common_default.getMax(conf.width, textDimensions.width + 2 * conf.noteMargin) : common_default.getMax(
3201
- fromActor.width / 2 + toActor.width / 2,
3202
- textDimensions.width + 2 * conf.noteMargin
3203
- );
3204
- noteModel.startx = startx - noteModel.width + (fromActor.width - conf.actorMargin) / 2;
3205
- } else if (msg.to === msg.from) {
3206
- textDimensions = utils_default.calculateTextDimensions(
3207
- shouldWrap ? utils_default.wrapLabel(msg.message, common_default.getMax(conf.width, fromActor.width), noteFont(conf)) : msg.message,
3208
- noteFont(conf)
3209
- );
3210
- noteModel.width = shouldWrap ? common_default.getMax(conf.width, fromActor.width) : common_default.getMax(fromActor.width, conf.width, textDimensions.width + 2 * conf.noteMargin);
3211
- noteModel.startx = startx + (fromActor.width - noteModel.width) / 2;
3212
- } else {
3213
- noteModel.width = Math.abs(startx + fromActor.width / 2 - (stopx + toActor.width / 2)) + conf.actorMargin;
3214
- noteModel.startx = startx < stopx ? startx + fromActor.width / 2 - conf.actorMargin / 2 : stopx + toActor.width / 2 - conf.actorMargin / 2;
3215
- }
3216
- if (shouldWrap) {
3217
- noteModel.message = utils_default.wrapLabel(
3218
- msg.message,
3219
- noteModel.width - 2 * conf.wrapPadding,
3220
- noteFont(conf)
3221
- );
3222
- }
3223
- log.debug(
3224
- `NM:[${noteModel.startx},${noteModel.stopx},${noteModel.starty},${noteModel.stopy}:${noteModel.width},${noteModel.height}=${msg.message}]`
3225
- );
3226
- return noteModel;
3227
- }, "buildNoteModel");
3228
- var buildMessageModel = /* @__PURE__ */ __name(function(msg, actors, diagObj) {
3229
- if (![
3230
- diagObj.db.LINETYPE.SOLID_OPEN,
3231
- diagObj.db.LINETYPE.DOTTED_OPEN,
3232
- diagObj.db.LINETYPE.SOLID,
3233
- diagObj.db.LINETYPE.DOTTED,
3234
- diagObj.db.LINETYPE.SOLID_CROSS,
3235
- diagObj.db.LINETYPE.DOTTED_CROSS,
3236
- diagObj.db.LINETYPE.SOLID_POINT,
3237
- diagObj.db.LINETYPE.DOTTED_POINT,
3238
- diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID,
3239
- diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED
3240
- ].includes(msg.type)) {
3241
- return {};
3242
- }
3243
- const [fromLeft, fromRight] = activationBounds(msg.from, actors);
3244
- const [toLeft, toRight] = activationBounds(msg.to, actors);
3245
- const isArrowToRight = fromLeft <= toLeft;
3246
- let startx = isArrowToRight ? fromRight : fromLeft;
3247
- let stopx = isArrowToRight ? toLeft : toRight;
3248
- const isArrowToActivation = Math.abs(toLeft - toRight) > 2;
3249
- const adjustValue = /* @__PURE__ */ __name((value) => {
3250
- return isArrowToRight ? -value : value;
3251
- }, "adjustValue");
3252
- if (msg.from === msg.to) {
3253
- stopx = startx;
3254
- } else {
3255
- if (msg.activate && !isArrowToActivation) {
3256
- stopx += adjustValue(conf.activationWidth / 2 - 1);
3257
- }
3258
- if (![diagObj.db.LINETYPE.SOLID_OPEN, diagObj.db.LINETYPE.DOTTED_OPEN].includes(msg.type)) {
3259
- stopx += adjustValue(3);
3260
- }
3261
- if ([diagObj.db.LINETYPE.BIDIRECTIONAL_SOLID, diagObj.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
3262
- msg.type
3263
- )) {
3264
- startx -= adjustValue(3);
3265
- }
3266
- }
3267
- const allBounds = [fromLeft, fromRight, toLeft, toRight];
3268
- const boundedWidth = Math.abs(startx - stopx);
3269
- if (msg.wrap && msg.message) {
3270
- msg.message = utils_default.wrapLabel(
3271
- msg.message,
3272
- common_default.getMax(boundedWidth + 2 * conf.wrapPadding, conf.width),
3273
- messageFont(conf)
3274
- );
3275
- }
3276
- const msgDims = utils_default.calculateTextDimensions(msg.message, messageFont(conf));
3277
- return {
3278
- width: common_default.getMax(
3279
- msg.wrap ? 0 : msgDims.width + 2 * conf.wrapPadding,
3280
- boundedWidth + 2 * conf.wrapPadding,
3281
- conf.width
3282
- ),
3283
- height: 0,
3284
- startx,
3285
- stopx,
3286
- starty: 0,
3287
- stopy: 0,
3288
- message: msg.message,
3289
- type: msg.type,
3290
- wrap: msg.wrap,
3291
- fromBounds: Math.min.apply(null, allBounds),
3292
- toBounds: Math.max.apply(null, allBounds)
3293
- };
3294
- }, "buildMessageModel");
3295
- var calculateLoopBounds = /* @__PURE__ */ __name(async function(messages, actors, _maxWidthPerActor, diagObj) {
3296
- const loops = {};
3297
- const stack = [];
3298
- let current, noteModel, msgModel;
3299
- for (const msg of messages) {
3300
- switch (msg.type) {
3301
- case diagObj.db.LINETYPE.LOOP_START:
3302
- case diagObj.db.LINETYPE.ALT_START:
3303
- case diagObj.db.LINETYPE.OPT_START:
3304
- case diagObj.db.LINETYPE.PAR_START:
3305
- case diagObj.db.LINETYPE.PAR_OVER_START:
3306
- case diagObj.db.LINETYPE.CRITICAL_START:
3307
- case diagObj.db.LINETYPE.BREAK_START:
3308
- stack.push({
3309
- id: msg.id,
3310
- msg: msg.message,
3311
- from: Number.MAX_SAFE_INTEGER,
3312
- to: Number.MIN_SAFE_INTEGER,
3313
- width: 0
3314
- });
3315
- break;
3316
- case diagObj.db.LINETYPE.ALT_ELSE:
3317
- case diagObj.db.LINETYPE.PAR_AND:
3318
- case diagObj.db.LINETYPE.CRITICAL_OPTION:
3319
- if (msg.message) {
3320
- current = stack.pop();
3321
- loops[current.id] = current;
3322
- loops[msg.id] = current;
3323
- stack.push(current);
3324
- }
3325
- break;
3326
- case diagObj.db.LINETYPE.LOOP_END:
3327
- case diagObj.db.LINETYPE.ALT_END:
3328
- case diagObj.db.LINETYPE.OPT_END:
3329
- case diagObj.db.LINETYPE.PAR_END:
3330
- case diagObj.db.LINETYPE.CRITICAL_END:
3331
- case diagObj.db.LINETYPE.BREAK_END:
3332
- current = stack.pop();
3333
- loops[current.id] = current;
3334
- break;
3335
- case diagObj.db.LINETYPE.ACTIVE_START:
3336
- {
3337
- const actorRect = actors.get(msg.from ? msg.from : msg.to.actor);
3338
- const stackedSize = actorActivations(msg.from ? msg.from : msg.to.actor).length;
3339
- const x = actorRect.x + actorRect.width / 2 + (stackedSize - 1) * conf.activationWidth / 2;
3340
- const toAdd = {
3341
- startx: x,
3342
- stopx: x + conf.activationWidth,
3343
- actor: msg.from,
3344
- enabled: true
3345
- };
3346
- bounds.activations.push(toAdd);
3347
- }
3348
- break;
3349
- case diagObj.db.LINETYPE.ACTIVE_END:
3350
- {
3351
- const lastActorActivationIdx = bounds.activations.map((a) => a.actor).lastIndexOf(msg.from);
3352
- bounds.activations.splice(lastActorActivationIdx, 1).splice(0, 1);
3353
- }
3354
- break;
3355
- }
3356
- const isNote = msg.placement !== void 0;
3357
- if (isNote) {
3358
- noteModel = await buildNoteModel(msg, actors, diagObj);
3359
- msg.noteModel = noteModel;
3360
- stack.forEach((stk) => {
3361
- current = stk;
3362
- current.from = common_default.getMin(current.from, noteModel.startx);
3363
- current.to = common_default.getMax(current.to, noteModel.startx + noteModel.width);
3364
- current.width = common_default.getMax(current.width, Math.abs(current.from - current.to)) - conf.labelBoxWidth;
3365
- });
3366
- } else {
3367
- msgModel = buildMessageModel(msg, actors, diagObj);
3368
- msg.msgModel = msgModel;
3369
- if (msgModel.startx && msgModel.stopx && stack.length > 0) {
3370
- stack.forEach((stk) => {
3371
- current = stk;
3372
- if (msgModel.startx === msgModel.stopx) {
3373
- const from = actors.get(msg.from);
3374
- const to = actors.get(msg.to);
3375
- current.from = common_default.getMin(
3376
- from.x - msgModel.width / 2,
3377
- from.x - from.width / 2,
3378
- current.from
3379
- );
3380
- current.to = common_default.getMax(
3381
- to.x + msgModel.width / 2,
3382
- to.x + from.width / 2,
3383
- current.to
3384
- );
3385
- current.width = common_default.getMax(current.width, Math.abs(current.to - current.from)) - conf.labelBoxWidth;
3386
- } else {
3387
- current.from = common_default.getMin(msgModel.startx, current.from);
3388
- current.to = common_default.getMax(msgModel.stopx, current.to);
3389
- current.width = common_default.getMax(current.width, msgModel.width) - conf.labelBoxWidth;
3390
- }
3391
- });
3392
- }
3393
- }
3394
- }
3395
- bounds.activations = [];
3396
- log.debug("Loop type widths:", loops);
3397
- return loops;
3398
- }, "calculateLoopBounds");
3399
- var sequenceRenderer_default = {
3400
- bounds,
3401
- drawActors,
3402
- drawActorsPopup,
3403
- setConf,
3404
- draw
3405
- };
3406
- var diagram = {
3407
- parser: sequenceDiagram_default,
3408
- get db() {
3409
- return new SequenceDB();
3410
- },
3411
- renderer: sequenceRenderer_default,
3412
- styles: styles_default,
3413
- init: /* @__PURE__ */ __name((cnf) => {
3414
- if (!cnf.sequence) {
3415
- cnf.sequence = {};
3416
- }
3417
- if (cnf.wrap) {
3418
- cnf.sequence.wrap = cnf.wrap;
3419
- setConfig2({ sequence: { wrap: cnf.wrap } });
3420
- }
3421
- }, "init")
3422
- };
3423
-
3424
- export { diagram };