@brainfish-ai/components 0.14.2 → 0.15.0-beta.1

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 (255) hide show
  1. package/dist/accordion.d.ts +12 -0
  2. package/dist/badge.d.ts +14 -0
  3. package/dist/button.d.ts +16 -0
  4. package/dist/calendar.d.ts +12 -0
  5. package/dist/card.d.ts +17 -0
  6. package/dist/chat-search.d.ts +424 -0
  7. package/dist/collapsible.d.ts +10 -0
  8. package/dist/{colors/index.d.ts → colors.d.ts} +133 -128
  9. package/dist/{components/combobox/combobox.d.ts → combobox.d.ts} +23 -18
  10. package/dist/command.d.ts +90 -0
  11. package/dist/data-table.d.ts +23 -0
  12. package/dist/{components/date-picker/date-picker.d.ts → date-picker.d.ts} +12 -9
  13. package/dist/dialog.d.ts +30 -0
  14. package/dist/div-button.d.ts +16 -0
  15. package/dist/dropdown-menu.d.ts +43 -0
  16. package/dist/esm/chunks/{ChatSearch.BVivOuWt.js → ChatSearch.nXLnU6TL.js} +7 -4
  17. package/dist/esm/chunks/ChatSearch.nXLnU6TL.js.map +1 -0
  18. package/dist/esm/chunks/{FormattedMessage.C7CKFL5X.js → FormattedMessage.aTY_CSO9.js} +3 -8
  19. package/dist/esm/chunks/{FormattedMessage.C7CKFL5X.js.map → FormattedMessage.aTY_CSO9.js.map} +1 -1
  20. package/dist/esm/chunks/_basePickBy-BRd8bulh.BihFF1eU.js +140 -0
  21. package/dist/esm/chunks/_basePickBy-BRd8bulh.BihFF1eU.js.map +1 -0
  22. package/dist/esm/chunks/_baseUniq-CjJl2kgN.C3Wg6Gzv.js +585 -0
  23. package/dist/esm/chunks/_baseUniq-CjJl2kgN.C3Wg6Gzv.js.map +1 -0
  24. package/dist/esm/chunks/_commonjsHelpers.BFTU3MAI.js +8 -0
  25. package/dist/esm/chunks/_commonjsHelpers.BFTU3MAI.js.map +1 -0
  26. package/dist/esm/chunks/arc-BwUz6pB-.CLjvikE5.js +84 -0
  27. package/dist/esm/chunks/arc-BwUz6pB-.CLjvikE5.js.map +1 -0
  28. package/dist/esm/chunks/architectureDiagram-W76B3OCA-Cb5kazGQ.1bO-o28W.js +4662 -0
  29. package/dist/esm/chunks/architectureDiagram-W76B3OCA-Cb5kazGQ.1bO-o28W.js.map +1 -0
  30. package/dist/esm/chunks/blockDiagram-QIGZ2CNN-DDf1fn8j.CbGMaSk6.js +2262 -0
  31. package/dist/esm/chunks/blockDiagram-QIGZ2CNN-DDf1fn8j.CbGMaSk6.js.map +1 -0
  32. package/dist/esm/chunks/c4Diagram-FPNF74CW-Bums6QOx.Cr4gEhB6.js +1581 -0
  33. package/dist/esm/chunks/c4Diagram-FPNF74CW-Bums6QOx.Cr4gEhB6.js.map +1 -0
  34. package/dist/esm/chunks/channel-0GCo3iLB.B41ZW7VC.js +6 -0
  35. package/dist/esm/chunks/channel-0GCo3iLB.B41ZW7VC.js.map +1 -0
  36. package/dist/esm/chunks/chunk-4BX2VUAB-BNEZvE0o.BzF9LZVo.js +9 -0
  37. package/dist/esm/chunks/chunk-4BX2VUAB-BNEZvE0o.BzF9LZVo.js.map +1 -0
  38. package/dist/esm/chunks/chunk-55IACEB6-DKe9mqg4.BScGh1GA.js +9 -0
  39. package/dist/esm/chunks/chunk-55IACEB6-DKe9mqg4.BScGh1GA.js.map +1 -0
  40. package/dist/esm/chunks/chunk-FMBD7UC4-crQF-lvP.eIOmyWTR.js +20 -0
  41. package/dist/esm/chunks/chunk-FMBD7UC4-crQF-lvP.eIOmyWTR.js.map +1 -0
  42. package/dist/esm/chunks/chunk-K7UQS3LO-Cfwyr-vZ.BAoAWAQk.js +1373 -0
  43. package/dist/esm/chunks/chunk-K7UQS3LO-Cfwyr-vZ.BAoAWAQk.js.map +1 -0
  44. package/dist/esm/chunks/chunk-QN33PNHL-DspJEonH.BH03Z53b.js +20 -0
  45. package/dist/esm/chunks/chunk-QN33PNHL-DspJEonH.BH03Z53b.js.map +1 -0
  46. package/dist/esm/chunks/chunk-QZHKN3VN-BCAuXuhM.Yv71fggY.js +16 -0
  47. package/dist/esm/chunks/chunk-QZHKN3VN-BCAuXuhM.Yv71fggY.js.map +1 -0
  48. package/dist/esm/chunks/chunk-TVAH2DTR-UAGFGTWa.DtaXLvO3.js +1368 -0
  49. package/dist/esm/chunks/chunk-TVAH2DTR-UAGFGTWa.DtaXLvO3.js.map +1 -0
  50. package/dist/esm/chunks/chunk-TZMSLE5B-BuOZ_3Ji.DWg5e95b.js +59 -0
  51. package/dist/esm/chunks/chunk-TZMSLE5B-BuOZ_3Ji.DWg5e95b.js.map +1 -0
  52. package/dist/esm/chunks/classDiagram-KNZD7YFC-DX7nurcU.CyPH6UHq.js +17 -0
  53. package/dist/esm/chunks/classDiagram-KNZD7YFC-DX7nurcU.CyPH6UHq.js.map +1 -0
  54. package/dist/esm/chunks/classDiagram-v2-RKCZMP56-DX7nurcU.CyPH6UHq.js +17 -0
  55. package/dist/esm/chunks/classDiagram-v2-RKCZMP56-DX7nurcU.CyPH6UHq.js.map +1 -0
  56. package/dist/esm/chunks/clone-Bqjztgu2.BFjA-F4h.js +9 -0
  57. package/dist/esm/chunks/clone-Bqjztgu2.BFjA-F4h.js.map +1 -0
  58. package/dist/esm/chunks/cose-bilkent-S5V4N54A-BQHziyWw.BZGNVFdw.js +2610 -0
  59. package/dist/esm/chunks/cose-bilkent-S5V4N54A-BQHziyWw.BZGNVFdw.js.map +1 -0
  60. package/dist/esm/chunks/cytoscape.esm-qgs_QMrm.Cg6eOcD7.js +18633 -0
  61. package/dist/esm/chunks/cytoscape.esm-qgs_QMrm.Cg6eOcD7.js.map +1 -0
  62. package/dist/esm/chunks/dagre-5GWH7T2D-lsJD5N-w.B1kdVc5w.js +445 -0
  63. package/dist/esm/chunks/dagre-5GWH7T2D-lsJD5N-w.B1kdVc5w.js.map +1 -0
  64. package/dist/esm/chunks/defaultLocale-D7EN2tov.B8F577Sx.js +168 -0
  65. package/dist/esm/chunks/defaultLocale-D7EN2tov.B8F577Sx.js.map +1 -0
  66. package/dist/esm/chunks/diagram-N5W7TBWH-BRbQQdVg.CLbXQp4w.js +533 -0
  67. package/dist/esm/chunks/diagram-N5W7TBWH-BRbQQdVg.CLbXQp4w.js.map +1 -0
  68. package/dist/esm/chunks/diagram-QEK2KX5R-8l9h9zsj.DLBRL8pH.js +218 -0
  69. package/dist/esm/chunks/diagram-QEK2KX5R-8l9h9zsj.DLBRL8pH.js.map +1 -0
  70. package/dist/esm/chunks/diagram-S2PKOQOG-Cqv8fzC4.BsV-iXxM.js +143 -0
  71. package/dist/esm/chunks/diagram-S2PKOQOG-Cqv8fzC4.BsV-iXxM.js.map +1 -0
  72. package/dist/esm/chunks/erDiagram-AWTI2OKA-CuacxCQc.BRxf9Bvb.js +842 -0
  73. package/dist/esm/chunks/erDiagram-AWTI2OKA-CuacxCQc.BRxf9Bvb.js.map +1 -0
  74. package/dist/esm/chunks/flowDiagram-PVAE7QVJ-CYALWpXg.DIYz6l2w.js +1621 -0
  75. package/dist/esm/chunks/flowDiagram-PVAE7QVJ-CYALWpXg.DIYz6l2w.js.map +1 -0
  76. package/dist/esm/chunks/ganttDiagram-OWAHRB6G-DasKdnJE.Dl2sI2Nk.js +2506 -0
  77. package/dist/esm/chunks/ganttDiagram-OWAHRB6G-DasKdnJE.Dl2sI2Nk.js.map +1 -0
  78. package/dist/esm/chunks/gitGraphDiagram-NY62KEGX-CBXt0yuv.mD35jpPG.js +700 -0
  79. package/dist/esm/chunks/gitGraphDiagram-NY62KEGX-CBXt0yuv.mD35jpPG.js.map +1 -0
  80. package/dist/esm/chunks/graph-DuS579Mj.CVtaKNIJ.js +248 -0
  81. package/dist/esm/chunks/graph-DuS579Mj.CVtaKNIJ.js.map +1 -0
  82. package/dist/esm/chunks/infoDiagram-STP46IZ2-D6dOD0xH.BLhsKnwz.js +25 -0
  83. package/dist/esm/chunks/infoDiagram-STP46IZ2-D6dOD0xH.BLhsKnwz.js.map +1 -0
  84. package/dist/esm/chunks/init-DjUOC4st.BOEiyheD.js +16 -0
  85. package/dist/esm/chunks/init-DjUOC4st.BOEiyheD.js.map +1 -0
  86. package/dist/esm/chunks/journeyDiagram-BIP6EPQ6-BVvhjpLT.Cy1B2LuZ.js +837 -0
  87. package/dist/esm/chunks/journeyDiagram-BIP6EPQ6-BVvhjpLT.Cy1B2LuZ.js.map +1 -0
  88. package/dist/esm/chunks/kanban-definition-6OIFK2YF-DXUNU6e4.YiYgNKI6.js +720 -0
  89. package/dist/esm/chunks/kanban-definition-6OIFK2YF-DXUNU6e4.YiYgNKI6.js.map +1 -0
  90. package/dist/esm/chunks/katex-CUSbq6rG.R-nwQ7Gi.js +11679 -0
  91. package/dist/esm/chunks/katex-CUSbq6rG.R-nwQ7Gi.js.map +1 -0
  92. package/dist/esm/chunks/layout-C51Wxzwk.D_mfdH7L.js +1322 -0
  93. package/dist/esm/chunks/layout-C51Wxzwk.D_mfdH7L.js.map +1 -0
  94. package/dist/esm/chunks/linear-CHlV0TT4.CvsRyKtq.js +256 -0
  95. package/dist/esm/chunks/linear-CHlV0TT4.CvsRyKtq.js.map +1 -0
  96. package/dist/esm/chunks/markdownTranslator-D7_8pMsF.-EYyJrCs.js +15985 -0
  97. package/dist/esm/chunks/markdownTranslator-D7_8pMsF.-EYyJrCs.js.map +1 -0
  98. package/dist/esm/chunks/mermaid.core-C5kBD6J-.BXPxVcVa.js +15491 -0
  99. package/dist/esm/chunks/mermaid.core-C5kBD6J-.BXPxVcVa.js.map +1 -0
  100. package/dist/esm/chunks/mindmap-definition-Q6HEUPPD-HFrYx80F.ysRA57eW.js +782 -0
  101. package/dist/esm/chunks/mindmap-definition-Q6HEUPPD-HFrYx80F.ysRA57eW.js.map +1 -0
  102. package/dist/esm/chunks/ordinal-DfAQgscy.J1PPD2vL.js +62 -0
  103. package/dist/esm/chunks/ordinal-DfAQgscy.J1PPD2vL.js.map +1 -0
  104. package/dist/esm/chunks/paragraph-node-C0kBl9gb.CIP8K4ND.js +61421 -0
  105. package/dist/esm/chunks/paragraph-node-C0kBl9gb.CIP8K4ND.js.map +1 -0
  106. package/dist/esm/chunks/pieDiagram-ADFJNKIX-CsslphWO.B4GbWuZv.js +162 -0
  107. package/dist/esm/chunks/pieDiagram-ADFJNKIX-CsslphWO.B4GbWuZv.js.map +1 -0
  108. package/dist/esm/chunks/quadrantDiagram-LMRXKWRM-5QFmGeOP.C_UxDQXe.js +1023 -0
  109. package/dist/esm/chunks/quadrantDiagram-LMRXKWRM-5QFmGeOP.C_UxDQXe.js.map +1 -0
  110. package/dist/esm/chunks/requirementDiagram-4UW4RH46-C22keu8n.C4-dnVVT.js +851 -0
  111. package/dist/esm/chunks/requirementDiagram-4UW4RH46-C22keu8n.C4-dnVVT.js.map +1 -0
  112. package/dist/esm/chunks/sankeyDiagram-GR3RE2ED-BpqD9_-e.ngMCnT6E.js +811 -0
  113. package/dist/esm/chunks/sankeyDiagram-GR3RE2ED-BpqD9_-e.ngMCnT6E.js.map +1 -0
  114. package/dist/esm/chunks/sequenceDiagram-C3RYC4MD-oePYpAJV.CBdzhzsP.js +2512 -0
  115. package/dist/esm/chunks/sequenceDiagram-C3RYC4MD-oePYpAJV.CBdzhzsP.js.map +1 -0
  116. package/dist/esm/chunks/simple-editor.BahVaPV_.js +17657 -0
  117. package/dist/esm/chunks/simple-editor.BahVaPV_.js.map +1 -0
  118. package/dist/esm/chunks/simple-viewer-BRtSPXgb.j1P0rnc3.js +5543 -0
  119. package/dist/esm/chunks/simple-viewer-BRtSPXgb.j1P0rnc3.js.map +1 -0
  120. package/dist/esm/chunks/stateDiagram-KXAO66HF-D4aLegBB.CQf3ipbf.js +264 -0
  121. package/dist/esm/chunks/stateDiagram-KXAO66HF-D4aLegBB.CQf3ipbf.js.map +1 -0
  122. package/dist/esm/chunks/stateDiagram-v2-UMBNRL4Z-EsHlUtVh.KT7g_d3p.js +17 -0
  123. package/dist/esm/chunks/stateDiagram-v2-UMBNRL4Z-EsHlUtVh.KT7g_d3p.js.map +1 -0
  124. package/dist/esm/chunks/timeline-definition-XQNQX7LJ-6YQdnQ9U.CyMubI5o.js +798 -0
  125. package/dist/esm/chunks/timeline-definition-XQNQX7LJ-6YQdnQ9U.CyMubI5o.js.map +1 -0
  126. package/dist/esm/chunks/treemap-75Q7IDZK-vsWUWgT4.STv98gDF.js +12982 -0
  127. package/dist/esm/chunks/treemap-75Q7IDZK-vsWUWgT4.STv98gDF.js.map +1 -0
  128. package/dist/esm/chunks/xychartDiagram-6GGTOJPD-M8ajOOsE.Ds3v-kkT.js +1341 -0
  129. package/dist/esm/chunks/xychartDiagram-6GGTOJPD-M8ajOOsE.Ds3v-kkT.js.map +1 -0
  130. package/dist/esm/components/chat-search.js +1 -1
  131. package/dist/esm/components/markdown-editor-viewer.js +2 -0
  132. package/dist/esm/components/markdown-editor-viewer.js.map +1 -0
  133. package/dist/esm/components/markdown.js +1 -1
  134. package/dist/esm/index.css +1 -1
  135. package/dist/esm/index.js +3 -2
  136. package/dist/esm/index.js.map +1 -1
  137. package/dist/{components/feedback/feedback.d.ts → feedback.d.ts} +21 -17
  138. package/dist/file-upload.d.ts +45 -0
  139. package/dist/{components/filter/types.d.ts → filter.d.ts} +82 -59
  140. package/dist/generating-star.d.ts +10 -0
  141. package/dist/icon.d.ts +26 -0
  142. package/dist/index.d.ts +1204 -28
  143. package/dist/input.d.ts +11 -0
  144. package/dist/label.d.ts +8 -0
  145. package/dist/markdown-editor-viewer.d.ts +113 -0
  146. package/dist/markdown.d.ts +55 -0
  147. package/dist/popover.d.ts +12 -0
  148. package/dist/progress.d.ts +8 -0
  149. package/dist/scroll-area.d.ts +8 -0
  150. package/dist/{components/select/simpleSelect.d.ts → select.d.ts} +20 -15
  151. package/dist/stats.html +1 -1
  152. package/dist/switch.d.ts +6 -0
  153. package/dist/table.d.ts +19 -0
  154. package/dist/textarea.d.ts +5 -0
  155. package/dist/tooltip.d.ts +18 -0
  156. package/dist/{components/two-level-combobox/two-level-combobox.d.ts → two-level-combobox.d.ts} +24 -15
  157. package/markdown-editor.plan.md +322 -0
  158. package/markdown-editor.spec.md +915 -0
  159. package/package.json +23 -4
  160. package/dist/colors/blue.d.ts +0 -13
  161. package/dist/colors/customColor.d.ts +0 -4
  162. package/dist/colors/dark.d.ts +0 -13
  163. package/dist/colors/green.d.ts +0 -13
  164. package/dist/colors/orange.d.ts +0 -13
  165. package/dist/colors/pink.d.ts +0 -13
  166. package/dist/colors/primary.d.ts +0 -20
  167. package/dist/colors/purple.d.ts +0 -13
  168. package/dist/colors/red.d.ts +0 -13
  169. package/dist/colors/yellow.d.ts +0 -13
  170. package/dist/components/chat-search/Answer.d.ts +0 -29
  171. package/dist/components/chat-search/AnswerActions.d.ts +0 -13
  172. package/dist/components/chat-search/AnswerBlock.d.ts +0 -8
  173. package/dist/components/chat-search/ChatSearch.d.ts +0 -11
  174. package/dist/components/chat-search/ChatSearchContext.d.ts +0 -36
  175. package/dist/components/chat-search/FollowUpQuestions.d.ts +0 -7
  176. package/dist/components/chat-search/FollowUpSearchBar.d.ts +0 -11
  177. package/dist/components/chat-search/Header.d.ts +0 -9
  178. package/dist/components/chat-search/LoadingConversation.d.ts +0 -2
  179. package/dist/components/chat-search/LoadingSkeleton.d.ts +0 -6
  180. package/dist/components/chat-search/NextBestActions.d.ts +0 -8
  181. package/dist/components/chat-search/PrimarySearch.d.ts +0 -35
  182. package/dist/components/chat-search/ScrollToBottomArrow.d.ts +0 -6
  183. package/dist/components/chat-search/Suggestions.d.ts +0 -9
  184. package/dist/components/chat-search/TimelineNavigation.d.ts +0 -9
  185. package/dist/components/chat-search/blocks/ActionButtons.d.ts +0 -5
  186. package/dist/components/chat-search/blocks/ActionInputForm.d.ts +0 -20
  187. package/dist/components/chat-search/blocks/MarkdownText.d.ts +0 -8
  188. package/dist/components/chat-search/blocks/utils.d.ts +0 -15
  189. package/dist/components/chat-search/helpers/excuteClientAction.d.ts +0 -9
  190. package/dist/components/chat-search/helpers/nextBestActions.d.ts +0 -7
  191. package/dist/components/chat-search/hooks/index.d.ts +0 -7
  192. package/dist/components/chat-search/hooks/useAccessibleColor.d.ts +0 -1
  193. package/dist/components/chat-search/hooks/useAnswerList.d.ts +0 -217
  194. package/dist/components/chat-search/hooks/useConversationId.d.ts +0 -5
  195. package/dist/components/chat-search/hooks/useConversationLoader.d.ts +0 -17
  196. package/dist/components/chat-search/hooks/useDarkMode.d.ts +0 -1
  197. package/dist/components/chat-search/hooks/useIsChatSearchDirty.d.ts +0 -1
  198. package/dist/components/chat-search/hooks/useScrollManager.d.ts +0 -6
  199. package/dist/components/chat-search/hooks/useSubscriptionManager.d.ts +0 -4
  200. package/dist/components/chat-search/hooks/useUrlManager.d.ts +0 -8
  201. package/dist/components/chat-search/index.d.ts +0 -5
  202. package/dist/components/chat-search/text-config.d.ts +0 -3
  203. package/dist/components/chat-search/theme.d.ts +0 -0
  204. package/dist/components/chat-search/types.d.ts +0 -260
  205. package/dist/components/combobox/index.d.ts +0 -1
  206. package/dist/components/data-table/data-table.d.ts +0 -17
  207. package/dist/components/data-table/index.d.ts +0 -2
  208. package/dist/components/date-picker/index.d.ts +0 -1
  209. package/dist/components/feedback/feedback-reason.d.ts +0 -10
  210. package/dist/components/feedback/index.d.ts +0 -1
  211. package/dist/components/file-upload/file-upload-status.d.ts +0 -17
  212. package/dist/components/file-upload/file-upload.d.ts +0 -4
  213. package/dist/components/file-upload/index.d.ts +0 -4
  214. package/dist/components/file-upload/types.d.ts +0 -18
  215. package/dist/components/file-upload/utils.d.ts +0 -1
  216. package/dist/components/filter/components/CustomValueInput.d.ts +0 -11
  217. package/dist/components/filter/components/MultiSelectDropdown.d.ts +0 -10
  218. package/dist/components/filter/components/SingleSelectDropdown.d.ts +0 -9
  219. package/dist/components/filter/filter.d.ts +0 -6
  220. package/dist/components/filter/filters.d.ts +0 -12
  221. package/dist/components/filter/hooks.d.ts +0 -9
  222. package/dist/components/filter/index.d.ts +0 -3
  223. package/dist/components/generating-star/generating-star.d.ts +0 -6
  224. package/dist/components/generating-star/index.d.ts +0 -2
  225. package/dist/components/markdown/CodeBlock.d.ts +0 -7
  226. package/dist/components/markdown/FormattedMessage.d.ts +0 -14
  227. package/dist/components/markdown/Frame.d.ts +0 -10
  228. package/dist/components/markdown/MemoizedReactMarkdown.d.ts +0 -6
  229. package/dist/components/markdown/MermaidDiagram.d.ts +0 -6
  230. package/dist/components/markdown/ZoomableImage.d.ts +0 -7
  231. package/dist/components/markdown/embeds/Loom.d.ts +0 -7
  232. package/dist/components/markdown/embeds/NativeVideo.d.ts +0 -6
  233. package/dist/components/markdown/embeds/Supademo.d.ts +0 -7
  234. package/dist/components/markdown/embeds/Typeform.d.ts +0 -7
  235. package/dist/components/markdown/embeds/VideoTimeline.d.ts +0 -9
  236. package/dist/components/markdown/embeds/Vimeo.d.ts +0 -7
  237. package/dist/components/markdown/embeds/Wistia.d.ts +0 -7
  238. package/dist/components/markdown/embeds/Youtube.d.ts +0 -7
  239. package/dist/components/markdown/embeds/index.d.ts +0 -9
  240. package/dist/components/markdown/index.d.ts +0 -6
  241. package/dist/components/markdown/utils/codeblock.d.ts +0 -6
  242. package/dist/components/markdown/utils/stripNewLines.d.ts +0 -1
  243. package/dist/components/markdown/utils/urls.d.ts +0 -6
  244. package/dist/components/select/index.d.ts +0 -1
  245. package/dist/components/two-level-combobox/index.d.ts +0 -1
  246. package/dist/env.d.ts +0 -5
  247. package/dist/esm/chunks/ChatSearch.BVivOuWt.js.map +0 -1
  248. package/dist/lib/addUtmParams.d.ts +0 -20
  249. package/dist/lib/api.d.ts +0 -96
  250. package/dist/lib/feature-flags.d.ts +0 -9
  251. package/dist/lib/features.d.ts +0 -3
  252. package/dist/lib/fetchClient.d.ts +0 -19
  253. package/dist/lib/getContentType.d.ts +0 -1
  254. package/dist/lib/hooks.d.ts +0 -15
  255. package/dist/lib/utils.d.ts +0 -8
@@ -0,0 +1,2512 @@
1
+ import { d, p as p$1, y, x, m, h } from './chunk-TZMSLE5B-BuOZ_3Ji.DWg5e95b.js';
2
+ import { _ as p, n as zL, c as ut$1, d as ht, l as F, j as cC, e as zh, f as vt$1, k as Kr, b as cy, s as uy, p as dy, a as hy, g as fy, q as py, t as rC, J as eC, y as ly, i as ee, u as oe$1, M as NL, L as jr, N as Da, Z as Pw, O as Nh, P as Co, E as Ft } from './mermaid.core-C5kBD6J-.BXPxVcVa.js';
3
+ import { e } from './chunk-QZHKN3VN-BCAuXuhM.Yv71fggY.js';
4
+
5
+ var Ut = function() {
6
+ var e = /* @__PURE__ */ p(function(pt, v, A, L) {
7
+ for (A = A || {}, L = pt.length; L--; A[pt[L]] = v) ;
8
+ return A;
9
+ }, "o"), t = [1, 2], n = [1, 3], s = [1, 4], r = [2, 4], i = [1, 9], c = [1, 11], h = [1, 13], o = [1, 14], a = [1, 16], p$1 = [1, 17], g = [1, 18], x = [1, 24], y = [1, 25], m = [1, 26], w = [1, 27], k = [1, 28], N = [1, 29], S = [1, 30], O = [1, 31], B = [1, 32], q = [1, 33], H = [1, 34], Z = [1, 35], at = [1, 36], U = [1, 37], G = [1, 38], F = [1, 39], D = [1, 41], $ = [1, 42], K = [1, 43], j = [1, 44], rt = [1, 45], R = [1, 46], E = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 55, 60, 61, 62, 63, 71], _ = [2, 71], X = [4, 5, 16, 50, 52, 53], tt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], M = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 55, 60, 61, 62, 63, 71], Vt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 55, 60, 61, 62, 63, 71], Zt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 55, 60, 61, 62, 63, 71], ot = [69, 70, 71], lt = [1, 127], Yt = {
10
+ trace: /* @__PURE__ */ p(function() {
11
+ }, "trace"),
12
+ yy: {},
13
+ symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, box_section: 10, box_line: 11, participant_statement: 12, create: 13, box: 14, restOfLine: 15, end: 16, signal: 17, autonumber: 18, NUM: 19, off: 20, activate: 21, actor: 22, deactivate: 23, note_statement: 24, links_statement: 25, link_statement: 26, properties_statement: 27, details_statement: 28, title: 29, legacy_title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, loop: 36, rect: 37, opt: 38, alt: 39, else_sections: 40, par: 41, par_sections: 42, par_over: 43, critical: 44, option_sections: 45, break: 46, option: 47, and: 48, else: 49, participant: 50, AS: 51, participant_actor: 52, destroy: 53, actor_with_config: 54, note: 55, placement: 56, text2: 57, over: 58, actor_pair: 59, links: 60, link: 61, properties: 62, details: 63, spaceList: 64, ",": 65, left_of: 66, right_of: 67, signaltype: 68, "+": 69, "-": 70, ACTOR: 71, config_object: 72, CONFIG_START: 73, CONFIG_CONTENT: 74, CONFIG_END: 75, SOLID_OPEN_ARROW: 76, DOTTED_OPEN_ARROW: 77, SOLID_ARROW: 78, BIDIRECTIONAL_SOLID_ARROW: 79, DOTTED_ARROW: 80, BIDIRECTIONAL_DOTTED_ARROW: 81, SOLID_CROSS: 82, DOTTED_CROSS: 83, SOLID_POINT: 84, DOTTED_POINT: 85, TXT: 86, $accept: 0, $end: 1 },
14
+ terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 55: "note", 58: "over", 60: "links", 61: "link", 62: "properties", 63: "details", 65: ",", 66: "left_of", 67: "right_of", 69: "+", 70: "-", 71: "ACTOR", 73: "CONFIG_START", 74: "CONFIG_CONTENT", 75: "CONFIG_END", 76: "SOLID_OPEN_ARROW", 77: "DOTTED_OPEN_ARROW", 78: "SOLID_ARROW", 79: "BIDIRECTIONAL_SOLID_ARROW", 80: "DOTTED_ARROW", 81: "BIDIRECTIONAL_DOTTED_ARROW", 82: "SOLID_CROSS", 83: "DOTTED_CROSS", 84: "SOLID_POINT", 85: "DOTTED_POINT", 86: "TXT" },
15
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [64, 2], [64, 1], [59, 3], [59, 1], [56, 1], [56, 1], [17, 5], [17, 5], [17, 4], [54, 2], [72, 3], [22, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [57, 1]],
16
+ performAction: /* @__PURE__ */ p(function(v, A, L, b, C, d, It) {
17
+ var u = d.length - 1;
18
+ switch (C) {
19
+ case 3:
20
+ return b.apply(d[u]), d[u];
21
+ case 4:
22
+ case 9:
23
+ this.$ = [];
24
+ break;
25
+ case 5:
26
+ case 10:
27
+ d[u - 1].push(d[u]), this.$ = d[u - 1];
28
+ break;
29
+ case 6:
30
+ case 7:
31
+ case 11:
32
+ case 12:
33
+ this.$ = d[u];
34
+ break;
35
+ case 8:
36
+ case 13:
37
+ this.$ = [];
38
+ break;
39
+ case 15:
40
+ d[u].type = "createParticipant", this.$ = d[u];
41
+ break;
42
+ case 16:
43
+ d[u - 1].unshift({ type: "boxStart", boxData: b.parseBoxData(d[u - 2]) }), d[u - 1].push({ type: "boxEnd", boxText: d[u - 2] }), this.$ = d[u - 1];
44
+ break;
45
+ case 18:
46
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[u - 2]), sequenceIndexStep: Number(d[u - 1]), sequenceVisible: true, signalType: b.LINETYPE.AUTONUMBER };
47
+ break;
48
+ case 19:
49
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[u - 1]), sequenceIndexStep: 1, sequenceVisible: true, signalType: b.LINETYPE.AUTONUMBER };
50
+ break;
51
+ case 20:
52
+ this.$ = { type: "sequenceIndex", sequenceVisible: false, signalType: b.LINETYPE.AUTONUMBER };
53
+ break;
54
+ case 21:
55
+ this.$ = { type: "sequenceIndex", sequenceVisible: true, signalType: b.LINETYPE.AUTONUMBER };
56
+ break;
57
+ case 22:
58
+ this.$ = { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: d[u - 1].actor };
59
+ break;
60
+ case 23:
61
+ this.$ = { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: d[u - 1].actor };
62
+ break;
63
+ case 29:
64
+ b.setDiagramTitle(d[u].substring(6)), this.$ = d[u].substring(6);
65
+ break;
66
+ case 30:
67
+ b.setDiagramTitle(d[u].substring(7)), this.$ = d[u].substring(7);
68
+ break;
69
+ case 31:
70
+ this.$ = d[u].trim(), b.setAccTitle(this.$);
71
+ break;
72
+ case 32:
73
+ case 33:
74
+ this.$ = d[u].trim(), b.setAccDescription(this.$);
75
+ break;
76
+ case 34:
77
+ d[u - 1].unshift({ type: "loopStart", loopText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.LOOP_START }), d[u - 1].push({ type: "loopEnd", loopText: d[u - 2], signalType: b.LINETYPE.LOOP_END }), this.$ = d[u - 1];
78
+ break;
79
+ case 35:
80
+ d[u - 1].unshift({ type: "rectStart", color: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.RECT_START }), d[u - 1].push({ type: "rectEnd", color: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.RECT_END }), this.$ = d[u - 1];
81
+ break;
82
+ case 36:
83
+ d[u - 1].unshift({ type: "optStart", optText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.OPT_START }), d[u - 1].push({ type: "optEnd", optText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.OPT_END }), this.$ = d[u - 1];
84
+ break;
85
+ case 37:
86
+ d[u - 1].unshift({ type: "altStart", altText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.ALT_START }), d[u - 1].push({ type: "altEnd", signalType: b.LINETYPE.ALT_END }), this.$ = d[u - 1];
87
+ break;
88
+ case 38:
89
+ d[u - 1].unshift({ type: "parStart", parText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.PAR_START }), d[u - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = d[u - 1];
90
+ break;
91
+ case 39:
92
+ d[u - 1].unshift({ type: "parStart", parText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.PAR_OVER_START }), d[u - 1].push({ type: "parEnd", signalType: b.LINETYPE.PAR_END }), this.$ = d[u - 1];
93
+ break;
94
+ case 40:
95
+ d[u - 1].unshift({ type: "criticalStart", criticalText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.CRITICAL_START }), d[u - 1].push({ type: "criticalEnd", signalType: b.LINETYPE.CRITICAL_END }), this.$ = d[u - 1];
96
+ break;
97
+ case 41:
98
+ d[u - 1].unshift({ type: "breakStart", breakText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.BREAK_START }), d[u - 1].push({ type: "breakEnd", optText: b.parseMessage(d[u - 2]), signalType: b.LINETYPE.BREAK_END }), this.$ = d[u - 1];
99
+ break;
100
+ case 43:
101
+ this.$ = d[u - 3].concat([{ type: "option", optionText: b.parseMessage(d[u - 1]), signalType: b.LINETYPE.CRITICAL_OPTION }, d[u]]);
102
+ break;
103
+ case 45:
104
+ this.$ = d[u - 3].concat([{ type: "and", parText: b.parseMessage(d[u - 1]), signalType: b.LINETYPE.PAR_AND }, d[u]]);
105
+ break;
106
+ case 47:
107
+ this.$ = d[u - 3].concat([{ type: "else", altText: b.parseMessage(d[u - 1]), signalType: b.LINETYPE.ALT_ELSE }, d[u]]);
108
+ break;
109
+ case 48:
110
+ d[u - 3].draw = "participant", d[u - 3].type = "addParticipant", d[u - 3].description = b.parseMessage(d[u - 1]), this.$ = d[u - 3];
111
+ break;
112
+ case 49:
113
+ d[u - 1].draw = "participant", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
114
+ break;
115
+ case 50:
116
+ d[u - 3].draw = "actor", d[u - 3].type = "addParticipant", d[u - 3].description = b.parseMessage(d[u - 1]), this.$ = d[u - 3];
117
+ break;
118
+ case 51:
119
+ d[u - 1].draw = "actor", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
120
+ break;
121
+ case 52:
122
+ d[u - 1].type = "destroyParticipant", this.$ = d[u - 1];
123
+ break;
124
+ case 53:
125
+ d[u - 1].draw = "participant", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
126
+ break;
127
+ case 54:
128
+ this.$ = [d[u - 1], { type: "addNote", placement: d[u - 2], actor: d[u - 1].actor, text: d[u] }];
129
+ break;
130
+ case 55:
131
+ d[u - 2] = [].concat(d[u - 1], d[u - 1]).slice(0, 2), d[u - 2][0] = d[u - 2][0].actor, d[u - 2][1] = d[u - 2][1].actor, this.$ = [d[u - 1], { type: "addNote", placement: b.PLACEMENT.OVER, actor: d[u - 2].slice(0, 2), text: d[u] }];
132
+ break;
133
+ case 56:
134
+ this.$ = [d[u - 1], { type: "addLinks", actor: d[u - 1].actor, text: d[u] }];
135
+ break;
136
+ case 57:
137
+ this.$ = [d[u - 1], { type: "addALink", actor: d[u - 1].actor, text: d[u] }];
138
+ break;
139
+ case 58:
140
+ this.$ = [d[u - 1], { type: "addProperties", actor: d[u - 1].actor, text: d[u] }];
141
+ break;
142
+ case 59:
143
+ this.$ = [d[u - 1], { type: "addDetails", actor: d[u - 1].actor, text: d[u] }];
144
+ break;
145
+ case 62:
146
+ this.$ = [d[u - 2], d[u]];
147
+ break;
148
+ case 63:
149
+ this.$ = d[u];
150
+ break;
151
+ case 64:
152
+ this.$ = b.PLACEMENT.LEFTOF;
153
+ break;
154
+ case 65:
155
+ this.$ = b.PLACEMENT.RIGHTOF;
156
+ break;
157
+ case 66:
158
+ this.$ = [
159
+ d[u - 4],
160
+ d[u - 1],
161
+ { type: "addMessage", from: d[u - 4].actor, to: d[u - 1].actor, signalType: d[u - 3], msg: d[u], activate: true },
162
+ { type: "activeStart", signalType: b.LINETYPE.ACTIVE_START, actor: d[u - 1].actor }
163
+ ];
164
+ break;
165
+ case 67:
166
+ this.$ = [
167
+ d[u - 4],
168
+ d[u - 1],
169
+ { type: "addMessage", from: d[u - 4].actor, to: d[u - 1].actor, signalType: d[u - 3], msg: d[u] },
170
+ { type: "activeEnd", signalType: b.LINETYPE.ACTIVE_END, actor: d[u - 4].actor }
171
+ ];
172
+ break;
173
+ case 68:
174
+ this.$ = [d[u - 3], d[u - 1], { type: "addMessage", from: d[u - 3].actor, to: d[u - 1].actor, signalType: d[u - 2], msg: d[u] }];
175
+ break;
176
+ case 69:
177
+ this.$ = {
178
+ type: "addParticipant",
179
+ actor: d[u - 1],
180
+ config: d[u]
181
+ };
182
+ break;
183
+ case 70:
184
+ this.$ = d[u - 1].trim();
185
+ break;
186
+ case 71:
187
+ this.$ = { type: "addParticipant", actor: d[u] };
188
+ break;
189
+ case 72:
190
+ this.$ = b.LINETYPE.SOLID_OPEN;
191
+ break;
192
+ case 73:
193
+ this.$ = b.LINETYPE.DOTTED_OPEN;
194
+ break;
195
+ case 74:
196
+ this.$ = b.LINETYPE.SOLID;
197
+ break;
198
+ case 75:
199
+ this.$ = b.LINETYPE.BIDIRECTIONAL_SOLID;
200
+ break;
201
+ case 76:
202
+ this.$ = b.LINETYPE.DOTTED;
203
+ break;
204
+ case 77:
205
+ this.$ = b.LINETYPE.BIDIRECTIONAL_DOTTED;
206
+ break;
207
+ case 78:
208
+ this.$ = b.LINETYPE.SOLID_CROSS;
209
+ break;
210
+ case 79:
211
+ this.$ = b.LINETYPE.DOTTED_CROSS;
212
+ break;
213
+ case 80:
214
+ this.$ = b.LINETYPE.SOLID_POINT;
215
+ break;
216
+ case 81:
217
+ this.$ = b.LINETYPE.DOTTED_POINT;
218
+ break;
219
+ case 82:
220
+ this.$ = b.parseMessage(d[u].trim().substring(1));
221
+ break;
222
+ }
223
+ }, "anonymous"),
224
+ table: [{ 3: 1, 4: t, 5: n, 6: s }, { 1: [3] }, { 3: 5, 4: t, 5: n, 6: s }, { 3: 6, 4: t, 5: n, 6: s }, e([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], r, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 17: 15, 18: a, 21: p$1, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, e(E, [2, 5]), { 9: 47, 12: 12, 13: h, 14: o, 17: 15, 18: a, 21: p$1, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, e(E, [2, 7]), e(E, [2, 8]), e(E, [2, 14]), { 12: 48, 50: U, 52: G, 53: F }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 71: R }, { 22: 55, 71: R }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, e(E, [2, 29]), e(E, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, e(E, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 54: 72, 71: [1, 73] }, { 22: 74, 71: R }, { 22: 75, 71: R }, { 68: 76, 76: [1, 77], 77: [1, 78], 78: [1, 79], 79: [1, 80], 80: [1, 81], 81: [1, 82], 82: [1, 83], 83: [1, 84], 84: [1, 85], 85: [1, 86] }, { 56: 87, 58: [1, 88], 66: [1, 89], 67: [1, 90] }, { 22: 91, 71: R }, { 22: 92, 71: R }, { 22: 93, 71: R }, { 22: 94, 71: R }, e([5, 51, 65, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86], _), e(E, [2, 6]), e(E, [2, 15]), e(X, [2, 9], { 10: 95 }), e(E, [2, 17]), { 5: [1, 97], 19: [1, 96] }, { 5: [1, 98] }, e(E, [2, 21]), { 5: [1, 99] }, { 5: [1, 100] }, e(E, [2, 24]), e(E, [2, 25]), e(E, [2, 26]), e(E, [2, 27]), e(E, [2, 28]), e(E, [2, 31]), e(E, [2, 32]), e(tt, r, { 7: 101 }), e(tt, r, { 7: 102 }), e(tt, r, { 7: 103 }), e(M, r, { 40: 104, 7: 105 }), e(Vt, r, { 42: 106, 7: 107 }), e(Vt, r, { 7: 107, 42: 108 }), e(Zt, r, { 45: 109, 7: 110 }), e(tt, r, { 7: 111 }), { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, e([5, 51], _, { 72: 115, 73: [1, 116] }), { 5: [1, 118], 51: [1, 117] }, { 5: [1, 119] }, { 22: 122, 69: [1, 120], 70: [1, 121], 71: R }, e(ot, [2, 72]), e(ot, [2, 73]), e(ot, [2, 74]), e(ot, [2, 75]), e(ot, [2, 76]), e(ot, [2, 77]), e(ot, [2, 78]), e(ot, [2, 79]), e(ot, [2, 80]), e(ot, [2, 81]), { 22: 123, 71: R }, { 22: 125, 59: 124, 71: R }, { 71: [2, 64] }, { 71: [2, 65] }, { 57: 126, 86: lt }, { 57: 128, 86: lt }, { 57: 129, 86: lt }, { 57: 130, 86: lt }, { 4: [1, 133], 5: [1, 135], 11: 132, 12: 134, 16: [1, 131], 50: U, 52: G, 53: F }, { 5: [1, 136] }, e(E, [2, 19]), e(E, [2, 20]), e(E, [2, 22]), e(E, [2, 23]), { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 137], 17: 15, 18: a, 21: p$1, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 138], 17: 15, 18: a, 21: p$1, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 139], 17: 15, 18: a, 21: p$1, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 16: [1, 140] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 46], 17: 15, 18: a, 21: p$1, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 49: [1, 141], 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 16: [1, 142] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 44], 17: 15, 18: a, 21: p$1, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 48: [1, 143], 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 16: [1, 144] }, { 16: [1, 145] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 42], 17: 15, 18: a, 21: p$1, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 47: [1, 146], 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 147], 17: 15, 18: a, 21: p$1, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: y, 31: m, 33: w, 35: k, 36: N, 37: S, 38: O, 39: B, 41: q, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: F, 55: D, 60: $, 61: K, 62: j, 63: rt, 71: R }, { 15: [1, 148] }, e(E, [2, 49]), e(E, [2, 53]), { 5: [2, 69] }, { 74: [1, 149] }, { 15: [1, 150] }, e(E, [2, 51]), e(E, [2, 52]), { 22: 151, 71: R }, { 22: 152, 71: R }, { 57: 153, 86: lt }, { 57: 154, 86: lt }, { 57: 155, 86: lt }, { 65: [1, 156], 86: [2, 63] }, { 5: [2, 56] }, { 5: [2, 82] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: [2, 59] }, e(E, [2, 16]), e(X, [2, 10]), { 12: 157, 50: U, 52: G, 53: F }, e(X, [2, 12]), e(X, [2, 13]), e(E, [2, 18]), e(E, [2, 34]), e(E, [2, 35]), e(E, [2, 36]), e(E, [2, 37]), { 15: [1, 158] }, e(E, [2, 38]), { 15: [1, 159] }, e(E, [2, 39]), e(E, [2, 40]), { 15: [1, 160] }, e(E, [2, 41]), { 5: [1, 161] }, { 75: [1, 162] }, { 5: [1, 163] }, { 57: 164, 86: lt }, { 57: 165, 86: lt }, { 5: [2, 68] }, { 5: [2, 54] }, { 5: [2, 55] }, { 22: 166, 71: R }, e(X, [2, 11]), e(M, r, { 7: 105, 40: 167 }), e(Vt, r, { 7: 107, 42: 168 }), e(Zt, r, { 7: 110, 45: 169 }), e(E, [2, 48]), { 5: [2, 70] }, e(E, [2, 50]), { 5: [2, 66] }, { 5: [2, 67] }, { 86: [2, 62] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
225
+ defaultActions: { 5: [2, 1], 6: [2, 2], 89: [2, 64], 90: [2, 65], 115: [2, 69], 126: [2, 56], 127: [2, 82], 128: [2, 57], 129: [2, 58], 130: [2, 59], 153: [2, 68], 154: [2, 54], 155: [2, 55], 162: [2, 70], 164: [2, 66], 165: [2, 67], 166: [2, 62], 167: [2, 47], 168: [2, 45], 169: [2, 43] },
226
+ parseError: /* @__PURE__ */ p(function(v, A) {
227
+ if (A.recoverable)
228
+ this.trace(v);
229
+ else {
230
+ var L = new Error(v);
231
+ throw L.hash = A, L;
232
+ }
233
+ }, "parseError"),
234
+ parse: /* @__PURE__ */ p(function(v) {
235
+ var A = this, L = [0], b = [], C = [null], d = [], It = this.table, u = "", kt = 0, $t = 0, Te = 2, jt = 1, Ee = d.slice.call(arguments, 1), Y = Object.create(this.lexer), ft = { yy: {} };
236
+ for (var Wt in this.yy)
237
+ Object.prototype.hasOwnProperty.call(this.yy, Wt) && (ft.yy[Wt] = this.yy[Wt]);
238
+ Y.setInput(v, ft.yy), ft.yy.lexer = Y, ft.yy.parser = this, typeof Y.yylloc > "u" && (Y.yylloc = {});
239
+ var Ft = Y.yylloc;
240
+ d.push(Ft);
241
+ var be = Y.options && Y.options.ranges;
242
+ typeof ft.yy.parseError == "function" ? this.parseError = ft.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
243
+ function me(et) {
244
+ L.length = L.length - 2 * et, C.length = C.length - et, d.length = d.length - et;
245
+ }
246
+ p(me, "popStack");
247
+ function te() {
248
+ var et;
249
+ return et = b.pop() || Y.lex() || jt, typeof et != "number" && (et instanceof Array && (b = et, et = b.pop()), et = A.symbols_[et] || et), et;
250
+ }
251
+ p(te, "lex");
252
+ for (var J, yt, it, qt, bt = {}, Pt, ht, ee, Nt; ; ) {
253
+ if (yt = L[L.length - 1], this.defaultActions[yt] ? it = this.defaultActions[yt] : ((J === null || typeof J > "u") && (J = te()), it = It[yt] && It[yt][J]), typeof it > "u" || !it.length || !it[0]) {
254
+ var zt = "";
255
+ Nt = [];
256
+ for (Pt in It[yt])
257
+ this.terminals_[Pt] && Pt > Te && Nt.push("'" + this.terminals_[Pt] + "'");
258
+ Y.showPosition ? zt = "Parse error on line " + (kt + 1) + `:
259
+ ` + Y.showPosition() + `
260
+ Expecting ` + Nt.join(", ") + ", got '" + (this.terminals_[J] || J) + "'" : zt = "Parse error on line " + (kt + 1) + ": Unexpected " + (J == jt ? "end of input" : "'" + (this.terminals_[J] || J) + "'"), this.parseError(zt, {
261
+ text: Y.match,
262
+ token: this.terminals_[J] || J,
263
+ line: Y.yylineno,
264
+ loc: Ft,
265
+ expected: Nt
266
+ });
267
+ }
268
+ if (it[0] instanceof Array && it.length > 1)
269
+ throw new Error("Parse Error: multiple actions possible at state: " + yt + ", token: " + J);
270
+ switch (it[0]) {
271
+ case 1:
272
+ L.push(J), C.push(Y.yytext), d.push(Y.yylloc), L.push(it[1]), J = null, $t = Y.yyleng, u = Y.yytext, kt = Y.yylineno, Ft = Y.yylloc;
273
+ break;
274
+ case 2:
275
+ if (ht = this.productions_[it[1]][1], bt.$ = C[C.length - ht], bt._$ = {
276
+ first_line: d[d.length - (ht || 1)].first_line,
277
+ last_line: d[d.length - 1].last_line,
278
+ first_column: d[d.length - (ht || 1)].first_column,
279
+ last_column: d[d.length - 1].last_column
280
+ }, be && (bt._$.range = [
281
+ d[d.length - (ht || 1)].range[0],
282
+ d[d.length - 1].range[1]
283
+ ]), qt = this.performAction.apply(bt, [
284
+ u,
285
+ $t,
286
+ kt,
287
+ ft.yy,
288
+ it[1],
289
+ C,
290
+ d
291
+ ].concat(Ee)), typeof qt < "u")
292
+ return qt;
293
+ ht && (L = L.slice(0, -1 * ht * 2), C = C.slice(0, -1 * ht), d = d.slice(0, -1 * ht)), L.push(this.productions_[it[1]][0]), C.push(bt.$), d.push(bt._$), ee = It[L[L.length - 2]][L[L.length - 1]], L.push(ee);
294
+ break;
295
+ case 3:
296
+ return true;
297
+ }
298
+ }
299
+ return true;
300
+ }, "parse")
301
+ }, ye = /* @__PURE__ */ function() {
302
+ var pt = {
303
+ EOF: 1,
304
+ parseError: /* @__PURE__ */ p(function(A, L) {
305
+ if (this.yy.parser)
306
+ this.yy.parser.parseError(A, L);
307
+ else
308
+ throw new Error(A);
309
+ }, "parseError"),
310
+ // resets the lexer, sets new input
311
+ setInput: /* @__PURE__ */ p(function(v, A) {
312
+ return this.yy = A || this.yy || {}, this._input = v, this._more = this._backtrack = this.done = false, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
313
+ first_line: 1,
314
+ first_column: 0,
315
+ last_line: 1,
316
+ last_column: 0
317
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
318
+ }, "setInput"),
319
+ // consumes and returns one char from the input
320
+ input: /* @__PURE__ */ p(function() {
321
+ var v = this._input[0];
322
+ this.yytext += v, this.yyleng++, this.offset++, this.match += v, this.matched += v;
323
+ var A = v.match(/(?:\r\n?|\n).*/g);
324
+ return A ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), v;
325
+ }, "input"),
326
+ // unshifts one char (or a string) into the input
327
+ unput: /* @__PURE__ */ p(function(v) {
328
+ var A = v.length, L = v.split(/(?:\r\n?|\n)/g);
329
+ this._input = v + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - A), this.offset -= A;
330
+ var b = this.match.split(/(?:\r\n?|\n)/g);
331
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), L.length - 1 && (this.yylineno -= L.length - 1);
332
+ var C = this.yylloc.range;
333
+ return this.yylloc = {
334
+ first_line: this.yylloc.first_line,
335
+ last_line: this.yylineno + 1,
336
+ first_column: this.yylloc.first_column,
337
+ last_column: L ? (L.length === b.length ? this.yylloc.first_column : 0) + b[b.length - L.length].length - L[0].length : this.yylloc.first_column - A
338
+ }, this.options.ranges && (this.yylloc.range = [C[0], C[0] + this.yyleng - A]), this.yyleng = this.yytext.length, this;
339
+ }, "unput"),
340
+ // When called from action, caches matched text and appends it on next action
341
+ more: /* @__PURE__ */ p(function() {
342
+ return this._more = true, this;
343
+ }, "more"),
344
+ // 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.
345
+ reject: /* @__PURE__ */ p(function() {
346
+ if (this.options.backtrack_lexer)
347
+ this._backtrack = true;
348
+ else
349
+ 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).
350
+ ` + this.showPosition(), {
351
+ text: "",
352
+ token: null,
353
+ line: this.yylineno
354
+ });
355
+ return this;
356
+ }, "reject"),
357
+ // retain first n characters of the match
358
+ less: /* @__PURE__ */ p(function(v) {
359
+ this.unput(this.match.slice(v));
360
+ }, "less"),
361
+ // displays already matched input, i.e. for error messages
362
+ pastInput: /* @__PURE__ */ p(function() {
363
+ var v = this.matched.substr(0, this.matched.length - this.match.length);
364
+ return (v.length > 20 ? "..." : "") + v.substr(-20).replace(/\n/g, "");
365
+ }, "pastInput"),
366
+ // displays upcoming input, i.e. for error messages
367
+ upcomingInput: /* @__PURE__ */ p(function() {
368
+ var v = this.match;
369
+ return v.length < 20 && (v += this._input.substr(0, 20 - v.length)), (v.substr(0, 20) + (v.length > 20 ? "..." : "")).replace(/\n/g, "");
370
+ }, "upcomingInput"),
371
+ // displays the character position where the lexing error occurred, i.e. for error messages
372
+ showPosition: /* @__PURE__ */ p(function() {
373
+ var v = this.pastInput(), A = new Array(v.length + 1).join("-");
374
+ return v + this.upcomingInput() + `
375
+ ` + A + "^";
376
+ }, "showPosition"),
377
+ // test the lexed token: return FALSE when not a match, otherwise return token
378
+ test_match: /* @__PURE__ */ p(function(v, A) {
379
+ var L, b, C;
380
+ if (this.options.backtrack_lexer && (C = {
381
+ yylineno: this.yylineno,
382
+ yylloc: {
383
+ first_line: this.yylloc.first_line,
384
+ last_line: this.last_line,
385
+ first_column: this.yylloc.first_column,
386
+ last_column: this.yylloc.last_column
387
+ },
388
+ yytext: this.yytext,
389
+ match: this.match,
390
+ matches: this.matches,
391
+ matched: this.matched,
392
+ yyleng: this.yyleng,
393
+ offset: this.offset,
394
+ _more: this._more,
395
+ _input: this._input,
396
+ yy: this.yy,
397
+ conditionStack: this.conditionStack.slice(0),
398
+ done: this.done
399
+ }, this.options.ranges && (C.yylloc.range = this.yylloc.range.slice(0))), b = v[0].match(/(?:\r\n?|\n).*/g), b && (this.yylineno += b.length), this.yylloc = {
400
+ first_line: this.yylloc.last_line,
401
+ last_line: this.yylineno + 1,
402
+ first_column: this.yylloc.last_column,
403
+ last_column: b ? b[b.length - 1].length - b[b.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + v[0].length
404
+ }, this.yytext += v[0], this.match += v[0], this.matches = v, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = false, this._backtrack = false, this._input = this._input.slice(v[0].length), this.matched += v[0], L = this.performAction.call(this, this.yy, this, A, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = false), L)
405
+ return L;
406
+ if (this._backtrack) {
407
+ for (var d in C)
408
+ this[d] = C[d];
409
+ return false;
410
+ }
411
+ return false;
412
+ }, "test_match"),
413
+ // return next match in input
414
+ next: /* @__PURE__ */ p(function() {
415
+ if (this.done)
416
+ return this.EOF;
417
+ this._input || (this.done = true);
418
+ var v, A, L, b;
419
+ this._more || (this.yytext = "", this.match = "");
420
+ for (var C = this._currentRules(), d = 0; d < C.length; d++)
421
+ if (L = this._input.match(this.rules[C[d]]), L && (!A || L[0].length > A[0].length)) {
422
+ if (A = L, b = d, this.options.backtrack_lexer) {
423
+ if (v = this.test_match(L, C[d]), v !== false)
424
+ return v;
425
+ if (this._backtrack) {
426
+ A = false;
427
+ continue;
428
+ } else
429
+ return false;
430
+ } else if (!this.options.flex)
431
+ break;
432
+ }
433
+ return A ? (v = this.test_match(A, C[b]), v !== false ? v : false) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
434
+ ` + this.showPosition(), {
435
+ text: "",
436
+ token: null,
437
+ line: this.yylineno
438
+ });
439
+ }, "next"),
440
+ // return next match that has a token
441
+ lex: /* @__PURE__ */ p(function() {
442
+ var A = this.next();
443
+ return A || this.lex();
444
+ }, "lex"),
445
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
446
+ begin: /* @__PURE__ */ p(function(A) {
447
+ this.conditionStack.push(A);
448
+ }, "begin"),
449
+ // pop the previously active lexer condition state off the condition stack
450
+ popState: /* @__PURE__ */ p(function() {
451
+ var A = this.conditionStack.length - 1;
452
+ return A > 0 ? this.conditionStack.pop() : this.conditionStack[0];
453
+ }, "popState"),
454
+ // produce the lexer rule set which is active for the currently active lexer condition state
455
+ _currentRules: /* @__PURE__ */ p(function() {
456
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
457
+ }, "_currentRules"),
458
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
459
+ topState: /* @__PURE__ */ p(function(A) {
460
+ return A = this.conditionStack.length - 1 - Math.abs(A || 0), A >= 0 ? this.conditionStack[A] : "INITIAL";
461
+ }, "topState"),
462
+ // alias for begin(condition)
463
+ pushState: /* @__PURE__ */ p(function(A) {
464
+ this.begin(A);
465
+ }, "pushState"),
466
+ // return the number of states currently on the stack
467
+ stateStackSize: /* @__PURE__ */ p(function() {
468
+ return this.conditionStack.length;
469
+ }, "stateStackSize"),
470
+ options: { "case-insensitive": true },
471
+ performAction: /* @__PURE__ */ p(function(A, L, b, C) {
472
+ switch (b) {
473
+ case 0:
474
+ return 5;
475
+ case 1:
476
+ break;
477
+ case 2:
478
+ break;
479
+ case 3:
480
+ break;
481
+ case 4:
482
+ break;
483
+ case 5:
484
+ break;
485
+ case 6:
486
+ return 19;
487
+ case 7:
488
+ return this.begin("CONFIG"), 73;
489
+ case 8:
490
+ return 74;
491
+ case 9:
492
+ return this.popState(), this.popState(), 75;
493
+ case 10:
494
+ return L.yytext = L.yytext.trim(), 71;
495
+ case 11:
496
+ return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 71;
497
+ case 12:
498
+ return this.begin("LINE"), 14;
499
+ case 13:
500
+ return this.begin("ID"), 50;
501
+ case 14:
502
+ return this.begin("ID"), 52;
503
+ case 15:
504
+ return 13;
505
+ case 16:
506
+ return this.begin("ID"), 53;
507
+ case 17:
508
+ return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 71;
509
+ case 18:
510
+ return this.popState(), this.popState(), this.begin("LINE"), 51;
511
+ case 19:
512
+ return this.popState(), this.popState(), 5;
513
+ case 20:
514
+ return this.begin("LINE"), 36;
515
+ case 21:
516
+ return this.begin("LINE"), 37;
517
+ case 22:
518
+ return this.begin("LINE"), 38;
519
+ case 23:
520
+ return this.begin("LINE"), 39;
521
+ case 24:
522
+ return this.begin("LINE"), 49;
523
+ case 25:
524
+ return this.begin("LINE"), 41;
525
+ case 26:
526
+ return this.begin("LINE"), 43;
527
+ case 27:
528
+ return this.begin("LINE"), 48;
529
+ case 28:
530
+ return this.begin("LINE"), 44;
531
+ case 29:
532
+ return this.begin("LINE"), 47;
533
+ case 30:
534
+ return this.begin("LINE"), 46;
535
+ case 31:
536
+ return this.popState(), 15;
537
+ case 32:
538
+ return 16;
539
+ case 33:
540
+ return 66;
541
+ case 34:
542
+ return 67;
543
+ case 35:
544
+ return 60;
545
+ case 36:
546
+ return 61;
547
+ case 37:
548
+ return 62;
549
+ case 38:
550
+ return 63;
551
+ case 39:
552
+ return 58;
553
+ case 40:
554
+ return 55;
555
+ case 41:
556
+ return this.begin("ID"), 21;
557
+ case 42:
558
+ return this.begin("ID"), 23;
559
+ case 43:
560
+ return 29;
561
+ case 44:
562
+ return 30;
563
+ case 45:
564
+ return this.begin("acc_title"), 31;
565
+ case 46:
566
+ return this.popState(), "acc_title_value";
567
+ case 47:
568
+ return this.begin("acc_descr"), 33;
569
+ case 48:
570
+ return this.popState(), "acc_descr_value";
571
+ case 49:
572
+ this.begin("acc_descr_multiline");
573
+ break;
574
+ case 50:
575
+ this.popState();
576
+ break;
577
+ case 51:
578
+ return "acc_descr_multiline_value";
579
+ case 52:
580
+ return 6;
581
+ case 53:
582
+ return 18;
583
+ case 54:
584
+ return 20;
585
+ case 55:
586
+ return 65;
587
+ case 56:
588
+ return 5;
589
+ case 57:
590
+ return L.yytext = L.yytext.trim(), 71;
591
+ case 58:
592
+ return 78;
593
+ case 59:
594
+ return 79;
595
+ case 60:
596
+ return 80;
597
+ case 61:
598
+ return 81;
599
+ case 62:
600
+ return 76;
601
+ case 63:
602
+ return 77;
603
+ case 64:
604
+ return 82;
605
+ case 65:
606
+ return 83;
607
+ case 66:
608
+ return 84;
609
+ case 67:
610
+ return 85;
611
+ case 68:
612
+ return 86;
613
+ case 69:
614
+ return 86;
615
+ case 70:
616
+ return 69;
617
+ case 71:
618
+ return 70;
619
+ case 72:
620
+ return 5;
621
+ case 73:
622
+ return "INVALID";
623
+ }
624
+ }, "anonymous"),
625
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:@\{)/i, /^(?:[^\}]+)/i, /^(?:\})/i, /^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i, /^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:<<->>)/i, /^(?:-->>)/i, /^(?:<<-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i, /^(?::)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
626
+ conditions: { acc_descr_multiline: { rules: [50, 51], inclusive: false }, acc_descr: { rules: [48], inclusive: false }, acc_title: { rules: [46], inclusive: false }, ID: { rules: [2, 3, 7, 10, 11, 17], inclusive: false }, ALIAS: { rules: [2, 3, 18, 19], inclusive: false }, LINE: { rules: [2, 3, 31], inclusive: false }, CONFIG: { rules: [8, 9], inclusive: false }, CONFIG_DATA: { rules: [], inclusive: false }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 49, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], inclusive: true } }
627
+ };
628
+ return pt;
629
+ }();
630
+ Yt.lexer = ye;
631
+ function At() {
632
+ this.yy = {};
633
+ }
634
+ return p(At, "Parser"), At.prototype = Yt, Yt.Parser = At, new At();
635
+ }();
636
+ Ut.parser = Ut;
637
+ var Ve = Ut, Ye = {
638
+ SOLID: 0,
639
+ DOTTED: 1,
640
+ NOTE: 2,
641
+ SOLID_CROSS: 3,
642
+ DOTTED_CROSS: 4,
643
+ SOLID_OPEN: 5,
644
+ DOTTED_OPEN: 6,
645
+ LOOP_START: 10,
646
+ LOOP_END: 11,
647
+ ALT_START: 12,
648
+ ALT_ELSE: 13,
649
+ ALT_END: 14,
650
+ OPT_START: 15,
651
+ OPT_END: 16,
652
+ ACTIVE_START: 17,
653
+ ACTIVE_END: 18,
654
+ PAR_START: 19,
655
+ PAR_AND: 20,
656
+ PAR_END: 21,
657
+ RECT_START: 22,
658
+ RECT_END: 23,
659
+ SOLID_POINT: 24,
660
+ DOTTED_POINT: 25,
661
+ AUTONUMBER: 26,
662
+ CRITICAL_START: 27,
663
+ CRITICAL_OPTION: 28,
664
+ CRITICAL_END: 29,
665
+ BREAK_START: 30,
666
+ BREAK_END: 31,
667
+ PAR_OVER_START: 32,
668
+ BIDIRECTIONAL_SOLID: 33,
669
+ BIDIRECTIONAL_DOTTED: 34
670
+ }, We = {
671
+ FILLED: 0,
672
+ OPEN: 1
673
+ }, Fe = {
674
+ LEFTOF: 0,
675
+ RIGHTOF: 1,
676
+ OVER: 2
677
+ }, Rt = {
678
+ ACTOR: "actor",
679
+ CONTROL: "control",
680
+ DATABASE: "database",
681
+ ENTITY: "entity"
682
+ }, wt, qe = (wt = class {
683
+ constructor() {
684
+ this.state = new e(() => ({
685
+ prevActor: void 0,
686
+ actors: /* @__PURE__ */ new Map(),
687
+ createdActors: /* @__PURE__ */ new Map(),
688
+ destroyedActors: /* @__PURE__ */ new Map(),
689
+ boxes: [],
690
+ messages: [],
691
+ notes: [],
692
+ sequenceNumbersEnabled: false,
693
+ wrapEnabled: void 0,
694
+ currentBox: void 0,
695
+ lastCreated: void 0,
696
+ lastDestroyed: void 0
697
+ })), this.setAccTitle = cy, this.setAccDescription = uy, this.setDiagramTitle = dy, this.getAccTitle = hy, this.getAccDescription = fy, this.getDiagramTitle = py, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(ut$1().wrap), this.LINETYPE = Ye, this.ARROWTYPE = We, this.PLACEMENT = Fe;
698
+ }
699
+ addBox(t) {
700
+ this.state.records.boxes.push({
701
+ name: t.text,
702
+ wrap: t.wrap ?? this.autoWrap(),
703
+ fill: t.color,
704
+ actorKeys: []
705
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
706
+ }
707
+ addActor(t, n, s, r, i) {
708
+ let c = this.state.records.currentBox, h;
709
+ if (i !== void 0) {
710
+ let a;
711
+ i.includes(`
712
+ `) ? a = i + `
713
+ ` : a = `{
714
+ ` + i + `
715
+ }`, h = rC(a, { schema: eC });
716
+ }
717
+ r = h?.type ?? r;
718
+ const o = this.state.records.actors.get(t);
719
+ if (o) {
720
+ if (this.state.records.currentBox && o.box && this.state.records.currentBox !== o.box)
721
+ throw new Error(
722
+ `A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
723
+ );
724
+ if (c = o.box ? o.box : this.state.records.currentBox, o.box = c, o && n === o.name && s == null)
725
+ return;
726
+ }
727
+ if (s?.text == null && (s = { text: n, type: r }), (r == null || s.text == null) && (s = { text: n, type: r }), this.state.records.actors.set(t, {
728
+ box: c,
729
+ name: n,
730
+ description: s.text,
731
+ wrap: s.wrap ?? this.autoWrap(),
732
+ prevActor: this.state.records.prevActor,
733
+ links: {},
734
+ properties: {},
735
+ actorCnt: null,
736
+ rectData: null,
737
+ type: r ?? "participant"
738
+ }), this.state.records.prevActor) {
739
+ const a = this.state.records.actors.get(this.state.records.prevActor);
740
+ a && (a.nextActor = t);
741
+ }
742
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(t), this.state.records.prevActor = t;
743
+ }
744
+ activationCount(t) {
745
+ let n, s = 0;
746
+ if (!t)
747
+ return 0;
748
+ for (n = 0; n < this.state.records.messages.length; n++)
749
+ this.state.records.messages[n].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[n].from === t && s++, this.state.records.messages[n].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[n].from === t && s--;
750
+ return s;
751
+ }
752
+ addMessage(t, n, s, r) {
753
+ this.state.records.messages.push({
754
+ id: this.state.records.messages.length.toString(),
755
+ from: t,
756
+ to: n,
757
+ message: s.text,
758
+ wrap: s.wrap ?? this.autoWrap(),
759
+ answer: r
760
+ });
761
+ }
762
+ addSignal(t, n, s, r, i = false) {
763
+ if (r === this.LINETYPE.ACTIVE_END && this.activationCount(t ?? "") < 1) {
764
+ const h = new Error("Trying to inactivate an inactive participant (" + t + ")");
765
+ throw h.hash = {
766
+ text: "->>-",
767
+ token: "->>-",
768
+ line: "1",
769
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
770
+ expected: ["'ACTIVE_PARTICIPANT'"]
771
+ }, h;
772
+ }
773
+ return this.state.records.messages.push({
774
+ id: this.state.records.messages.length.toString(),
775
+ from: t,
776
+ to: n,
777
+ message: s?.text ?? "",
778
+ wrap: s?.wrap ?? this.autoWrap(),
779
+ type: r,
780
+ activate: i
781
+ }), true;
782
+ }
783
+ hasAtLeastOneBox() {
784
+ return this.state.records.boxes.length > 0;
785
+ }
786
+ hasAtLeastOneBoxWithTitle() {
787
+ return this.state.records.boxes.some((t) => t.name);
788
+ }
789
+ getMessages() {
790
+ return this.state.records.messages;
791
+ }
792
+ getBoxes() {
793
+ return this.state.records.boxes;
794
+ }
795
+ getActors() {
796
+ return this.state.records.actors;
797
+ }
798
+ getCreatedActors() {
799
+ return this.state.records.createdActors;
800
+ }
801
+ getDestroyedActors() {
802
+ return this.state.records.destroyedActors;
803
+ }
804
+ getActor(t) {
805
+ return this.state.records.actors.get(t);
806
+ }
807
+ getActorKeys() {
808
+ return [...this.state.records.actors.keys()];
809
+ }
810
+ enableSequenceNumbers() {
811
+ this.state.records.sequenceNumbersEnabled = true;
812
+ }
813
+ disableSequenceNumbers() {
814
+ this.state.records.sequenceNumbersEnabled = false;
815
+ }
816
+ showSequenceNumbers() {
817
+ return this.state.records.sequenceNumbersEnabled;
818
+ }
819
+ setWrap(t) {
820
+ this.state.records.wrapEnabled = t;
821
+ }
822
+ extractWrap(t) {
823
+ if (t === void 0)
824
+ return {};
825
+ t = t.trim();
826
+ const n = /^:?wrap:/.exec(t) !== null ? true : /^:?nowrap:/.exec(t) !== null ? false : void 0;
827
+ return { cleanedText: (n === void 0 ? t : t.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: n };
828
+ }
829
+ autoWrap() {
830
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : ut$1().sequence?.wrap ?? false;
831
+ }
832
+ clear() {
833
+ this.state.reset(), ly();
834
+ }
835
+ parseMessage(t) {
836
+ const n = t.trim(), { wrap: s, cleanedText: r } = this.extractWrap(n), i = {
837
+ text: r,
838
+ wrap: s
839
+ };
840
+ return F.debug(`parseMessage: ${JSON.stringify(i)}`), i;
841
+ }
842
+ // We expect the box statement to be color first then description
843
+ // 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
844
+ // We extract first segment as color, the rest of the line is considered as text
845
+ parseBoxData(t) {
846
+ const n = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);
847
+ let s = n?.[1] ? n[1].trim() : "transparent", r = n?.[2] ? n[2].trim() : void 0;
848
+ if (window?.CSS)
849
+ window.CSS.supports("color", s) || (s = "transparent", r = t.trim());
850
+ else {
851
+ const h = new Option().style;
852
+ h.color = s, h.color !== s && (s = "transparent", r = t.trim());
853
+ }
854
+ const { wrap: i, cleanedText: c } = this.extractWrap(r);
855
+ return {
856
+ text: c ? ee(c, ut$1()) : void 0,
857
+ color: s,
858
+ wrap: i
859
+ };
860
+ }
861
+ addNote(t, n, s) {
862
+ const r = {
863
+ actor: t,
864
+ placement: n,
865
+ message: s.text,
866
+ wrap: s.wrap ?? this.autoWrap()
867
+ }, i = [].concat(t, t);
868
+ this.state.records.notes.push(r), this.state.records.messages.push({
869
+ id: this.state.records.messages.length.toString(),
870
+ from: i[0],
871
+ to: i[1],
872
+ message: s.text,
873
+ wrap: s.wrap ?? this.autoWrap(),
874
+ type: this.LINETYPE.NOTE,
875
+ placement: n
876
+ });
877
+ }
878
+ addLinks(t, n) {
879
+ const s = this.getActor(t);
880
+ try {
881
+ let r = ee(n.text, ut$1());
882
+ r = r.replace(/&equals;/g, "="), r = r.replace(/&amp;/g, "&");
883
+ const i = JSON.parse(r);
884
+ this.insertLinks(s, i);
885
+ } catch (r) {
886
+ F.error("error while parsing actor link text", r);
887
+ }
888
+ }
889
+ addALink(t, n) {
890
+ const s = this.getActor(t);
891
+ try {
892
+ const r = {};
893
+ let i = ee(n.text, ut$1());
894
+ const c = i.indexOf("@");
895
+ i = i.replace(/&equals;/g, "="), i = i.replace(/&amp;/g, "&");
896
+ const h = i.slice(0, c - 1).trim(), o = i.slice(c + 1).trim();
897
+ r[h] = o, this.insertLinks(s, r);
898
+ } catch (r) {
899
+ F.error("error while parsing actor link text", r);
900
+ }
901
+ }
902
+ insertLinks(t, n) {
903
+ if (t.links == null)
904
+ t.links = n;
905
+ else
906
+ for (const s in n)
907
+ t.links[s] = n[s];
908
+ }
909
+ addProperties(t, n) {
910
+ const s = this.getActor(t);
911
+ try {
912
+ const r = ee(n.text, ut$1()), i = JSON.parse(r);
913
+ this.insertProperties(s, i);
914
+ } catch (r) {
915
+ F.error("error while parsing actor properties text", r);
916
+ }
917
+ }
918
+ insertProperties(t, n) {
919
+ if (t.properties == null)
920
+ t.properties = n;
921
+ else
922
+ for (const s in n)
923
+ t.properties[s] = n[s];
924
+ }
925
+ boxEnd() {
926
+ this.state.records.currentBox = void 0;
927
+ }
928
+ addDetails(t, n) {
929
+ const s = this.getActor(t), r = document.getElementById(n.text);
930
+ try {
931
+ const i = r.innerHTML, c = JSON.parse(i);
932
+ c.properties && this.insertProperties(s, c.properties), c.links && this.insertLinks(s, c.links);
933
+ } catch (i) {
934
+ F.error("error while parsing actor details text", i);
935
+ }
936
+ }
937
+ getActorProperty(t, n) {
938
+ if (t?.properties !== void 0)
939
+ return t.properties[n];
940
+ }
941
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
942
+ apply(t) {
943
+ if (Array.isArray(t))
944
+ t.forEach((n) => {
945
+ this.apply(n);
946
+ });
947
+ else
948
+ switch (t.type) {
949
+ case "sequenceIndex":
950
+ this.state.records.messages.push({
951
+ id: this.state.records.messages.length.toString(),
952
+ from: void 0,
953
+ to: void 0,
954
+ message: {
955
+ start: t.sequenceIndex,
956
+ step: t.sequenceIndexStep,
957
+ visible: t.sequenceVisible
958
+ },
959
+ wrap: false,
960
+ type: t.signalType
961
+ });
962
+ break;
963
+ case "addParticipant":
964
+ this.addActor(t.actor, t.actor, t.description, t.draw, t.config);
965
+ break;
966
+ case "createParticipant":
967
+ if (this.state.records.actors.has(t.actor))
968
+ throw new Error(
969
+ "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"
970
+ );
971
+ this.state.records.lastCreated = t.actor, this.addActor(t.actor, t.actor, t.description, t.draw, t.config), this.state.records.createdActors.set(t.actor, this.state.records.messages.length);
972
+ break;
973
+ case "destroyParticipant":
974
+ this.state.records.lastDestroyed = t.actor, this.state.records.destroyedActors.set(t.actor, this.state.records.messages.length);
975
+ break;
976
+ case "activeStart":
977
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
978
+ break;
979
+ case "activeEnd":
980
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
981
+ break;
982
+ case "addNote":
983
+ this.addNote(t.actor, t.placement, t.text);
984
+ break;
985
+ case "addLinks":
986
+ this.addLinks(t.actor, t.text);
987
+ break;
988
+ case "addALink":
989
+ this.addALink(t.actor, t.text);
990
+ break;
991
+ case "addProperties":
992
+ this.addProperties(t.actor, t.text);
993
+ break;
994
+ case "addDetails":
995
+ this.addDetails(t.actor, t.text);
996
+ break;
997
+ case "addMessage":
998
+ if (this.state.records.lastCreated) {
999
+ if (t.to !== this.state.records.lastCreated)
1000
+ throw new Error(
1001
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1002
+ );
1003
+ this.state.records.lastCreated = void 0;
1004
+ } else if (this.state.records.lastDestroyed) {
1005
+ if (t.to !== this.state.records.lastDestroyed && t.from !== this.state.records.lastDestroyed)
1006
+ throw new Error(
1007
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1008
+ );
1009
+ this.state.records.lastDestroyed = void 0;
1010
+ }
1011
+ this.addSignal(t.from, t.to, t.msg, t.signalType, t.activate);
1012
+ break;
1013
+ case "boxStart":
1014
+ this.addBox(t.boxData);
1015
+ break;
1016
+ case "boxEnd":
1017
+ this.boxEnd();
1018
+ break;
1019
+ case "loopStart":
1020
+ this.addSignal(void 0, void 0, t.loopText, t.signalType);
1021
+ break;
1022
+ case "loopEnd":
1023
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1024
+ break;
1025
+ case "rectStart":
1026
+ this.addSignal(void 0, void 0, t.color, t.signalType);
1027
+ break;
1028
+ case "rectEnd":
1029
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1030
+ break;
1031
+ case "optStart":
1032
+ this.addSignal(void 0, void 0, t.optText, t.signalType);
1033
+ break;
1034
+ case "optEnd":
1035
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1036
+ break;
1037
+ case "altStart":
1038
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1039
+ break;
1040
+ case "else":
1041
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1042
+ break;
1043
+ case "altEnd":
1044
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1045
+ break;
1046
+ case "setAccTitle":
1047
+ cy(t.text);
1048
+ break;
1049
+ case "parStart":
1050
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1051
+ break;
1052
+ case "and":
1053
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1054
+ break;
1055
+ case "parEnd":
1056
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1057
+ break;
1058
+ case "criticalStart":
1059
+ this.addSignal(void 0, void 0, t.criticalText, t.signalType);
1060
+ break;
1061
+ case "option":
1062
+ this.addSignal(void 0, void 0, t.optionText, t.signalType);
1063
+ break;
1064
+ case "criticalEnd":
1065
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1066
+ break;
1067
+ case "breakStart":
1068
+ this.addSignal(void 0, void 0, t.breakText, t.signalType);
1069
+ break;
1070
+ case "breakEnd":
1071
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1072
+ break;
1073
+ }
1074
+ }
1075
+ getConfig() {
1076
+ return ut$1().sequence;
1077
+ }
1078
+ }, p(wt, "SequenceDB"), wt), ze = /* @__PURE__ */ p((e) => `.actor {
1079
+ stroke: ${e.actorBorder};
1080
+ fill: ${e.actorBkg};
1081
+ }
1082
+
1083
+ text.actor > tspan {
1084
+ fill: ${e.actorTextColor};
1085
+ stroke: none;
1086
+ }
1087
+
1088
+ .actor-line {
1089
+ stroke: ${e.actorLineColor};
1090
+ }
1091
+
1092
+ .innerArc {
1093
+ stroke-width: 1.5;
1094
+ stroke-dasharray: none;
1095
+ }
1096
+
1097
+ .messageLine0 {
1098
+ stroke-width: 1.5;
1099
+ stroke-dasharray: none;
1100
+ stroke: ${e.signalColor};
1101
+ }
1102
+
1103
+ .messageLine1 {
1104
+ stroke-width: 1.5;
1105
+ stroke-dasharray: 2, 2;
1106
+ stroke: ${e.signalColor};
1107
+ }
1108
+
1109
+ #arrowhead path {
1110
+ fill: ${e.signalColor};
1111
+ stroke: ${e.signalColor};
1112
+ }
1113
+
1114
+ .sequenceNumber {
1115
+ fill: ${e.sequenceNumberColor};
1116
+ }
1117
+
1118
+ #sequencenumber {
1119
+ fill: ${e.signalColor};
1120
+ }
1121
+
1122
+ #crosshead path {
1123
+ fill: ${e.signalColor};
1124
+ stroke: ${e.signalColor};
1125
+ }
1126
+
1127
+ .messageText {
1128
+ fill: ${e.signalTextColor};
1129
+ stroke: none;
1130
+ }
1131
+
1132
+ .labelBox {
1133
+ stroke: ${e.labelBoxBorderColor};
1134
+ fill: ${e.labelBoxBkgColor};
1135
+ }
1136
+
1137
+ .labelText, .labelText > tspan {
1138
+ fill: ${e.labelTextColor};
1139
+ stroke: none;
1140
+ }
1141
+
1142
+ .loopText, .loopText > tspan {
1143
+ fill: ${e.loopTextColor};
1144
+ stroke: none;
1145
+ }
1146
+
1147
+ .loopLine {
1148
+ stroke-width: 2px;
1149
+ stroke-dasharray: 2, 2;
1150
+ stroke: ${e.labelBoxBorderColor};
1151
+ fill: ${e.labelBoxBorderColor};
1152
+ }
1153
+
1154
+ .note {
1155
+ //stroke: #decc93;
1156
+ stroke: ${e.noteBorderColor};
1157
+ fill: ${e.noteBkgColor};
1158
+ }
1159
+
1160
+ .noteText, .noteText > tspan {
1161
+ fill: ${e.noteTextColor};
1162
+ stroke: none;
1163
+ }
1164
+
1165
+ .activation0 {
1166
+ fill: ${e.activationBkgColor};
1167
+ stroke: ${e.activationBorderColor};
1168
+ }
1169
+
1170
+ .activation1 {
1171
+ fill: ${e.activationBkgColor};
1172
+ stroke: ${e.activationBorderColor};
1173
+ }
1174
+
1175
+ .activation2 {
1176
+ fill: ${e.activationBkgColor};
1177
+ stroke: ${e.activationBorderColor};
1178
+ }
1179
+
1180
+ .actorPopupMenu {
1181
+ position: absolute;
1182
+ }
1183
+
1184
+ .actorPopupMenuPanel {
1185
+ position: absolute;
1186
+ fill: ${e.actorBkg};
1187
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1188
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1189
+ }
1190
+ .actor-man line {
1191
+ stroke: ${e.actorBorder};
1192
+ fill: ${e.actorBkg};
1193
+ }
1194
+ .actor-man circle, line {
1195
+ stroke: ${e.actorBorder};
1196
+ fill: ${e.actorBkg};
1197
+ stroke-width: 2px;
1198
+ }
1199
+
1200
+ `, "getStyles"), He = ze, Tt = 18 * 2, gt = "actor-top", xt = "actor-bottom", Ct = "actor-box", ut = "actor-man", Lt = /* @__PURE__ */ p(function(e, t) {
1201
+ return x(e, t);
1202
+ }, "drawRect"), Ue = /* @__PURE__ */ p(function(e, t, n, s, r) {
1203
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1204
+ return { height: 0, width: 0 };
1205
+ const i = t.links, c = t.actorCnt, h = t.rectData;
1206
+ var o = "none";
1207
+ r && (o = "block !important");
1208
+ const a = e.append("g");
1209
+ a.attr("id", "actor" + c + "_popup"), a.attr("class", "actorPopupMenu"), a.attr("display", o);
1210
+ var p = "";
1211
+ h.class !== void 0 && (p = " " + h.class);
1212
+ let g = h.width > n ? h.width : n;
1213
+ const x = a.append("rect");
1214
+ if (x.attr("class", "actorPopupMenuPanel" + p), x.attr("x", h.x), x.attr("y", h.height), x.attr("fill", h.fill), x.attr("stroke", h.stroke), x.attr("width", g), x.attr("height", h.height), x.attr("rx", h.rx), x.attr("ry", h.ry), i != null) {
1215
+ var y = 20;
1216
+ for (let k in i) {
1217
+ var m = a.append("a"), w = cC.sanitizeUrl(i[k]);
1218
+ m.attr("xlink:href", w), m.attr("target", "_blank"), us(s)(
1219
+ k,
1220
+ m,
1221
+ h.x + 10,
1222
+ h.height + y,
1223
+ g,
1224
+ 20,
1225
+ { class: "actor" },
1226
+ s
1227
+ ), y += 30;
1228
+ }
1229
+ }
1230
+ return x.attr("height", y), { height: h.height + y, width: g };
1231
+ }, "drawPopup"), Ot = /* @__PURE__ */ p(function(e) {
1232
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1233
+ }, "popupMenuToggle"), Dt = /* @__PURE__ */ p(async function(e, t, n = null) {
1234
+ let s = e.append("foreignObject");
1235
+ const r = await Co(t.text, Ft()), c = s.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();
1236
+ if (s.attr("height", Math.round(c.height)).attr("width", Math.round(c.width)), t.class === "noteText") {
1237
+ const h = e.node().firstChild;
1238
+ h.setAttribute("height", c.height + 2 * t.textMargin);
1239
+ const o = h.getBBox();
1240
+ s.attr("x", Math.round(o.x + o.width / 2 - c.width / 2)).attr("y", Math.round(o.y + o.height / 2 - c.height / 2));
1241
+ } else if (n) {
1242
+ let { startx: h, stopx: o, starty: a } = n;
1243
+ if (h > o) {
1244
+ const p = h;
1245
+ h = o, o = p;
1246
+ }
1247
+ s.attr("x", Math.round(h + Math.abs(h - o) / 2 - c.width / 2)), t.class === "loopText" ? s.attr("y", Math.round(a)) : s.attr("y", Math.round(a - c.height));
1248
+ }
1249
+ return [s];
1250
+ }, "drawKatex"), vt = /* @__PURE__ */ p(function(e, t) {
1251
+ let n = 0, s = 0;
1252
+ const r = t.text.split(Kr.lineBreakRegex), [i, c] = Da(t.fontSize);
1253
+ let h = [], o = 0, a = /* @__PURE__ */ p(() => t.y, "yfunc");
1254
+ if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1255
+ switch (t.valign) {
1256
+ case "top":
1257
+ case "start":
1258
+ a = /* @__PURE__ */ p(() => Math.round(t.y + t.textMargin), "yfunc");
1259
+ break;
1260
+ case "middle":
1261
+ case "center":
1262
+ a = /* @__PURE__ */ p(() => Math.round(t.y + (n + s + t.textMargin) / 2), "yfunc");
1263
+ break;
1264
+ case "bottom":
1265
+ case "end":
1266
+ a = /* @__PURE__ */ p(() => Math.round(
1267
+ t.y + (n + s + 2 * t.textMargin) - t.textMargin
1268
+ ), "yfunc");
1269
+ break;
1270
+ }
1271
+ if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1272
+ switch (t.anchor) {
1273
+ case "left":
1274
+ case "start":
1275
+ t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1276
+ break;
1277
+ case "middle":
1278
+ case "center":
1279
+ t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1280
+ break;
1281
+ case "right":
1282
+ case "end":
1283
+ t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1284
+ break;
1285
+ }
1286
+ for (let [p, g] of r.entries()) {
1287
+ t.textMargin !== void 0 && t.textMargin === 0 && i !== void 0 && (o = p * i);
1288
+ const x = e.append("text");
1289
+ x.attr("x", t.x), x.attr("y", a()), t.anchor !== void 0 && x.attr("text-anchor", t.anchor).attr("dominant-baseline", t.dominantBaseline).attr("alignment-baseline", t.alignmentBaseline), t.fontFamily !== void 0 && x.style("font-family", t.fontFamily), c !== void 0 && x.style("font-size", c), t.fontWeight !== void 0 && x.style("font-weight", t.fontWeight), t.fill !== void 0 && x.attr("fill", t.fill), t.class !== void 0 && x.attr("class", t.class), t.dy !== void 0 ? x.attr("dy", t.dy) : o !== 0 && x.attr("dy", o);
1290
+ const y = g || Pw;
1291
+ if (t.tspan) {
1292
+ const m = x.append("tspan");
1293
+ m.attr("x", t.x), t.fill !== void 0 && m.attr("fill", t.fill), m.text(y);
1294
+ } else
1295
+ x.text(y);
1296
+ t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (s += (x._groups || x)[0][0].getBBox().height, n = s), h.push(x);
1297
+ }
1298
+ return h;
1299
+ }, "drawText"), oe = /* @__PURE__ */ p(function(e, t) {
1300
+ function n(r, i, c, h, o) {
1301
+ return r + "," + i + " " + (r + c) + "," + i + " " + (r + c) + "," + (i + h - o) + " " + (r + c - o * 1.2) + "," + (i + h) + " " + r + "," + (i + h);
1302
+ }
1303
+ p(n, "genPoints");
1304
+ const s = e.append("polygon");
1305
+ return s.attr("points", n(t.x, t.y, t.width, t.height, 7)), s.attr("class", "labelBox"), t.y = t.y + t.height / 2, vt(e, t), s;
1306
+ }, "drawLabel"), P = -1, ce = /* @__PURE__ */ p((e, t, n, s) => {
1307
+ e.select && n.forEach((r) => {
1308
+ const i = t.get(r), c = e.select("#actor" + i.actorCnt);
1309
+ !s.mirrorActors && i.stopy ? c.attr("y2", i.stopy + i.height / 2) : s.mirrorActors && c.attr("y2", i.stopy);
1310
+ });
1311
+ }, "fixLifeLineHeights"), Ge = /* @__PURE__ */ p(function(e, t, n, s) {
1312
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h$1 = e.append("g").lower();
1313
+ var o = h$1;
1314
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h$1.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1315
+ const a = y();
1316
+ var p = "actor";
1317
+ t.properties?.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.rx = 3, a.ry = 3, a.name = t.name;
1318
+ const g = Lt(o, a);
1319
+ if (t.rectData = a, t.properties?.icon) {
1320
+ const y = t.properties.icon.trim();
1321
+ y.charAt(0) === "@" ? m(o, a.x + a.width - 20, a.y + 10, y.substr(1)) : h(o, a.x + a.width - 20, a.y + 10, y);
1322
+ }
1323
+ dt(n, jr(t.description))(
1324
+ t.description,
1325
+ o,
1326
+ a.x,
1327
+ a.y,
1328
+ a.width,
1329
+ a.height,
1330
+ { class: `actor ${Ct}` },
1331
+ n
1332
+ );
1333
+ let x = t.height;
1334
+ if (g.node) {
1335
+ const y = g.node().getBBox();
1336
+ t.height = y.height, x = y.height;
1337
+ }
1338
+ return x;
1339
+ }, "drawActorTypeParticipant"), Ke = /* @__PURE__ */ p(function(e, t, n, s) {
1340
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h$1 = e.append("g").lower();
1341
+ var o = h$1;
1342
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h$1.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1343
+ const a = y();
1344
+ var p = "actor";
1345
+ t.properties?.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name;
1346
+ const g = 6, x = {
1347
+ ...a,
1348
+ x: a.x + -g,
1349
+ y: a.y + +g,
1350
+ class: "actor"
1351
+ }, y$1 = Lt(o, a);
1352
+ if (Lt(o, x), t.rectData = a, t.properties?.icon) {
1353
+ const w = t.properties.icon.trim();
1354
+ w.charAt(0) === "@" ? m(o, a.x + a.width - 20, a.y + 10, w.substr(1)) : h(o, a.x + a.width - 20, a.y + 10, w);
1355
+ }
1356
+ dt(n, jr(t.description))(
1357
+ t.description,
1358
+ o,
1359
+ a.x - g,
1360
+ a.y + g,
1361
+ a.width,
1362
+ a.height,
1363
+ { class: `actor ${Ct}` },
1364
+ n
1365
+ );
1366
+ let m$1 = t.height;
1367
+ if (y$1.node) {
1368
+ const w = y$1.node().getBBox();
1369
+ t.height = w.height, m$1 = w.height;
1370
+ }
1371
+ return m$1;
1372
+ }, "drawActorTypeCollections"), Xe = /* @__PURE__ */ p(function(e, t, n, s) {
1373
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h$1 = e.append("g").lower();
1374
+ let o = h$1;
1375
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h$1.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1376
+ const a = y();
1377
+ let p = "actor";
1378
+ t.properties?.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name;
1379
+ const g = a.height / 2, x = g / (2.5 + a.height / 50), y$1 = o.append("g"), m$1 = o.append("g");
1380
+ if (y$1.append("path").attr(
1381
+ "d",
1382
+ `M ${a.x},${a.y + g}
1383
+ a ${x},${g} 0 0 0 0,${a.height}
1384
+ h ${a.width - 2 * x}
1385
+ a ${x},${g} 0 0 0 0,-${a.height}
1386
+ Z
1387
+ `
1388
+ ).attr("class", p), m$1.append("path").attr(
1389
+ "d",
1390
+ `M ${a.x},${a.y + g}
1391
+ a ${x},${g} 0 0 0 0,${a.height}`
1392
+ ).attr("stroke", "#666").attr("stroke-width", "1px").attr("class", p), y$1.attr("transform", `translate(${x}, ${-(a.height / 2)})`), m$1.attr("transform", `translate(${a.width - x}, ${-a.height / 2})`), t.rectData = a, t.properties?.icon) {
1393
+ const N = t.properties.icon.trim(), S = a.x + a.width - 20, O = a.y + 10;
1394
+ N.charAt(0) === "@" ? m(o, S, O, N.substr(1)) : h(o, S, O, N);
1395
+ }
1396
+ dt(n, jr(t.description))(
1397
+ t.description,
1398
+ o,
1399
+ a.x,
1400
+ a.y,
1401
+ a.width,
1402
+ a.height,
1403
+ { class: `actor ${Ct}` },
1404
+ n
1405
+ );
1406
+ let w = t.height;
1407
+ const k = y$1.select("path:last-child");
1408
+ if (k.node()) {
1409
+ const N = k.node().getBBox();
1410
+ t.height = N.height, w = N.height;
1411
+ }
1412
+ return w;
1413
+ }, "drawActorTypeQueue"), Je = /* @__PURE__ */ p(function(e, t, n, s) {
1414
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 75, h = e.append("g").lower();
1415
+ s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1416
+ const o = e.append("g");
1417
+ let a = ut;
1418
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1419
+ const p = y();
1420
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor";
1421
+ const g = t.x + t.width / 2, x = r + 30, y$1 = 18;
1422
+ o.append("defs").append("marker").attr("id", "filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").append("path").attr("d", "M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"), o.append("circle").attr("cx", g).attr("cy", x).attr("r", y$1).attr("fill", "#eaeaf7").attr("stroke", "#666").attr("stroke-width", 1.2), o.append("line").attr("marker-end", "url(#filled-head-control)").attr("transform", `translate(${g}, ${x - y$1})`);
1423
+ const m = o.node().getBBox();
1424
+ return t.height = m.height + 2 * (n?.sequence?.labelBoxHeight ?? 0), dt(n, jr(t.description))(
1425
+ t.description,
1426
+ o,
1427
+ p.x,
1428
+ p.y + y$1 + (s ? 5 : 10),
1429
+ p.width,
1430
+ p.height,
1431
+ { class: `actor ${ut}` },
1432
+ n
1433
+ ), t.height;
1434
+ }, "drawActorTypeControl"), Qe = /* @__PURE__ */ p(function(e, t, n, s) {
1435
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 75, h = e.append("g").lower(), o = e.append("g");
1436
+ let a = ut;
1437
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1438
+ const p = y();
1439
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor";
1440
+ const g = t.x + t.width / 2, x = r + (s ? 10 : 25), y$1 = 18;
1441
+ o.append("circle").attr("cx", g).attr("cy", x).attr("r", y$1).attr("width", t.width).attr("height", t.height), o.append("line").attr("x1", g - y$1).attr("x2", g + y$1).attr("y1", x + y$1).attr("y2", x + y$1).attr("stroke", "#333").attr("stroke-width", 2);
1442
+ const m = o.node().getBBox();
1443
+ return t.height = m.height + (n?.sequence?.labelBoxHeight ?? 0), s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P), dt(n, jr(t.description))(
1444
+ t.description,
1445
+ o,
1446
+ p.x,
1447
+ p.y + (s ? (x - r + y$1 - 5) / 2 : (x + y$1 - r) / 2),
1448
+ p.width,
1449
+ p.height,
1450
+ { class: `actor ${ut}` },
1451
+ n
1452
+ ), s ? o.attr("transform", `translate(0, ${y$1 / 2})`) : o.attr("transform", `translate(0, ${y$1 / 2})`), t.height;
1453
+ }, "drawActorTypeEntity"), Ze = /* @__PURE__ */ p(function(e, t, n, s) {
1454
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height + 2 * n.boxTextMargin, h = e.append("g").lower();
1455
+ let o = h;
1456
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1457
+ const a = y();
1458
+ let p = "actor";
1459
+ t.properties?.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name, a.x = t.x, a.y = r;
1460
+ const g = a.width / 4, x = a.width / 4, y$1 = g / 2, m = y$1 / (2.5 + g / 50), w = o.append("g"), k = `
1461
+ M ${a.x},${a.y + m}
1462
+ a ${y$1},${m} 0 0 0 ${g},0
1463
+ a ${y$1},${m} 0 0 0 -${g},0
1464
+ l 0,${x - 2 * m}
1465
+ a ${y$1},${m} 0 0 0 ${g},0
1466
+ l 0,-${x - 2 * m}
1467
+ `;
1468
+ w.append("path").attr("d", k).attr("fill", "#eaeaea").attr("stroke", "#000").attr("stroke-width", 1).attr("class", p), s ? w.attr("transform", `translate(${g * 1.5}, ${a.height / 4 - 2 * m})`) : w.attr("transform", `translate(${g * 1.5}, ${(a.height + m) / 4})`), t.rectData = a, dt(n, jr(t.description))(
1469
+ t.description,
1470
+ o,
1471
+ a.x,
1472
+ a.y + (s ? (a.height + x) / 4 : (a.height + m) / 2),
1473
+ a.width,
1474
+ a.height,
1475
+ { class: `actor ${Ct}` },
1476
+ n
1477
+ );
1478
+ const N = w.select("path:last-child");
1479
+ if (N.node()) {
1480
+ const S = N.node().getBBox();
1481
+ t.height = S.height + (n.sequence.labelBoxHeight ?? 0);
1482
+ }
1483
+ return t.height;
1484
+ }, "drawActorTypeDatabase"), $e = /* @__PURE__ */ p(function(e, t, n, s) {
1485
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 80, h = 30, o = e.append("g").lower();
1486
+ s || (P++, o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1487
+ const a = e.append("g");
1488
+ let p = ut;
1489
+ s ? p += ` ${xt}` : p += ` ${gt}`, a.attr("class", p), a.attr("name", t.name);
1490
+ const g = y();
1491
+ g.x = t.x, g.y = r, g.fill = "#eaeaea", g.width = t.width, g.height = t.height, g.class = "actor", a.append("line").attr("id", "actor-man-torso" + P).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 10).attr("x2", t.x + t.width / 2 - 15).attr("y2", r + 10), a.append("line").attr("id", "actor-man-arms" + P).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 0).attr("x2", t.x + t.width / 2 - h * 2.5).attr("y2", r + 20), a.append("circle").attr("cx", t.x + t.width / 2).attr("cy", r + 10).attr("r", h);
1492
+ const x = a.node().getBBox();
1493
+ return t.height = x.height + (n.sequence.labelBoxHeight ?? 0), dt(n, jr(t.description))(
1494
+ t.description,
1495
+ a,
1496
+ g.x,
1497
+ g.y + (s ? h / 2 - 4 : h / 2 + 3),
1498
+ g.width,
1499
+ g.height,
1500
+ { class: `actor ${ut}` },
1501
+ n
1502
+ ), s ? a.attr("transform", `translate(0,${h / 2 + 7})`) : a.attr("transform", `translate(0,${h / 2 + 7})`), t.height;
1503
+ }, "drawActorTypeBoundary"), je = /* @__PURE__ */ p(function(e, t, n, s) {
1504
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 80, h = e.append("g").lower();
1505
+ s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1506
+ const o = e.append("g");
1507
+ let a = ut;
1508
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1509
+ const p = y();
1510
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor", p.rx = 3, p.ry = 3, o.append("line").attr("id", "actor-man-torso" + P).attr("x1", i).attr("y1", r + 25).attr("x2", i).attr("y2", r + 45), o.append("line").attr("id", "actor-man-arms" + P).attr("x1", i - Tt / 2).attr("y1", r + 33).attr("x2", i + Tt / 2).attr("y2", r + 33), o.append("line").attr("x1", i - Tt / 2).attr("y1", r + 60).attr("x2", i).attr("y2", r + 45), o.append("line").attr("x1", i).attr("y1", r + 45).attr("x2", i + Tt / 2 - 2).attr("y2", r + 60);
1511
+ const g = o.append("circle");
1512
+ g.attr("cx", t.x + t.width / 2), g.attr("cy", r + 10), g.attr("r", 15), g.attr("width", t.width), g.attr("height", t.height);
1513
+ const x = o.node().getBBox();
1514
+ return t.height = x.height, dt(n, jr(t.description))(
1515
+ t.description,
1516
+ o,
1517
+ p.x,
1518
+ p.y + 35,
1519
+ p.width,
1520
+ p.height,
1521
+ { class: `actor ${ut}` },
1522
+ n
1523
+ ), t.height;
1524
+ }, "drawActorTypeActor"), ts = /* @__PURE__ */ p(async function(e, t, n, s) {
1525
+ switch (t.type) {
1526
+ case "actor":
1527
+ return await je(e, t, n, s);
1528
+ case "participant":
1529
+ return await Ge(e, t, n, s);
1530
+ case "boundary":
1531
+ return await $e(e, t, n, s);
1532
+ case "control":
1533
+ return await Je(e, t, n, s);
1534
+ case "entity":
1535
+ return await Qe(e, t, n, s);
1536
+ case "database":
1537
+ return await Ze(e, t, n, s);
1538
+ case "collections":
1539
+ return await Ke(e, t, n, s);
1540
+ case "queue":
1541
+ return await Xe(e, t, n, s);
1542
+ }
1543
+ }, "drawActor"), es = /* @__PURE__ */ p(function(e, t, n) {
1544
+ const r = e.append("g");
1545
+ le(r, t), t.name && dt(n)(
1546
+ t.name,
1547
+ r,
1548
+ t.x,
1549
+ t.y + n.boxTextMargin + (t.textMaxHeight || 0) / 2,
1550
+ t.width,
1551
+ 0,
1552
+ { class: "text" },
1553
+ n
1554
+ ), r.lower();
1555
+ }, "drawBox"), ss = /* @__PURE__ */ p(function(e) {
1556
+ return e.append("g");
1557
+ }, "anchorElement"), as = /* @__PURE__ */ p(function(e, t, n, s, r) {
1558
+ const i = y(), c = t.anchored;
1559
+ i.x = t.startx, i.y = t.starty, i.class = "activation" + r % 3, i.width = t.stopx - t.startx, i.height = n - t.starty, Lt(c, i);
1560
+ }, "drawActivation"), rs = /* @__PURE__ */ p(async function(e, t, n, s) {
1561
+ const {
1562
+ boxMargin: r,
1563
+ boxTextMargin: i,
1564
+ labelBoxHeight: c,
1565
+ labelBoxWidth: h,
1566
+ messageFontFamily: o,
1567
+ messageFontSize: a,
1568
+ messageFontWeight: p$2
1569
+ } = s, g = e.append("g"), x = /* @__PURE__ */ p(function(w, k, N, S) {
1570
+ return g.append("line").attr("x1", w).attr("y1", k).attr("x2", N).attr("y2", S).attr("class", "loopLine");
1571
+ }, "drawLoopLine");
1572
+ x(t.startx, t.starty, t.stopx, t.starty), x(t.stopx, t.starty, t.stopx, t.stopy), x(t.startx, t.stopy, t.stopx, t.stopy), x(t.startx, t.starty, t.startx, t.stopy), t.sections !== void 0 && t.sections.forEach(function(w) {
1573
+ x(t.startx, w.y, t.stopx, w.y).style(
1574
+ "stroke-dasharray",
1575
+ "3, 3"
1576
+ );
1577
+ });
1578
+ let y = p$1();
1579
+ y.text = n, y.x = t.startx, y.y = t.starty, y.fontFamily = o, y.fontSize = a, y.fontWeight = p$2, y.anchor = "middle", y.valign = "middle", y.tspan = false, y.width = h || 50, y.height = c || 20, y.textMargin = i, y.class = "labelText", oe(g, y), y = he(), y.text = t.title, y.x = t.startx + h / 2 + (t.stopx - t.startx) / 2, y.y = t.starty + r + i, y.anchor = "middle", y.valign = "middle", y.textMargin = i, y.class = "loopText", y.fontFamily = o, y.fontSize = a, y.fontWeight = p$2, y.wrap = true;
1580
+ let m = jr(y.text) ? await Dt(g, y, t) : vt(g, y);
1581
+ if (t.sectionTitles !== void 0) {
1582
+ for (const [w, k] of Object.entries(t.sectionTitles))
1583
+ if (k.message) {
1584
+ y.text = k.message, y.x = t.startx + (t.stopx - t.startx) / 2, y.y = t.sections[w].y + r + i, y.class = "loopText", y.anchor = "middle", y.valign = "middle", y.tspan = false, y.fontFamily = o, y.fontSize = a, y.fontWeight = p$2, y.wrap = t.wrap, jr(y.text) ? (t.starty = t.sections[w].y, await Dt(g, y, t)) : vt(g, y);
1585
+ let N = Math.round(
1586
+ m.map((S) => (S._groups || S)[0][0].getBBox().height).reduce((S, O) => S + O)
1587
+ );
1588
+ t.sections[w].height += N - (r + i);
1589
+ }
1590
+ }
1591
+ return t.height = Math.round(t.stopy - t.starty), g;
1592
+ }, "drawLoop"), le = /* @__PURE__ */ p(function(e, t) {
1593
+ d(e, t);
1594
+ }, "drawBackgroundRect"), is = /* @__PURE__ */ p(function(e) {
1595
+ e.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1596
+ "d",
1597
+ "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"
1598
+ );
1599
+ }, "insertDatabaseIcon"), ns = /* @__PURE__ */ p(function(e) {
1600
+ e.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1601
+ "d",
1602
+ "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"
1603
+ );
1604
+ }, "insertComputerIcon"), os = /* @__PURE__ */ p(function(e) {
1605
+ e.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1606
+ "d",
1607
+ "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"
1608
+ );
1609
+ }, "insertClockIcon"), cs = /* @__PURE__ */ p(function(e) {
1610
+ e.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M -1 0 L 10 5 L 0 10 z");
1611
+ }, "insertArrowHead"), ls = /* @__PURE__ */ p(function(e) {
1612
+ e.append("defs").append("marker").attr("id", "filled-head").attr("refX", 15.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1613
+ }, "insertArrowFilledHead"), hs = /* @__PURE__ */ p(function(e) {
1614
+ e.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
1615
+ }, "insertSequenceNumber"), ds = /* @__PURE__ */ p(function(e) {
1616
+ e.append("defs").append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5).append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7");
1617
+ }, "insertArrowCrossHead"), he = /* @__PURE__ */ p(function() {
1618
+ return {
1619
+ x: 0,
1620
+ y: 0,
1621
+ fill: void 0,
1622
+ anchor: void 0,
1623
+ style: "#666",
1624
+ width: void 0,
1625
+ height: void 0,
1626
+ textMargin: 0,
1627
+ rx: 0,
1628
+ ry: 0,
1629
+ tspan: true,
1630
+ valign: void 0
1631
+ };
1632
+ }, "getTextObj"), ps = /* @__PURE__ */ p(function() {
1633
+ return {
1634
+ x: 0,
1635
+ y: 0,
1636
+ fill: "#EDF2AE",
1637
+ stroke: "#666",
1638
+ width: 100,
1639
+ anchor: "start",
1640
+ height: 100,
1641
+ rx: 0,
1642
+ ry: 0
1643
+ };
1644
+ }, "getNoteRect"), dt = /* @__PURE__ */ function() {
1645
+ function e(i, c, h, o, a, p, g) {
1646
+ const x = c.append("text").attr("x", h + a / 2).attr("y", o + p / 2 + 5).style("text-anchor", "middle").text(i);
1647
+ r(x, g);
1648
+ }
1649
+ p(e, "byText");
1650
+ function t(i, c, h, o, a, p, g, x) {
1651
+ const { actorFontSize: y, actorFontFamily: m, actorFontWeight: w } = x, [k, N] = Da(y), S = i.split(Kr.lineBreakRegex);
1652
+ for (let O = 0; O < S.length; O++) {
1653
+ const B = O * k - k * (S.length - 1) / 2, q = c.append("text").attr("x", h + a / 2).attr("y", o).style("text-anchor", "middle").style("font-size", N).style("font-weight", w).style("font-family", m);
1654
+ q.append("tspan").attr("x", h + a / 2).attr("dy", B).text(S[O]), q.attr("y", o + p / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(q, g);
1655
+ }
1656
+ }
1657
+ p(t, "byTspan");
1658
+ function n(i, c, h, o, a, p, g, x) {
1659
+ const y = c.append("switch"), w = y.append("foreignObject").attr("x", h).attr("y", o).attr("width", a).attr("height", p).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1660
+ w.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, y, h, o, a, p, g, x), r(w, g);
1661
+ }
1662
+ p(n, "byFo");
1663
+ async function s(i, c, h, o, a, p, g, x) {
1664
+ const y = await NL(i, Ft()), m = c.append("switch"), k = m.append("foreignObject").attr("x", h + a / 2 - y.width / 2).attr("y", o + p / 2 - y.height / 2).attr("width", y.width).attr("height", y.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1665
+ k.append("div").style("text-align", "center").style("vertical-align", "middle").html(await Co(i, Ft())), t(i, m, h, o, a, p, g, x), r(k, g);
1666
+ }
1667
+ p(s, "byKatex");
1668
+ function r(i, c) {
1669
+ for (const h in c)
1670
+ c.hasOwnProperty(h) && i.attr(h, c[h]);
1671
+ }
1672
+ return p(r, "_setTextAttrs"), function(i, c = false) {
1673
+ return c ? s : i.textPlacement === "fo" ? n : i.textPlacement === "old" ? e : t;
1674
+ };
1675
+ }(), us = /* @__PURE__ */ function() {
1676
+ function e(r, i, c, h, o, a, p) {
1677
+ const g = i.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").text(r);
1678
+ s(g, p);
1679
+ }
1680
+ p(e, "byText");
1681
+ function t(r, i, c, h, o, a, p, g) {
1682
+ const { actorFontSize: x, actorFontFamily: y, actorFontWeight: m } = g, w = r.split(Kr.lineBreakRegex);
1683
+ for (let k = 0; k < w.length; k++) {
1684
+ const N = k * x - x * (w.length - 1) / 2, S = i.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").style("font-size", x).style("font-weight", m).style("font-family", y);
1685
+ S.append("tspan").attr("x", c).attr("dy", N).text(w[k]), S.attr("y", h + a / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(S, p);
1686
+ }
1687
+ }
1688
+ p(t, "byTspan");
1689
+ function n(r, i, c, h, o, a, p, g) {
1690
+ const x = i.append("switch"), m = x.append("foreignObject").attr("x", c).attr("y", h).attr("width", o).attr("height", a).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1691
+ m.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), t(r, x, c, h, o, a, p, g), s(m, p);
1692
+ }
1693
+ p(n, "byFo");
1694
+ function s(r, i) {
1695
+ for (const c in i)
1696
+ i.hasOwnProperty(c) && r.attr(c, i[c]);
1697
+ }
1698
+ return p(s, "_setTextAttrs"), function(r) {
1699
+ return r.textPlacement === "fo" ? n : r.textPlacement === "old" ? e : t;
1700
+ };
1701
+ }(), V = {
1702
+ drawRect: Lt,
1703
+ drawText: vt,
1704
+ drawLabel: oe,
1705
+ drawActor: ts,
1706
+ drawBox: es,
1707
+ drawPopup: Ue,
1708
+ anchorElement: ss,
1709
+ drawActivation: as,
1710
+ drawLoop: rs,
1711
+ drawBackgroundRect: le,
1712
+ insertArrowHead: cs,
1713
+ insertArrowFilledHead: ls,
1714
+ insertSequenceNumber: hs,
1715
+ insertArrowCrossHead: ds,
1716
+ insertDatabaseIcon: is,
1717
+ insertComputerIcon: ns,
1718
+ insertClockIcon: os,
1719
+ getTextObj: he,
1720
+ getNoteRect: ps,
1721
+ fixLifeLineHeights: ce,
1722
+ sanitizeUrl: cC.sanitizeUrl
1723
+ }, l = {}, T = {
1724
+ data: {
1725
+ startx: void 0,
1726
+ stopx: void 0,
1727
+ starty: void 0,
1728
+ stopy: void 0
1729
+ },
1730
+ verticalPos: 0,
1731
+ sequenceItems: [],
1732
+ activations: [],
1733
+ models: {
1734
+ getHeight: /* @__PURE__ */ p(function() {
1735
+ return Math.max.apply(
1736
+ null,
1737
+ this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
1738
+ ) + (this.loops.length === 0 ? 0 : this.loops.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.messages.length === 0 ? 0 : this.messages.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.notes.length === 0 ? 0 : this.notes.map((e) => e.height || 0).reduce((e, t) => e + t));
1739
+ }, "getHeight"),
1740
+ clear: /* @__PURE__ */ p(function() {
1741
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1742
+ }, "clear"),
1743
+ addBox: /* @__PURE__ */ p(function(e) {
1744
+ this.boxes.push(e);
1745
+ }, "addBox"),
1746
+ addActor: /* @__PURE__ */ p(function(e) {
1747
+ this.actors.push(e);
1748
+ }, "addActor"),
1749
+ addLoop: /* @__PURE__ */ p(function(e) {
1750
+ this.loops.push(e);
1751
+ }, "addLoop"),
1752
+ addMessage: /* @__PURE__ */ p(function(e) {
1753
+ this.messages.push(e);
1754
+ }, "addMessage"),
1755
+ addNote: /* @__PURE__ */ p(function(e) {
1756
+ this.notes.push(e);
1757
+ }, "addNote"),
1758
+ lastActor: /* @__PURE__ */ p(function() {
1759
+ return this.actors[this.actors.length - 1];
1760
+ }, "lastActor"),
1761
+ lastLoop: /* @__PURE__ */ p(function() {
1762
+ return this.loops[this.loops.length - 1];
1763
+ }, "lastLoop"),
1764
+ lastMessage: /* @__PURE__ */ p(function() {
1765
+ return this.messages[this.messages.length - 1];
1766
+ }, "lastMessage"),
1767
+ lastNote: /* @__PURE__ */ p(function() {
1768
+ return this.notes[this.notes.length - 1];
1769
+ }, "lastNote"),
1770
+ actors: [],
1771
+ boxes: [],
1772
+ loops: [],
1773
+ messages: [],
1774
+ notes: []
1775
+ },
1776
+ init: /* @__PURE__ */ p(function() {
1777
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1778
+ startx: void 0,
1779
+ stopx: void 0,
1780
+ starty: void 0,
1781
+ stopy: void 0
1782
+ }, this.verticalPos = 0, ue(ut$1());
1783
+ }, "init"),
1784
+ updateVal: /* @__PURE__ */ p(function(e, t, n, s) {
1785
+ e[t] === void 0 ? e[t] = n : e[t] = s(n, e[t]);
1786
+ }, "updateVal"),
1787
+ updateBounds: /* @__PURE__ */ p(function(e, t, n, s) {
1788
+ const r = this;
1789
+ let i = 0;
1790
+ function c(h) {
1791
+ return /* @__PURE__ */ p(function(a) {
1792
+ i++;
1793
+ const p = r.sequenceItems.length - i + 1;
1794
+ r.updateVal(a, "starty", t - p * l.boxMargin, Math.min), r.updateVal(a, "stopy", s + p * l.boxMargin, Math.max), r.updateVal(T.data, "startx", e - p * l.boxMargin, Math.min), r.updateVal(T.data, "stopx", n + p * l.boxMargin, Math.max), h !== "activation" && (r.updateVal(a, "startx", e - p * l.boxMargin, Math.min), r.updateVal(a, "stopx", n + p * l.boxMargin, Math.max), r.updateVal(T.data, "starty", t - p * l.boxMargin, Math.min), r.updateVal(T.data, "stopy", s + p * l.boxMargin, Math.max));
1795
+ }, "updateItemBounds");
1796
+ }
1797
+ p(c, "updateFn"), this.sequenceItems.forEach(c()), this.activations.forEach(c("activation"));
1798
+ }, "updateBounds"),
1799
+ insert: /* @__PURE__ */ p(function(e, t, n, s) {
1800
+ const r = Kr.getMin(e, n), i = Kr.getMax(e, n), c = Kr.getMin(t, s), h = Kr.getMax(t, s);
1801
+ this.updateVal(T.data, "startx", r, Math.min), this.updateVal(T.data, "starty", c, Math.min), this.updateVal(T.data, "stopx", i, Math.max), this.updateVal(T.data, "stopy", h, Math.max), this.updateBounds(r, c, i, h);
1802
+ }, "insert"),
1803
+ newActivation: /* @__PURE__ */ p(function(e, t, n) {
1804
+ const s = n.get(e.from), r = Bt(e.from).length || 0, i = s.x + s.width / 2 + (r - 1) * l.activationWidth / 2;
1805
+ this.activations.push({
1806
+ startx: i,
1807
+ starty: this.verticalPos + 2,
1808
+ stopx: i + l.activationWidth,
1809
+ stopy: void 0,
1810
+ actor: e.from,
1811
+ anchored: V.anchorElement(t)
1812
+ });
1813
+ }, "newActivation"),
1814
+ endActivation: /* @__PURE__ */ p(function(e) {
1815
+ const t = this.activations.map(function(n) {
1816
+ return n.actor;
1817
+ }).lastIndexOf(e.from);
1818
+ return this.activations.splice(t, 1)[0];
1819
+ }, "endActivation"),
1820
+ createLoop: /* @__PURE__ */ p(function(e = { message: void 0, wrap: false, width: void 0 }, t) {
1821
+ return {
1822
+ startx: void 0,
1823
+ starty: this.verticalPos,
1824
+ stopx: void 0,
1825
+ stopy: void 0,
1826
+ title: e.message,
1827
+ wrap: e.wrap,
1828
+ width: e.width,
1829
+ height: 0,
1830
+ fill: t
1831
+ };
1832
+ }, "createLoop"),
1833
+ newLoop: /* @__PURE__ */ p(function(e = { message: void 0, wrap: false, width: void 0 }, t) {
1834
+ this.sequenceItems.push(this.createLoop(e, t));
1835
+ }, "newLoop"),
1836
+ endLoop: /* @__PURE__ */ p(function() {
1837
+ return this.sequenceItems.pop();
1838
+ }, "endLoop"),
1839
+ isLoopOverlap: /* @__PURE__ */ p(function() {
1840
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : false;
1841
+ }, "isLoopOverlap"),
1842
+ addSectionToLoop: /* @__PURE__ */ p(function(e) {
1843
+ const t = this.sequenceItems.pop();
1844
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: T.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
1845
+ }, "addSectionToLoop"),
1846
+ saveVerticalPos: /* @__PURE__ */ p(function() {
1847
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1848
+ }, "saveVerticalPos"),
1849
+ resetVerticalPos: /* @__PURE__ */ p(function() {
1850
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1851
+ }, "resetVerticalPos"),
1852
+ bumpVerticalPos: /* @__PURE__ */ p(function(e) {
1853
+ this.verticalPos = this.verticalPos + e, this.data.stopy = Kr.getMax(this.data.stopy, this.verticalPos);
1854
+ }, "bumpVerticalPos"),
1855
+ getVerticalPos: /* @__PURE__ */ p(function() {
1856
+ return this.verticalPos;
1857
+ }, "getVerticalPos"),
1858
+ getBounds: /* @__PURE__ */ p(function() {
1859
+ return { bounds: this.data, models: this.models };
1860
+ }, "getBounds")
1861
+ }, gs = /* @__PURE__ */ p(async function(e, t) {
1862
+ T.bumpVerticalPos(l.boxMargin), t.height = l.boxMargin, t.starty = T.getVerticalPos();
1863
+ const n = y();
1864
+ n.x = t.startx, n.y = t.starty, n.width = t.width || l.width, n.class = "note";
1865
+ const s = e.append("g"), r = V.drawRect(s, n), i = p$1();
1866
+ i.x = t.startx, i.y = t.starty, i.width = n.width, i.dy = "1em", i.text = t.message, i.class = "noteText", i.fontFamily = l.noteFontFamily, i.fontSize = l.noteFontSize, i.fontWeight = l.noteFontWeight, i.anchor = l.noteAlign, i.textMargin = l.noteMargin, i.valign = "center";
1867
+ const c = jr(i.text) ? await Dt(s, i) : vt(s, i), h = Math.round(
1868
+ c.map((o) => (o._groups || o)[0][0].getBBox().height).reduce((o, a) => o + a)
1869
+ );
1870
+ r.attr("height", h + 2 * l.noteMargin), t.height += h + 2 * l.noteMargin, T.bumpVerticalPos(h + 2 * l.noteMargin), t.stopy = t.starty + h + 2 * l.noteMargin, t.stopx = t.startx + n.width, T.insert(t.startx, t.starty, t.stopx, t.stopy), T.models.addNote(t);
1871
+ }, "drawNote"), Et = /* @__PURE__ */ p((e) => ({
1872
+ fontFamily: e.messageFontFamily,
1873
+ fontSize: e.messageFontSize,
1874
+ fontWeight: e.messageFontWeight
1875
+ }), "messageFont"), mt = /* @__PURE__ */ p((e) => ({
1876
+ fontFamily: e.noteFontFamily,
1877
+ fontSize: e.noteFontSize,
1878
+ fontWeight: e.noteFontWeight
1879
+ }), "noteFont"), Gt = /* @__PURE__ */ p((e) => ({
1880
+ fontFamily: e.actorFontFamily,
1881
+ fontSize: e.actorFontSize,
1882
+ fontWeight: e.actorFontWeight
1883
+ }), "actorFont");
1884
+ async function de(e, t) {
1885
+ T.bumpVerticalPos(10);
1886
+ const { startx: n, stopx: s, message: r } = t, i = Kr.splitBreaks(r).length, c = jr(r), h = c ? await NL(r, ut$1()) : oe$1.calculateTextDimensions(r, Et(l));
1887
+ if (!c) {
1888
+ const g = h.height / i;
1889
+ t.height += g, T.bumpVerticalPos(g);
1890
+ }
1891
+ let o, a = h.height - 10;
1892
+ const p = h.width;
1893
+ if (n === s) {
1894
+ o = T.getVerticalPos() + a, l.rightAngles || (a += l.boxMargin, o = T.getVerticalPos() + a), a += 30;
1895
+ const g = Kr.getMax(p / 2, l.width / 2);
1896
+ T.insert(
1897
+ n - g,
1898
+ T.getVerticalPos() - 10 + a,
1899
+ s + g,
1900
+ T.getVerticalPos() + 30 + a
1901
+ );
1902
+ } else
1903
+ a += l.boxMargin, o = T.getVerticalPos() + a, T.insert(n, o - 10, s, o);
1904
+ return T.bumpVerticalPos(a), t.height += a, t.stopy = t.starty + t.height, T.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), o;
1905
+ }
1906
+ p(de, "boundMessage");
1907
+ var xs = /* @__PURE__ */ p(async function(e, t, n, s) {
1908
+ const { startx: r, stopx: i, starty: c, message: h, type: o, sequenceIndex: a, sequenceVisible: p } = t, g = oe$1.calculateTextDimensions(h, Et(l)), x = p$1();
1909
+ x.x = r, x.y = c + 10, x.width = i - r, x.class = "messageText", x.dy = "1em", x.text = h, x.fontFamily = l.messageFontFamily, x.fontSize = l.messageFontSize, x.fontWeight = l.messageFontWeight, x.anchor = l.messageAlign, x.valign = "center", x.textMargin = l.wrapPadding, x.tspan = false, jr(x.text) ? await Dt(e, x, { startx: r, stopx: i, starty: n }) : vt(e, x);
1910
+ const y = g.width;
1911
+ let m;
1912
+ r === i ? l.rightAngles ? m = e.append("path").attr(
1913
+ "d",
1914
+ `M ${r},${n} H ${r + Kr.getMax(l.width / 2, y / 2)} V ${n + 25} H ${r}`
1915
+ ) : m = e.append("path").attr(
1916
+ "d",
1917
+ "M " + r + "," + n + " C " + (r + 60) + "," + (n - 10) + " " + (r + 60) + "," + (n + 30) + " " + r + "," + (n + 20)
1918
+ ) : (m = e.append("line"), m.attr("x1", r), m.attr("y1", n), m.attr("x2", i), m.attr("y2", n)), o === s.db.LINETYPE.DOTTED || o === s.db.LINETYPE.DOTTED_CROSS || o === s.db.LINETYPE.DOTTED_POINT || o === s.db.LINETYPE.DOTTED_OPEN || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED ? (m.style("stroke-dasharray", "3, 3"), m.attr("class", "messageLine1")) : m.attr("class", "messageLine0");
1919
+ let w = "";
1920
+ l.arrowMarkerAbsolute && (w = Nh(true)), m.attr("stroke-width", 2), m.attr("stroke", "none"), m.style("fill", "none"), (o === s.db.LINETYPE.SOLID || o === s.db.LINETYPE.DOTTED) && m.attr("marker-end", "url(" + w + "#arrowhead)"), (o === s.db.LINETYPE.BIDIRECTIONAL_SOLID || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (m.attr("marker-start", "url(" + w + "#arrowhead)"), m.attr("marker-end", "url(" + w + "#arrowhead)")), (o === s.db.LINETYPE.SOLID_POINT || o === s.db.LINETYPE.DOTTED_POINT) && m.attr("marker-end", "url(" + w + "#filled-head)"), (o === s.db.LINETYPE.SOLID_CROSS || o === s.db.LINETYPE.DOTTED_CROSS) && m.attr("marker-end", "url(" + w + "#crosshead)"), (p || l.showSequenceNumbers) && ((o === s.db.LINETYPE.BIDIRECTIONAL_SOLID || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (r < i ? m.attr("x1", r + 2 * 6) : m.attr("x1", r + 6)), e.append("line").attr("x1", r).attr("y1", n).attr("x2", r).attr("y2", n).attr("stroke-width", 0).attr("marker-start", "url(" + w + "#sequencenumber)"), e.append("text").attr("x", r).attr("y", n + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(a));
1921
+ }, "drawMessage"), fs = /* @__PURE__ */ p(function(e, t, n, s, r, i, c) {
1922
+ let h = 0, o = 0, a, p = 0;
1923
+ for (const g of s) {
1924
+ const x = t.get(g), y = x.box;
1925
+ a && a != y && (c || T.models.addBox(a), o += l.boxMargin + a.margin), y && y != a && (c || (y.x = h + o, y.y = r), o += y.margin), x.width = x.width || l.width, x.height = Kr.getMax(x.height || l.height, l.height), x.margin = x.margin || l.actorMargin, p = Kr.getMax(p, x.height), n.get(x.name) && (o += x.width / 2), x.x = h + o, x.starty = T.getVerticalPos(), T.insert(x.x, r, x.x + x.width, x.height), h += x.width + o, x.box && (x.box.width = h + y.margin - x.box.x), o = x.margin, a = x.box, T.models.addActor(x);
1926
+ }
1927
+ a && !c && T.models.addBox(a), T.bumpVerticalPos(p);
1928
+ }, "addActorRenderingData"), Kt = /* @__PURE__ */ p(async function(e, t, n, s) {
1929
+ if (s) {
1930
+ let r = 0;
1931
+ T.bumpVerticalPos(l.boxMargin * 2);
1932
+ for (const i of n) {
1933
+ const c = t.get(i);
1934
+ c.stopy || (c.stopy = T.getVerticalPos());
1935
+ const h = await V.drawActor(e, c, l, true);
1936
+ r = Kr.getMax(r, h);
1937
+ }
1938
+ T.bumpVerticalPos(r + l.boxMargin);
1939
+ } else
1940
+ for (const r of n) {
1941
+ const i = t.get(r);
1942
+ await V.drawActor(e, i, l, false);
1943
+ }
1944
+ }, "drawActors"), pe = /* @__PURE__ */ p(function(e, t, n, s) {
1945
+ let r = 0, i = 0;
1946
+ for (const c of n) {
1947
+ const h = t.get(c), o = Ts(h), a = V.drawPopup(
1948
+ e,
1949
+ h,
1950
+ o,
1951
+ l,
1952
+ l.forceMenus,
1953
+ s
1954
+ );
1955
+ a.height > r && (r = a.height), a.width + h.x > i && (i = a.width + h.x);
1956
+ }
1957
+ return { maxHeight: r, maxWidth: i };
1958
+ }, "drawActorsPopup"), ue = /* @__PURE__ */ p(function(e) {
1959
+ vt$1(l, e), e.fontFamily && (l.actorFontFamily = l.noteFontFamily = l.messageFontFamily = e.fontFamily), e.fontSize && (l.actorFontSize = l.noteFontSize = l.messageFontSize = e.fontSize), e.fontWeight && (l.actorFontWeight = l.noteFontWeight = l.messageFontWeight = e.fontWeight);
1960
+ }, "setConf"), Bt = /* @__PURE__ */ p(function(e) {
1961
+ return T.activations.filter(function(t) {
1962
+ return t.actor === e;
1963
+ });
1964
+ }, "actorActivations"), ae = /* @__PURE__ */ p(function(e, t) {
1965
+ const n = t.get(e), s = Bt(e), r = s.reduce(
1966
+ function(c, h) {
1967
+ return Kr.getMin(c, h.startx);
1968
+ },
1969
+ n.x + n.width / 2 - 1
1970
+ ), i = s.reduce(
1971
+ function(c, h) {
1972
+ return Kr.getMax(c, h.stopx);
1973
+ },
1974
+ n.x + n.width / 2 + 1
1975
+ );
1976
+ return [r, i];
1977
+ }, "activationBounds");
1978
+ function nt(e, t, n, s, r) {
1979
+ T.bumpVerticalPos(n);
1980
+ let i = s;
1981
+ if (t.id && t.message && e[t.id]) {
1982
+ const c = e[t.id].width, h = Et(l);
1983
+ t.message = oe$1.wrapLabel(`[${t.message}]`, c - 2 * l.wrapPadding, h), t.width = c, t.wrap = true;
1984
+ const o = oe$1.calculateTextDimensions(t.message, h), a = Kr.getMax(o.height, l.labelBoxHeight);
1985
+ i = s + a, F.debug(`${a} - ${t.message}`);
1986
+ }
1987
+ r(t), T.bumpVerticalPos(i);
1988
+ }
1989
+ p(nt, "adjustLoopHeightForWrap");
1990
+ function ge(e, t, n, s, r, i, c) {
1991
+ function h(p, g) {
1992
+ p.x < r.get(e.from).x ? (T.insert(
1993
+ t.stopx - g,
1994
+ t.starty,
1995
+ t.startx,
1996
+ t.stopy + p.height / 2 + l.noteMargin
1997
+ ), t.stopx = t.stopx + g) : (T.insert(
1998
+ t.startx,
1999
+ t.starty,
2000
+ t.stopx + g,
2001
+ t.stopy + p.height / 2 + l.noteMargin
2002
+ ), t.stopx = t.stopx - g);
2003
+ }
2004
+ p(h, "receiverAdjustment");
2005
+ function o(p, g) {
2006
+ p.x < r.get(e.to).x ? (T.insert(
2007
+ t.startx - g,
2008
+ t.starty,
2009
+ t.stopx,
2010
+ t.stopy + p.height / 2 + l.noteMargin
2011
+ ), t.startx = t.startx + g) : (T.insert(
2012
+ t.stopx,
2013
+ t.starty,
2014
+ t.startx + g,
2015
+ t.stopy + p.height / 2 + l.noteMargin
2016
+ ), t.startx = t.startx - g);
2017
+ }
2018
+ p(o, "senderAdjustment");
2019
+ const a = [
2020
+ Rt.ACTOR,
2021
+ Rt.CONTROL,
2022
+ Rt.ENTITY,
2023
+ Rt.DATABASE
2024
+ ];
2025
+ if (i.get(e.to) == s) {
2026
+ const p = r.get(e.to), g = a.includes(p.type) ? Tt / 2 + 3 : p.width / 2 + 3;
2027
+ h(p, g), p.starty = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2028
+ } else if (c.get(e.from) == s) {
2029
+ const p = r.get(e.from);
2030
+ if (l.mirrorActors) {
2031
+ const g = a.includes(p.type) ? Tt / 2 : p.width / 2;
2032
+ o(p, g);
2033
+ }
2034
+ p.stopy = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2035
+ } else if (c.get(e.to) == s) {
2036
+ const p = r.get(e.to);
2037
+ if (l.mirrorActors) {
2038
+ const g = a.includes(p.type) ? Tt / 2 + 3 : p.width / 2 + 3;
2039
+ h(p, g);
2040
+ }
2041
+ p.stopy = n - p.height / 2, T.bumpVerticalPos(p.height / 2);
2042
+ }
2043
+ }
2044
+ p(ge, "adjustCreatedDestroyedData");
2045
+ var ys = /* @__PURE__ */ p(async function(e, t, n, s) {
2046
+ const { securityLevel: r, sequence: i } = ut$1();
2047
+ l = i;
2048
+ let c;
2049
+ r === "sandbox" && (c = ht("#i" + t));
2050
+ const h = r === "sandbox" ? ht(c.nodes()[0].contentDocument.body) : ht("body"), o = r === "sandbox" ? c.nodes()[0].contentDocument : document;
2051
+ T.init(), F.debug(s.db);
2052
+ const a = r === "sandbox" ? h.select(`[id="${t}"]`) : ht(`[id="${t}"]`), p$1 = s.db.getActors(), g = s.db.getCreatedActors(), x = s.db.getDestroyedActors(), y = s.db.getBoxes();
2053
+ let m = s.db.getActorKeys();
2054
+ const w = s.db.getMessages(), k = s.db.getDiagramTitle(), N = s.db.hasAtLeastOneBox(), S = s.db.hasAtLeastOneBoxWithTitle(), O = await xe(p$1, w, s);
2055
+ if (l.height = await fe(p$1, O, y), V.insertComputerIcon(a), V.insertDatabaseIcon(a), V.insertClockIcon(a), N && (T.bumpVerticalPos(l.boxMargin), S && T.bumpVerticalPos(y[0].textMaxHeight)), l.hideUnusedParticipants === true) {
2056
+ const E = /* @__PURE__ */ new Set();
2057
+ w.forEach((_) => {
2058
+ E.add(_.from), E.add(_.to);
2059
+ }), m = m.filter((_) => E.has(_));
2060
+ }
2061
+ fs(a, p$1, g, m, 0, w, false);
2062
+ const B = await ms(w, p$1, O, s);
2063
+ V.insertArrowHead(a), V.insertArrowCrossHead(a), V.insertArrowFilledHead(a), V.insertSequenceNumber(a);
2064
+ function q(E, _) {
2065
+ const X = T.endActivation(E);
2066
+ X.starty + 18 > _ && (X.starty = _ - 6, _ += 12), V.drawActivation(
2067
+ a,
2068
+ X,
2069
+ _,
2070
+ l,
2071
+ Bt(E.from).length
2072
+ ), T.insert(X.startx, _ - 10, X.stopx, _);
2073
+ }
2074
+ p(q, "activeEnd");
2075
+ let H = 1, Z = 1;
2076
+ const at = [], U = [];
2077
+ let G = 0;
2078
+ for (const E of w) {
2079
+ let _, X, tt;
2080
+ switch (E.type) {
2081
+ case s.db.LINETYPE.NOTE:
2082
+ T.resetVerticalPos(), X = E.noteModel, await gs(a, X);
2083
+ break;
2084
+ case s.db.LINETYPE.ACTIVE_START:
2085
+ T.newActivation(E, a, p$1);
2086
+ break;
2087
+ case s.db.LINETYPE.ACTIVE_END:
2088
+ q(E, T.getVerticalPos());
2089
+ break;
2090
+ case s.db.LINETYPE.LOOP_START:
2091
+ nt(
2092
+ B,
2093
+ E,
2094
+ l.boxMargin,
2095
+ l.boxMargin + l.boxTextMargin,
2096
+ (M) => T.newLoop(M)
2097
+ );
2098
+ break;
2099
+ case s.db.LINETYPE.LOOP_END:
2100
+ _ = T.endLoop(), await V.drawLoop(a, _, "loop", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2101
+ break;
2102
+ case s.db.LINETYPE.RECT_START:
2103
+ nt(
2104
+ B,
2105
+ E,
2106
+ l.boxMargin,
2107
+ l.boxMargin,
2108
+ (M) => T.newLoop(void 0, M.message)
2109
+ );
2110
+ break;
2111
+ case s.db.LINETYPE.RECT_END:
2112
+ _ = T.endLoop(), U.push(_), T.models.addLoop(_), T.bumpVerticalPos(_.stopy - T.getVerticalPos());
2113
+ break;
2114
+ case s.db.LINETYPE.OPT_START:
2115
+ nt(
2116
+ B,
2117
+ E,
2118
+ l.boxMargin,
2119
+ l.boxMargin + l.boxTextMargin,
2120
+ (M) => T.newLoop(M)
2121
+ );
2122
+ break;
2123
+ case s.db.LINETYPE.OPT_END:
2124
+ _ = T.endLoop(), await V.drawLoop(a, _, "opt", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2125
+ break;
2126
+ case s.db.LINETYPE.ALT_START:
2127
+ nt(
2128
+ B,
2129
+ E,
2130
+ l.boxMargin,
2131
+ l.boxMargin + l.boxTextMargin,
2132
+ (M) => T.newLoop(M)
2133
+ );
2134
+ break;
2135
+ case s.db.LINETYPE.ALT_ELSE:
2136
+ nt(
2137
+ B,
2138
+ E,
2139
+ l.boxMargin + l.boxTextMargin,
2140
+ l.boxMargin,
2141
+ (M) => T.addSectionToLoop(M)
2142
+ );
2143
+ break;
2144
+ case s.db.LINETYPE.ALT_END:
2145
+ _ = T.endLoop(), await V.drawLoop(a, _, "alt", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2146
+ break;
2147
+ case s.db.LINETYPE.PAR_START:
2148
+ case s.db.LINETYPE.PAR_OVER_START:
2149
+ nt(
2150
+ B,
2151
+ E,
2152
+ l.boxMargin,
2153
+ l.boxMargin + l.boxTextMargin,
2154
+ (M) => T.newLoop(M)
2155
+ ), T.saveVerticalPos();
2156
+ break;
2157
+ case s.db.LINETYPE.PAR_AND:
2158
+ nt(
2159
+ B,
2160
+ E,
2161
+ l.boxMargin + l.boxTextMargin,
2162
+ l.boxMargin,
2163
+ (M) => T.addSectionToLoop(M)
2164
+ );
2165
+ break;
2166
+ case s.db.LINETYPE.PAR_END:
2167
+ _ = T.endLoop(), await V.drawLoop(a, _, "par", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2168
+ break;
2169
+ case s.db.LINETYPE.AUTONUMBER:
2170
+ H = E.message.start || H, Z = E.message.step || Z, E.message.visible ? s.db.enableSequenceNumbers() : s.db.disableSequenceNumbers();
2171
+ break;
2172
+ case s.db.LINETYPE.CRITICAL_START:
2173
+ nt(
2174
+ B,
2175
+ E,
2176
+ l.boxMargin,
2177
+ l.boxMargin + l.boxTextMargin,
2178
+ (M) => T.newLoop(M)
2179
+ );
2180
+ break;
2181
+ case s.db.LINETYPE.CRITICAL_OPTION:
2182
+ nt(
2183
+ B,
2184
+ E,
2185
+ l.boxMargin + l.boxTextMargin,
2186
+ l.boxMargin,
2187
+ (M) => T.addSectionToLoop(M)
2188
+ );
2189
+ break;
2190
+ case s.db.LINETYPE.CRITICAL_END:
2191
+ _ = T.endLoop(), await V.drawLoop(a, _, "critical", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2192
+ break;
2193
+ case s.db.LINETYPE.BREAK_START:
2194
+ nt(
2195
+ B,
2196
+ E,
2197
+ l.boxMargin,
2198
+ l.boxMargin + l.boxTextMargin,
2199
+ (M) => T.newLoop(M)
2200
+ );
2201
+ break;
2202
+ case s.db.LINETYPE.BREAK_END:
2203
+ _ = T.endLoop(), await V.drawLoop(a, _, "break", l), T.bumpVerticalPos(_.stopy - T.getVerticalPos()), T.models.addLoop(_);
2204
+ break;
2205
+ default:
2206
+ try {
2207
+ tt = E.msgModel, tt.starty = T.getVerticalPos(), tt.sequenceIndex = H, tt.sequenceVisible = s.db.showSequenceNumbers();
2208
+ const M = await de(a, tt);
2209
+ ge(
2210
+ E,
2211
+ tt,
2212
+ M,
2213
+ G,
2214
+ p$1,
2215
+ g,
2216
+ x
2217
+ ), at.push({ messageModel: tt, lineStartY: M }), T.models.addMessage(tt);
2218
+ } catch (M) {
2219
+ F.error("error while drawing message", M);
2220
+ }
2221
+ }
2222
+ [
2223
+ s.db.LINETYPE.SOLID_OPEN,
2224
+ s.db.LINETYPE.DOTTED_OPEN,
2225
+ s.db.LINETYPE.SOLID,
2226
+ s.db.LINETYPE.DOTTED,
2227
+ s.db.LINETYPE.SOLID_CROSS,
2228
+ s.db.LINETYPE.DOTTED_CROSS,
2229
+ s.db.LINETYPE.SOLID_POINT,
2230
+ s.db.LINETYPE.DOTTED_POINT,
2231
+ s.db.LINETYPE.BIDIRECTIONAL_SOLID,
2232
+ s.db.LINETYPE.BIDIRECTIONAL_DOTTED
2233
+ ].includes(E.type) && (H = H + Z), G++;
2234
+ }
2235
+ F.debug("createdActors", g), F.debug("destroyedActors", x), await Kt(a, p$1, m, false);
2236
+ for (const E of at)
2237
+ await xs(a, E.messageModel, E.lineStartY, s);
2238
+ l.mirrorActors && await Kt(a, p$1, m, true), U.forEach((E) => V.drawBackgroundRect(a, E)), ce(a, p$1, m, l);
2239
+ for (const E of T.models.boxes) {
2240
+ E.height = T.getVerticalPos() - E.y, T.insert(E.x, E.y, E.x + E.width, E.height);
2241
+ const _ = l.boxMargin * 2;
2242
+ E.startx = E.x - _, E.starty = E.y - _ * 0.25, E.stopx = E.startx + E.width + 2 * _, E.stopy = E.starty + E.height + _ * 0.75, E.stroke = "rgb(0,0,0, 0.5)", V.drawBox(a, E, l);
2243
+ }
2244
+ N && T.bumpVerticalPos(l.boxMargin);
2245
+ const F$1 = pe(a, p$1, m, o), { bounds: D } = T.getBounds();
2246
+ D.startx === void 0 && (D.startx = 0), D.starty === void 0 && (D.starty = 0), D.stopx === void 0 && (D.stopx = 0), D.stopy === void 0 && (D.stopy = 0);
2247
+ let $ = D.stopy - D.starty;
2248
+ $ < F$1.maxHeight && ($ = F$1.maxHeight);
2249
+ let K = $ + 2 * l.diagramMarginY;
2250
+ l.mirrorActors && (K = K - l.boxMargin + l.bottomMarginAdj);
2251
+ let j = D.stopx - D.startx;
2252
+ j < F$1.maxWidth && (j = F$1.maxWidth);
2253
+ const rt = j + 2 * l.diagramMarginX;
2254
+ k && a.append("text").text(k).attr("x", (D.stopx - D.startx) / 2 - 2 * l.diagramMarginX).attr("y", -25), zh(a, K, rt, l.useMaxWidth);
2255
+ const R = k ? 40 : 0;
2256
+ a.attr(
2257
+ "viewBox",
2258
+ D.startx - l.diagramMarginX + " -" + (l.diagramMarginY + R) + " " + rt + " " + (K + R)
2259
+ ), F.debug("models:", T.models);
2260
+ }, "draw");
2261
+ async function xe(e, t, n) {
2262
+ const s = {};
2263
+ for (const r of t)
2264
+ if (e.get(r.to) && e.get(r.from)) {
2265
+ const i = e.get(r.to);
2266
+ if (r.placement === n.db.PLACEMENT.LEFTOF && !i.prevActor || r.placement === n.db.PLACEMENT.RIGHTOF && !i.nextActor)
2267
+ continue;
2268
+ const c = r.placement !== void 0, h = !c, o = c ? mt(l) : Et(l), a = r.wrap ? oe$1.wrapLabel(r.message, l.width - 2 * l.wrapPadding, o) : r.message, g = (jr(a) ? await NL(r.message, ut$1()) : oe$1.calculateTextDimensions(a, o)).width + 2 * l.wrapPadding;
2269
+ h && r.from === i.nextActor ? s[r.to] = Kr.getMax(
2270
+ s[r.to] || 0,
2271
+ g
2272
+ ) : h && r.from === i.prevActor ? s[r.from] = Kr.getMax(
2273
+ s[r.from] || 0,
2274
+ g
2275
+ ) : h && r.from === r.to ? (s[r.from] = Kr.getMax(
2276
+ s[r.from] || 0,
2277
+ g / 2
2278
+ ), s[r.to] = Kr.getMax(
2279
+ s[r.to] || 0,
2280
+ g / 2
2281
+ )) : r.placement === n.db.PLACEMENT.RIGHTOF ? s[r.from] = Kr.getMax(
2282
+ s[r.from] || 0,
2283
+ g
2284
+ ) : r.placement === n.db.PLACEMENT.LEFTOF ? s[i.prevActor] = Kr.getMax(
2285
+ s[i.prevActor] || 0,
2286
+ g
2287
+ ) : r.placement === n.db.PLACEMENT.OVER && (i.prevActor && (s[i.prevActor] = Kr.getMax(
2288
+ s[i.prevActor] || 0,
2289
+ g / 2
2290
+ )), i.nextActor && (s[r.from] = Kr.getMax(
2291
+ s[r.from] || 0,
2292
+ g / 2
2293
+ )));
2294
+ }
2295
+ return F.debug("maxMessageWidthPerActor:", s), s;
2296
+ }
2297
+ p(xe, "getMaxMessageWidthPerActor");
2298
+ var Ts = /* @__PURE__ */ p(function(e) {
2299
+ let t = 0;
2300
+ const n = Gt(l);
2301
+ for (const s in e.links) {
2302
+ const i = oe$1.calculateTextDimensions(s, n).width + 2 * l.wrapPadding + 2 * l.boxMargin;
2303
+ t < i && (t = i);
2304
+ }
2305
+ return t;
2306
+ }, "getRequiredPopupWidth");
2307
+ async function fe(e, t, n) {
2308
+ let s = 0;
2309
+ for (const i of e.keys()) {
2310
+ const c = e.get(i);
2311
+ c.wrap && (c.description = oe$1.wrapLabel(
2312
+ c.description,
2313
+ l.width - 2 * l.wrapPadding,
2314
+ Gt(l)
2315
+ ));
2316
+ const h = jr(c.description) ? await NL(c.description, ut$1()) : oe$1.calculateTextDimensions(c.description, Gt(l));
2317
+ c.width = c.wrap ? l.width : Kr.getMax(l.width, h.width + 2 * l.wrapPadding), c.height = c.wrap ? Kr.getMax(h.height, l.height) : l.height, s = Kr.getMax(s, c.height);
2318
+ }
2319
+ for (const i in t) {
2320
+ const c = e.get(i);
2321
+ if (!c)
2322
+ continue;
2323
+ const h = e.get(c.nextActor);
2324
+ if (!h) {
2325
+ const g = t[i] + l.actorMargin - c.width / 2;
2326
+ c.margin = Kr.getMax(g, l.actorMargin);
2327
+ continue;
2328
+ }
2329
+ const a = t[i] + l.actorMargin - c.width / 2 - h.width / 2;
2330
+ c.margin = Kr.getMax(a, l.actorMargin);
2331
+ }
2332
+ let r = 0;
2333
+ return n.forEach((i) => {
2334
+ const c = Et(l);
2335
+ let h = i.actorKeys.reduce((g, x) => g += e.get(x).width + (e.get(x).margin || 0), 0);
2336
+ const o = l.boxMargin * 8;
2337
+ h += o, h -= 2 * l.boxTextMargin, i.wrap && (i.name = oe$1.wrapLabel(i.name, h - 2 * l.wrapPadding, c));
2338
+ const a = oe$1.calculateTextDimensions(i.name, c);
2339
+ r = Kr.getMax(a.height, r);
2340
+ const p = Kr.getMax(h, a.width + 2 * l.wrapPadding);
2341
+ if (i.margin = l.boxTextMargin, h < p) {
2342
+ const g = (p - h) / 2;
2343
+ i.margin += g;
2344
+ }
2345
+ }), n.forEach((i) => i.textMaxHeight = r), Kr.getMax(s, l.height);
2346
+ }
2347
+ p(fe, "calculateActorMargins");
2348
+ var Es = /* @__PURE__ */ p(async function(e, t, n) {
2349
+ const s = t.get(e.from), r = t.get(e.to), i = s.x, c = r.x, h = e.wrap && e.message;
2350
+ let o = jr(e.message) ? await NL(e.message, ut$1()) : oe$1.calculateTextDimensions(
2351
+ h ? oe$1.wrapLabel(e.message, l.width, mt(l)) : e.message,
2352
+ mt(l)
2353
+ );
2354
+ const a = {
2355
+ width: h ? l.width : Kr.getMax(l.width, o.width + 2 * l.noteMargin),
2356
+ height: 0,
2357
+ startx: s.x,
2358
+ stopx: 0,
2359
+ starty: 0,
2360
+ stopy: 0,
2361
+ message: e.message
2362
+ };
2363
+ return e.placement === n.db.PLACEMENT.RIGHTOF ? (a.width = h ? Kr.getMax(l.width, o.width) : Kr.getMax(
2364
+ s.width / 2 + r.width / 2,
2365
+ o.width + 2 * l.noteMargin
2366
+ ), a.startx = i + (s.width + l.actorMargin) / 2) : e.placement === n.db.PLACEMENT.LEFTOF ? (a.width = h ? Kr.getMax(l.width, o.width + 2 * l.noteMargin) : Kr.getMax(
2367
+ s.width / 2 + r.width / 2,
2368
+ o.width + 2 * l.noteMargin
2369
+ ), a.startx = i - a.width + (s.width - l.actorMargin) / 2) : e.to === e.from ? (o = oe$1.calculateTextDimensions(
2370
+ h ? oe$1.wrapLabel(e.message, Kr.getMax(l.width, s.width), mt(l)) : e.message,
2371
+ mt(l)
2372
+ ), a.width = h ? Kr.getMax(l.width, s.width) : Kr.getMax(s.width, l.width, o.width + 2 * l.noteMargin), a.startx = i + (s.width - a.width) / 2) : (a.width = Math.abs(i + s.width / 2 - (c + r.width / 2)) + l.actorMargin, a.startx = i < c ? i + s.width / 2 - l.actorMargin / 2 : c + r.width / 2 - l.actorMargin / 2), h && (a.message = oe$1.wrapLabel(
2373
+ e.message,
2374
+ a.width - 2 * l.wrapPadding,
2375
+ mt(l)
2376
+ )), F.debug(
2377
+ `NM:[${a.startx},${a.stopx},${a.starty},${a.stopy}:${a.width},${a.height}=${e.message}]`
2378
+ ), a;
2379
+ }, "buildNoteModel"), bs = /* @__PURE__ */ p(function(e, t, n) {
2380
+ if (![
2381
+ n.db.LINETYPE.SOLID_OPEN,
2382
+ n.db.LINETYPE.DOTTED_OPEN,
2383
+ n.db.LINETYPE.SOLID,
2384
+ n.db.LINETYPE.DOTTED,
2385
+ n.db.LINETYPE.SOLID_CROSS,
2386
+ n.db.LINETYPE.DOTTED_CROSS,
2387
+ n.db.LINETYPE.SOLID_POINT,
2388
+ n.db.LINETYPE.DOTTED_POINT,
2389
+ n.db.LINETYPE.BIDIRECTIONAL_SOLID,
2390
+ n.db.LINETYPE.BIDIRECTIONAL_DOTTED
2391
+ ].includes(e.type))
2392
+ return {};
2393
+ const [s, r] = ae(e.from, t), [i, c] = ae(e.to, t), h = s <= i;
2394
+ let o = h ? r : s, a = h ? i : c;
2395
+ const p$1 = Math.abs(i - c) > 2, g = /* @__PURE__ */ p((w) => h ? -w : w, "adjustValue");
2396
+ e.from === e.to ? a = o : (e.activate && !p$1 && (a += g(l.activationWidth / 2 - 1)), [n.db.LINETYPE.SOLID_OPEN, n.db.LINETYPE.DOTTED_OPEN].includes(e.type) || (a += g(3)), [n.db.LINETYPE.BIDIRECTIONAL_SOLID, n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
2397
+ e.type
2398
+ ) && (o -= g(3)));
2399
+ const x = [s, r, i, c], y = Math.abs(o - a);
2400
+ e.wrap && e.message && (e.message = oe$1.wrapLabel(
2401
+ e.message,
2402
+ Kr.getMax(y + 2 * l.wrapPadding, l.width),
2403
+ Et(l)
2404
+ ));
2405
+ const m = oe$1.calculateTextDimensions(e.message, Et(l));
2406
+ return {
2407
+ width: Kr.getMax(
2408
+ e.wrap ? 0 : m.width + 2 * l.wrapPadding,
2409
+ y + 2 * l.wrapPadding,
2410
+ l.width
2411
+ ),
2412
+ height: 0,
2413
+ startx: o,
2414
+ stopx: a,
2415
+ starty: 0,
2416
+ stopy: 0,
2417
+ message: e.message,
2418
+ type: e.type,
2419
+ wrap: e.wrap,
2420
+ fromBounds: Math.min.apply(null, x),
2421
+ toBounds: Math.max.apply(null, x)
2422
+ };
2423
+ }, "buildMessageModel"), ms = /* @__PURE__ */ p(async function(e, t, n, s) {
2424
+ const r = {}, i = [];
2425
+ let c, h, o;
2426
+ for (const a of e) {
2427
+ switch (a.type) {
2428
+ case s.db.LINETYPE.LOOP_START:
2429
+ case s.db.LINETYPE.ALT_START:
2430
+ case s.db.LINETYPE.OPT_START:
2431
+ case s.db.LINETYPE.PAR_START:
2432
+ case s.db.LINETYPE.PAR_OVER_START:
2433
+ case s.db.LINETYPE.CRITICAL_START:
2434
+ case s.db.LINETYPE.BREAK_START:
2435
+ i.push({
2436
+ id: a.id,
2437
+ msg: a.message,
2438
+ from: Number.MAX_SAFE_INTEGER,
2439
+ to: Number.MIN_SAFE_INTEGER,
2440
+ width: 0
2441
+ });
2442
+ break;
2443
+ case s.db.LINETYPE.ALT_ELSE:
2444
+ case s.db.LINETYPE.PAR_AND:
2445
+ case s.db.LINETYPE.CRITICAL_OPTION:
2446
+ a.message && (c = i.pop(), r[c.id] = c, r[a.id] = c, i.push(c));
2447
+ break;
2448
+ case s.db.LINETYPE.LOOP_END:
2449
+ case s.db.LINETYPE.ALT_END:
2450
+ case s.db.LINETYPE.OPT_END:
2451
+ case s.db.LINETYPE.PAR_END:
2452
+ case s.db.LINETYPE.CRITICAL_END:
2453
+ case s.db.LINETYPE.BREAK_END:
2454
+ c = i.pop(), r[c.id] = c;
2455
+ break;
2456
+ case s.db.LINETYPE.ACTIVE_START:
2457
+ {
2458
+ const g = t.get(a.from ? a.from : a.to.actor), x = Bt(a.from ? a.from : a.to.actor).length, y = g.x + g.width / 2 + (x - 1) * l.activationWidth / 2, m = {
2459
+ startx: y,
2460
+ stopx: y + l.activationWidth,
2461
+ actor: a.from,
2462
+ enabled: true
2463
+ };
2464
+ T.activations.push(m);
2465
+ }
2466
+ break;
2467
+ case s.db.LINETYPE.ACTIVE_END:
2468
+ {
2469
+ const g = T.activations.map((x) => x.actor).lastIndexOf(a.from);
2470
+ T.activations.splice(g, 1).splice(0, 1);
2471
+ }
2472
+ break;
2473
+ }
2474
+ a.placement !== void 0 ? (h = await Es(a, t, s), a.noteModel = h, i.forEach((g) => {
2475
+ c = g, c.from = Kr.getMin(c.from, h.startx), c.to = Kr.getMax(c.to, h.startx + h.width), c.width = Kr.getMax(c.width, Math.abs(c.from - c.to)) - l.labelBoxWidth;
2476
+ })) : (o = bs(a, t, s), a.msgModel = o, o.startx && o.stopx && i.length > 0 && i.forEach((g) => {
2477
+ if (c = g, o.startx === o.stopx) {
2478
+ const x = t.get(a.from), y = t.get(a.to);
2479
+ c.from = Kr.getMin(
2480
+ x.x - o.width / 2,
2481
+ x.x - x.width / 2,
2482
+ c.from
2483
+ ), c.to = Kr.getMax(
2484
+ y.x + o.width / 2,
2485
+ y.x + x.width / 2,
2486
+ c.to
2487
+ ), c.width = Kr.getMax(c.width, Math.abs(c.to - c.from)) - l.labelBoxWidth;
2488
+ } else
2489
+ c.from = Kr.getMin(o.startx, c.from), c.to = Kr.getMax(o.stopx, c.to), c.width = Kr.getMax(c.width, o.width) - l.labelBoxWidth;
2490
+ }));
2491
+ }
2492
+ return T.activations = [], F.debug("Loop type widths:", r), r;
2493
+ }, "calculateLoopBounds"), ws = {
2494
+ bounds: T,
2495
+ drawActors: Kt,
2496
+ drawActorsPopup: pe,
2497
+ setConf: ue,
2498
+ draw: ys
2499
+ }, _s = {
2500
+ parser: Ve,
2501
+ get db() {
2502
+ return new qe();
2503
+ },
2504
+ renderer: ws,
2505
+ styles: He,
2506
+ init: /* @__PURE__ */ p((e) => {
2507
+ e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, zL({ sequence: { wrap: e.wrap } }));
2508
+ }, "init")
2509
+ };
2510
+
2511
+ export { _s as diagram };
2512
+ //# sourceMappingURL=sequenceDiagram-C3RYC4MD-oePYpAJV.CBdzhzsP.js.map