@data_wise/hyper-markdown 1.0.0

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