@ucap-llm/ai-ui 1.1.6 → 1.1.7

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