@openbkn/workshop 0.2.2-rc.5 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +83 -13
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +341 -218
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,2969 @@
1
+ import { I as pr } from "./chunk-2Q5K7J3B-rT4eU6_y.js";
2
+ import { _ as f, q as Er, c as j, k as Ht, l as nt, p as Ue, d as ur, e as fr, m as N, b as He, s as _r, v as gr, a as xr, g as yr, x as Ir, y as Rr, J as Or, D as Lr, j as Ft, u as Q, a0 as tt, a1 as vt, V as Ge, a2 as br, O as zt, a3 as mr, a4 as Xe } from "./mermaid.core-yQghUlIz.js";
3
+ import { a as Sr, g as le, b as pt, d as Ar, e as he, f as de } from "./chunk-55XCU76K-dcpLOktb.js";
4
+ var ne = (function() {
5
+ var e = /* @__PURE__ */ f(function(_t, w, C, D) {
6
+ for (C = C || {}, D = _t.length; D--; C[_t[D]] = w) ;
7
+ return C;
8
+ }, "o"), t = [1, 2], a = [1, 3], r = [1, 4], i = [2, 4], o = [1, 9], s = [1, 11], n = [1, 12], h = [1, 14], d = [1, 15], E = [1, 17], u = [1, 18], _ = [1, 19], L = [1, 25], g = [1, 26], R = [1, 27], T = [1, 28], O = [1, 29], x = [1, 30], m = [1, 31], S = [1, 32], b = [1, 33], P = [1, 34], k = [1, 35], B = [1, 36], V = [1, 37], K = [1, 38], z = [1, 39], X = [1, 40], et = [1, 42], rt = [1, 43], U = [1, 44], ot = [1, 45], at = [1, 46], W = [1, 47], M = [1, 4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 48, 49, 50, 51, 53, 54, 56, 61, 62, 63, 64, 73], Z = [1, 56], Mt = [1, 75], A = [1, 81], v = [1, 82], dt = [1, 83], st = [1, 84], H = [1, 85], mt = [1, 86], pe = [1, 87], Ee = [1, 88], ue = [1, 89], fe = [1, 90], _e = [1, 91], ge = [1, 92], xe = [1, 93], ye = [1, 94], Ie = [1, 95], Re = [1, 96], Oe = [1, 97], Le = [1, 98], be = [1, 99], me = [1, 100], Se = [1, 101], Ae = [1, 102], we = [1, 103], Ne = [1, 104], Pe = [1, 105], ke = [1, 106], De = [2, 79], ve = [2, 78], Pt = [4, 5, 17, 51, 53, 54], Bt = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 51, 53, 54, 56, 61, 62, 63, 64, 73], Ce = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 50, 51, 53, 54, 56, 61, 62, 63, 64, 73], $t = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 49, 51, 53, 54, 56, 61, 62, 63, 64, 73], Me = [4, 5, 10, 14, 15, 17, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 48, 51, 53, 54, 56, 61, 62, 63, 64, 73], jt = [5, 52], F = [62, 70, 71, 72, 73], Be = [62, 73], lt = [1, 152], te = {
9
+ trace: /* @__PURE__ */ f(function() {
10
+ }, "trace"),
11
+ yy: {},
12
+ symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, INVALID: 10, box_section: 11, box_line: 12, participant_statement: 13, create: 14, box: 15, restOfLine: 16, end: 17, signal: 18, autonumber: 19, NUM: 20, off: 21, activate: 22, actor: 23, deactivate: 24, note_statement: 25, links_statement: 26, link_statement: 27, properties_statement: 28, details_statement: 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: 40, else_sections: 41, par: 42, par_sections: 43, par_over: 44, critical: 45, option_sections: 46, break: 47, option: 48, and: 49, else: 50, participant: 51, AS: 52, participant_actor: 53, destroy: 54, actor_with_config: 55, note: 56, placement: 57, text2: 58, over: 59, actor_pair: 60, links: 61, link: 62, properties: 63, details: 64, spaceList: 65, ",": 66, left_of: 67, right_of: 68, signaltype: 69, "+": 70, "-": 71, "()": 72, ACTOR: 73, config_object: 74, CONFIG_START: 75, CONFIG_CONTENT: 76, CONFIG_END: 77, SOLID_OPEN_ARROW: 78, DOTTED_OPEN_ARROW: 79, SOLID_ARROW: 80, SOLID_ARROW_TOP: 81, SOLID_ARROW_BOTTOM: 82, STICK_ARROW_TOP: 83, STICK_ARROW_BOTTOM: 84, SOLID_ARROW_TOP_DOTTED: 85, SOLID_ARROW_BOTTOM_DOTTED: 86, STICK_ARROW_TOP_DOTTED: 87, STICK_ARROW_BOTTOM_DOTTED: 88, SOLID_ARROW_TOP_REVERSE: 89, SOLID_ARROW_BOTTOM_REVERSE: 90, STICK_ARROW_TOP_REVERSE: 91, STICK_ARROW_BOTTOM_REVERSE: 92, SOLID_ARROW_TOP_REVERSE_DOTTED: 93, SOLID_ARROW_BOTTOM_REVERSE_DOTTED: 94, STICK_ARROW_TOP_REVERSE_DOTTED: 95, STICK_ARROW_BOTTOM_REVERSE_DOTTED: 96, BIDIRECTIONAL_SOLID_ARROW: 97, DOTTED_ARROW: 98, BIDIRECTIONAL_DOTTED_ARROW: 99, SOLID_CROSS: 100, DOTTED_CROSS: 101, SOLID_POINT: 102, DOTTED_POINT: 103, TXT: 104, $accept: 0, $end: 1 },
13
+ terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 10: "INVALID", 14: "create", 15: "box", 16: "restOfLine", 17: "end", 19: "autonumber", 20: "NUM", 21: "off", 22: "activate", 24: "deactivate", 30: "title", 31: "legacy_title", 32: "acc_title", 33: "acc_title_value", 34: "acc_descr", 35: "acc_descr_value", 36: "acc_descr_multiline_value", 37: "loop", 38: "rect", 39: "opt", 40: "alt", 42: "par", 44: "par_over", 45: "critical", 47: "break", 48: "option", 49: "and", 50: "else", 51: "participant", 52: "AS", 53: "participant_actor", 54: "destroy", 56: "note", 59: "over", 61: "links", 62: "link", 63: "properties", 64: "details", 66: ",", 67: "left_of", 68: "right_of", 70: "+", 71: "-", 72: "()", 73: "ACTOR", 75: "CONFIG_START", 76: "CONFIG_CONTENT", 77: "CONFIG_END", 78: "SOLID_OPEN_ARROW", 79: "DOTTED_OPEN_ARROW", 80: "SOLID_ARROW", 81: "SOLID_ARROW_TOP", 82: "SOLID_ARROW_BOTTOM", 83: "STICK_ARROW_TOP", 84: "STICK_ARROW_BOTTOM", 85: "SOLID_ARROW_TOP_DOTTED", 86: "SOLID_ARROW_BOTTOM_DOTTED", 87: "STICK_ARROW_TOP_DOTTED", 88: "STICK_ARROW_BOTTOM_DOTTED", 89: "SOLID_ARROW_TOP_REVERSE", 90: "SOLID_ARROW_BOTTOM_REVERSE", 91: "STICK_ARROW_TOP_REVERSE", 92: "STICK_ARROW_BOTTOM_REVERSE", 93: "SOLID_ARROW_TOP_REVERSE_DOTTED", 94: "SOLID_ARROW_BOTTOM_REVERSE_DOTTED", 95: "STICK_ARROW_TOP_REVERSE_DOTTED", 96: "STICK_ARROW_BOTTOM_REVERSE_DOTTED", 97: "BIDIRECTIONAL_SOLID_ARROW", 98: "DOTTED_ARROW", 99: "BIDIRECTIONAL_DOTTED_ARROW", 100: "SOLID_CROSS", 101: "DOTTED_CROSS", 102: "SOLID_POINT", 103: "DOTTED_POINT", 104: "TXT" },
14
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [8, 1], [11, 0], [11, 2], [12, 2], [12, 1], [12, 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], [46, 1], [46, 4], [43, 1], [43, 4], [41, 1], [41, 4], [13, 5], [13, 3], [13, 5], [13, 3], [13, 3], [13, 5], [13, 3], [13, 5], [13, 3], [25, 4], [25, 4], [26, 3], [27, 3], [28, 3], [29, 3], [65, 2], [65, 1], [60, 3], [60, 1], [57, 1], [57, 1], [18, 5], [18, 5], [18, 5], [18, 5], [18, 6], [18, 4], [55, 2], [74, 3], [23, 1], [23, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [69, 1], [58, 1]],
15
+ performAction: /* @__PURE__ */ f(function(w, C, D, y, G, c, kt) {
16
+ var p = c.length - 1;
17
+ switch (G) {
18
+ case 3:
19
+ return y.apply(c[p]), c[p];
20
+ case 4:
21
+ case 10:
22
+ this.$ = [];
23
+ break;
24
+ case 5:
25
+ case 11:
26
+ c[p - 1].push(c[p]), this.$ = c[p - 1];
27
+ break;
28
+ case 6:
29
+ case 7:
30
+ case 12:
31
+ case 13:
32
+ this.$ = c[p];
33
+ break;
34
+ case 8:
35
+ case 9:
36
+ case 14:
37
+ this.$ = [];
38
+ break;
39
+ case 16:
40
+ c[p].type = "createParticipant", this.$ = c[p];
41
+ break;
42
+ case 17:
43
+ c[p - 1].unshift({ type: "boxStart", boxData: y.parseBoxData(c[p - 2]) }), c[p - 1].push({ type: "boxEnd", boxText: c[p - 2] }), this.$ = c[p - 1];
44
+ break;
45
+ case 19:
46
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(c[p - 2]), sequenceIndexStep: Number(c[p - 1]), sequenceVisible: !0, signalType: y.LINETYPE.AUTONUMBER };
47
+ break;
48
+ case 20:
49
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(c[p - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: y.LINETYPE.AUTONUMBER };
50
+ break;
51
+ case 21:
52
+ this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: y.LINETYPE.AUTONUMBER };
53
+ break;
54
+ case 22:
55
+ this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: y.LINETYPE.AUTONUMBER };
56
+ break;
57
+ case 23:
58
+ this.$ = { type: "activeStart", signalType: y.LINETYPE.ACTIVE_START, actor: c[p - 1].actor };
59
+ break;
60
+ case 24:
61
+ this.$ = { type: "activeEnd", signalType: y.LINETYPE.ACTIVE_END, actor: c[p - 1].actor };
62
+ break;
63
+ case 30:
64
+ y.setDiagramTitle(c[p].substring(6)), this.$ = c[p].substring(6);
65
+ break;
66
+ case 31:
67
+ y.setDiagramTitle(c[p].substring(7)), this.$ = c[p].substring(7);
68
+ break;
69
+ case 32:
70
+ this.$ = c[p].trim(), y.setAccTitle(this.$);
71
+ break;
72
+ case 33:
73
+ case 34:
74
+ this.$ = c[p].trim(), y.setAccDescription(this.$);
75
+ break;
76
+ case 35:
77
+ c[p - 1].unshift({ type: "loopStart", loopText: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.LOOP_START }), c[p - 1].push({ type: "loopEnd", loopText: c[p - 2], signalType: y.LINETYPE.LOOP_END }), this.$ = c[p - 1];
78
+ break;
79
+ case 36:
80
+ c[p - 1].unshift({ type: "rectStart", color: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.RECT_START }), c[p - 1].push({ type: "rectEnd", color: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.RECT_END }), this.$ = c[p - 1];
81
+ break;
82
+ case 37:
83
+ c[p - 1].unshift({ type: "optStart", optText: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.OPT_START }), c[p - 1].push({ type: "optEnd", optText: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.OPT_END }), this.$ = c[p - 1];
84
+ break;
85
+ case 38:
86
+ c[p - 1].unshift({ type: "altStart", altText: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.ALT_START }), c[p - 1].push({ type: "altEnd", signalType: y.LINETYPE.ALT_END }), this.$ = c[p - 1];
87
+ break;
88
+ case 39:
89
+ c[p - 1].unshift({ type: "parStart", parText: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.PAR_START }), c[p - 1].push({ type: "parEnd", signalType: y.LINETYPE.PAR_END }), this.$ = c[p - 1];
90
+ break;
91
+ case 40:
92
+ c[p - 1].unshift({ type: "parStart", parText: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.PAR_OVER_START }), c[p - 1].push({ type: "parEnd", signalType: y.LINETYPE.PAR_END }), this.$ = c[p - 1];
93
+ break;
94
+ case 41:
95
+ c[p - 1].unshift({ type: "criticalStart", criticalText: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.CRITICAL_START }), c[p - 1].push({ type: "criticalEnd", signalType: y.LINETYPE.CRITICAL_END }), this.$ = c[p - 1];
96
+ break;
97
+ case 42:
98
+ c[p - 1].unshift({ type: "breakStart", breakText: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.BREAK_START }), c[p - 1].push({ type: "breakEnd", optText: y.parseMessage(c[p - 2]), signalType: y.LINETYPE.BREAK_END }), this.$ = c[p - 1];
99
+ break;
100
+ case 44:
101
+ this.$ = c[p - 3].concat([{ type: "option", optionText: y.parseMessage(c[p - 1]), signalType: y.LINETYPE.CRITICAL_OPTION }, c[p]]);
102
+ break;
103
+ case 46:
104
+ this.$ = c[p - 3].concat([{ type: "and", parText: y.parseMessage(c[p - 1]), signalType: y.LINETYPE.PAR_AND }, c[p]]);
105
+ break;
106
+ case 48:
107
+ this.$ = c[p - 3].concat([{ type: "else", altText: y.parseMessage(c[p - 1]), signalType: y.LINETYPE.ALT_ELSE }, c[p]]);
108
+ break;
109
+ case 49:
110
+ c[p - 3].draw = "participant", c[p - 3].type = "addParticipant", c[p - 3].description = y.parseMessage(c[p - 1]), this.$ = c[p - 3];
111
+ break;
112
+ case 50:
113
+ c[p - 1].draw = "participant", c[p - 1].type = "addParticipant", this.$ = c[p - 1];
114
+ break;
115
+ case 51:
116
+ c[p - 3].draw = "actor", c[p - 3].type = "addParticipant", c[p - 3].description = y.parseMessage(c[p - 1]), this.$ = c[p - 3];
117
+ break;
118
+ case 52:
119
+ case 57:
120
+ c[p - 1].draw = "actor", c[p - 1].type = "addParticipant", this.$ = c[p - 1];
121
+ break;
122
+ case 53:
123
+ c[p - 1].type = "destroyParticipant", this.$ = c[p - 1];
124
+ break;
125
+ case 54:
126
+ c[p - 3].draw = "participant", c[p - 3].type = "addParticipant", c[p - 3].description = y.parseMessage(c[p - 1]), this.$ = c[p - 3];
127
+ break;
128
+ case 55:
129
+ c[p - 1].draw = "participant", c[p - 1].type = "addParticipant", this.$ = c[p - 1];
130
+ break;
131
+ case 56:
132
+ c[p - 3].draw = "actor", c[p - 3].type = "addParticipant", c[p - 3].description = y.parseMessage(c[p - 1]), this.$ = c[p - 3];
133
+ break;
134
+ case 58:
135
+ this.$ = [c[p - 1], { type: "addNote", placement: c[p - 2], actor: c[p - 1].actor, text: c[p] }];
136
+ break;
137
+ case 59:
138
+ c[p - 2] = [].concat(c[p - 1], c[p - 1]).slice(0, 2), c[p - 2][0] = c[p - 2][0].actor, c[p - 2][1] = c[p - 2][1].actor, this.$ = [c[p - 1], { type: "addNote", placement: y.PLACEMENT.OVER, actor: c[p - 2].slice(0, 2), text: c[p] }];
139
+ break;
140
+ case 60:
141
+ this.$ = [c[p - 1], { type: "addLinks", actor: c[p - 1].actor, text: c[p] }];
142
+ break;
143
+ case 61:
144
+ this.$ = [c[p - 1], { type: "addALink", actor: c[p - 1].actor, text: c[p] }];
145
+ break;
146
+ case 62:
147
+ this.$ = [c[p - 1], { type: "addProperties", actor: c[p - 1].actor, text: c[p] }];
148
+ break;
149
+ case 63:
150
+ this.$ = [c[p - 1], { type: "addDetails", actor: c[p - 1].actor, text: c[p] }];
151
+ break;
152
+ case 66:
153
+ this.$ = [c[p - 2], c[p]];
154
+ break;
155
+ case 67:
156
+ this.$ = c[p];
157
+ break;
158
+ case 68:
159
+ this.$ = y.PLACEMENT.LEFTOF;
160
+ break;
161
+ case 69:
162
+ this.$ = y.PLACEMENT.RIGHTOF;
163
+ break;
164
+ case 70:
165
+ this.$ = [
166
+ c[p - 4],
167
+ c[p - 1],
168
+ { type: "addMessage", from: c[p - 4].actor, to: c[p - 1].actor, signalType: c[p - 3], msg: c[p], activate: !0 },
169
+ { type: "activeStart", signalType: y.LINETYPE.ACTIVE_START, actor: c[p - 1].actor }
170
+ ];
171
+ break;
172
+ case 71:
173
+ this.$ = [
174
+ c[p - 4],
175
+ c[p - 1],
176
+ { type: "addMessage", from: c[p - 4].actor, to: c[p - 1].actor, signalType: c[p - 3], msg: c[p] },
177
+ { type: "activeEnd", signalType: y.LINETYPE.ACTIVE_END, actor: c[p - 4].actor }
178
+ ];
179
+ break;
180
+ case 72:
181
+ this.$ = [
182
+ c[p - 4],
183
+ c[p - 1],
184
+ { type: "addMessage", from: c[p - 4].actor, to: c[p - 1].actor, signalType: c[p - 3], msg: c[p], activate: !0, centralConnection: y.LINETYPE.CENTRAL_CONNECTION },
185
+ { type: "centralConnection", signalType: y.LINETYPE.CENTRAL_CONNECTION, actor: c[p - 1].actor }
186
+ ];
187
+ break;
188
+ case 73:
189
+ this.$ = [
190
+ c[p - 4],
191
+ c[p - 1],
192
+ { type: "addMessage", from: c[p - 4].actor, to: c[p - 1].actor, signalType: c[p - 2], msg: c[p], activate: !1, centralConnection: y.LINETYPE.CENTRAL_CONNECTION_REVERSE },
193
+ { type: "centralConnectionReverse", signalType: y.LINETYPE.CENTRAL_CONNECTION_REVERSE, actor: c[p - 4].actor }
194
+ ];
195
+ break;
196
+ case 74:
197
+ this.$ = [
198
+ c[p - 5],
199
+ c[p - 1],
200
+ { type: "addMessage", from: c[p - 5].actor, to: c[p - 1].actor, signalType: c[p - 3], msg: c[p], activate: !0, centralConnection: y.LINETYPE.CENTRAL_CONNECTION_DUAL },
201
+ { type: "centralConnection", signalType: y.LINETYPE.CENTRAL_CONNECTION, actor: c[p - 1].actor },
202
+ { type: "centralConnectionReverse", signalType: y.LINETYPE.CENTRAL_CONNECTION_REVERSE, actor: c[p - 5].actor }
203
+ ];
204
+ break;
205
+ case 75:
206
+ this.$ = [c[p - 3], c[p - 1], { type: "addMessage", from: c[p - 3].actor, to: c[p - 1].actor, signalType: c[p - 2], msg: c[p] }];
207
+ break;
208
+ case 76:
209
+ this.$ = {
210
+ type: "addParticipant",
211
+ actor: c[p - 1],
212
+ config: c[p]
213
+ };
214
+ break;
215
+ case 77:
216
+ this.$ = c[p - 1].trim();
217
+ break;
218
+ case 78:
219
+ case 79:
220
+ this.$ = { type: "addParticipant", actor: c[p] };
221
+ break;
222
+ case 80:
223
+ this.$ = y.LINETYPE.SOLID_OPEN;
224
+ break;
225
+ case 81:
226
+ this.$ = y.LINETYPE.DOTTED_OPEN;
227
+ break;
228
+ case 82:
229
+ this.$ = y.LINETYPE.SOLID;
230
+ break;
231
+ case 83:
232
+ this.$ = y.LINETYPE.SOLID_TOP;
233
+ break;
234
+ case 84:
235
+ this.$ = y.LINETYPE.SOLID_BOTTOM;
236
+ break;
237
+ case 85:
238
+ this.$ = y.LINETYPE.STICK_TOP;
239
+ break;
240
+ case 86:
241
+ this.$ = y.LINETYPE.STICK_BOTTOM;
242
+ break;
243
+ case 87:
244
+ this.$ = y.LINETYPE.SOLID_TOP_DOTTED;
245
+ break;
246
+ case 88:
247
+ this.$ = y.LINETYPE.SOLID_BOTTOM_DOTTED;
248
+ break;
249
+ case 89:
250
+ this.$ = y.LINETYPE.STICK_TOP_DOTTED;
251
+ break;
252
+ case 90:
253
+ this.$ = y.LINETYPE.STICK_BOTTOM_DOTTED;
254
+ break;
255
+ case 91:
256
+ this.$ = y.LINETYPE.SOLID_ARROW_TOP_REVERSE;
257
+ break;
258
+ case 92:
259
+ this.$ = y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;
260
+ break;
261
+ case 93:
262
+ this.$ = y.LINETYPE.STICK_ARROW_TOP_REVERSE;
263
+ break;
264
+ case 94:
265
+ this.$ = y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;
266
+ break;
267
+ case 95:
268
+ this.$ = y.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;
269
+ break;
270
+ case 96:
271
+ this.$ = y.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;
272
+ break;
273
+ case 97:
274
+ this.$ = y.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;
275
+ break;
276
+ case 98:
277
+ this.$ = y.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;
278
+ break;
279
+ case 99:
280
+ this.$ = y.LINETYPE.BIDIRECTIONAL_SOLID;
281
+ break;
282
+ case 100:
283
+ this.$ = y.LINETYPE.DOTTED;
284
+ break;
285
+ case 101:
286
+ this.$ = y.LINETYPE.BIDIRECTIONAL_DOTTED;
287
+ break;
288
+ case 102:
289
+ this.$ = y.LINETYPE.SOLID_CROSS;
290
+ break;
291
+ case 103:
292
+ this.$ = y.LINETYPE.DOTTED_CROSS;
293
+ break;
294
+ case 104:
295
+ this.$ = y.LINETYPE.SOLID_POINT;
296
+ break;
297
+ case 105:
298
+ this.$ = y.LINETYPE.DOTTED_POINT;
299
+ break;
300
+ case 106:
301
+ this.$ = y.parseMessage(c[p].trim().substring(1));
302
+ break;
303
+ }
304
+ }, "anonymous"),
305
+ table: [{ 3: 1, 4: t, 5: a, 6: r }, { 1: [3] }, { 3: 5, 4: t, 5: a, 6: r }, { 3: 6, 4: t, 5: a, 6: r }, e([1, 4, 5, 10, 14, 15, 19, 22, 24, 30, 31, 32, 34, 36, 37, 38, 39, 40, 42, 44, 45, 47, 51, 53, 54, 56, 61, 62, 63, 64, 73], i, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: o, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: h, 15: d, 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: T, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, e(M, [2, 5]), { 9: 48, 13: 13, 14: h, 15: d, 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: T, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, e(M, [2, 7]), e(M, [2, 8]), e(M, [2, 9]), e(M, [2, 15]), { 13: 49, 51: K, 53: z, 54: X }, { 16: [1, 50] }, { 5: [1, 51] }, { 5: [1, 54], 20: [1, 52], 21: [1, 53] }, { 23: 55, 62: Z, 73: W }, { 23: 57, 62: Z, 73: W }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, { 5: [1, 61] }, { 5: [1, 62] }, e(M, [2, 30]), e(M, [2, 31]), { 33: [1, 63] }, { 35: [1, 64] }, e(M, [2, 34]), { 16: [1, 65] }, { 16: [1, 66] }, { 16: [1, 67] }, { 16: [1, 68] }, { 16: [1, 69] }, { 16: [1, 70] }, { 16: [1, 71] }, { 16: [1, 72] }, { 23: 73, 55: 74, 62: Z, 73: Mt }, { 23: 76, 55: 77, 62: Z, 73: Mt }, { 23: 78, 62: Z, 73: W }, { 69: 79, 72: [1, 80], 78: A, 79: v, 80: dt, 81: st, 82: H, 83: mt, 84: pe, 85: Ee, 86: ue, 87: fe, 88: _e, 89: ge, 90: xe, 91: ye, 92: Ie, 93: Re, 94: Oe, 95: Le, 96: be, 97: me, 98: Se, 99: Ae, 100: we, 101: Ne, 102: Pe, 103: ke }, { 57: 107, 59: [1, 108], 67: [1, 109], 68: [1, 110] }, { 23: 111, 62: Z, 73: W }, e([72, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103], De, { 23: 112, 62: Z, 73: W }), { 23: 113, 62: Z, 73: W }, { 23: 114, 62: Z, 73: W }, e([5, 66, 72, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104], ve), e(M, [2, 6]), e(M, [2, 16]), e(Pt, [2, 10], { 11: 115 }), e(M, [2, 18]), { 5: [1, 117], 20: [1, 116] }, { 5: [1, 118] }, e(M, [2, 22]), { 5: [1, 119] }, e([5, 52, 66, 104], De), { 5: [1, 120] }, e(M, [2, 25]), e(M, [2, 26]), e(M, [2, 27]), e(M, [2, 28]), e(M, [2, 29]), e(M, [2, 32]), e(M, [2, 33]), e(Bt, i, { 7: 121 }), e(Bt, i, { 7: 122 }), e(Bt, i, { 7: 123 }), e(Ce, i, { 41: 124, 7: 125 }), e($t, i, { 43: 126, 7: 127 }), e($t, i, { 7: 127, 43: 128 }), e(Me, i, { 46: 129, 7: 130 }), e(Bt, i, { 7: 131 }), { 5: [1, 133], 52: [1, 132] }, { 5: [1, 135], 52: [1, 134] }, e(jt, ve, { 74: 136, 75: [1, 137] }), { 5: [1, 139], 52: [1, 138] }, { 5: [1, 141], 52: [1, 140] }, { 5: [1, 142] }, { 23: 146, 62: Z, 70: [1, 143], 71: [1, 144], 72: [1, 145], 73: W }, { 69: 147, 78: A, 79: v, 80: dt, 81: st, 82: H, 83: mt, 84: pe, 85: Ee, 86: ue, 87: fe, 88: _e, 89: ge, 90: xe, 91: ye, 92: Ie, 93: Re, 94: Oe, 95: Le, 96: be, 97: me, 98: Se, 99: Ae, 100: we, 101: Ne, 102: Pe, 103: ke }, e(F, [2, 80]), e(F, [2, 81]), e(F, [2, 82]), e(F, [2, 83]), e(F, [2, 84]), e(F, [2, 85]), e(F, [2, 86]), e(F, [2, 87]), e(F, [2, 88]), e(F, [2, 89]), e(F, [2, 90]), e(F, [2, 91]), e(F, [2, 92]), e(F, [2, 93]), e(F, [2, 94]), e(F, [2, 95]), e(F, [2, 96]), e(F, [2, 97]), e(F, [2, 98]), e(F, [2, 99]), e(F, [2, 100]), e(F, [2, 101]), e(F, [2, 102]), e(F, [2, 103]), e(F, [2, 104]), e(F, [2, 105]), { 23: 148, 62: Z, 73: W }, { 23: 150, 60: 149, 62: Z, 73: W }, e(Be, [2, 68]), e(Be, [2, 69]), { 58: 151, 104: lt }, { 58: 153, 104: lt }, { 58: 154, 104: lt }, { 58: 155, 104: lt }, { 4: [1, 158], 5: [1, 160], 12: 157, 13: 159, 17: [1, 156], 51: K, 53: z, 54: X }, { 5: [1, 161] }, e(M, [2, 20]), e(M, [2, 21]), e(M, [2, 23]), e(M, [2, 24]), { 4: o, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: h, 15: d, 17: [1, 162], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: T, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 4: o, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: h, 15: d, 17: [1, 163], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: T, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 4: o, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: h, 15: d, 17: [1, 164], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: T, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 17: [1, 165] }, { 4: o, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: h, 15: d, 17: [2, 47], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: T, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 50: [1, 166], 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 17: [1, 167] }, { 4: o, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: h, 15: d, 17: [2, 45], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: T, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 49: [1, 168], 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 17: [1, 169] }, { 17: [1, 170] }, { 4: o, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: h, 15: d, 17: [2, 43], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: T, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 48: [1, 171], 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 4: o, 5: s, 8: 8, 9: 10, 10: n, 13: 13, 14: h, 15: d, 17: [1, 172], 18: 16, 19: E, 22: u, 23: 41, 24: _, 25: 20, 26: 21, 27: 22, 28: 23, 29: 24, 30: L, 31: g, 32: R, 34: T, 36: O, 37: x, 38: m, 39: S, 40: b, 42: P, 44: k, 45: B, 47: V, 51: K, 53: z, 54: X, 56: et, 61: rt, 62: U, 63: ot, 64: at, 73: W }, { 16: [1, 173] }, e(M, [2, 50]), { 16: [1, 174] }, e(M, [2, 55]), e(jt, [2, 76]), { 76: [1, 175] }, { 16: [1, 176] }, e(M, [2, 52]), { 16: [1, 177] }, e(M, [2, 57]), e(M, [2, 53]), { 23: 178, 62: Z, 73: W }, { 23: 179, 62: Z, 73: W }, { 23: 180, 62: Z, 73: W }, { 58: 181, 104: lt }, { 23: 182, 62: Z, 72: [1, 183], 73: W }, { 58: 184, 104: lt }, { 58: 185, 104: lt }, { 66: [1, 186], 104: [2, 67] }, { 5: [2, 60] }, { 5: [2, 106] }, { 5: [2, 61] }, { 5: [2, 62] }, { 5: [2, 63] }, e(M, [2, 17]), e(Pt, [2, 11]), { 13: 187, 51: K, 53: z, 54: X }, e(Pt, [2, 13]), e(Pt, [2, 14]), e(M, [2, 19]), e(M, [2, 35]), e(M, [2, 36]), e(M, [2, 37]), e(M, [2, 38]), { 16: [1, 188] }, e(M, [2, 39]), { 16: [1, 189] }, e(M, [2, 40]), e(M, [2, 41]), { 16: [1, 190] }, e(M, [2, 42]), { 5: [1, 191] }, { 5: [1, 192] }, { 77: [1, 193] }, { 5: [1, 194] }, { 5: [1, 195] }, { 58: 196, 104: lt }, { 58: 197, 104: lt }, { 58: 198, 104: lt }, { 5: [2, 75] }, { 58: 199, 104: lt }, { 23: 200, 62: Z, 73: W }, { 5: [2, 58] }, { 5: [2, 59] }, { 23: 201, 62: Z, 73: W }, e(Pt, [2, 12]), e(Ce, i, { 7: 125, 41: 202 }), e($t, i, { 7: 127, 43: 203 }), e(Me, i, { 7: 130, 46: 204 }), e(M, [2, 49]), e(M, [2, 54]), e(jt, [2, 77]), e(M, [2, 51]), e(M, [2, 56]), { 5: [2, 70] }, { 5: [2, 71] }, { 5: [2, 72] }, { 5: [2, 73] }, { 58: 205, 104: lt }, { 104: [2, 66] }, { 17: [2, 48] }, { 17: [2, 46] }, { 17: [2, 44] }, { 5: [2, 74] }],
306
+ defaultActions: { 5: [2, 1], 6: [2, 2], 151: [2, 60], 152: [2, 106], 153: [2, 61], 154: [2, 62], 155: [2, 63], 181: [2, 75], 184: [2, 58], 185: [2, 59], 196: [2, 70], 197: [2, 71], 198: [2, 72], 199: [2, 73], 201: [2, 66], 202: [2, 48], 203: [2, 46], 204: [2, 44], 205: [2, 74] },
307
+ parseError: /* @__PURE__ */ f(function(w, C) {
308
+ if (C.recoverable)
309
+ this.trace(w);
310
+ else {
311
+ var D = new Error(w);
312
+ throw D.hash = C, D;
313
+ }
314
+ }, "parseError"),
315
+ parse: /* @__PURE__ */ f(function(w) {
316
+ var C = this, D = [0], y = [], G = [null], c = [], kt = this.table, p = "", Vt = 0, Ye = 0, lr = 2, Ve = 1, hr = c.slice.call(arguments, 1), $ = Object.create(this.lexer), It = { yy: {} };
317
+ for (var ee in this.yy)
318
+ Object.prototype.hasOwnProperty.call(this.yy, ee) && (It.yy[ee] = this.yy[ee]);
319
+ $.setInput(w, It.yy), It.yy.lexer = $, It.yy.parser = this, typeof $.yylloc > "u" && ($.yylloc = {});
320
+ var re = $.yylloc;
321
+ c.push(re);
322
+ var dr = $.options && $.options.ranges;
323
+ typeof It.yy.parseError == "function" ? this.parseError = It.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
324
+ function Tr(ct) {
325
+ D.length = D.length - 2 * ct, G.length = G.length - ct, c.length = c.length - ct;
326
+ }
327
+ f(Tr, "popStack");
328
+ function We() {
329
+ var ct;
330
+ return ct = y.pop() || $.lex() || Ve, typeof ct != "number" && (ct instanceof Array && (y = ct, ct = y.pop()), ct = C.symbols_[ct] || ct), ct;
331
+ }
332
+ f(We, "lex");
333
+ for (var it, Rt, ht, ae, St = {}, Wt, Et, Ke, Kt; ; ) {
334
+ if (Rt = D[D.length - 1], this.defaultActions[Rt] ? ht = this.defaultActions[Rt] : ((it === null || typeof it > "u") && (it = We()), ht = kt[Rt] && kt[Rt][it]), typeof ht > "u" || !ht.length || !ht[0]) {
335
+ var se = "";
336
+ Kt = [];
337
+ for (Wt in kt[Rt])
338
+ this.terminals_[Wt] && Wt > lr && Kt.push("'" + this.terminals_[Wt] + "'");
339
+ $.showPosition ? se = "Parse error on line " + (Vt + 1) + `:
340
+ ` + $.showPosition() + `
341
+ Expecting ` + Kt.join(", ") + ", got '" + (this.terminals_[it] || it) + "'" : se = "Parse error on line " + (Vt + 1) + ": Unexpected " + (it == Ve ? "end of input" : "'" + (this.terminals_[it] || it) + "'"), this.parseError(se, {
342
+ text: $.match,
343
+ token: this.terminals_[it] || it,
344
+ line: $.yylineno,
345
+ loc: re,
346
+ expected: Kt
347
+ });
348
+ }
349
+ if (ht[0] instanceof Array && ht.length > 1)
350
+ throw new Error("Parse Error: multiple actions possible at state: " + Rt + ", token: " + it);
351
+ switch (ht[0]) {
352
+ case 1:
353
+ D.push(it), G.push($.yytext), c.push($.yylloc), D.push(ht[1]), it = null, Ye = $.yyleng, p = $.yytext, Vt = $.yylineno, re = $.yylloc;
354
+ break;
355
+ case 2:
356
+ if (Et = this.productions_[ht[1]][1], St.$ = G[G.length - Et], St._$ = {
357
+ first_line: c[c.length - (Et || 1)].first_line,
358
+ last_line: c[c.length - 1].last_line,
359
+ first_column: c[c.length - (Et || 1)].first_column,
360
+ last_column: c[c.length - 1].last_column
361
+ }, dr && (St._$.range = [
362
+ c[c.length - (Et || 1)].range[0],
363
+ c[c.length - 1].range[1]
364
+ ]), ae = this.performAction.apply(St, [
365
+ p,
366
+ Ye,
367
+ Vt,
368
+ It.yy,
369
+ ht[1],
370
+ G,
371
+ c
372
+ ].concat(hr)), typeof ae < "u")
373
+ return ae;
374
+ Et && (D = D.slice(0, -1 * Et * 2), G = G.slice(0, -1 * Et), c = c.slice(0, -1 * Et)), D.push(this.productions_[ht[1]][0]), G.push(St.$), c.push(St._$), Ke = kt[D[D.length - 2]][D[D.length - 1]], D.push(Ke);
375
+ break;
376
+ case 3:
377
+ return !0;
378
+ }
379
+ }
380
+ return !0;
381
+ }, "parse")
382
+ }, cr = /* @__PURE__ */ (function() {
383
+ var _t = {
384
+ EOF: 1,
385
+ parseError: /* @__PURE__ */ f(function(C, D) {
386
+ if (this.yy.parser)
387
+ this.yy.parser.parseError(C, D);
388
+ else
389
+ throw new Error(C);
390
+ }, "parseError"),
391
+ // resets the lexer, sets new input
392
+ setInput: /* @__PURE__ */ f(function(w, C) {
393
+ return this.yy = C || this.yy || {}, this._input = w, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
394
+ first_line: 1,
395
+ first_column: 0,
396
+ last_line: 1,
397
+ last_column: 0
398
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
399
+ }, "setInput"),
400
+ // consumes and returns one char from the input
401
+ input: /* @__PURE__ */ f(function() {
402
+ var w = this._input[0];
403
+ this.yytext += w, this.yyleng++, this.offset++, this.match += w, this.matched += w;
404
+ var C = w.match(/(?:\r\n?|\n).*/g);
405
+ return C ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), w;
406
+ }, "input"),
407
+ // unshifts one char (or a string) into the input
408
+ unput: /* @__PURE__ */ f(function(w) {
409
+ var C = w.length, D = w.split(/(?:\r\n?|\n)/g);
410
+ this._input = w + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - C), this.offset -= C;
411
+ var y = this.match.split(/(?:\r\n?|\n)/g);
412
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), D.length - 1 && (this.yylineno -= D.length - 1);
413
+ var G = this.yylloc.range;
414
+ return this.yylloc = {
415
+ first_line: this.yylloc.first_line,
416
+ last_line: this.yylineno + 1,
417
+ first_column: this.yylloc.first_column,
418
+ last_column: D ? (D.length === y.length ? this.yylloc.first_column : 0) + y[y.length - D.length].length - D[0].length : this.yylloc.first_column - C
419
+ }, this.options.ranges && (this.yylloc.range = [G[0], G[0] + this.yyleng - C]), this.yyleng = this.yytext.length, this;
420
+ }, "unput"),
421
+ // When called from action, caches matched text and appends it on next action
422
+ more: /* @__PURE__ */ f(function() {
423
+ return this._more = !0, this;
424
+ }, "more"),
425
+ // 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.
426
+ reject: /* @__PURE__ */ f(function() {
427
+ if (this.options.backtrack_lexer)
428
+ this._backtrack = !0;
429
+ else
430
+ 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).
431
+ ` + this.showPosition(), {
432
+ text: "",
433
+ token: null,
434
+ line: this.yylineno
435
+ });
436
+ return this;
437
+ }, "reject"),
438
+ // retain first n characters of the match
439
+ less: /* @__PURE__ */ f(function(w) {
440
+ this.unput(this.match.slice(w));
441
+ }, "less"),
442
+ // displays already matched input, i.e. for error messages
443
+ pastInput: /* @__PURE__ */ f(function() {
444
+ var w = this.matched.substr(0, this.matched.length - this.match.length);
445
+ return (w.length > 20 ? "..." : "") + w.substr(-20).replace(/\n/g, "");
446
+ }, "pastInput"),
447
+ // displays upcoming input, i.e. for error messages
448
+ upcomingInput: /* @__PURE__ */ f(function() {
449
+ var w = this.match;
450
+ return w.length < 20 && (w += this._input.substr(0, 20 - w.length)), (w.substr(0, 20) + (w.length > 20 ? "..." : "")).replace(/\n/g, "");
451
+ }, "upcomingInput"),
452
+ // displays the character position where the lexing error occurred, i.e. for error messages
453
+ showPosition: /* @__PURE__ */ f(function() {
454
+ var w = this.pastInput(), C = new Array(w.length + 1).join("-");
455
+ return w + this.upcomingInput() + `
456
+ ` + C + "^";
457
+ }, "showPosition"),
458
+ // test the lexed token: return FALSE when not a match, otherwise return token
459
+ test_match: /* @__PURE__ */ f(function(w, C) {
460
+ var D, y, G;
461
+ if (this.options.backtrack_lexer && (G = {
462
+ yylineno: this.yylineno,
463
+ yylloc: {
464
+ first_line: this.yylloc.first_line,
465
+ last_line: this.last_line,
466
+ first_column: this.yylloc.first_column,
467
+ last_column: this.yylloc.last_column
468
+ },
469
+ yytext: this.yytext,
470
+ match: this.match,
471
+ matches: this.matches,
472
+ matched: this.matched,
473
+ yyleng: this.yyleng,
474
+ offset: this.offset,
475
+ _more: this._more,
476
+ _input: this._input,
477
+ yy: this.yy,
478
+ conditionStack: this.conditionStack.slice(0),
479
+ done: this.done
480
+ }, this.options.ranges && (G.yylloc.range = this.yylloc.range.slice(0))), y = w[0].match(/(?:\r\n?|\n).*/g), y && (this.yylineno += y.length), this.yylloc = {
481
+ first_line: this.yylloc.last_line,
482
+ last_line: this.yylineno + 1,
483
+ first_column: this.yylloc.last_column,
484
+ last_column: y ? y[y.length - 1].length - y[y.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + w[0].length
485
+ }, this.yytext += w[0], this.match += w[0], this.matches = w, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(w[0].length), this.matched += w[0], D = this.performAction.call(this, this.yy, this, C, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), D)
486
+ return D;
487
+ if (this._backtrack) {
488
+ for (var c in G)
489
+ this[c] = G[c];
490
+ return !1;
491
+ }
492
+ return !1;
493
+ }, "test_match"),
494
+ // return next match in input
495
+ next: /* @__PURE__ */ f(function() {
496
+ if (this.done)
497
+ return this.EOF;
498
+ this._input || (this.done = !0);
499
+ var w, C, D, y;
500
+ this._more || (this.yytext = "", this.match = "");
501
+ for (var G = this._currentRules(), c = 0; c < G.length; c++)
502
+ if (D = this._input.match(this.rules[G[c]]), D && (!C || D[0].length > C[0].length)) {
503
+ if (C = D, y = c, this.options.backtrack_lexer) {
504
+ if (w = this.test_match(D, G[c]), w !== !1)
505
+ return w;
506
+ if (this._backtrack) {
507
+ C = !1;
508
+ continue;
509
+ } else
510
+ return !1;
511
+ } else if (!this.options.flex)
512
+ break;
513
+ }
514
+ return C ? (w = this.test_match(C, G[y]), w !== !1 ? w : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
515
+ ` + this.showPosition(), {
516
+ text: "",
517
+ token: null,
518
+ line: this.yylineno
519
+ });
520
+ }, "next"),
521
+ // return next match that has a token
522
+ lex: /* @__PURE__ */ f(function() {
523
+ var C = this.next();
524
+ return C || this.lex();
525
+ }, "lex"),
526
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
527
+ begin: /* @__PURE__ */ f(function(C) {
528
+ this.conditionStack.push(C);
529
+ }, "begin"),
530
+ // pop the previously active lexer condition state off the condition stack
531
+ popState: /* @__PURE__ */ f(function() {
532
+ var C = this.conditionStack.length - 1;
533
+ return C > 0 ? this.conditionStack.pop() : this.conditionStack[0];
534
+ }, "popState"),
535
+ // produce the lexer rule set which is active for the currently active lexer condition state
536
+ _currentRules: /* @__PURE__ */ f(function() {
537
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
538
+ }, "_currentRules"),
539
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
540
+ topState: /* @__PURE__ */ f(function(C) {
541
+ return C = this.conditionStack.length - 1 - Math.abs(C || 0), C >= 0 ? this.conditionStack[C] : "INITIAL";
542
+ }, "topState"),
543
+ // alias for begin(condition)
544
+ pushState: /* @__PURE__ */ f(function(C) {
545
+ this.begin(C);
546
+ }, "pushState"),
547
+ // return the number of states currently on the stack
548
+ stateStackSize: /* @__PURE__ */ f(function() {
549
+ return this.conditionStack.length;
550
+ }, "stateStackSize"),
551
+ options: { "case-insensitive": !0 },
552
+ performAction: /* @__PURE__ */ f(function(C, D, y, G) {
553
+ switch (y) {
554
+ case 0:
555
+ return 5;
556
+ case 1:
557
+ break;
558
+ case 2:
559
+ break;
560
+ case 3:
561
+ break;
562
+ case 4:
563
+ break;
564
+ case 5:
565
+ break;
566
+ case 6:
567
+ return 20;
568
+ case 7:
569
+ return this.begin("CONFIG"), 75;
570
+ case 8:
571
+ return 76;
572
+ case 9:
573
+ return this.popState(), this.begin("ALIAS"), 77;
574
+ case 10:
575
+ return this.popState(), this.popState(), 77;
576
+ case 11:
577
+ return D.yytext = D.yytext.trim(), 73;
578
+ case 12:
579
+ return D.yytext = D.yytext.trim(), this.begin("ALIAS"), 73;
580
+ case 13:
581
+ return D.yytext = D.yytext.trim(), this.popState(), 73;
582
+ case 14:
583
+ return this.popState(), 10;
584
+ case 15:
585
+ return D.yytext = D.yytext.trim(), this.popState(), 10;
586
+ case 16:
587
+ return this.begin("LINE"), 15;
588
+ case 17:
589
+ return this.begin("ID"), 51;
590
+ case 18:
591
+ return this.begin("ID"), 53;
592
+ case 19:
593
+ return 14;
594
+ case 20:
595
+ return this.begin("ID"), 54;
596
+ case 21:
597
+ return this.popState(), this.popState(), this.begin("LINE"), 52;
598
+ case 22:
599
+ return this.popState(), this.popState(), 5;
600
+ case 23:
601
+ return this.begin("LINE"), 37;
602
+ case 24:
603
+ return this.begin("LINE"), 38;
604
+ case 25:
605
+ return this.begin("LINE"), 39;
606
+ case 26:
607
+ return this.begin("LINE"), 40;
608
+ case 27:
609
+ return this.begin("LINE"), 50;
610
+ case 28:
611
+ return this.begin("LINE"), 42;
612
+ case 29:
613
+ return this.begin("LINE"), 44;
614
+ case 30:
615
+ return this.begin("LINE"), 49;
616
+ case 31:
617
+ return this.begin("LINE"), 45;
618
+ case 32:
619
+ return this.begin("LINE"), 48;
620
+ case 33:
621
+ return this.begin("LINE"), 47;
622
+ case 34:
623
+ return this.popState(), 16;
624
+ case 35:
625
+ return 17;
626
+ case 36:
627
+ return 67;
628
+ case 37:
629
+ return 68;
630
+ case 38:
631
+ return 61;
632
+ case 39:
633
+ return 62;
634
+ case 40:
635
+ return 63;
636
+ case 41:
637
+ return 64;
638
+ case 42:
639
+ return 59;
640
+ case 43:
641
+ return 56;
642
+ case 44:
643
+ return this.begin("ID"), 22;
644
+ case 45:
645
+ return this.begin("ID"), 24;
646
+ case 46:
647
+ return 30;
648
+ case 47:
649
+ return 31;
650
+ case 48:
651
+ return this.begin("acc_title"), 32;
652
+ case 49:
653
+ return this.popState(), "acc_title_value";
654
+ case 50:
655
+ return this.begin("acc_descr"), 34;
656
+ case 51:
657
+ return this.popState(), "acc_descr_value";
658
+ case 52:
659
+ this.begin("acc_descr_multiline");
660
+ break;
661
+ case 53:
662
+ this.popState();
663
+ break;
664
+ case 54:
665
+ return "acc_descr_multiline_value";
666
+ case 55:
667
+ return 6;
668
+ case 56:
669
+ return 19;
670
+ case 57:
671
+ return 21;
672
+ case 58:
673
+ return 66;
674
+ case 59:
675
+ return 5;
676
+ case 60:
677
+ return D.yytext = D.yytext.trim(), 73;
678
+ case 61:
679
+ return 80;
680
+ case 62:
681
+ return 97;
682
+ case 63:
683
+ return 98;
684
+ case 64:
685
+ return 99;
686
+ case 65:
687
+ return 78;
688
+ case 66:
689
+ return 79;
690
+ case 67:
691
+ return 100;
692
+ case 68:
693
+ return 101;
694
+ case 69:
695
+ return 102;
696
+ case 70:
697
+ return 103;
698
+ case 71:
699
+ return 85;
700
+ case 72:
701
+ return 86;
702
+ case 73:
703
+ return 87;
704
+ case 74:
705
+ return 88;
706
+ case 75:
707
+ return 93;
708
+ case 76:
709
+ return 94;
710
+ case 77:
711
+ return 95;
712
+ case 78:
713
+ return 96;
714
+ case 79:
715
+ return 81;
716
+ case 80:
717
+ return 82;
718
+ case 81:
719
+ return 83;
720
+ case 82:
721
+ return 84;
722
+ case 83:
723
+ return 89;
724
+ case 84:
725
+ return 90;
726
+ case 85:
727
+ return 91;
728
+ case 86:
729
+ return 92;
730
+ case 87:
731
+ return 104;
732
+ case 88:
733
+ return 104;
734
+ case 89:
735
+ return 70;
736
+ case 90:
737
+ return 71;
738
+ case 91:
739
+ return 72;
740
+ case 92:
741
+ return 5;
742
+ case 93:
743
+ return 10;
744
+ }
745
+ }, "anonymous"),
746
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i, /^(?:@\{)/i, /^(?:[^\}]+)/i, /^(?:\}(?=\s+as\s))/i, /^(?:\})/i, /^(?:[^<>:\n,;@\s]+(?=\s*@\{))/i, /^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i, /^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i, /^(?:[^<>:\n,;@]*<[^\n]*)/i, /^(?:[^\n]+)/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/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(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/i, /^(?:link(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/i, /^(?:properties(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/i, /^(?:details(?=[ \t]+[^\/\\\+\(\)<>:\n,;\s\-]))/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, /^(?:--\|\\)/i, /^(?:--\|\/)/i, /^(?:--\\\\)/i, /^(?:--\/\/)/i, /^(?:\/\|--)/i, /^(?:\\\|--)/i, /^(?:\/\/--)/i, /^(?:\\\\--)/i, /^(?:-\|\\)/i, /^(?:-\|\/)/i, /^(?:-\\\\)/i, /^(?:-\/\/)/i, /^(?:\/\|-)/i, /^(?:\\\|-)/i, /^(?:\/\/-)/i, /^(?:\\\\-)/i, /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i, /^(?::)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:\(\))/i, /^(?:$)/i, /^(?:.)/i],
747
+ conditions: { acc_descr_multiline: { rules: [53, 54], inclusive: !1 }, acc_descr: { rules: [51], inclusive: !1 }, acc_title: { rules: [49], inclusive: !1 }, ID: { rules: [2, 3, 7, 11, 12, 13, 14, 15], inclusive: !1 }, ALIAS: { rules: [2, 3, 21, 22], inclusive: !1 }, LINE: { rules: [2, 3, 34], inclusive: !1 }, CONFIG: { rules: [8, 9, 10], inclusive: !1 }, CONFIG_DATA: { rules: [], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 52, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], inclusive: !0 } }
748
+ };
749
+ return _t;
750
+ })();
751
+ te.lexer = cr;
752
+ function Yt() {
753
+ this.yy = {};
754
+ }
755
+ return f(Yt, "Parser"), Yt.prototype = te, te.Parser = Yt, new Yt();
756
+ })();
757
+ ne.parser = ne;
758
+ var wr = ne, Nr = {
759
+ SOLID: 0,
760
+ DOTTED: 1,
761
+ NOTE: 2,
762
+ SOLID_CROSS: 3,
763
+ DOTTED_CROSS: 4,
764
+ SOLID_OPEN: 5,
765
+ DOTTED_OPEN: 6,
766
+ LOOP_START: 10,
767
+ LOOP_END: 11,
768
+ ALT_START: 12,
769
+ ALT_ELSE: 13,
770
+ ALT_END: 14,
771
+ OPT_START: 15,
772
+ OPT_END: 16,
773
+ ACTIVE_START: 17,
774
+ ACTIVE_END: 18,
775
+ PAR_START: 19,
776
+ PAR_AND: 20,
777
+ PAR_END: 21,
778
+ RECT_START: 22,
779
+ RECT_END: 23,
780
+ SOLID_POINT: 24,
781
+ DOTTED_POINT: 25,
782
+ AUTONUMBER: 26,
783
+ CRITICAL_START: 27,
784
+ CRITICAL_OPTION: 28,
785
+ CRITICAL_END: 29,
786
+ BREAK_START: 30,
787
+ BREAK_END: 31,
788
+ PAR_OVER_START: 32,
789
+ BIDIRECTIONAL_SOLID: 33,
790
+ BIDIRECTIONAL_DOTTED: 34,
791
+ SOLID_TOP: 41,
792
+ SOLID_BOTTOM: 42,
793
+ STICK_TOP: 43,
794
+ STICK_BOTTOM: 44,
795
+ SOLID_ARROW_TOP_REVERSE: 45,
796
+ SOLID_ARROW_BOTTOM_REVERSE: 46,
797
+ STICK_ARROW_TOP_REVERSE: 47,
798
+ STICK_ARROW_BOTTOM_REVERSE: 48,
799
+ SOLID_TOP_DOTTED: 51,
800
+ SOLID_BOTTOM_DOTTED: 52,
801
+ STICK_TOP_DOTTED: 53,
802
+ STICK_BOTTOM_DOTTED: 54,
803
+ SOLID_ARROW_TOP_REVERSE_DOTTED: 55,
804
+ SOLID_ARROW_BOTTOM_REVERSE_DOTTED: 56,
805
+ STICK_ARROW_TOP_REVERSE_DOTTED: 57,
806
+ STICK_ARROW_BOTTOM_REVERSE_DOTTED: 58,
807
+ CENTRAL_CONNECTION: 59,
808
+ CENTRAL_CONNECTION_REVERSE: 60,
809
+ CENTRAL_CONNECTION_DUAL: 61
810
+ }, Pr = {
811
+ FILLED: 0,
812
+ OPEN: 1
813
+ }, kr = {
814
+ LEFTOF: 0,
815
+ RIGHTOF: 1,
816
+ OVER: 2
817
+ }, qt = {
818
+ ACTOR: "actor",
819
+ CONTROL: "control",
820
+ DATABASE: "database",
821
+ ENTITY: "entity"
822
+ }, wt, Dr = (wt = class {
823
+ constructor() {
824
+ this.state = new pr(() => ({
825
+ prevActor: void 0,
826
+ actors: /* @__PURE__ */ new Map(),
827
+ createdActors: /* @__PURE__ */ new Map(),
828
+ destroyedActors: /* @__PURE__ */ new Map(),
829
+ boxes: [],
830
+ messages: [],
831
+ notes: [],
832
+ sequenceNumbersEnabled: !1,
833
+ wrapEnabled: void 0,
834
+ currentBox: void 0,
835
+ lastCreated: void 0,
836
+ lastDestroyed: void 0
837
+ })), this.setAccTitle = He, this.setAccDescription = _r, this.setDiagramTitle = gr, this.getAccTitle = xr, this.getAccDescription = yr, this.getDiagramTitle = Ir, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(j().wrap), this.LINETYPE = Nr, this.ARROWTYPE = Pr, this.PLACEMENT = kr;
838
+ }
839
+ addBox(t) {
840
+ this.state.records.boxes.push({
841
+ name: t.text,
842
+ wrap: t.wrap ?? this.autoWrap(),
843
+ fill: t.color,
844
+ actorKeys: []
845
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
846
+ }
847
+ addActor(t, a, r, i, o) {
848
+ let s = this.state.records.currentBox, n;
849
+ if (o !== void 0) {
850
+ let d;
851
+ o.includes(`
852
+ `) ? d = o + `
853
+ ` : d = `{
854
+ ` + o + `
855
+ }`, n = Rr(d, { schema: Or });
856
+ }
857
+ i = n?.type ?? i, n?.alias && (!r || r.text === a) && (r = { text: n.alias, wrap: r?.wrap, type: i });
858
+ const h = this.state.records.actors.get(t);
859
+ if (h) {
860
+ if (this.state.records.currentBox && h.box && this.state.records.currentBox !== h.box)
861
+ throw new Error(
862
+ `A same participant should only be defined in one Box: ${h.name} can't be in '${h.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
863
+ );
864
+ if (s = h.box ? h.box : this.state.records.currentBox, h.box = s, h && a === h.name && r == null)
865
+ return;
866
+ }
867
+ if (r?.text == null && (r = { text: a, type: i }), (i == null || r.text == null) && (r = { text: a, type: i }), this.state.records.actors.set(t, {
868
+ box: s,
869
+ name: a,
870
+ description: r.text,
871
+ wrap: r.wrap ?? this.autoWrap(),
872
+ prevActor: this.state.records.prevActor,
873
+ links: {},
874
+ properties: {},
875
+ actorCnt: null,
876
+ rectData: null,
877
+ type: i ?? "participant"
878
+ }), this.state.records.prevActor) {
879
+ const d = this.state.records.actors.get(this.state.records.prevActor);
880
+ d && (d.nextActor = t);
881
+ }
882
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(t), this.state.records.prevActor = t;
883
+ }
884
+ activationCount(t) {
885
+ let a, r = 0;
886
+ if (!t)
887
+ return 0;
888
+ for (a = 0; a < this.state.records.messages.length; a++)
889
+ this.state.records.messages[a].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[a].from === t && r++, this.state.records.messages[a].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[a].from === t && r--;
890
+ return r;
891
+ }
892
+ addMessage(t, a, r, i) {
893
+ this.state.records.messages.push({
894
+ id: this.state.records.messages.length.toString(),
895
+ from: t,
896
+ to: a,
897
+ message: r.text,
898
+ wrap: r.wrap ?? this.autoWrap(),
899
+ answer: i
900
+ });
901
+ }
902
+ addSignal(t, a, r, i, o = !1, s) {
903
+ if (i === this.LINETYPE.ACTIVE_END && this.activationCount(t ?? "") < 1) {
904
+ const h = new Error("Trying to inactivate an inactive participant (" + t + ")");
905
+ throw h.hash = {
906
+ text: "->>-",
907
+ token: "->>-",
908
+ line: "1",
909
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
910
+ expected: ["'ACTIVE_PARTICIPANT'"]
911
+ }, h;
912
+ }
913
+ return this.state.records.messages.push({
914
+ id: this.state.records.messages.length.toString(),
915
+ from: t,
916
+ to: a,
917
+ message: r?.text ?? "",
918
+ wrap: r?.wrap ?? this.autoWrap(),
919
+ type: i,
920
+ activate: o,
921
+ centralConnection: s ?? 0
922
+ }), !0;
923
+ }
924
+ hasAtLeastOneBox() {
925
+ return this.state.records.boxes.length > 0;
926
+ }
927
+ hasAtLeastOneBoxWithTitle() {
928
+ return this.state.records.boxes.some((t) => t.name);
929
+ }
930
+ getMessages() {
931
+ return this.state.records.messages;
932
+ }
933
+ getBoxes() {
934
+ return this.state.records.boxes;
935
+ }
936
+ getActors() {
937
+ return this.state.records.actors;
938
+ }
939
+ getCreatedActors() {
940
+ return this.state.records.createdActors;
941
+ }
942
+ getDestroyedActors() {
943
+ return this.state.records.destroyedActors;
944
+ }
945
+ getActor(t) {
946
+ return this.state.records.actors.get(t);
947
+ }
948
+ getActorKeys() {
949
+ return [...this.state.records.actors.keys()];
950
+ }
951
+ enableSequenceNumbers() {
952
+ this.state.records.sequenceNumbersEnabled = !0;
953
+ }
954
+ disableSequenceNumbers() {
955
+ this.state.records.sequenceNumbersEnabled = !1;
956
+ }
957
+ showSequenceNumbers() {
958
+ return this.state.records.sequenceNumbersEnabled;
959
+ }
960
+ setWrap(t) {
961
+ this.state.records.wrapEnabled = t;
962
+ }
963
+ extractWrap(t) {
964
+ if (t === void 0)
965
+ return {};
966
+ t = t.trim();
967
+ const a = /^:?wrap:/.exec(t) !== null ? !0 : /^:?nowrap:/.exec(t) !== null ? !1 : void 0;
968
+ return { cleanedText: (a === void 0 ? t : t.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: a };
969
+ }
970
+ autoWrap() {
971
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : j().sequence?.wrap ?? !1;
972
+ }
973
+ clear() {
974
+ this.state.reset(), Lr();
975
+ }
976
+ parseMessage(t) {
977
+ const a = t.trim(), { wrap: r, cleanedText: i } = this.extractWrap(a), o = {
978
+ text: i,
979
+ wrap: r
980
+ };
981
+ return nt.debug(`parseMessage: ${JSON.stringify(o)}`), o;
982
+ }
983
+ // We expect the box statement to be color first then description
984
+ // 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
985
+ // We extract first segment as color, the rest of the line is considered as text
986
+ parseBoxData(t) {
987
+ const a = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);
988
+ let r = a?.[1] ? a[1].trim() : "transparent", i = a?.[2] ? a[2].trim() : void 0;
989
+ if (window?.CSS)
990
+ window.CSS.supports("color", r) || (r = "transparent", i = t.trim());
991
+ else {
992
+ const n = new Option().style;
993
+ n.color = r, n.color !== r && (r = "transparent", i = t.trim());
994
+ }
995
+ const { wrap: o, cleanedText: s } = this.extractWrap(i);
996
+ return {
997
+ text: s ? Ft(s, j()) : void 0,
998
+ color: r,
999
+ wrap: o
1000
+ };
1001
+ }
1002
+ addNote(t, a, r) {
1003
+ const i = {
1004
+ actor: t,
1005
+ placement: a,
1006
+ message: r.text,
1007
+ wrap: r.wrap ?? this.autoWrap()
1008
+ }, o = [].concat(t, t);
1009
+ this.state.records.notes.push(i), this.state.records.messages.push({
1010
+ id: this.state.records.messages.length.toString(),
1011
+ from: o[0],
1012
+ to: o[1],
1013
+ message: r.text,
1014
+ wrap: r.wrap ?? this.autoWrap(),
1015
+ type: this.LINETYPE.NOTE,
1016
+ placement: a
1017
+ });
1018
+ }
1019
+ addLinks(t, a) {
1020
+ const r = this.getActor(t);
1021
+ try {
1022
+ let i = Ft(a.text, j());
1023
+ i = i.replace(/&equals;/g, "="), i = i.replace(/&amp;/g, "&");
1024
+ const o = JSON.parse(i);
1025
+ this.insertLinks(r, o);
1026
+ } catch (i) {
1027
+ nt.error("error while parsing actor link text", i);
1028
+ }
1029
+ }
1030
+ addALink(t, a) {
1031
+ const r = this.getActor(t);
1032
+ try {
1033
+ const i = {};
1034
+ let o = Ft(a.text, j());
1035
+ const s = o.indexOf("@");
1036
+ o = o.replace(/&equals;/g, "="), o = o.replace(/&amp;/g, "&");
1037
+ const n = o.slice(0, s - 1).trim(), h = o.slice(s + 1).trim();
1038
+ i[n] = h, this.insertLinks(r, i);
1039
+ } catch (i) {
1040
+ nt.error("error while parsing actor link text", i);
1041
+ }
1042
+ }
1043
+ insertLinks(t, a) {
1044
+ if (t.links == null)
1045
+ t.links = a;
1046
+ else
1047
+ for (const r in a)
1048
+ t.links[r] = a[r];
1049
+ }
1050
+ addProperties(t, a) {
1051
+ const r = this.getActor(t);
1052
+ try {
1053
+ const i = Ft(a.text, j()), o = JSON.parse(i);
1054
+ this.insertProperties(r, o);
1055
+ } catch (i) {
1056
+ nt.error("error while parsing actor properties text", i);
1057
+ }
1058
+ }
1059
+ insertProperties(t, a) {
1060
+ if (t.properties == null)
1061
+ t.properties = a;
1062
+ else
1063
+ for (const r in a)
1064
+ t.properties[r] = a[r];
1065
+ }
1066
+ boxEnd() {
1067
+ this.state.records.currentBox = void 0;
1068
+ }
1069
+ addDetails(t, a) {
1070
+ const r = this.getActor(t), i = document.getElementById(a.text);
1071
+ try {
1072
+ const o = i.innerHTML, s = JSON.parse(o);
1073
+ s.properties && this.insertProperties(r, s.properties), s.links && this.insertLinks(r, s.links);
1074
+ } catch (o) {
1075
+ nt.error("error while parsing actor details text", o);
1076
+ }
1077
+ }
1078
+ getActorProperty(t, a) {
1079
+ if (t?.properties !== void 0)
1080
+ return t.properties[a];
1081
+ }
1082
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
1083
+ apply(t) {
1084
+ if (Array.isArray(t))
1085
+ t.forEach((a) => {
1086
+ this.apply(a);
1087
+ });
1088
+ else
1089
+ switch (t.type) {
1090
+ case "sequenceIndex":
1091
+ this.state.records.messages.push({
1092
+ id: this.state.records.messages.length.toString(),
1093
+ from: void 0,
1094
+ to: void 0,
1095
+ message: {
1096
+ start: t.sequenceIndex,
1097
+ step: t.sequenceIndexStep,
1098
+ visible: t.sequenceVisible
1099
+ },
1100
+ wrap: !1,
1101
+ type: t.signalType
1102
+ });
1103
+ break;
1104
+ case "addParticipant":
1105
+ this.addActor(t.actor, t.actor, t.description, t.draw, t.config);
1106
+ break;
1107
+ case "createParticipant":
1108
+ if (this.state.records.actors.has(t.actor))
1109
+ throw new Error(
1110
+ "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"
1111
+ );
1112
+ 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);
1113
+ break;
1114
+ case "destroyParticipant":
1115
+ this.state.records.lastDestroyed = t.actor, this.state.records.destroyedActors.set(t.actor, this.state.records.messages.length);
1116
+ break;
1117
+ case "activeStart":
1118
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
1119
+ break;
1120
+ case "centralConnection":
1121
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
1122
+ break;
1123
+ case "centralConnectionReverse":
1124
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
1125
+ break;
1126
+ case "activeEnd":
1127
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
1128
+ break;
1129
+ case "addNote":
1130
+ this.addNote(t.actor, t.placement, t.text);
1131
+ break;
1132
+ case "addLinks":
1133
+ this.addLinks(t.actor, t.text);
1134
+ break;
1135
+ case "addALink":
1136
+ this.addALink(t.actor, t.text);
1137
+ break;
1138
+ case "addProperties":
1139
+ this.addProperties(t.actor, t.text);
1140
+ break;
1141
+ case "addDetails":
1142
+ this.addDetails(t.actor, t.text);
1143
+ break;
1144
+ case "addMessage":
1145
+ if (this.state.records.lastCreated) {
1146
+ if (t.to !== this.state.records.lastCreated)
1147
+ throw new Error(
1148
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1149
+ );
1150
+ this.state.records.lastCreated = void 0;
1151
+ } else if (this.state.records.lastDestroyed) {
1152
+ if (t.to !== this.state.records.lastDestroyed && t.from !== this.state.records.lastDestroyed)
1153
+ throw new Error(
1154
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1155
+ );
1156
+ this.state.records.lastDestroyed = void 0;
1157
+ }
1158
+ this.addSignal(
1159
+ t.from,
1160
+ t.to,
1161
+ t.msg,
1162
+ t.signalType,
1163
+ t.activate,
1164
+ t.centralConnection
1165
+ );
1166
+ break;
1167
+ case "boxStart":
1168
+ this.addBox(t.boxData);
1169
+ break;
1170
+ case "boxEnd":
1171
+ this.boxEnd();
1172
+ break;
1173
+ case "loopStart":
1174
+ this.addSignal(void 0, void 0, t.loopText, t.signalType);
1175
+ break;
1176
+ case "loopEnd":
1177
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1178
+ break;
1179
+ case "rectStart":
1180
+ this.addSignal(void 0, void 0, t.color, t.signalType);
1181
+ break;
1182
+ case "rectEnd":
1183
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1184
+ break;
1185
+ case "optStart":
1186
+ this.addSignal(void 0, void 0, t.optText, t.signalType);
1187
+ break;
1188
+ case "optEnd":
1189
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1190
+ break;
1191
+ case "altStart":
1192
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1193
+ break;
1194
+ case "else":
1195
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1196
+ break;
1197
+ case "altEnd":
1198
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1199
+ break;
1200
+ case "setAccTitle":
1201
+ He(t.text);
1202
+ break;
1203
+ case "parStart":
1204
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1205
+ break;
1206
+ case "and":
1207
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1208
+ break;
1209
+ case "parEnd":
1210
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1211
+ break;
1212
+ case "criticalStart":
1213
+ this.addSignal(void 0, void 0, t.criticalText, t.signalType);
1214
+ break;
1215
+ case "option":
1216
+ this.addSignal(void 0, void 0, t.optionText, t.signalType);
1217
+ break;
1218
+ case "criticalEnd":
1219
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1220
+ break;
1221
+ case "breakStart":
1222
+ this.addSignal(void 0, void 0, t.breakText, t.signalType);
1223
+ break;
1224
+ case "breakEnd":
1225
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1226
+ break;
1227
+ }
1228
+ }
1229
+ getConfig() {
1230
+ return j().sequence;
1231
+ }
1232
+ }, f(wt, "SequenceDB"), wt), vr = /* @__PURE__ */ f((e) => {
1233
+ const t = e.dropShadow ?? "none", { look: a } = j();
1234
+ return `.actor {
1235
+ stroke: ${e.actorBorder};
1236
+ fill: ${e.actorBkg};
1237
+ stroke-width: ${e.strokeWidth ?? 1};
1238
+ }
1239
+
1240
+ rect.actor.outer-path[data-look="neo"] {
1241
+ filter: ${t};
1242
+ }
1243
+
1244
+ rect.note[data-look="neo"] {
1245
+ stroke:${e.noteBorderColor};
1246
+ fill:${e.noteBkgColor};
1247
+ filter: ${t};
1248
+ }
1249
+
1250
+ text.actor > tspan {
1251
+ fill: ${e.actorTextColor};
1252
+ stroke: none;
1253
+ }
1254
+
1255
+ .actor-line {
1256
+ stroke: ${e.actorLineColor};
1257
+ }
1258
+
1259
+ .innerArc {
1260
+ stroke-width: 1.5;
1261
+ stroke-dasharray: none;
1262
+ }
1263
+
1264
+ .messageLine0 {
1265
+ stroke-width: 1.5;
1266
+ stroke-dasharray: none;
1267
+ stroke: ${e.signalColor};
1268
+ }
1269
+
1270
+ .messageLine1 {
1271
+ stroke-width: 1.5;
1272
+ stroke-dasharray: 2, 2;
1273
+ stroke: ${e.signalColor};
1274
+ }
1275
+
1276
+ [id$="-arrowhead"] path {
1277
+ fill: ${e.signalColor};
1278
+ stroke: ${e.signalColor};
1279
+ }
1280
+
1281
+ .sequenceNumber {
1282
+ fill: ${e.sequenceNumberColor};
1283
+ }
1284
+
1285
+ [id$="-sequencenumber"] {
1286
+ fill: ${e.signalColor};
1287
+ }
1288
+
1289
+ [id$="-crosshead"] path {
1290
+ fill: ${e.signalColor};
1291
+ stroke: ${e.signalColor};
1292
+ }
1293
+
1294
+ .messageText {
1295
+ fill: ${e.signalTextColor};
1296
+ stroke: none;
1297
+ }
1298
+
1299
+ .labelBox {
1300
+ stroke: ${e.labelBoxBorderColor};
1301
+ fill: ${e.labelBoxBkgColor};
1302
+ filter: ${a === "neo" ? t : "none"};
1303
+ }
1304
+
1305
+ .labelText, .labelText > tspan {
1306
+ fill: ${e.labelTextColor};
1307
+ stroke: none;
1308
+ }
1309
+
1310
+ .loopText, .loopText > tspan {
1311
+ fill: ${e.loopTextColor};
1312
+ stroke: none;
1313
+ }
1314
+
1315
+ .sectionTitle, .sectionTitle > tspan {
1316
+ fill: ${e.loopTextColor};
1317
+ stroke: none;
1318
+ }
1319
+
1320
+ .loopLine {
1321
+ stroke-width: 2px;
1322
+ stroke-dasharray: 2, 2;
1323
+ stroke: ${e.labelBoxBorderColor};
1324
+ fill: ${e.labelBoxBorderColor};
1325
+ }
1326
+
1327
+ .note {
1328
+ //stroke: #decc93;
1329
+ stroke: ${e.noteBorderColor};
1330
+ fill: ${e.noteBkgColor};
1331
+ }
1332
+
1333
+ /*
1334
+ * No font-weight here, deliberately. Note text renders inside tspan elements, and a weight emitted at
1335
+ * tspan level outranks the inline style drawText puts on the parent text element from the
1336
+ * sequence.noteFontWeight config key -- so that documented key would never reach the glyphs.
1337
+ * The theme variable formerly emitted here is a different value from that config key, and
1338
+ * git/styles.js reads it as its own bold-label weight under redux and neo, so it cannot be
1339
+ * lowered there either.
1340
+ */
1341
+ .noteText, .noteText > tspan {
1342
+ fill: ${e.noteTextColor};
1343
+ stroke: none;
1344
+ }
1345
+
1346
+ .activation0 {
1347
+ fill: ${e.activationBkgColor};
1348
+ stroke: ${e.activationBorderColor};
1349
+ }
1350
+
1351
+ .activation1 {
1352
+ fill: ${e.activationBkgColor};
1353
+ stroke: ${e.activationBorderColor};
1354
+ }
1355
+
1356
+ .activation2 {
1357
+ fill: ${e.activationBkgColor};
1358
+ stroke: ${e.activationBorderColor};
1359
+ }
1360
+
1361
+ .actorPopupMenu {
1362
+ position: absolute;
1363
+ }
1364
+
1365
+ .actorPopupMenuPanel {
1366
+ position: absolute;
1367
+ fill: ${e.actorBkg};
1368
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1369
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1370
+ }
1371
+ .actor-man circle, line {
1372
+ fill: ${e.actorBkg};
1373
+ stroke-width: 2px;
1374
+ }
1375
+
1376
+ g rect.rect {
1377
+ filter: ${t};
1378
+ stroke: ${e.nodeBorder};
1379
+ }
1380
+ `;
1381
+ }, "getStyles"), Cr = vr, Xt = 44, Te = 6, Ut = 6, Mr = /* @__PURE__ */ f((e, t) => e.actorTextHeight ?? Q.calculateTextDimensions(e.description ?? "", {
1382
+ fontFamily: t.actorFontFamily,
1383
+ fontSize: t.actorFontSize,
1384
+ fontWeight: t.actorFontWeight
1385
+ }).height, "actorLabelHeight"), Je = /* @__PURE__ */ f((e) => Xt + Te + e + Ut, "actorStackHeight"), Br = /* @__PURE__ */ f((e, t, a) => {
1386
+ const r = e + t, i = r - Ut - a / 2;
1387
+ return {
1388
+ lifelineStartY: r,
1389
+ glyphBottomY: r - Ut - a - Te,
1390
+ labelCenterY: i
1391
+ };
1392
+ }, "headerBands"), Yr = /* @__PURE__ */ f((e, t) => {
1393
+ const a = e + Ut, r = a + Xt;
1394
+ return {
1395
+ glyphTopY: a,
1396
+ glyphBottomY: r,
1397
+ labelCenterY: r + Te + t / 2,
1398
+ stackHeight: Je(t)
1399
+ };
1400
+ }, "footerBands"), Ot = 36, Vr = -5, Ze = 60, Fe = Ze - Vr, Ct = /* @__PURE__ */ f((e, t, a, r) => {
1401
+ if (t.look !== "neo")
1402
+ return null;
1403
+ const i = Mr(e, t);
1404
+ return a ? Yr(r, i) : Br(r, e.height, i);
1405
+ }, "neoBands"), gt = "actor-top", xt = "actor-bottom", Jt = "actor-box", Lt = "actor-man", ut = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), J = /* @__PURE__ */ f((e, t) => e?.length ? e[t % e.length] : void 0, "paletteColor"), Dt = /* @__PURE__ */ f(function(e, t) {
1406
+ const a = Ar(e, t);
1407
+ return zt().look === "neo" && a.attr("data-look", "neo"), a;
1408
+ }, "drawRect"), Wr = /* @__PURE__ */ f(function(e, t, a, r, i) {
1409
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1410
+ return { height: 0, width: 0 };
1411
+ const o = t.links, s = t.actorCnt, n = t.rectData;
1412
+ var h = "none";
1413
+ i && (h = "block !important");
1414
+ const d = e.append("g");
1415
+ d.attr("id", "actor" + s + "_popup"), d.attr("class", "actorPopupMenu"), d.attr("display", h);
1416
+ var E = "";
1417
+ n.class !== void 0 && (E = " " + n.class);
1418
+ let u = n.width > a ? n.width : a;
1419
+ const _ = d.append("rect");
1420
+ if (_.attr("class", "actorPopupMenuPanel" + E), _.attr("x", n.x), _.attr("y", n.height), _.attr("fill", n.fill), _.attr("stroke", n.stroke), _.attr("width", u), _.attr("height", n.height), _.attr("rx", n.rx), _.attr("ry", n.ry), o != null) {
1421
+ var L = 20;
1422
+ for (let T in o) {
1423
+ var g = d.append("a"), R = Ue.sanitizeUrl(o[T]);
1424
+ g.attr("xlink:href", R), g.attr("target", "_blank"), la(r)(
1425
+ T,
1426
+ g,
1427
+ n.x + 10,
1428
+ n.height + L,
1429
+ u,
1430
+ 20,
1431
+ { class: "actor" },
1432
+ r
1433
+ ), L += 30;
1434
+ }
1435
+ }
1436
+ return _.attr("height", L), { height: n.height + L, width: u };
1437
+ }, "drawPopup"), Zt = /* @__PURE__ */ f(function(e) {
1438
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1439
+ }, "popupMenuToggle"), Gt = /* @__PURE__ */ f(async function(e, t, a = null) {
1440
+ let r = e.append("foreignObject");
1441
+ const i = await Xe(t.text, zt()), s = r.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();
1442
+ if (r.attr("height", Math.round(s.height)).attr("width", Math.round(s.width)), t.class === "noteText") {
1443
+ const n = e.node().firstChild;
1444
+ n.setAttribute("height", s.height + 2 * t.textMargin);
1445
+ const h = n.getBBox();
1446
+ r.attr("x", Math.round(h.x + h.width / 2 - s.width / 2)).attr("y", Math.round(h.y + h.height / 2 - s.height / 2));
1447
+ } else if (a) {
1448
+ let { startx: n, stopx: h, starty: d } = a;
1449
+ if (n > h) {
1450
+ const E = n;
1451
+ n = h, h = E;
1452
+ }
1453
+ r.attr("x", Math.round(n + Math.abs(n - h) / 2 - s.width / 2)), t.class === "loopText" ? r.attr("y", Math.round(d)) : r.attr("y", Math.round(d - s.height));
1454
+ }
1455
+ return [r];
1456
+ }, "drawKatex"), Nt = /* @__PURE__ */ f(function(e, t) {
1457
+ let a = 0, r = 0;
1458
+ const i = t.text.split(N.lineBreakRegex), [o, s] = Ge(t.fontSize);
1459
+ let n = [], h = 0, d = /* @__PURE__ */ f(() => t.y, "yfunc");
1460
+ if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1461
+ switch (t.valign) {
1462
+ case "top":
1463
+ case "start":
1464
+ d = /* @__PURE__ */ f(() => Math.round(t.y + t.textMargin), "yfunc");
1465
+ break;
1466
+ case "middle":
1467
+ case "center":
1468
+ d = /* @__PURE__ */ f(() => Math.round(t.y + (a + r + t.textMargin) / 2), "yfunc");
1469
+ break;
1470
+ case "bottom":
1471
+ case "end":
1472
+ d = /* @__PURE__ */ f(() => Math.round(
1473
+ t.y + (a + r + 2 * t.textMargin) - t.textMargin
1474
+ ), "yfunc");
1475
+ break;
1476
+ }
1477
+ if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1478
+ switch (t.anchor) {
1479
+ case "left":
1480
+ case "start":
1481
+ t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1482
+ break;
1483
+ case "middle":
1484
+ case "center":
1485
+ t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1486
+ break;
1487
+ case "right":
1488
+ case "end":
1489
+ t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1490
+ break;
1491
+ }
1492
+ for (let [E, u] of i.entries()) {
1493
+ t.textMargin !== void 0 && t.textMargin === 0 && o !== void 0 && (h = E * o);
1494
+ const _ = e.append("text");
1495
+ _.attr("x", t.x), _.attr("y", d()), t.anchor !== void 0 && _.attr("text-anchor", t.anchor).attr("dominant-baseline", t.dominantBaseline).attr("alignment-baseline", t.alignmentBaseline), t.fontFamily !== void 0 && _.style("font-family", t.fontFamily), s !== void 0 && _.style("font-size", s), t.fontWeight !== void 0 && _.style("font-weight", t.fontWeight), t.fill !== void 0 && _.attr("fill", t.fill), t.class !== void 0 && _.attr("class", t.class), t.dy !== void 0 ? _.attr("dy", t.dy) : h !== 0 && _.attr("dy", h);
1496
+ const L = u || br;
1497
+ if (t.tspan) {
1498
+ const g = _.append("tspan");
1499
+ g.attr("x", t.x), t.fill !== void 0 && g.attr("fill", t.fill), g.text(L);
1500
+ } else
1501
+ _.text(L);
1502
+ t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (r += (_._groups || _)[0][0].getBBox().height, a = r), n.push(_);
1503
+ }
1504
+ return n;
1505
+ }, "drawText"), Qe = /* @__PURE__ */ f(function(e, t) {
1506
+ function a(i, o, s, n, h) {
1507
+ return i + "," + o + " " + (i + s) + "," + o + " " + (i + s) + "," + (o + n - h) + " " + (i + s - h * 1.2) + "," + (o + n) + " " + i + "," + (o + n);
1508
+ }
1509
+ f(a, "genPoints");
1510
+ const r = e.append("polygon");
1511
+ return r.attr("points", a(t.x, t.y, t.width, t.height, 7)), r.attr("class", "labelBox"), t.y = t.y + t.height / 2, Nt(e, t), r;
1512
+ }, "drawLabel"), Y = -1, $e = /* @__PURE__ */ f((e, t, a, r) => {
1513
+ e.select && a.forEach((i) => {
1514
+ const o = t.get(i), s = e.select("#actor" + o.actorCnt);
1515
+ !r.mirrorActors && o.stopy ? s.attr("y2", o.stopy + o.height / 2) : r.mirrorActors && s.attr("y2", o.stopy);
1516
+ });
1517
+ }, "fixLifeLineHeights"), Kr = /* @__PURE__ */ f(function(e, t, a, r, i, o) {
1518
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, h = s + t.height, { look: d, theme: E, themeVariables: u } = a, { bkgColorArray: _, borderColorArray: L } = u, g = e.append("g").lower();
1519
+ var R = g;
1520
+ r || (Y++, Object.keys(t.links || {}).length && !a.forceMenus && R.attr("onclick", Zt(`actor${Y}_popup`)).attr("cursor", "pointer"), R.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", h).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), R = g.append("g"), t.actorCnt = Y, t.links != null && R.attr("id", "root-" + Y), d === "neo" && R.attr("data-look", "neo"));
1521
+ const T = pt();
1522
+ var O = "actor";
1523
+ t.properties?.class ? O = t.properties.class : T.fill = "#eaeaea", r ? O += ` ${xt}` : O += ` ${gt}`, T.x = t.x, T.y = s, T.width = t.width, T.height = t.height, T.class = O, T.rx = 3, T.ry = 3, T.name = t.name, d === "neo" && (T.rx = 6, T.ry = 6);
1524
+ const x = Dt(R, T), m = o.get(t.name) ?? 0;
1525
+ if (ut.has(E) && (x.style("stroke", J(L, m)), x.style("fill", J(_, m))), d === "neo" && x.attr("filter", `url(#${yt(i)})`), t.rectData = T, t.properties?.icon) {
1526
+ const b = t.properties.icon.trim();
1527
+ b.charAt(0) === "@" ? he(R, T.x + T.width - 20, T.y + 10, b.substr(1)) : de(R, T.x + T.width - 20, T.y + 10, b);
1528
+ }
1529
+ r || (R.attr("data-et", "participant"), R.attr("data-type", "participant"), R.attr("data-id", t.name)), ft(a, tt(t.description))(
1530
+ t.description,
1531
+ R,
1532
+ T.x,
1533
+ T.y,
1534
+ T.width,
1535
+ T.height,
1536
+ { class: `actor ${Jt}` },
1537
+ a
1538
+ );
1539
+ let S = t.height;
1540
+ if (x.node) {
1541
+ const b = x.node().getBBox();
1542
+ a.look !== "neo" && (t.height = b.height, S = b.height);
1543
+ }
1544
+ return S;
1545
+ }, "drawActorTypeParticipant"), Hr = /* @__PURE__ */ f(function(e, t, a, r, i, o) {
1546
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, h = s + t.height, { look: d, theme: E, themeVariables: u } = a, { bkgColorArray: _, borderColorArray: L } = u, g = e.append("g").lower();
1547
+ var R = g;
1548
+ r || (Y++, Object.keys(t.links || {}).length && !a.forceMenus && R.attr("onclick", Zt(`actor${Y}_popup`)).attr("cursor", "pointer"), R.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", h).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), R = g.append("g"), t.actorCnt = Y, t.links != null && R.attr("id", "root-" + Y), d === "neo" && R.attr("data-look", "neo"));
1549
+ const T = pt();
1550
+ var O = "actor";
1551
+ t.properties?.class ? O = t.properties.class : T.fill = "#eaeaea", r ? O += ` ${xt}` : O += ` ${gt}`, T.x = t.x, T.y = s, T.width = t.width, T.height = t.height, T.class = O, T.name = t.name;
1552
+ const x = 6;
1553
+ a.look === "neo" && (T.height = t.height - x);
1554
+ const m = {
1555
+ ...T,
1556
+ x: T.x + -x,
1557
+ y: T.y + +x,
1558
+ class: "actor"
1559
+ }, S = Dt(R, T), b = Dt(R, m);
1560
+ t.rectData = T, d === "neo" && R.attr("filter", `url(#${yt(i)})`);
1561
+ const P = o.get(t.name) ?? 0;
1562
+ if (ut.has(E) && (S.style("stroke", J(L, P)), S.style("fill", J(_, P)), b.style("stroke", J(L, P)), b.style("fill", J(_, P))), t.properties?.icon) {
1563
+ const B = t.properties.icon.trim();
1564
+ B.charAt(0) === "@" ? he(R, T.x + T.width - 20, T.y + 10, B.substr(1)) : de(R, T.x + T.width - 20, T.y + 10, B);
1565
+ }
1566
+ ft(a, tt(t.description))(
1567
+ t.description,
1568
+ R,
1569
+ T.x - x,
1570
+ T.y + x,
1571
+ T.width,
1572
+ T.height,
1573
+ { class: `actor ${Jt}` },
1574
+ a
1575
+ );
1576
+ let k = t.height;
1577
+ if (S.node) {
1578
+ const B = S.node().getBBox();
1579
+ a.look !== "neo" && (t.height = B.height, k = B.height);
1580
+ }
1581
+ return r || (R.attr("data-et", "participant"), R.attr("data-type", "collections"), R.attr("data-id", t.name)), k;
1582
+ }, "drawActorTypeCollections"), Fr = /* @__PURE__ */ f(function(e, t, a, r, i, o) {
1583
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, h = s + t.height, { look: d, theme: E, themeVariables: u } = a, { bkgColorArray: _, borderColorArray: L } = u, g = e.append("g").lower();
1584
+ let R = g;
1585
+ r || (Y++, Object.keys(t.links || {}).length && !a.forceMenus && R.attr("onclick", Zt(`actor${Y}_popup`)).attr("cursor", "pointer"), R.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", h).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), R = g.append("g"), t.actorCnt = Y, t.links != null && R.attr("id", "root-" + Y), d === "neo" && R.attr("data-look", "neo"));
1586
+ const T = pt();
1587
+ let O = "actor";
1588
+ t.properties?.class ? O = t.properties.class : T.fill = "#eaeaea", r ? O += ` ${xt}` : O += ` ${gt}`, R.attr("class", O), T.x = t.x, T.y = s, T.width = t.width, T.height = t.height, T.name = t.name;
1589
+ const x = T.height / 2, m = x / (2.5 + T.height / 50), S = R.append("g"), b = R.append("g"), P = `M ${T.x},${T.y + x}
1590
+ a ${m},${x} 0 0 0 0,${T.height}
1591
+ h ${T.width - 2 * m}
1592
+ a ${m},${x} 0 0 0 0,-${T.height}
1593
+ Z
1594
+ `;
1595
+ S.append("path").attr("d", P), b.append("path").attr(
1596
+ "d",
1597
+ `M ${T.x},${T.y + x}
1598
+ a ${m},${x} 0 0 0 0,${T.height}`
1599
+ ), S.attr("transform", `translate(${m}, ${-(T.height / 2)})`), b.attr("transform", `translate(${T.width - m}, ${-T.height / 2})`), t.rectData = T, d === "neo" && S.attr("filter", `url(#${yt(i)})`);
1600
+ const k = o.get(t.name) ?? 0;
1601
+ if (ut.has(E) && (S.style("stroke", J(L, k)), S.style("fill", J(_, k)), b.style("stroke", J(L, k)), b.style("fill", J(_, k))), t.properties?.icon) {
1602
+ const K = t.properties.icon.trim(), z = T.x + T.width - 20, X = T.y + 10;
1603
+ K.charAt(0) === "@" ? he(R, z, X, K.substr(1)) : de(R, z, X, K);
1604
+ }
1605
+ ft(a, tt(t.description))(
1606
+ t.description,
1607
+ R,
1608
+ T.x,
1609
+ T.y,
1610
+ T.width,
1611
+ T.height,
1612
+ { class: `actor ${Jt}` },
1613
+ a
1614
+ );
1615
+ let B = t.height;
1616
+ const V = S.select("path:last-child");
1617
+ if (V.node()) {
1618
+ const K = V.node().getBBox();
1619
+ a.look !== "neo" && (t.height = K.height, B = K.height);
1620
+ }
1621
+ return r || (R.attr("data-et", "participant"), R.attr("data-type", "queue"), R.attr("data-id", t.name)), B;
1622
+ }, "drawActorTypeQueue"), qr = /* @__PURE__ */ f(function(e, t, a, r, i, o) {
1623
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, h = Ct(t, a, r, s), d = h ? h.lifelineStartY : s + 75, { look: E, theme: u, themeVariables: _ } = a, { bkgColorArray: L, borderColorArray: g, actorBorder: R, actorBkg: T } = _, O = e.append("g").lower();
1624
+ r || (Y++, O.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", d).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = Y);
1625
+ const x = e.append("g");
1626
+ let m = Lt;
1627
+ r ? m += ` ${xt}` : m += ` ${gt}`, x.attr("class", m), x.attr("name", t.name);
1628
+ const S = pt();
1629
+ S.x = t.x, S.y = s, S.fill = "#eaeaea", S.width = t.width, S.height = t.height, S.class = "actor";
1630
+ const b = t.x + t.width / 2, P = h ? h.glyphBottomY - 22 : s + 32, k = 22;
1631
+ x.append("defs").append("marker").attr("id", i + "-filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").attr("stroke-width", 1.2).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"), x.append("circle").attr("cx", b).attr("cy", P).attr("r", k).attr("filter", `${E === "neo" ? `url(#${yt(i)})` : ""}`), x.append("line").attr("marker-end", "url(#" + i + "-filled-head-control)").attr("transform", `translate(${b}, ${P - k})`);
1632
+ const B = o.get(t.name) ?? 0;
1633
+ if (ut.has(u) ? (x.style("stroke", J(g, B)), x.style("fill", J(L, B))) : (x.style("stroke", R), x.style("fill", T)), !h) {
1634
+ const V = x.node().getBBox();
1635
+ t.height = V.height + 2 * (a?.sequence?.labelBoxHeight ?? 0);
1636
+ }
1637
+ return ft(a, tt(t.description))(
1638
+ t.description,
1639
+ x,
1640
+ S.x,
1641
+ h ? h.labelCenterY - S.height / 2 : S.y + k + (r ? 5 : 12),
1642
+ S.width,
1643
+ S.height,
1644
+ { class: `actor ${Lt}` },
1645
+ a
1646
+ ), r || (x.attr("data-et", "participant"), x.attr("data-type", "control"), x.attr("data-id", t.name)), t.height;
1647
+ }, "drawActorTypeControl"), zr = /* @__PURE__ */ f(function(e, t, a, r, i, o) {
1648
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, h = Ct(t, a, r, s), d = h ? h.lifelineStartY : s + 75, { look: E, theme: u, themeVariables: _ } = a, { bkgColorArray: L, borderColorArray: g } = _, R = e.append("g").lower(), T = e.append("g");
1649
+ let O = "actor";
1650
+ r ? O += ` ${xt}` : O += ` ${gt}`, T.attr("class", O), T.attr("name", t.name);
1651
+ const x = pt();
1652
+ x.x = t.x, x.y = s, x.fill = "#eaeaea", x.width = t.width, x.height = t.height, x.class = "actor";
1653
+ const m = t.x + t.width / 2, S = h ? h.glyphBottomY - 22 : s + (r ? 10 : 25), b = 22;
1654
+ T.append("circle").attr("cx", m).attr("cy", S).attr("r", b).attr("width", t.width).attr("height", t.height), T.append("line").attr("x1", m - b).attr("x2", m + b).attr("y1", S + b).attr("y2", S + b).attr("stroke-width", 2), E === "neo" && T.attr("filter", `url(#${yt(i)})`);
1655
+ const P = o.get(t.name) ?? 0;
1656
+ if (ut.has(u) && (T.style("stroke", J(g, P)), T.style("fill", J(L, P))), !h) {
1657
+ const k = T.node().getBBox();
1658
+ t.height = k.height + (a?.sequence?.labelBoxHeight ?? 0);
1659
+ }
1660
+ return r || (Y++, R.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", d).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = Y), ft(a, tt(t.description))(
1661
+ t.description,
1662
+ T,
1663
+ x.x,
1664
+ h ? h.labelCenterY - x.height / 2 : x.y + (r ? 15 : 30),
1665
+ x.width,
1666
+ x.height,
1667
+ { class: `actor ${Lt}` },
1668
+ a
1669
+ ), h || T.attr("transform", `translate(0, ${r ? b : b / 2 - 5})`), r || (T.attr("data-et", "participant"), T.attr("data-type", "entity"), T.attr("data-id", t.name)), t.height;
1670
+ }, "drawActorTypeEntity"), Ur = /* @__PURE__ */ f(function(e, t, a, r, i, o) {
1671
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, h = Ct(t, a, r, s), d = h ? h.lifelineStartY : s + t.height + 2 * a.boxTextMargin, { theme: E, themeVariables: u, look: _ } = a, { bkgColorArray: L, borderColorArray: g, actorBorder: R } = u, T = e.append("g").lower();
1672
+ let O = T;
1673
+ r || (Y++, Object.keys(t.links || {}).length && !a.forceMenus && O.attr("onclick", Zt(`actor${Y}_popup`)).attr("cursor", "pointer"), O.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", d).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), O = T.append("g"), t.actorCnt = Y, t.links != null && O.attr("id", "root-" + Y), _ === "neo" && O.attr("data-look", "neo"));
1674
+ const x = pt();
1675
+ let m = "actor";
1676
+ t.properties?.class ? m = t.properties.class : x.fill = "#eaeaea", r ? m += ` ${xt}` : m += ` ${gt}`, x.x = t.x, x.y = s, x.width = t.width, x.height = t.height, x.class = m, x.name = t.name, x.x = t.x, x.y = s;
1677
+ const S = x.width / 3, b = S / 2, P = b / (2.5 + S / 50), k = h ? Xt : x.width / 3, B = h ? h.glyphBottomY - k - P : x.y, V = O.append("g");
1678
+ V.attr("class", m);
1679
+ const K = `
1680
+ M ${x.x},${B + P}
1681
+ a ${b},${P} 0 0 0 ${S},0
1682
+ a ${b},${P} 0 0 0 -${S},0
1683
+ l 0,${k - 2 * P}
1684
+ a ${b},${P} 0 0 0 ${S},0
1685
+ l 0,-${k - 2 * P}
1686
+ `;
1687
+ V.append("path").attr("d", K), _ === "neo" && V.attr("filter", `url(#${yt(i)})`);
1688
+ const z = o.get(t.name) ?? 0;
1689
+ if (ut.has(E) ? (V.style("stroke", J(g, z)), V.style("fill", J(L, z))) : V.style("stroke", R), V.attr("transform", `translate(${S}, ${P})`), t.rectData = x, ft(a, tt(t.description))(
1690
+ t.description,
1691
+ O,
1692
+ x.x,
1693
+ h ? h.labelCenterY - x.height / 2 : x.y + 35,
1694
+ x.width,
1695
+ x.height,
1696
+ { class: `actor ${Jt}` },
1697
+ a
1698
+ ), !h) {
1699
+ const X = V.select("path:last-child");
1700
+ if (X.node()) {
1701
+ const et = X.node().getBBox();
1702
+ t.height = et.height + (a.sequence.labelBoxHeight ?? 0);
1703
+ }
1704
+ }
1705
+ return r || (O.attr("data-et", "participant"), O.attr("data-type", "database"), O.attr("data-id", t.name)), t.height;
1706
+ }, "drawActorTypeDatabase"), Gr = /* @__PURE__ */ f(function(e, t, a, r, i, o) {
1707
+ const s = r ? t.stopy : t.starty, n = t.x + t.width / 2, h = Ct(t, a, r, s), d = h ? h.lifelineStartY : s + 80, E = 22, u = h ? h.glyphBottomY - E : s + 12, _ = e.append("g").lower(), { look: L, theme: g, themeVariables: R } = a, { bkgColorArray: T, borderColorArray: O, actorBorder: x } = R;
1708
+ r || (Y++, _.append("line").attr("id", "actor" + Y).attr("x1", n).attr("y1", d).attr("x2", n).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = Y);
1709
+ const m = e.append("g");
1710
+ let S = Lt;
1711
+ r ? S += ` ${xt}` : S += ` ${gt}`, m.attr("class", S), m.attr("name", t.name);
1712
+ const b = pt();
1713
+ b.x = t.x, b.y = s, b.fill = "#eaeaea", b.width = t.width, b.height = t.height, b.class = "actor", m.append("line").attr("id", "actor-man-torso" + Y).attr("x1", t.x + t.width / 2 - E * 2.5).attr("y1", u).attr("x2", t.x + t.width / 2 - 15).attr("y2", u), m.append("line").attr("id", "actor-man-arms" + Y).attr("x1", t.x + t.width / 2 - E * 2.5).attr("y1", u - 10).attr("x2", t.x + t.width / 2 - E * 2.5).attr("y2", u + 10), m.append("circle").attr("cx", t.x + t.width / 2).attr("cy", u).attr("r", E), L === "neo" && m.attr("filter", `url(#${yt(i)})`);
1714
+ const P = o.get(t.name) ?? 0;
1715
+ if (ut.has(g) ? (m.style("stroke", J(O, P)), m.style("fill", J(T, P))) : m.style("stroke", x), !h) {
1716
+ const k = m.node().getBBox();
1717
+ t.height = k.height + (a.sequence.labelBoxHeight ?? 0);
1718
+ }
1719
+ return ft(a, tt(t.description))(
1720
+ t.description,
1721
+ m,
1722
+ b.x,
1723
+ h ? h.labelCenterY - b.height / 2 : b.y + 15,
1724
+ b.width,
1725
+ b.height,
1726
+ { class: `actor ${Lt}` },
1727
+ a
1728
+ ), h || m.attr("transform", `translate(0,${E / 2 + 10})`), r || (m.attr("data-et", "participant"), m.attr("data-type", "boundary"), m.attr("data-id", t.name)), t.height;
1729
+ }, "drawActorTypeBoundary"), Xr = /* @__PURE__ */ f(function(e, t, a, r, i) {
1730
+ const o = r ? t.stopy : t.starty, s = t.x + t.width / 2, n = Ct(t, a, r, o), h = n ? n.lifelineStartY : o + 80, { theme: d, themeVariables: E } = a, { bkgColorArray: u, borderColorArray: _, actorBorder: L } = E, g = e.append("g").lower();
1731
+ r || (Y++, g.append("line").attr("id", "actor" + Y).attr("x1", s).attr("y1", h).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = Y);
1732
+ const R = e.append("g");
1733
+ let T = Lt;
1734
+ r ? T += ` ${xt}` : T += ` ${gt}`, R.attr("class", T), R.attr("name", t.name), r || R.attr("data-et", "participant").attr("data-type", "actor").attr("data-id", t.name);
1735
+ const O = n ? Xt / Fe : 1, x = /* @__PURE__ */ f((k) => n ? n.glyphBottomY - (Ze - k) * O : o + k, "gy"), m = /* @__PURE__ */ f((k) => s + k * O, "gx");
1736
+ R.append("line").attr("id", "actor-man-torso" + Y).attr("x1", s).attr("y1", x(25)).attr("x2", s).attr("y2", x(45)), R.append("line").attr("id", "actor-man-arms" + Y).attr("x1", m(-Ot / 2)).attr("y1", x(33)).attr("x2", m(Ot / 2)).attr("y2", x(33)), R.append("line").attr("x1", m(-Ot / 2)).attr("y1", x(60)).attr("x2", s).attr("y2", x(45)), R.append("line").attr("x1", s).attr("y1", x(45)).attr("x2", m(Ot / 2 - 2)).attr("y2", x(60));
1737
+ const S = R.append("circle");
1738
+ S.attr("cx", t.x + t.width / 2), S.attr("cy", x(10)), S.attr("r", 15 * O), S.attr("width", t.width), S.attr("height", t.height), n || (t.height = Fe);
1739
+ const b = pt();
1740
+ b.x = t.x, b.y = o, b.fill = "#eaeaea", b.width = t.width, b.height = t.height, b.class = "actor", b.rx = 3, b.ry = 3;
1741
+ const P = i.get(t.name) ?? 0;
1742
+ return ut.has(d) ? (R.style("stroke", J(_, P)), R.style("fill", J(u, P))) : R.style("stroke", L), ft(a, tt(t.description))(
1743
+ t.description,
1744
+ R,
1745
+ b.x,
1746
+ n ? n.labelCenterY - b.height / 2 : o + 35,
1747
+ b.width,
1748
+ b.height,
1749
+ { class: `actor ${Lt}` },
1750
+ a
1751
+ ), t.height;
1752
+ }, "drawActorTypeActor"), Jr = /* @__PURE__ */ f(async function(e, t, a, r, i, o, s) {
1753
+ const n = s ?? new Map(
1754
+ [...o.db.getActors().values()].map((h, d) => [h.name, d])
1755
+ );
1756
+ switch (t.type) {
1757
+ case "actor":
1758
+ return await Xr(e, t, a, r, n);
1759
+ case "participant":
1760
+ return await Kr(
1761
+ e,
1762
+ t,
1763
+ a,
1764
+ r,
1765
+ i,
1766
+ n
1767
+ );
1768
+ case "boundary":
1769
+ return await Gr(
1770
+ e,
1771
+ t,
1772
+ a,
1773
+ r,
1774
+ i,
1775
+ n
1776
+ );
1777
+ case "control":
1778
+ return await qr(
1779
+ e,
1780
+ t,
1781
+ a,
1782
+ r,
1783
+ i,
1784
+ n
1785
+ );
1786
+ case "entity":
1787
+ return await zr(
1788
+ e,
1789
+ t,
1790
+ a,
1791
+ r,
1792
+ i,
1793
+ n
1794
+ );
1795
+ case "database":
1796
+ return await Ur(
1797
+ e,
1798
+ t,
1799
+ a,
1800
+ r,
1801
+ i,
1802
+ n
1803
+ );
1804
+ case "collections":
1805
+ return await Hr(
1806
+ e,
1807
+ t,
1808
+ a,
1809
+ r,
1810
+ i,
1811
+ n
1812
+ );
1813
+ case "queue":
1814
+ return await Fr(
1815
+ e,
1816
+ t,
1817
+ a,
1818
+ r,
1819
+ i,
1820
+ n
1821
+ );
1822
+ }
1823
+ }, "drawActor"), Zr = /* @__PURE__ */ f(function(e, t, a) {
1824
+ const i = e.append("g");
1825
+ je(i, t), t.name && ft(a)(
1826
+ t.name,
1827
+ i,
1828
+ t.x,
1829
+ t.y + a.boxTextMargin + (t.textMaxHeight || 0) / 2,
1830
+ t.width,
1831
+ 0,
1832
+ { class: "text" },
1833
+ a
1834
+ ), i.lower();
1835
+ }, "drawBox"), Qr = /* @__PURE__ */ f(function(e) {
1836
+ return e.append("g");
1837
+ }, "anchorElement"), $r = /* @__PURE__ */ f(function(e, t, a, r, i, o, s) {
1838
+ const { theme: n, themeVariables: h } = r, { bkgColorArray: d, borderColorArray: E, mainBkg: u } = h, _ = pt(), L = t.anchored, g = t.actor;
1839
+ _.x = t.startx, _.y = t.starty, _.class = "activation" + i % 3, _.width = t.stopx - t.startx, _.height = a - t.starty;
1840
+ const R = Dt(L, _), O = (s ?? new Map(
1841
+ [...o.db.getActors().values()].map((x, m) => [x.name, m])
1842
+ )).get(g) ?? 0;
1843
+ ut.has(n) && (R.style("stroke", J(E, O)), R.style("fill", J(d, O) ?? u));
1844
+ }, "drawActivation"), jr = /* @__PURE__ */ f(async function(e, t, a, r, i) {
1845
+ const {
1846
+ boxMargin: o,
1847
+ boxTextMargin: s,
1848
+ labelBoxHeight: n,
1849
+ labelBoxWidth: h,
1850
+ messageFontFamily: d,
1851
+ messageFontSize: E,
1852
+ messageFontWeight: u
1853
+ } = r, _ = e.append("g").attr("data-et", "control-structure").attr("data-id", "i" + i.id), L = /* @__PURE__ */ f(function(T, O, x, m) {
1854
+ return _.append("line").attr("x1", T).attr("y1", O).attr("x2", x).attr("y2", m).attr("class", "loopLine");
1855
+ }, "drawLoopLine");
1856
+ L(t.startx, t.starty, t.stopx, t.starty), L(t.stopx, t.starty, t.stopx, t.stopy), L(t.startx, t.stopy, t.stopx, t.stopy), L(t.startx, t.starty, t.startx, t.stopy), t.sections !== void 0 && t.sections.forEach(function(T) {
1857
+ L(t.startx, T.y, t.stopx, T.y).style(
1858
+ "stroke-dasharray",
1859
+ "3, 3"
1860
+ );
1861
+ });
1862
+ let g = le();
1863
+ g.text = a, g.x = t.startx, g.y = t.starty, g.fontFamily = d, g.fontSize = E, g.fontWeight = u, g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.width = Math.max(h ?? 0, 50), g.height = n + (r.look === "neo" ? 15 : 0) || 20, g.textMargin = s, g.class = "labelText", Qe(_, g), g = tr(), g.text = t.title, g.x = t.startx + h / 2 + (t.stopx - t.startx) / 2, g.y = t.starty + o + s, g.anchor = "middle", g.valign = "middle", g.textMargin = s, g.class = "loopText", g.fontFamily = d, g.fontSize = E, g.fontWeight = u, g.wrap = !0;
1864
+ let R = tt(g.text) ? await Gt(_, g, t) : Nt(_, g);
1865
+ if (t.sectionTitles !== void 0) {
1866
+ for (const [T, O] of Object.entries(t.sectionTitles))
1867
+ if (O.message) {
1868
+ g.text = O.message, g.x = t.startx + (t.stopx - t.startx) / 2, g.y = t.sections[T].y + o + s, g.class = "sectionTitle", g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.fontFamily = d, g.fontSize = E, g.fontWeight = u, g.wrap = t.wrap, tt(g.text) ? (t.starty = t.sections[T].y, await Gt(_, g, t)) : Nt(_, g);
1869
+ let x = Math.round(
1870
+ R.map((m) => (m._groups || m)[0][0].getBBox().height).reduce((m, S) => m + S)
1871
+ );
1872
+ t.sections[T].height += x - (o + s);
1873
+ }
1874
+ }
1875
+ return t.height = Math.round(t.stopy - t.starty), _;
1876
+ }, "drawLoop"), je = /* @__PURE__ */ f(function(e, t) {
1877
+ Sr(e, t);
1878
+ }, "drawBackgroundRect"), ta = /* @__PURE__ */ f(function(e, t) {
1879
+ e.append("defs").append("symbol").attr("id", t + "-database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1880
+ "d",
1881
+ "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"
1882
+ );
1883
+ }, "insertDatabaseIcon"), ea = /* @__PURE__ */ f(function(e, t) {
1884
+ e.append("defs").append("symbol").attr("id", t + "-computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1885
+ "d",
1886
+ "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"
1887
+ );
1888
+ }, "insertComputerIcon"), ra = /* @__PURE__ */ f(function(e, t) {
1889
+ e.append("defs").append("symbol").attr("id", t + "-clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1890
+ "d",
1891
+ "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"
1892
+ );
1893
+ }, "insertClockIcon"), aa = /* @__PURE__ */ f(function(e, t) {
1894
+ e.append("defs").append("marker").attr("id", t + "-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");
1895
+ }, "insertArrowHead"), sa = /* @__PURE__ */ f(function(e, t) {
1896
+ e.append("defs").append("marker").attr("id", t + "-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");
1897
+ }, "insertArrowFilledHead"), ia = /* @__PURE__ */ f(function(e, t) {
1898
+ e.append("defs").append("marker").attr("id", t + "-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);
1899
+ }, "insertSequenceNumber"), na = /* @__PURE__ */ f(function(e, t) {
1900
+ e.append("defs").append("marker").attr("id", t + "-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");
1901
+ }, "insertArrowCrossHead"), yt = /* @__PURE__ */ f((e) => e ? `${e}-drop-shadow` : "drop-shadow", "dropShadowId"), oa = /* @__PURE__ */ f(function(e, t, a) {
1902
+ const { theme: r } = t;
1903
+ e.append("defs").append("filter").attr("id", yt(a)).attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", "0.06").attr("flood-color", `${r === "redux" || r === "redux-color" ? "#000000" : "#FFFFFF"}`);
1904
+ }, "insertDropShadow"), tr = /* @__PURE__ */ f(function() {
1905
+ return {
1906
+ x: 0,
1907
+ y: 0,
1908
+ fill: void 0,
1909
+ anchor: void 0,
1910
+ style: "#666",
1911
+ width: void 0,
1912
+ height: void 0,
1913
+ textMargin: 0,
1914
+ rx: 0,
1915
+ ry: 0,
1916
+ tspan: !0,
1917
+ valign: void 0
1918
+ };
1919
+ }, "getTextObj"), ca = /* @__PURE__ */ f(function() {
1920
+ return {
1921
+ x: 0,
1922
+ y: 0,
1923
+ fill: "#EDF2AE",
1924
+ stroke: "#666",
1925
+ width: 100,
1926
+ anchor: "start",
1927
+ height: 100,
1928
+ rx: 0,
1929
+ ry: 0
1930
+ };
1931
+ }, "getNoteRect"), ft = /* @__PURE__ */ (function() {
1932
+ function e(o, s, n, h, d, E, u) {
1933
+ const _ = s.append("text").attr("x", n + d / 2).attr("y", h + E / 2 + 5).style("text-anchor", "middle").text(o);
1934
+ i(_, u);
1935
+ }
1936
+ f(e, "byText");
1937
+ function t(o, s, n, h, d, E, u, _) {
1938
+ const { actorFontSize: L, actorFontFamily: g, actorFontWeight: R } = _, [T, O] = Ge(L), x = o.split(N.lineBreakRegex);
1939
+ for (let m = 0; m < x.length; m++) {
1940
+ const S = m * T - T * (x.length - 1) / 2, b = s.append("text").attr("x", n + d / 2).attr("y", h).style("text-anchor", "middle").style("font-size", O).style("font-weight", R).style("font-family", g);
1941
+ b.append("tspan").attr("x", n + d / 2).attr("dy", S).text(x[m]), b.attr("y", h + E / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), i(b, u);
1942
+ }
1943
+ }
1944
+ f(t, "byTspan");
1945
+ function a(o, s, n, h, d, E, u, _) {
1946
+ const L = s.append("switch"), R = L.append("foreignObject").attr("x", n).attr("y", h).attr("width", d).attr("height", E).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1947
+ R.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(o), t(o, L, n, h, d, E, u, _), i(R, u);
1948
+ }
1949
+ f(a, "byFo");
1950
+ async function r(o, s, n, h, d, E, u, _) {
1951
+ const L = await vt(o, zt()), g = s.append("switch"), T = g.append("foreignObject").attr("x", n + d / 2 - L.width / 2).attr("y", h + E / 2 - L.height / 2).attr("width", L.width).attr("height", L.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1952
+ T.append("div").style("text-align", "center").style("vertical-align", "middle").html(await Xe(o, zt())), t(o, g, n, h, d, E, u, _), i(T, u);
1953
+ }
1954
+ f(r, "byKatex");
1955
+ function i(o, s) {
1956
+ for (const n in s)
1957
+ s.hasOwnProperty(n) && o.attr(n, s[n]);
1958
+ }
1959
+ return f(i, "_setTextAttrs"), function(o, s = !1) {
1960
+ return s ? r : o.textPlacement === "fo" ? a : o.textPlacement === "old" ? e : t;
1961
+ };
1962
+ })(), la = /* @__PURE__ */ (function() {
1963
+ function e(i, o, s, n, h, d, E) {
1964
+ const u = o.append("text").attr("x", s).attr("y", n).style("text-anchor", "start").text(i);
1965
+ r(u, E);
1966
+ }
1967
+ f(e, "byText");
1968
+ function t(i, o, s, n, h, d, E, u) {
1969
+ const { actorFontSize: _, actorFontFamily: L, actorFontWeight: g } = u, R = i.split(N.lineBreakRegex);
1970
+ for (let T = 0; T < R.length; T++) {
1971
+ const O = T * _ - _ * (R.length - 1) / 2, x = o.append("text").attr("x", s).attr("y", n).style("text-anchor", "start").style("font-size", _).style("font-weight", g).style("font-family", L);
1972
+ x.append("tspan").attr("x", s).attr("dy", O).text(R[T]), x.attr("y", n + d / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(x, E);
1973
+ }
1974
+ }
1975
+ f(t, "byTspan");
1976
+ function a(i, o, s, n, h, d, E, u) {
1977
+ const _ = o.append("switch"), g = _.append("foreignObject").attr("x", s).attr("y", n).attr("width", h).attr("height", d).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1978
+ g.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, _, s, n, h, d, E, u), r(g, E);
1979
+ }
1980
+ f(a, "byFo");
1981
+ function r(i, o) {
1982
+ for (const s in o)
1983
+ o.hasOwnProperty(s) && i.attr(s, o[s]);
1984
+ }
1985
+ return f(r, "_setTextAttrs"), function(i) {
1986
+ return i.textPlacement === "fo" ? a : i.textPlacement === "old" ? e : t;
1987
+ };
1988
+ })(), ha = /* @__PURE__ */ f(function(e, t) {
1989
+ e.append("defs").append("marker").attr("id", t + "-solidTopArrowHead").attr("refX", 7.9).attr("refY", 7.25).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 8 L 0 8 z");
1990
+ }, "insertSolidTopArrowHead"), da = /* @__PURE__ */ f(function(e, t) {
1991
+ e.append("defs").append("marker").attr("id", t + "-solidBottomArrowHead").attr("refX", 7.9).attr("refY", 0.75).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 0 L 0 8 z");
1992
+ }, "insertSolidBottomArrowHead"), Ta = /* @__PURE__ */ f(function(e, t) {
1993
+ e.append("defs").append("marker").attr("id", t + "-stickTopArrowHead").attr("refX", 7.5).attr("refY", 7).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 7 7").attr("stroke", "black").attr("stroke-width", 1.5).attr("fill", "none");
1994
+ }, "insertStickTopArrowHead"), pa = /* @__PURE__ */ f(function(e, t) {
1995
+ e.append("defs").append("marker").attr("id", t + "-stickBottomArrowHead").attr("refX", 7.5).attr("refY", 0).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 7 L 7 0").attr("stroke", "black").attr("stroke-width", 1.5).attr("fill", "none");
1996
+ }, "insertStickBottomArrowHead"), q = {
1997
+ drawRect: Dt,
1998
+ drawText: Nt,
1999
+ drawLabel: Qe,
2000
+ drawActor: Jr,
2001
+ drawBox: Zr,
2002
+ drawPopup: Wr,
2003
+ anchorElement: Qr,
2004
+ drawActivation: $r,
2005
+ drawLoop: jr,
2006
+ drawBackgroundRect: je,
2007
+ insertArrowHead: aa,
2008
+ insertArrowFilledHead: sa,
2009
+ insertSequenceNumber: ia,
2010
+ insertArrowCrossHead: na,
2011
+ insertDatabaseIcon: ta,
2012
+ insertComputerIcon: ea,
2013
+ insertClockIcon: ra,
2014
+ getTextObj: tr,
2015
+ getNoteRect: ca,
2016
+ fixLifeLineHeights: $e,
2017
+ sanitizeUrl: Ue.sanitizeUrl,
2018
+ insertDropShadow: oa,
2019
+ insertSolidTopArrowHead: ha,
2020
+ insertSolidBottomArrowHead: da,
2021
+ insertStickTopArrowHead: Ta,
2022
+ insertStickBottomArrowHead: pa
2023
+ }, l = {}, I = {
2024
+ data: {
2025
+ startx: void 0,
2026
+ stopx: void 0,
2027
+ starty: void 0,
2028
+ stopy: void 0
2029
+ },
2030
+ verticalPos: 0,
2031
+ sequenceItems: [],
2032
+ activations: [],
2033
+ models: {
2034
+ getHeight: /* @__PURE__ */ f(function() {
2035
+ return Math.max.apply(
2036
+ null,
2037
+ this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
2038
+ ) + (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));
2039
+ }, "getHeight"),
2040
+ clear: /* @__PURE__ */ f(function() {
2041
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
2042
+ }, "clear"),
2043
+ addBox: /* @__PURE__ */ f(function(e) {
2044
+ this.boxes.push(e);
2045
+ }, "addBox"),
2046
+ addActor: /* @__PURE__ */ f(function(e) {
2047
+ this.actors.push(e);
2048
+ }, "addActor"),
2049
+ addLoop: /* @__PURE__ */ f(function(e) {
2050
+ this.loops.push(e);
2051
+ }, "addLoop"),
2052
+ addMessage: /* @__PURE__ */ f(function(e) {
2053
+ this.messages.push(e);
2054
+ }, "addMessage"),
2055
+ addNote: /* @__PURE__ */ f(function(e) {
2056
+ this.notes.push(e);
2057
+ }, "addNote"),
2058
+ lastActor: /* @__PURE__ */ f(function() {
2059
+ return this.actors[this.actors.length - 1];
2060
+ }, "lastActor"),
2061
+ lastLoop: /* @__PURE__ */ f(function() {
2062
+ return this.loops[this.loops.length - 1];
2063
+ }, "lastLoop"),
2064
+ lastMessage: /* @__PURE__ */ f(function() {
2065
+ return this.messages[this.messages.length - 1];
2066
+ }, "lastMessage"),
2067
+ lastNote: /* @__PURE__ */ f(function() {
2068
+ return this.notes[this.notes.length - 1];
2069
+ }, "lastNote"),
2070
+ actors: [],
2071
+ boxes: [],
2072
+ loops: [],
2073
+ messages: [],
2074
+ notes: []
2075
+ },
2076
+ init: /* @__PURE__ */ f(function() {
2077
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
2078
+ startx: void 0,
2079
+ stopx: void 0,
2080
+ starty: void 0,
2081
+ stopy: void 0
2082
+ }, this.verticalPos = 0, ar(j());
2083
+ }, "init"),
2084
+ updateVal: /* @__PURE__ */ f(function(e, t, a, r) {
2085
+ e[t] === void 0 ? e[t] = a : e[t] = r(a, e[t]);
2086
+ }, "updateVal"),
2087
+ updateBounds: /* @__PURE__ */ f(function(e, t, a, r) {
2088
+ const i = this;
2089
+ let o = 0;
2090
+ function s(n) {
2091
+ return /* @__PURE__ */ f(function(d) {
2092
+ o++;
2093
+ const E = i.sequenceItems.length - o + 1;
2094
+ i.updateVal(d, "starty", t - E * l.boxMargin, Math.min), i.updateVal(d, "stopy", r + E * l.boxMargin, Math.max), i.updateVal(I.data, "startx", e - E * l.boxMargin, Math.min), i.updateVal(I.data, "stopx", a + E * l.boxMargin, Math.max), n !== "activation" && (i.updateVal(d, "startx", e - E * l.boxMargin, Math.min), i.updateVal(d, "stopx", a + E * l.boxMargin, Math.max), i.updateVal(I.data, "starty", t - E * l.boxMargin, Math.min), i.updateVal(I.data, "stopy", r + E * l.boxMargin, Math.max));
2095
+ }, "updateItemBounds");
2096
+ }
2097
+ f(s, "updateFn"), this.sequenceItems.forEach(s()), this.activations.forEach(s("activation"));
2098
+ }, "updateBounds"),
2099
+ insert: /* @__PURE__ */ f(function(e, t, a, r) {
2100
+ const i = N.getMin(e, a), o = N.getMax(e, a), s = N.getMin(t, r), n = N.getMax(t, r);
2101
+ this.updateVal(I.data, "startx", i, Math.min), this.updateVal(I.data, "starty", s, Math.min), this.updateVal(I.data, "stopx", o, Math.max), this.updateVal(I.data, "stopy", n, Math.max), this.updateBounds(i, s, o, n);
2102
+ }, "insert"),
2103
+ newActivation: /* @__PURE__ */ f(function(e, t, a) {
2104
+ const r = a.get(e.from), i = Qt(e.from).length || 0, o = r.x + r.width / 2 + (i - 1) * l.activationWidth / 2;
2105
+ this.activations.push({
2106
+ startx: o,
2107
+ starty: this.verticalPos + 2,
2108
+ stopx: o + l.activationWidth,
2109
+ stopy: void 0,
2110
+ actor: e.from,
2111
+ anchored: q.anchorElement(t)
2112
+ });
2113
+ }, "newActivation"),
2114
+ endActivation: /* @__PURE__ */ f(function(e) {
2115
+ const t = this.activations.map(function(a) {
2116
+ return a.actor;
2117
+ }).lastIndexOf(e.from);
2118
+ return this.activations.splice(t, 1)[0];
2119
+ }, "endActivation"),
2120
+ createLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
2121
+ return {
2122
+ startx: void 0,
2123
+ starty: this.verticalPos,
2124
+ stopx: void 0,
2125
+ stopy: void 0,
2126
+ title: e.message,
2127
+ wrap: e.wrap,
2128
+ width: e.width,
2129
+ height: 0,
2130
+ fill: t
2131
+ };
2132
+ }, "createLoop"),
2133
+ newLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
2134
+ this.sequenceItems.push(this.createLoop(e, t));
2135
+ }, "newLoop"),
2136
+ endLoop: /* @__PURE__ */ f(function() {
2137
+ return this.sequenceItems.pop();
2138
+ }, "endLoop"),
2139
+ isLoopOverlap: /* @__PURE__ */ f(function() {
2140
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
2141
+ }, "isLoopOverlap"),
2142
+ addSectionToLoop: /* @__PURE__ */ f(function(e) {
2143
+ const t = this.sequenceItems.pop();
2144
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: I.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
2145
+ }, "addSectionToLoop"),
2146
+ saveVerticalPos: /* @__PURE__ */ f(function() {
2147
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
2148
+ }, "saveVerticalPos"),
2149
+ resetVerticalPos: /* @__PURE__ */ f(function() {
2150
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
2151
+ }, "resetVerticalPos"),
2152
+ bumpVerticalPos: /* @__PURE__ */ f(function(e) {
2153
+ this.verticalPos = this.verticalPos + e, this.data.stopy = N.getMax(this.data.stopy, this.verticalPos);
2154
+ }, "bumpVerticalPos"),
2155
+ getVerticalPos: /* @__PURE__ */ f(function() {
2156
+ return this.verticalPos;
2157
+ }, "getVerticalPos"),
2158
+ getBounds: /* @__PURE__ */ f(function() {
2159
+ return { bounds: this.data, models: this.models };
2160
+ }, "getBounds")
2161
+ }, Ea = /* @__PURE__ */ f(async function(e, t, a) {
2162
+ I.bumpVerticalPos(l.boxMargin), t.height = l.boxMargin, t.starty = I.getVerticalPos();
2163
+ const r = pt();
2164
+ r.x = t.startx, r.y = t.starty, r.width = t.width || l.width, r.class = "note";
2165
+ const i = e.append("g");
2166
+ i.attr("data-et", "note"), i.attr("data-id", "i" + a);
2167
+ const o = q.drawRect(i, r), s = le();
2168
+ s.x = t.startx, s.y = t.starty, s.width = r.width, s.dy = "1em", s.text = t.message, s.class = "noteText", s.fontFamily = l.noteFontFamily, s.fontSize = l.noteFontSize, s.fontWeight = l.noteFontWeight, s.anchor = l.noteAlign, s.textMargin = l.noteMargin, s.valign = "center";
2169
+ const n = tt(s.text) ? await Gt(i, s) : Nt(i, s), h = Math.round(
2170
+ n.map((d) => (d._groups || d)[0][0].getBBox().height).reduce((d, E) => d + E)
2171
+ );
2172
+ o.attr("height", h + 2 * l.noteMargin), t.height += h + 2 * l.noteMargin, I.bumpVerticalPos(h + 2 * l.noteMargin), t.stopy = t.starty + h + 2 * l.noteMargin, t.stopx = t.startx + r.width, I.insert(t.startx, t.starty, t.stopx, t.stopy), I.models.addNote(t);
2173
+ }, "drawNote"), qe = /* @__PURE__ */ f(function(e, t, a, r, i, o, s) {
2174
+ const n = r.db.getActors(), h = n.get(t.from), d = n.get(t.to), E = a.sequenceVisible;
2175
+ let u = h.x + h.width / 2, _ = d.x + d.width / 2;
2176
+ const L = u <= _, g = or(t, r), R = e.append("g"), T = 16.5, O = /* @__PURE__ */ f((P, k) => {
2177
+ const B = P ? T : -T;
2178
+ return k ? -B : B;
2179
+ }, "getCircleOffset"), x = /* @__PURE__ */ f((P) => {
2180
+ R.append("circle").attr("cx", P).attr("cy", s).attr("r", 5).attr("width", 10).attr("height", 10);
2181
+ }, "drawCircle"), { CENTRAL_CONNECTION: m, CENTRAL_CONNECTION_REVERSE: S, CENTRAL_CONNECTION_DUAL: b } = r.db.LINETYPE;
2182
+ if (E)
2183
+ switch (t.centralConnection) {
2184
+ case m:
2185
+ g && (_ += O(L, !0));
2186
+ break;
2187
+ case S:
2188
+ g || (u += O(L, !1));
2189
+ break;
2190
+ case b:
2191
+ g ? _ += O(L, !0) : u += O(L, !1);
2192
+ break;
2193
+ }
2194
+ switch (t.centralConnection) {
2195
+ case m:
2196
+ x(_);
2197
+ break;
2198
+ case S:
2199
+ x(u);
2200
+ break;
2201
+ case b:
2202
+ x(u), x(_);
2203
+ break;
2204
+ }
2205
+ }, "drawCentralConnection"), bt = /* @__PURE__ */ f((e) => ({
2206
+ fontFamily: e.messageFontFamily,
2207
+ fontSize: e.messageFontSize,
2208
+ fontWeight: e.messageFontWeight
2209
+ }), "messageFont"), At = /* @__PURE__ */ f((e) => ({
2210
+ fontFamily: e.noteFontFamily,
2211
+ fontSize: e.noteFontSize,
2212
+ fontWeight: e.noteFontWeight
2213
+ }), "noteFont"), oe = /* @__PURE__ */ f((e) => ({
2214
+ fontFamily: e.actorFontFamily,
2215
+ fontSize: e.actorFontSize,
2216
+ fontWeight: e.actorFontWeight
2217
+ }), "actorFont");
2218
+ async function er(e, t) {
2219
+ I.bumpVerticalPos(10);
2220
+ const { startx: a, stopx: r, message: i } = t, o = N.splitBreaks(i).length, s = tt(i), n = s ? await vt(i, j()) : Q.calculateTextDimensions(i, bt(l));
2221
+ if (!s) {
2222
+ const u = n.height / o;
2223
+ t.height += u, I.bumpVerticalPos(u);
2224
+ }
2225
+ let h, d = n.height - 10;
2226
+ const E = n.width;
2227
+ if (a === r) {
2228
+ h = I.getVerticalPos() + d, l.rightAngles || (d += l.boxMargin, h = I.getVerticalPos() + d), d += 30;
2229
+ const u = N.getMax(E / 2, l.width / 2);
2230
+ I.insert(
2231
+ a - u,
2232
+ I.getVerticalPos() - 10 + d,
2233
+ r + u,
2234
+ I.getVerticalPos() + 30 + d
2235
+ );
2236
+ } else
2237
+ d += l.boxMargin, h = I.getVerticalPos() + d, I.insert(a, h - 10, r, h);
2238
+ return I.bumpVerticalPos(d), t.height += d, t.stopy = t.starty + t.height, I.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), h;
2239
+ }
2240
+ f(er, "boundMessage");
2241
+ var ua = /* @__PURE__ */ f(async function(e, t, a, r, i, o) {
2242
+ const { startx: s, stopx: n, starty: h, message: d, type: E, sequenceIndex: u, sequenceVisible: _ } = t, L = Q.calculateTextDimensions(d, bt(l)), g = le();
2243
+ g.x = Math.min(s, n), g.y = h + 10, g.width = Math.abs(n - s), g.class = "messageText", g.dy = "1em", g.text = d, g.fontFamily = l.messageFontFamily, g.fontSize = l.messageFontSize, g.fontWeight = l.messageFontWeight, g.anchor = l.messageAlign, g.valign = "center", g.textMargin = l.wrapPadding, g.tspan = !1, tt(g.text) ? await Gt(e, g, { startx: s, stopx: n, starty: a }) : Nt(e, g);
2244
+ const R = L.width;
2245
+ let T;
2246
+ if (s === n) {
2247
+ const x = _ || l.showSequenceNumbers, m = or(i, r), S = Ra(i, r), b = s + (x && (m || S) ? 10 : 0);
2248
+ l.rightAngles ? T = e.append("path").attr(
2249
+ "d",
2250
+ `M ${b},${a} H ${s + N.getMax(l.width / 2, R / 2)} V ${a + 25} H ${s}`
2251
+ ) : T = e.append("path").attr(
2252
+ "d",
2253
+ "M " + b + "," + a + " C " + (b + 60) + "," + (a - 10) + " " + (s + 60) + "," + (a + 30) + " " + s + "," + (a + 20)
2254
+ ), ie(i, r) && qe(e, i, t, r, s, n, a);
2255
+ } else
2256
+ T = e.append("line"), T.attr("x1", s), T.attr("y1", a), T.attr("x2", n), T.attr("y2", a), ie(i, r) && qe(e, i, t, r, s, n, a);
2257
+ E === r.db.LINETYPE.DOTTED || E === r.db.LINETYPE.DOTTED_CROSS || E === r.db.LINETYPE.DOTTED_POINT || E === r.db.LINETYPE.DOTTED_OPEN || E === r.db.LINETYPE.BIDIRECTIONAL_DOTTED || E === r.db.LINETYPE.SOLID_TOP_DOTTED || E === r.db.LINETYPE.SOLID_BOTTOM_DOTTED || E === r.db.LINETYPE.STICK_TOP_DOTTED || E === r.db.LINETYPE.STICK_BOTTOM_DOTTED || E === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || E === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || E === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || E === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED ? (T.style("stroke-dasharray", "3, 3"), T.attr("class", "messageLine1")) : T.attr("class", "messageLine0"), T.attr("data-et", "message"), T.attr("data-id", "i" + t.id), T.attr("data-from", t.from), T.attr("data-to", t.to);
2258
+ let O = "";
2259
+ if (l.arrowMarkerAbsolute && (O = mr(!0)), T.attr("stroke-width", 2), T.attr("stroke", "none"), T.style("fill", "none"), (E === r.db.LINETYPE.SOLID_TOP || E === r.db.LINETYPE.SOLID_TOP_DOTTED) && T.attr("marker-end", "url(" + O + "#" + o + "-solidTopArrowHead)"), (E === r.db.LINETYPE.SOLID_BOTTOM || E === r.db.LINETYPE.SOLID_BOTTOM_DOTTED) && T.attr("marker-end", "url(" + O + "#" + o + "-solidBottomArrowHead)"), (E === r.db.LINETYPE.STICK_TOP || E === r.db.LINETYPE.STICK_TOP_DOTTED) && T.attr("marker-end", "url(" + O + "#" + o + "-stickTopArrowHead)"), (E === r.db.LINETYPE.STICK_BOTTOM || E === r.db.LINETYPE.STICK_BOTTOM_DOTTED) && T.attr("marker-end", "url(" + O + "#" + o + "-stickBottomArrowHead)"), (E === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || E === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED) && T.attr("marker-start", "url(" + O + "#" + o + "-solidBottomArrowHead)"), (E === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || E === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED) && T.attr("marker-start", "url(" + O + "#" + o + "-solidTopArrowHead)"), (E === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || E === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED) && T.attr("marker-start", "url(" + O + "#" + o + "-stickBottomArrowHead)"), (E === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || E === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED) && T.attr("marker-start", "url(" + O + "#" + o + "-stickTopArrowHead)"), (E === r.db.LINETYPE.SOLID || E === r.db.LINETYPE.DOTTED) && T.attr("marker-end", "url(" + O + "#" + o + "-arrowhead)"), (E === r.db.LINETYPE.BIDIRECTIONAL_SOLID || E === r.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (T.attr("marker-start", "url(" + O + "#" + o + "-arrowhead)"), T.attr("marker-end", "url(" + O + "#" + o + "-arrowhead)")), (E === r.db.LINETYPE.SOLID_POINT || E === r.db.LINETYPE.DOTTED_POINT) && T.attr("marker-end", "url(" + O + "#" + o + "-filled-head)"), (E === r.db.LINETYPE.SOLID_CROSS || E === r.db.LINETYPE.DOTTED_CROSS) && T.attr("marker-end", "url(" + O + "#" + o + "-crosshead)"), _ || l.showSequenceNumbers) {
2260
+ const x = E === r.db.LINETYPE.BIDIRECTIONAL_SOLID || E === r.db.LINETYPE.BIDIRECTIONAL_DOTTED, m = E === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || E === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || E === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || E === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || E === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || E === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || E === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || E === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED, S = 6, b = ie(i, r);
2261
+ let P = s, k = n;
2262
+ x ? (s < n ? P = s + S * 2 : (P = s - S + (b ? -5 : 0), P += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), T.attr("x1", P)) : m ? (n > s ? k = n - 2 * S : (k = n - S, P += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), k += b ? 15 : 0, T.attr("x2", k), T.attr("x1", P)) : T.attr("x1", s + S);
2263
+ let B = 0;
2264
+ const V = s === n, K = s <= n;
2265
+ V ? B = t.fromBounds + 1 : m ? B = K ? t.toBounds - 1 : t.fromBounds + 1 : B = K ? t.fromBounds + 1 : t.toBounds - 1;
2266
+ let z = "12px";
2267
+ const X = u.toString().length;
2268
+ X > 5 ? z = "7px" : X > 3 && (z = "9px"), e.append("line").attr("x1", B).attr("y1", a).attr("x2", B).attr("y2", a).attr("stroke-width", 0).attr("marker-start", "url(" + O + "#" + o + "-sequencenumber)"), e.append("text").attr("x", B).attr("y", a + 4).attr("font-family", "sans-serif").attr("font-size", z).attr("text-anchor", "middle").attr("class", "sequenceNumber").text(u);
2269
+ }
2270
+ }, "drawMessage"), fa = /* @__PURE__ */ f(function(e, t, a, r, i, o, s) {
2271
+ let n = 0, h = 0, d, E = 0;
2272
+ for (const u of r) {
2273
+ const _ = t.get(u), L = _.box;
2274
+ d && d != L && (s || I.models.addBox(d), h += l.boxMargin + d.margin), L && L != d && (s || (L.x = n + h, L.y = i), h += L.margin), _.width = N.getMax(_.width || l.width, l.width), _.height = N.getMax(_.height || l.height, l.height), _.margin = _.margin || l.actorMargin, E = N.getMax(E, _.height), a.get(_.name) && (h += _.width / 2), _.x = n + h, _.starty = I.getVerticalPos(), I.insert(_.x, i, _.x + _.width, _.height), n += _.width + h, _.box && (_.box.width = n + L.margin - _.box.x), h = _.margin, d = _.box, I.models.addActor(_);
2275
+ }
2276
+ d && !s && I.models.addBox(d), I.bumpVerticalPos(E);
2277
+ }, "addActorRenderingData"), ce = /* @__PURE__ */ f(async function(e, t, a, r, i, o, s) {
2278
+ if (r) {
2279
+ let n = 0;
2280
+ I.bumpVerticalPos(l.boxMargin * 2);
2281
+ for (const h of a) {
2282
+ const d = t.get(h);
2283
+ d.stopy || (d.stopy = I.getVerticalPos());
2284
+ const E = await q.drawActor(
2285
+ e,
2286
+ d,
2287
+ l,
2288
+ !0,
2289
+ i,
2290
+ o,
2291
+ s
2292
+ );
2293
+ n = N.getMax(n, E);
2294
+ }
2295
+ I.bumpVerticalPos(n + l.boxMargin);
2296
+ } else
2297
+ for (const n of a) {
2298
+ const h = t.get(n);
2299
+ await q.drawActor(e, h, l, !1, i, o, s);
2300
+ }
2301
+ }, "drawActors"), rr = /* @__PURE__ */ f(function(e, t, a, r) {
2302
+ let i = 0, o = 0;
2303
+ for (const s of a) {
2304
+ const n = t.get(s), h = ga(n), d = q.drawPopup(
2305
+ e,
2306
+ n,
2307
+ h,
2308
+ l,
2309
+ l.forceMenus,
2310
+ r
2311
+ );
2312
+ d.height > i && (i = d.height), d.width + n.x > o && (o = d.width + n.x);
2313
+ }
2314
+ return { maxHeight: i, maxWidth: o };
2315
+ }, "drawActorsPopup"), ar = /* @__PURE__ */ f(function(e) {
2316
+ fr(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);
2317
+ }, "setConf"), Qt = /* @__PURE__ */ f(function(e) {
2318
+ return I.activations.filter(function(t) {
2319
+ return t.actor === e;
2320
+ });
2321
+ }, "actorActivations"), ze = /* @__PURE__ */ f(function(e, t) {
2322
+ const a = t.get(e), r = Qt(e), i = r.reduce(
2323
+ function(s, n) {
2324
+ return N.getMin(s, n.startx);
2325
+ },
2326
+ a.x + a.width / 2 - 1
2327
+ ), o = r.reduce(
2328
+ function(s, n) {
2329
+ return N.getMax(s, n.stopx);
2330
+ },
2331
+ a.x + a.width / 2 + 1
2332
+ );
2333
+ return [i, o];
2334
+ }, "activationBounds");
2335
+ function Tt(e, t, a, r, i) {
2336
+ I.bumpVerticalPos(a);
2337
+ let o = r;
2338
+ if (t.id && t.message && e[t.id]) {
2339
+ const s = e[t.id].width, n = bt(l);
2340
+ t.message = Q.wrapLabel(`[${t.message}]`, s - 2 * l.wrapPadding, n), t.width = s, t.wrap = !0;
2341
+ const h = Q.calculateTextDimensions(t.message, n), d = N.getMax(h.height, l.labelBoxHeight);
2342
+ o = r + d, nt.debug(`${d} - ${t.message}`);
2343
+ }
2344
+ i(t), I.bumpVerticalPos(o);
2345
+ }
2346
+ f(Tt, "adjustLoopHeightForWrap");
2347
+ function sr(e, t, a, r, i, o, s) {
2348
+ function n(E, u) {
2349
+ E.x < i.get(e.from).x ? (I.insert(
2350
+ t.stopx - u,
2351
+ t.starty,
2352
+ t.startx,
2353
+ t.stopy + E.height / 2 + l.noteMargin
2354
+ ), t.stopx = t.stopx + u) : (I.insert(
2355
+ t.startx,
2356
+ t.starty,
2357
+ t.stopx + u,
2358
+ t.stopy + E.height / 2 + l.noteMargin
2359
+ ), t.stopx = t.stopx - u);
2360
+ }
2361
+ f(n, "receiverAdjustment");
2362
+ function h(E, u) {
2363
+ E.x < i.get(e.to).x ? (I.insert(
2364
+ t.startx - u,
2365
+ t.starty,
2366
+ t.stopx,
2367
+ t.stopy + E.height / 2 + l.noteMargin
2368
+ ), t.startx = t.startx + u) : (I.insert(
2369
+ t.stopx,
2370
+ t.starty,
2371
+ t.startx + u,
2372
+ t.stopy + E.height / 2 + l.noteMargin
2373
+ ), t.startx = t.startx - u);
2374
+ }
2375
+ f(h, "senderAdjustment");
2376
+ const d = [
2377
+ qt.ACTOR,
2378
+ qt.CONTROL,
2379
+ qt.ENTITY,
2380
+ qt.DATABASE
2381
+ ];
2382
+ if (o.get(e.to) == r) {
2383
+ const E = i.get(e.to), u = d.includes(E.type) ? Ot / 2 + 3 : E.width / 2 + 3;
2384
+ n(E, u), E.starty = a - E.height / 2, I.bumpVerticalPos(E.height / 2);
2385
+ } else if (s.get(e.from) == r) {
2386
+ const E = i.get(e.from);
2387
+ if (l.mirrorActors) {
2388
+ const u = d.includes(E.type) ? Ot / 2 : E.width / 2;
2389
+ h(E, u);
2390
+ }
2391
+ E.stopy = a - E.height / 2, I.bumpVerticalPos(E.height / 2);
2392
+ } else if (s.get(e.to) == r) {
2393
+ const E = i.get(e.to);
2394
+ if (l.mirrorActors) {
2395
+ const u = d.includes(E.type) ? Ot / 2 + 3 : E.width / 2 + 3;
2396
+ n(E, u);
2397
+ }
2398
+ E.stopy = a - E.height / 2, I.bumpVerticalPos(E.height / 2);
2399
+ }
2400
+ }
2401
+ f(sr, "adjustCreatedDestroyedData");
2402
+ var _a = /* @__PURE__ */ f(async function(e, t, a, r) {
2403
+ const { securityLevel: i, sequence: o, look: s, themeVariables: n } = j();
2404
+ l = o;
2405
+ let h;
2406
+ i === "sandbox" && (h = Ht("#i" + t));
2407
+ const d = i === "sandbox" ? Ht(h.nodes()[0].contentDocument.body) : Ht("body"), E = i === "sandbox" ? h.nodes()[0].contentDocument : document;
2408
+ I.init(), nt.debug(r.db);
2409
+ const u = i === "sandbox" ? d.select(`[id="${t}"]`) : Ht(`[id="${t}"]`), _ = r.db.getActors(), L = r.db.getCreatedActors(), g = r.db.getDestroyedActors(), R = r.db.getBoxes();
2410
+ let T = r.db.getActorKeys();
2411
+ const O = r.db.getMessages(), x = r.db.getDiagramTitle(), m = r.db.hasAtLeastOneBox(), S = r.db.hasAtLeastOneBoxWithTitle(), b = await ir(_, O, r);
2412
+ if (l.height = await nr(_, b, R), q.insertComputerIcon(u, t), q.insertDatabaseIcon(u, t), q.insertClockIcon(u, t), m && (I.bumpVerticalPos(l.boxMargin), S && I.bumpVerticalPos(R[0].textMaxHeight)), l.hideUnusedParticipants === !0) {
2413
+ const A = /* @__PURE__ */ new Set();
2414
+ O.forEach((v) => {
2415
+ A.add(v.from), A.add(v.to);
2416
+ }), T = T.filter((v) => A.has(v));
2417
+ }
2418
+ const P = new Map(
2419
+ T.map((A, v) => [_.get(A)?.name ?? A, v])
2420
+ );
2421
+ fa(u, _, L, T, 0, O, !1);
2422
+ const k = await La(O, _, b, r);
2423
+ q.insertArrowHead(u, t), q.insertArrowCrossHead(u, t), q.insertArrowFilledHead(u, t), q.insertSequenceNumber(u, t), q.insertSolidTopArrowHead(u, t), q.insertSolidBottomArrowHead(u, t), q.insertStickTopArrowHead(u, t), q.insertStickBottomArrowHead(u, t), s === "neo" && q.insertDropShadow(u, l, t);
2424
+ function B(A, v) {
2425
+ const dt = I.endActivation(A);
2426
+ dt.starty + 18 > v && (dt.starty = v - 6, v += 12), q.drawActivation(
2427
+ u,
2428
+ dt,
2429
+ v,
2430
+ l,
2431
+ Qt(A.from).length,
2432
+ r,
2433
+ P
2434
+ ), I.insert(dt.startx, v - 10, dt.stopx, v);
2435
+ }
2436
+ f(B, "activeEnd");
2437
+ let V = 1, K = 1;
2438
+ const z = [], X = [];
2439
+ let et = 0;
2440
+ for (const A of O) {
2441
+ let v, dt, st;
2442
+ switch (A.type) {
2443
+ case r.db.LINETYPE.NOTE:
2444
+ I.resetVerticalPos(), dt = A.noteModel, await Ea(u, dt, A.id);
2445
+ break;
2446
+ case r.db.LINETYPE.ACTIVE_START:
2447
+ I.newActivation(A, u, _);
2448
+ break;
2449
+ case r.db.LINETYPE.CENTRAL_CONNECTION:
2450
+ I.newActivation(A, u, _);
2451
+ break;
2452
+ case r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:
2453
+ I.newActivation(A, u, _);
2454
+ break;
2455
+ case r.db.LINETYPE.ACTIVE_END:
2456
+ B(A, I.getVerticalPos());
2457
+ break;
2458
+ case r.db.LINETYPE.LOOP_START:
2459
+ Tt(
2460
+ k,
2461
+ A,
2462
+ l.boxMargin,
2463
+ l.boxMargin + l.boxTextMargin,
2464
+ (H) => I.newLoop(H)
2465
+ );
2466
+ break;
2467
+ case r.db.LINETYPE.LOOP_END:
2468
+ v = I.endLoop(), await q.drawLoop(u, v, "loop", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2469
+ break;
2470
+ case r.db.LINETYPE.RECT_START:
2471
+ Tt(k, A, l.boxMargin, l.boxMargin, (H) => {
2472
+ let mt = H.message;
2473
+ mt || (mt = n?.rectBkgColor || n?.actorBkg || "rgba(128, 128, 128, 0.5)"), I.newLoop(void 0, mt);
2474
+ });
2475
+ break;
2476
+ case r.db.LINETYPE.RECT_END:
2477
+ v = I.endLoop(), X.push(v), I.models.addLoop(v), I.bumpVerticalPos(v.stopy - I.getVerticalPos());
2478
+ break;
2479
+ case r.db.LINETYPE.OPT_START:
2480
+ Tt(
2481
+ k,
2482
+ A,
2483
+ l.boxMargin,
2484
+ l.boxMargin + l.boxTextMargin,
2485
+ (H) => I.newLoop(H)
2486
+ );
2487
+ break;
2488
+ case r.db.LINETYPE.OPT_END:
2489
+ v = I.endLoop(), await q.drawLoop(u, v, "opt", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2490
+ break;
2491
+ case r.db.LINETYPE.ALT_START:
2492
+ Tt(
2493
+ k,
2494
+ A,
2495
+ l.boxMargin,
2496
+ l.boxMargin + l.boxTextMargin,
2497
+ (H) => I.newLoop(H)
2498
+ );
2499
+ break;
2500
+ case r.db.LINETYPE.ALT_ELSE:
2501
+ Tt(
2502
+ k,
2503
+ A,
2504
+ l.boxMargin + l.boxTextMargin,
2505
+ l.boxMargin,
2506
+ (H) => I.addSectionToLoop(H)
2507
+ );
2508
+ break;
2509
+ case r.db.LINETYPE.ALT_END:
2510
+ v = I.endLoop(), await q.drawLoop(u, v, "alt", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2511
+ break;
2512
+ case r.db.LINETYPE.PAR_START:
2513
+ case r.db.LINETYPE.PAR_OVER_START:
2514
+ Tt(
2515
+ k,
2516
+ A,
2517
+ l.boxMargin,
2518
+ l.boxMargin + l.boxTextMargin,
2519
+ (H) => I.newLoop(H)
2520
+ ), I.saveVerticalPos();
2521
+ break;
2522
+ case r.db.LINETYPE.PAR_AND:
2523
+ Tt(
2524
+ k,
2525
+ A,
2526
+ l.boxMargin + l.boxTextMargin,
2527
+ l.boxMargin,
2528
+ (H) => I.addSectionToLoop(H)
2529
+ );
2530
+ break;
2531
+ case r.db.LINETYPE.PAR_END:
2532
+ v = I.endLoop(), await q.drawLoop(u, v, "par", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2533
+ break;
2534
+ case r.db.LINETYPE.AUTONUMBER:
2535
+ V = A.message.start || V, K = A.message.step || K, A.message.visible ? r.db.enableSequenceNumbers() : r.db.disableSequenceNumbers();
2536
+ break;
2537
+ case r.db.LINETYPE.CRITICAL_START:
2538
+ Tt(
2539
+ k,
2540
+ A,
2541
+ l.boxMargin,
2542
+ l.boxMargin + l.boxTextMargin,
2543
+ (H) => I.newLoop(H)
2544
+ );
2545
+ break;
2546
+ case r.db.LINETYPE.CRITICAL_OPTION:
2547
+ Tt(
2548
+ k,
2549
+ A,
2550
+ l.boxMargin + l.boxTextMargin,
2551
+ l.boxMargin,
2552
+ (H) => I.addSectionToLoop(H)
2553
+ );
2554
+ break;
2555
+ case r.db.LINETYPE.CRITICAL_END:
2556
+ v = I.endLoop(), await q.drawLoop(u, v, "critical", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2557
+ break;
2558
+ case r.db.LINETYPE.BREAK_START:
2559
+ Tt(
2560
+ k,
2561
+ A,
2562
+ l.boxMargin,
2563
+ l.boxMargin + l.boxTextMargin,
2564
+ (H) => I.newLoop(H)
2565
+ );
2566
+ break;
2567
+ case r.db.LINETYPE.BREAK_END:
2568
+ v = I.endLoop(), await q.drawLoop(u, v, "break", l, A), I.bumpVerticalPos(v.stopy - I.getVerticalPos()), I.models.addLoop(v);
2569
+ break;
2570
+ default:
2571
+ try {
2572
+ st = A.msgModel, st.starty = I.getVerticalPos(), st.sequenceIndex = V, st.sequenceVisible = r.db.showSequenceNumbers(), st.id = A.id, st.from = A.from, st.to = A.to;
2573
+ const H = await er(u, st);
2574
+ sr(
2575
+ A,
2576
+ st,
2577
+ H,
2578
+ et,
2579
+ _,
2580
+ L,
2581
+ g
2582
+ ), z.push({ messageModel: st, lineStartY: H, msg: A }), I.models.addMessage(st);
2583
+ } catch (H) {
2584
+ nt.error("error while drawing message", H);
2585
+ }
2586
+ }
2587
+ [
2588
+ r.db.LINETYPE.SOLID_OPEN,
2589
+ r.db.LINETYPE.DOTTED_OPEN,
2590
+ r.db.LINETYPE.SOLID,
2591
+ r.db.LINETYPE.SOLID_TOP,
2592
+ r.db.LINETYPE.SOLID_BOTTOM,
2593
+ r.db.LINETYPE.STICK_TOP,
2594
+ r.db.LINETYPE.STICK_BOTTOM,
2595
+ r.db.LINETYPE.SOLID_TOP_DOTTED,
2596
+ r.db.LINETYPE.SOLID_BOTTOM_DOTTED,
2597
+ r.db.LINETYPE.STICK_TOP_DOTTED,
2598
+ r.db.LINETYPE.STICK_BOTTOM_DOTTED,
2599
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2600
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
2601
+ r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2602
+ r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2603
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2604
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2605
+ r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2606
+ r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2607
+ r.db.LINETYPE.DOTTED,
2608
+ r.db.LINETYPE.SOLID_CROSS,
2609
+ r.db.LINETYPE.DOTTED_CROSS,
2610
+ r.db.LINETYPE.SOLID_POINT,
2611
+ r.db.LINETYPE.DOTTED_POINT,
2612
+ r.db.LINETYPE.BIDIRECTIONAL_SOLID,
2613
+ r.db.LINETYPE.BIDIRECTIONAL_DOTTED
2614
+ ].includes(A.type) && (V = Math.round((V + K) * 100) / 100), et++;
2615
+ }
2616
+ nt.debug("createdActors", L), nt.debug("destroyedActors", g), await ce(u, _, T, !1, t, r, P);
2617
+ for (const A of z)
2618
+ await ua(u, A.messageModel, A.lineStartY, r, A.msg, t);
2619
+ l.mirrorActors && await ce(u, _, T, !0, t, r, P), X.forEach((A) => q.drawBackgroundRect(u, A)), $e(u, _, T, l);
2620
+ for (const A of I.models.boxes) {
2621
+ A.height = I.getVerticalPos() - A.y, I.insert(A.x, A.y, A.x + A.width, A.height);
2622
+ const v = l.boxMargin * 2;
2623
+ A.startx = A.x - v, A.starty = A.y - v * 0.25, A.stopx = A.startx + A.width + 2 * v, A.stopy = A.starty + A.height + v * 0.75, A.stroke = "rgb(0,0,0, 0.5)", q.drawBox(u, A, l);
2624
+ }
2625
+ m && I.bumpVerticalPos(l.boxMargin);
2626
+ const rt = rr(u, _, T, E), { bounds: U } = I.getBounds();
2627
+ U.startx === void 0 && (U.startx = 0), U.starty === void 0 && (U.starty = 0), U.stopx === void 0 && (U.stopx = 0), U.stopy === void 0 && (U.stopy = 0);
2628
+ let ot = U.stopy - U.starty;
2629
+ ot < rt.maxHeight && (ot = rt.maxHeight);
2630
+ let at = ot + 2 * l.diagramMarginY;
2631
+ l.mirrorActors && (at = at - l.boxMargin + l.bottomMarginAdj);
2632
+ let W = U.stopx - U.startx;
2633
+ W < rt.maxWidth && (W = rt.maxWidth);
2634
+ const M = W + 2 * l.diagramMarginX;
2635
+ x && u.append("text").text(x).attr("x", (U.stopx - U.startx) / 2 - 2 * l.diagramMarginX).attr("y", -25), ur(u, at, M, l.useMaxWidth);
2636
+ const Z = x ? 40 : 0, Mt = _.size && s === "neo" ? 30 : 0;
2637
+ u.attr(
2638
+ "viewBox",
2639
+ U.startx - l.diagramMarginX + " -" + (l.diagramMarginY + Z) + " " + M + " " + (at + Z + Mt)
2640
+ ), nt.debug("models:", I.models);
2641
+ }, "draw");
2642
+ async function ir(e, t, a) {
2643
+ const r = {};
2644
+ for (const i of t)
2645
+ if (e.get(i.to) && e.get(i.from)) {
2646
+ const o = e.get(i.to);
2647
+ if (i.placement === a.db.PLACEMENT.LEFTOF && !o.prevActor || i.placement === a.db.PLACEMENT.RIGHTOF && !o.nextActor)
2648
+ continue;
2649
+ const s = i.placement !== void 0, n = !s, h = s ? At(l) : bt(l), d = i.wrap ? Q.wrapLabel(i.message, l.width - 2 * l.wrapPadding, h) : i.message, u = (tt(d) ? await vt(i.message, j()) : Q.calculateTextDimensions(d, h)).width + 2 * l.wrapPadding;
2650
+ n && i.from === o.nextActor ? r[i.to] = N.getMax(
2651
+ r[i.to] || 0,
2652
+ u
2653
+ ) : n && i.from === o.prevActor ? r[i.from] = N.getMax(
2654
+ r[i.from] || 0,
2655
+ u
2656
+ ) : n && i.from === i.to ? (r[i.from] = N.getMax(
2657
+ r[i.from] || 0,
2658
+ u / 2
2659
+ ), r[i.to] = N.getMax(
2660
+ r[i.to] || 0,
2661
+ u / 2
2662
+ )) : i.placement === a.db.PLACEMENT.RIGHTOF ? r[i.from] = N.getMax(
2663
+ r[i.from] || 0,
2664
+ u
2665
+ ) : i.placement === a.db.PLACEMENT.LEFTOF ? r[o.prevActor] = N.getMax(
2666
+ r[o.prevActor] || 0,
2667
+ u
2668
+ ) : i.placement === a.db.PLACEMENT.OVER && (o.prevActor && (r[o.prevActor] = N.getMax(
2669
+ r[o.prevActor] || 0,
2670
+ u / 2
2671
+ )), o.nextActor && (r[i.from] = N.getMax(
2672
+ r[i.from] || 0,
2673
+ u / 2
2674
+ )));
2675
+ }
2676
+ return nt.debug("maxMessageWidthPerActor:", r), r;
2677
+ }
2678
+ f(ir, "getMaxMessageWidthPerActor");
2679
+ var ga = /* @__PURE__ */ f(function(e) {
2680
+ let t = 0;
2681
+ const a = oe(l);
2682
+ for (const r in e.links) {
2683
+ const o = Q.calculateTextDimensions(r, a).width + 2 * l.wrapPadding + 2 * l.boxMargin;
2684
+ t < o && (t = o);
2685
+ }
2686
+ return t;
2687
+ }, "getRequiredPopupWidth");
2688
+ async function nr(e, t, a) {
2689
+ let r = 0;
2690
+ for (const o of e.keys()) {
2691
+ const s = e.get(o);
2692
+ s.wrap && (s.description = Q.wrapLabel(
2693
+ s.description,
2694
+ l.width - 2 * l.wrapPadding,
2695
+ oe(l)
2696
+ ));
2697
+ const n = tt(s.description) ? await vt(s.description, j()) : Q.calculateTextDimensions(s.description, oe(l));
2698
+ s.width = s.wrap ? l.width : N.getMax(l.width, n.width + 2 * l.wrapPadding), j().look === "neo" ? (s.actorTextHeight = n.height, s.height = N.getMax(Je(n.height), l.height)) : s.height = s.wrap ? N.getMax(n.height, l.height) : l.height, r = N.getMax(r, s.height);
2699
+ }
2700
+ for (const o in t) {
2701
+ const s = e.get(o);
2702
+ if (!s)
2703
+ continue;
2704
+ const n = e.get(s.nextActor);
2705
+ if (!n) {
2706
+ const u = t[o] + l.actorMargin - s.width / 2;
2707
+ s.margin = N.getMax(u, l.actorMargin);
2708
+ continue;
2709
+ }
2710
+ const d = t[o] + l.actorMargin - s.width / 2 - n.width / 2;
2711
+ s.margin = N.getMax(d, l.actorMargin);
2712
+ }
2713
+ let i = 0;
2714
+ return a.forEach((o) => {
2715
+ const s = bt(l);
2716
+ let n = o.actorKeys.reduce((u, _) => u += e.get(_).width + (e.get(_).margin || 0), 0);
2717
+ const h = l.boxMargin * 8;
2718
+ n += h, n -= 2 * l.boxTextMargin, o.wrap && (o.name = Q.wrapLabel(o.name, n - 2 * l.wrapPadding, s));
2719
+ const d = Q.calculateTextDimensions(o.name, s);
2720
+ i = N.getMax(d.height, i);
2721
+ const E = N.getMax(n, d.width + 2 * l.wrapPadding);
2722
+ if (o.margin = l.boxTextMargin, n < E) {
2723
+ const u = (E - n) / 2;
2724
+ o.margin += u;
2725
+ }
2726
+ }), a.forEach((o) => o.textMaxHeight = i), N.getMax(r, l.height);
2727
+ }
2728
+ f(nr, "calculateActorMargins");
2729
+ var xa = /* @__PURE__ */ f(async function(e, t, a) {
2730
+ const r = t.get(e.from), i = t.get(e.to), o = r.x, s = i.x, n = e.wrap && e.message;
2731
+ let h = tt(e.message) ? await vt(e.message, j()) : Q.calculateTextDimensions(
2732
+ n ? Q.wrapLabel(e.message, l.width, At(l)) : e.message,
2733
+ At(l)
2734
+ );
2735
+ const d = {
2736
+ width: n ? l.width : N.getMax(l.width, h.width + 2 * l.noteMargin),
2737
+ height: 0,
2738
+ startx: r.x,
2739
+ stopx: 0,
2740
+ starty: 0,
2741
+ stopy: 0,
2742
+ message: e.message
2743
+ };
2744
+ return e.placement === a.db.PLACEMENT.RIGHTOF ? (d.width = n ? N.getMax(l.width, h.width) : N.getMax(
2745
+ r.width / 2 + i.width / 2,
2746
+ h.width + 2 * l.noteMargin
2747
+ ), d.startx = o + (r.width + l.actorMargin) / 2) : e.placement === a.db.PLACEMENT.LEFTOF ? (d.width = n ? N.getMax(l.width, h.width + 2 * l.noteMargin) : N.getMax(
2748
+ r.width / 2 + i.width / 2,
2749
+ h.width + 2 * l.noteMargin
2750
+ ), d.startx = o - d.width + (r.width - l.actorMargin) / 2) : e.to === e.from ? (h = Q.calculateTextDimensions(
2751
+ n ? Q.wrapLabel(e.message, N.getMax(l.width, r.width), At(l)) : e.message,
2752
+ At(l)
2753
+ ), d.width = n ? N.getMax(l.width, r.width) : N.getMax(r.width, l.width, h.width + 2 * l.noteMargin), d.startx = o + (r.width - d.width) / 2) : (d.width = Math.abs(o + r.width / 2 - (s + i.width / 2)) + l.actorMargin, d.startx = o < s ? o + r.width / 2 - l.actorMargin / 2 : s + i.width / 2 - l.actorMargin / 2), n && (d.message = Q.wrapLabel(
2754
+ e.message,
2755
+ d.width - 2 * l.wrapPadding,
2756
+ At(l)
2757
+ )), nt.debug(
2758
+ `NM:[${d.startx},${d.stopx},${d.starty},${d.stopy}:${d.width},${d.height}=${e.message}]`
2759
+ ), d;
2760
+ }, "buildNoteModel"), ya = 4, ie = /* @__PURE__ */ f(function(e, t) {
2761
+ const { CENTRAL_CONNECTION: a, CENTRAL_CONNECTION_REVERSE: r, CENTRAL_CONNECTION_DUAL: i } = t.db.LINETYPE;
2762
+ return [a, r, i].includes(
2763
+ e.centralConnection
2764
+ );
2765
+ }, "hasCentralConnection"), Ia = /* @__PURE__ */ f(function(e, t, a) {
2766
+ const {
2767
+ CENTRAL_CONNECTION_REVERSE: r,
2768
+ CENTRAL_CONNECTION_DUAL: i,
2769
+ BIDIRECTIONAL_SOLID: o,
2770
+ BIDIRECTIONAL_DOTTED: s
2771
+ } = t.db.LINETYPE;
2772
+ let n = 0;
2773
+ return (e.centralConnection === r || e.centralConnection === i) && (n += ya), (e.centralConnection === r || e.centralConnection === i) && (e.type === o || e.type === s) && (n += a ? 0 : -6), n;
2774
+ }, "calculateCentralConnectionOffset"), or = /* @__PURE__ */ f(function(e, t) {
2775
+ const {
2776
+ SOLID_ARROW_TOP_REVERSE: a,
2777
+ SOLID_ARROW_TOP_REVERSE_DOTTED: r,
2778
+ SOLID_ARROW_BOTTOM_REVERSE: i,
2779
+ SOLID_ARROW_BOTTOM_REVERSE_DOTTED: o,
2780
+ STICK_ARROW_TOP_REVERSE: s,
2781
+ STICK_ARROW_TOP_REVERSE_DOTTED: n,
2782
+ STICK_ARROW_BOTTOM_REVERSE: h,
2783
+ STICK_ARROW_BOTTOM_REVERSE_DOTTED: d
2784
+ } = t.db.LINETYPE;
2785
+ return [
2786
+ a,
2787
+ r,
2788
+ i,
2789
+ o,
2790
+ s,
2791
+ n,
2792
+ h,
2793
+ d
2794
+ ].includes(e.type);
2795
+ }, "isReverseArrowType"), Ra = /* @__PURE__ */ f(function(e, t) {
2796
+ const { BIDIRECTIONAL_SOLID: a, BIDIRECTIONAL_DOTTED: r } = t.db.LINETYPE;
2797
+ return [a, r].includes(e.type);
2798
+ }, "isBidirectionalArrowType"), Oa = /* @__PURE__ */ f(function(e, t, a) {
2799
+ const { look: r } = j();
2800
+ if (![
2801
+ a.db.LINETYPE.SOLID_OPEN,
2802
+ a.db.LINETYPE.DOTTED_OPEN,
2803
+ a.db.LINETYPE.SOLID,
2804
+ a.db.LINETYPE.SOLID_TOP,
2805
+ a.db.LINETYPE.SOLID_BOTTOM,
2806
+ a.db.LINETYPE.STICK_TOP,
2807
+ a.db.LINETYPE.STICK_BOTTOM,
2808
+ a.db.LINETYPE.SOLID_TOP_DOTTED,
2809
+ a.db.LINETYPE.SOLID_BOTTOM_DOTTED,
2810
+ a.db.LINETYPE.STICK_TOP_DOTTED,
2811
+ a.db.LINETYPE.STICK_BOTTOM_DOTTED,
2812
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2813
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
2814
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2815
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2816
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2817
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2818
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2819
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2820
+ a.db.LINETYPE.DOTTED,
2821
+ a.db.LINETYPE.SOLID_CROSS,
2822
+ a.db.LINETYPE.DOTTED_CROSS,
2823
+ a.db.LINETYPE.SOLID_POINT,
2824
+ a.db.LINETYPE.DOTTED_POINT,
2825
+ a.db.LINETYPE.BIDIRECTIONAL_SOLID,
2826
+ a.db.LINETYPE.BIDIRECTIONAL_DOTTED
2827
+ ].includes(e.type))
2828
+ return {};
2829
+ const [i, o] = ze(e.from, t), [s, n] = ze(e.to, t), h = i <= s;
2830
+ let d = h ? o : i, E = h ? s : n;
2831
+ r === "neo" && (e.type !== a.db.LINETYPE.SOLID_OPEN && (E += h ? -3 : 3), (e.type === a.db.LINETYPE.BIDIRECTIONAL_SOLID || e.type === a.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (d += h ? 3 : -3)), d += Ia(e, a, h);
2832
+ const u = Math.abs(s - n) > 2, _ = /* @__PURE__ */ f((T) => h ? -T : T, "adjustValue");
2833
+ e.from === e.to ? E = d : (e.activate && !u && (E += _(l.activationWidth / 2 - 1)), [
2834
+ a.db.LINETYPE.SOLID_OPEN,
2835
+ a.db.LINETYPE.DOTTED_OPEN,
2836
+ a.db.LINETYPE.STICK_TOP,
2837
+ a.db.LINETYPE.STICK_BOTTOM,
2838
+ a.db.LINETYPE.STICK_TOP_DOTTED,
2839
+ a.db.LINETYPE.STICK_BOTTOM_DOTTED,
2840
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2841
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2842
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
2843
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
2844
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
2845
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
2846
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2847
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
2848
+ ].includes(e.type) || (E += _(3)), [
2849
+ a.db.LINETYPE.BIDIRECTIONAL_SOLID,
2850
+ a.db.LINETYPE.BIDIRECTIONAL_DOTTED,
2851
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
2852
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
2853
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
2854
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
2855
+ ].includes(e.type) && (d -= _(3)));
2856
+ const L = [i, o, s, n], g = Math.abs(d - E);
2857
+ e.wrap && e.message && (e.message = Q.wrapLabel(
2858
+ e.message,
2859
+ N.getMax(g + 2 * l.wrapPadding, l.width),
2860
+ bt(l)
2861
+ ));
2862
+ const R = Q.calculateTextDimensions(e.message, bt(l));
2863
+ return {
2864
+ width: N.getMax(
2865
+ e.wrap ? 0 : R.width + 2 * l.wrapPadding,
2866
+ g + 2 * l.wrapPadding,
2867
+ l.width
2868
+ ),
2869
+ height: 0,
2870
+ startx: d,
2871
+ stopx: E,
2872
+ starty: 0,
2873
+ stopy: 0,
2874
+ message: e.message,
2875
+ type: e.type,
2876
+ wrap: e.wrap,
2877
+ fromBounds: Math.min.apply(null, L),
2878
+ toBounds: Math.max.apply(null, L)
2879
+ };
2880
+ }, "buildMessageModel"), La = /* @__PURE__ */ f(async function(e, t, a, r) {
2881
+ const i = {}, o = [];
2882
+ let s, n, h;
2883
+ for (const d of e) {
2884
+ switch (d.type) {
2885
+ case r.db.LINETYPE.LOOP_START:
2886
+ case r.db.LINETYPE.ALT_START:
2887
+ case r.db.LINETYPE.OPT_START:
2888
+ case r.db.LINETYPE.PAR_START:
2889
+ case r.db.LINETYPE.PAR_OVER_START:
2890
+ case r.db.LINETYPE.CRITICAL_START:
2891
+ case r.db.LINETYPE.BREAK_START:
2892
+ o.push({
2893
+ id: d.id,
2894
+ msg: d.message,
2895
+ from: Number.MAX_SAFE_INTEGER,
2896
+ to: Number.MIN_SAFE_INTEGER,
2897
+ width: 0
2898
+ });
2899
+ break;
2900
+ case r.db.LINETYPE.ALT_ELSE:
2901
+ case r.db.LINETYPE.PAR_AND:
2902
+ case r.db.LINETYPE.CRITICAL_OPTION:
2903
+ d.message && (s = o.pop(), i[s.id] = s, i[d.id] = s, o.push(s));
2904
+ break;
2905
+ case r.db.LINETYPE.LOOP_END:
2906
+ case r.db.LINETYPE.ALT_END:
2907
+ case r.db.LINETYPE.OPT_END:
2908
+ case r.db.LINETYPE.PAR_END:
2909
+ case r.db.LINETYPE.CRITICAL_END:
2910
+ case r.db.LINETYPE.BREAK_END:
2911
+ s = o.pop(), i[s.id] = s;
2912
+ break;
2913
+ case r.db.LINETYPE.ACTIVE_START:
2914
+ {
2915
+ const u = t.get(d.from ? d.from : d.to.actor), _ = Qt(d.from ? d.from : d.to.actor).length, L = u.x + u.width / 2 + (_ - 1) * l.activationWidth / 2, g = {
2916
+ startx: L,
2917
+ stopx: L + l.activationWidth,
2918
+ actor: d.from,
2919
+ enabled: !0
2920
+ };
2921
+ I.activations.push(g);
2922
+ }
2923
+ break;
2924
+ case r.db.LINETYPE.ACTIVE_END:
2925
+ {
2926
+ const u = I.activations.map((_) => _.actor).lastIndexOf(d.from);
2927
+ I.activations.splice(u, 1).splice(0, 1);
2928
+ }
2929
+ break;
2930
+ }
2931
+ d.placement !== void 0 ? (n = await xa(d, t, r), d.noteModel = n, o.forEach((u) => {
2932
+ s = u, s.from = N.getMin(s.from, n.startx), s.to = N.getMax(s.to, n.startx + n.width), s.width = N.getMax(s.width, Math.abs(s.from - s.to)) - l.labelBoxWidth;
2933
+ })) : (h = Oa(d, t, r), d.msgModel = h, h.startx && h.stopx && o.length > 0 && o.forEach((u) => {
2934
+ if (s = u, h.startx === h.stopx) {
2935
+ const _ = t.get(d.from), L = t.get(d.to);
2936
+ s.from = N.getMin(
2937
+ _.x - h.width / 2,
2938
+ _.x - _.width / 2,
2939
+ s.from
2940
+ ), s.to = N.getMax(
2941
+ L.x + h.width / 2,
2942
+ L.x + _.width / 2,
2943
+ s.to
2944
+ ), s.width = N.getMax(s.width, Math.abs(s.to - s.from)) - l.labelBoxWidth;
2945
+ } else
2946
+ s.from = N.getMin(h.startx, s.from), s.to = N.getMax(h.stopx, s.to), s.width = N.getMax(s.width, h.width) - l.labelBoxWidth;
2947
+ }));
2948
+ }
2949
+ return I.activations = [], nt.debug("Loop type widths:", i), i;
2950
+ }, "calculateLoopBounds"), ba = {
2951
+ bounds: I,
2952
+ drawActors: ce,
2953
+ drawActorsPopup: rr,
2954
+ setConf: ar,
2955
+ draw: _a
2956
+ }, wa = {
2957
+ parser: wr,
2958
+ get db() {
2959
+ return new Dr();
2960
+ },
2961
+ renderer: ba,
2962
+ styles: Cr,
2963
+ init: /* @__PURE__ */ f((e) => {
2964
+ e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, Er({ sequence: { wrap: e.wrap } }));
2965
+ }, "init")
2966
+ };
2967
+ export {
2968
+ wa as diagram
2969
+ };