@n8n-zengchao/chat 0.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/README.md +289 -0
  2. package/dist/App.vue.d.ts +2 -0
  3. package/dist/__stories__/App.stories.d.ts +18 -0
  4. package/dist/__tests__/Input.spec.d.ts +1 -0
  5. package/dist/__tests__/api/generic.spec.d.ts +1 -0
  6. package/dist/__tests__/api/message.spec.d.ts +1 -0
  7. package/dist/__tests__/index.spec.d.ts +1 -0
  8. package/dist/__tests__/plugins/chat.spec.d.ts +1 -0
  9. package/dist/__tests__/plugins/chat.test.d.ts +1 -0
  10. package/dist/__tests__/setup.d.ts +0 -0
  11. package/dist/__tests__/utils/create.d.ts +5 -0
  12. package/dist/__tests__/utils/fetch.d.ts +13 -0
  13. package/dist/__tests__/utils/index.d.ts +3 -0
  14. package/dist/__tests__/utils/selectors.d.ts +12 -0
  15. package/dist/__tests__/utils/streaming.spec.d.ts +1 -0
  16. package/dist/__tests__/utils/streamingHandlers.spec.d.ts +1 -0
  17. package/dist/_basePickBy-aQilsjEs.mjs +106 -0
  18. package/dist/_baseUniq-Agc10qFQ.mjs +232 -0
  19. package/dist/api/generic.d.ts +7 -0
  20. package/dist/api/index.d.ts +2 -0
  21. package/dist/api/message.d.ts +11 -0
  22. package/dist/arc-EhYU_DB1.mjs +79 -0
  23. package/dist/architecture-U656AL7Q-B1STlXpR.mjs +10 -0
  24. package/dist/architectureDiagram-VXUJARFQ-DOVAbXSw.mjs +4054 -0
  25. package/dist/array-B5w981Vk.mjs +5 -0
  26. package/dist/blockDiagram-VD42YOAC-BsX3Fkg3.mjs +3013 -0
  27. package/dist/c4Diagram-YG6GDRKO-B5JaLuX6.mjs +2957 -0
  28. package/dist/channel-CqrIo07y.mjs +4 -0
  29. package/dist/chat.bundle.es.js +37656 -0
  30. package/dist/chat.bundle.umd.js +2784 -0
  31. package/dist/chat.es.js +35738 -0
  32. package/dist/chat.umd.js +2776 -0
  33. package/dist/chunk-4BX2VUAB-dn0RXIrC.mjs +7 -0
  34. package/dist/chunk-55IACEB6-DrIttNoL.mjs +7 -0
  35. package/dist/chunk-76Q3JFCE-D7DMbWeQ.mjs +20 -0
  36. package/dist/chunk-ABZYJK2D-_NXv778f.mjs +2516 -0
  37. package/dist/chunk-ATLVNIR6-CBnG7Ev9.mjs +66 -0
  38. package/dist/chunk-B4BG7PRW-DElmmAse.mjs +3109 -0
  39. package/dist/chunk-CVBHYZKI-kPsSw5G9.mjs +11 -0
  40. package/dist/chunk-DI55MBZ5-Bw6uFFfD.mjs +1995 -0
  41. package/dist/chunk-DZXZ2BO8.mjs +19 -0
  42. package/dist/chunk-EXTU4WIE-DWzncOZf.mjs +8 -0
  43. package/dist/chunk-FMBD7UC4-CQf-nVrj.mjs +4 -0
  44. package/dist/chunk-FPAJGGOC-HRc6DGju.mjs +12254 -0
  45. package/dist/chunk-FWNWRKHM-CGiJVNMo.mjs +57 -0
  46. package/dist/chunk-HN2XXSSU-DMfVdeUE.mjs +75 -0
  47. package/dist/chunk-JA3XYJ7Z-b0Li4NN8.mjs +1834 -0
  48. package/dist/chunk-JZLCHNYA-C_4MLySW.mjs +4862 -0
  49. package/dist/chunk-KS23V3DP-BRKOfbU6.mjs +136 -0
  50. package/dist/chunk-LBM3YZW2-JIQK8wiH.mjs +20 -0
  51. package/dist/chunk-LHMN2FUI-PNCyIUgu.mjs +20 -0
  52. package/dist/chunk-MI3HLSF2-B9GTCmLp.mjs +1146 -0
  53. package/dist/chunk-N4CR4FBY-CjlmnCPD.mjs +40 -0
  54. package/dist/chunk-O7ZBX7Z2-DmJUfqJj.mjs +27 -0
  55. package/dist/chunk-QN33PNHL-nN1zLFSf.mjs +24 -0
  56. package/dist/chunk-QXUST7PY-CY78Btj9.mjs +487 -0
  57. package/dist/chunk-QZHKN3VN-BF5N1pfB.mjs +12 -0
  58. package/dist/chunk-S3R3BYOJ-BhFsv0Go.mjs +1076 -0
  59. package/dist/chunk-S6J4BHB3-BvrWTdbl.mjs +20 -0
  60. package/dist/chunk-T53DSG4Q-XzY06amw.mjs +25 -0
  61. package/dist/chunk-TZMSLE5B-DVmJQ8eg.mjs +57 -0
  62. package/dist/classDiagram-2ON5EDUG-CKxiEVX9.mjs +33 -0
  63. package/dist/classDiagram-v2-WZHVMYZB-sAa_2keq.mjs +33 -0
  64. package/dist/clone-nkGlb0Gn.mjs +8 -0
  65. package/dist/components/Button.vue.d.ts +17 -0
  66. package/dist/components/Chat.vue.d.ts +2 -0
  67. package/dist/components/ChatFile.vue.d.ts +11 -0
  68. package/dist/components/ChatWindow.vue.d.ts +2 -0
  69. package/dist/components/GetStarted.vue.d.ts +2 -0
  70. package/dist/components/GetStartedFooter.vue.d.ts +2 -0
  71. package/dist/components/Input.vue.d.ts +39 -0
  72. package/dist/components/Layout.vue.d.ts +23 -0
  73. package/dist/components/Message.vue.d.ts +39 -0
  74. package/dist/components/MessageTyping.vue.d.ts +76 -0
  75. package/dist/components/MessagesList.vue.d.ts +164 -0
  76. package/dist/components/PoweredBy.vue.d.ts +2 -0
  77. package/dist/components/index.d.ts +10 -0
  78. package/dist/composables/index.d.ts +3 -0
  79. package/dist/composables/useChat.d.ts +2 -0
  80. package/dist/composables/useI18n.d.ts +4 -0
  81. package/dist/composables/useOptions.d.ts +4 -0
  82. package/dist/constants/defaults.d.ts +3 -0
  83. package/dist/constants/index.d.ts +3 -0
  84. package/dist/constants/localStorage.d.ts +2 -0
  85. package/dist/constants/symbols.d.ts +4 -0
  86. package/dist/cose-bilkent-S5V4N54A-1lKG2PUg.mjs +2251 -0
  87. package/dist/cytoscape.esm-Dls1_mGy.mjs +18108 -0
  88. package/dist/dagre-6UL2VRFP-CbWFu9xQ.mjs +300 -0
  89. package/dist/dagre-DEdOheHq.mjs +1385 -0
  90. package/dist/defaultLocale-CyoQm63E.mjs +178 -0
  91. package/dist/diagram-PSM6KHXK-CJcHbrJH.mjs +499 -0
  92. package/dist/diagram-QEK2KX5R-XQ9XOVL4.mjs +228 -0
  93. package/dist/diagram-S2PKOQOG-CmRfaeSf.mjs +146 -0
  94. package/dist/dist-BT0fjU7K.mjs +50 -0
  95. package/dist/erDiagram-Q2GNP2WA-iuoUWHwm.mjs +1603 -0
  96. package/dist/event-buses/chatEventBus.d.ts +1 -0
  97. package/dist/event-buses/index.d.ts +1 -0
  98. package/dist/favicon.ico +0 -0
  99. package/dist/flowDiagram-NV44I4VS-D3GMS8-G.mjs +4132 -0
  100. package/dist/ganttDiagram-LVOFAZNH-DMTZVZDR.mjs +2832 -0
  101. package/dist/gitGraph-F6HP7TQM-CrdUzURw.mjs +10 -0
  102. package/dist/gitGraphDiagram-NY62KEGX-DipP5Fgt.mjs +636 -0
  103. package/dist/graphlib-D9eH5icd.mjs +224 -0
  104. package/dist/index.d.ts +2 -0
  105. package/dist/info-NVLQJR56-C-93Yf3U.mjs +10 -0
  106. package/dist/infoDiagram-F6ZHWCRC-jM50s26K.mjs +33 -0
  107. package/dist/init-CYeu4QfE.mjs +14 -0
  108. package/dist/isArrayLikeObject-BPcFdnyK.mjs +459 -0
  109. package/dist/isUndefined-BvarJ1wS.mjs +374 -0
  110. package/dist/journeyDiagram-XKPGCS4Q-BEEO_0Bh.mjs +885 -0
  111. package/dist/kanban-definition-3W4ZIXB7-B8u_HDmL.mjs +971 -0
  112. package/dist/katex-Dc1vXbUC.mjs +22094 -0
  113. package/dist/line-BJxACIPZ.mjs +31 -0
  114. package/dist/linear-DHHVI-cj.mjs +251 -0
  115. package/dist/math-Byg0NvhS.mjs +9 -0
  116. package/dist/mermaid-parser.core-YT4qvimq.mjs +49 -0
  117. package/dist/mindmap-definition-VGOIOE7T-ah41V88S.mjs +960 -0
  118. package/dist/now-DsJMgI1z.mjs +6 -0
  119. package/dist/ordinal-L0-EVPg8.mjs +62 -0
  120. package/dist/packet-BFZMPI3H-Cs4kRHct.mjs +10 -0
  121. package/dist/path-BcDHwjEr.mjs +80 -0
  122. package/dist/pie-7BOR55EZ-YZ5Xu4o6.mjs +10 -0
  123. package/dist/pieDiagram-ADFJNKIX-CqI33m1a.mjs +174 -0
  124. package/dist/plugins/chat.d.ts +3 -0
  125. package/dist/plugins/index.d.ts +1 -0
  126. package/dist/quadrantDiagram-AYHSOK5B-DDv2X9c1.mjs +1971 -0
  127. package/dist/radar-NHE76QYJ-TpirOFtv.mjs +10 -0
  128. package/dist/requirementDiagram-UZGBJVZJ-DXa77VzO.mjs +2194 -0
  129. package/dist/sankeyDiagram-TZEHDZUN--B9DInJC.mjs +885 -0
  130. package/dist/sequenceDiagram-WL72ISMW-Dqn9jJ3g.mjs +3562 -0
  131. package/dist/src-DdwtiGjk.mjs +1976 -0
  132. package/dist/stateDiagram-FKZM4ZOC-D3eEcVjS.mjs +226 -0
  133. package/dist/stateDiagram-v2-4FDKWEC3-dzwJ4caL.mjs +32 -0
  134. package/dist/style.css +3 -0
  135. package/dist/timeline-definition-IT6M3QCI-z93ry7RN.mjs +831 -0
  136. package/dist/toInteger-1S_4Byef.mjs +36 -0
  137. package/dist/treemap-KMMF4GRG-BlF0Ev1z.mjs +10 -0
  138. package/dist/types/chat.d.ts +13 -0
  139. package/dist/types/index.d.ts +5 -0
  140. package/dist/types/messages.d.ts +17 -0
  141. package/dist/types/options.d.ts +33 -0
  142. package/dist/types/streaming.d.ts +18 -0
  143. package/dist/types/webhook.d.ts +19 -0
  144. package/dist/utils/event-bus.d.ts +8 -0
  145. package/dist/utils/index.d.ts +3 -0
  146. package/dist/utils/mount.d.ts +1 -0
  147. package/dist/utils/streaming.d.ts +26 -0
  148. package/dist/utils/streamingHandlers.d.ts +6 -0
  149. package/dist/utils/utils.d.ts +1 -0
  150. package/dist/xychartDiagram-PRI3JC2R-C3aDcgBz.mjs +2022 -0
  151. package/package.json +78 -0
@@ -0,0 +1,3562 @@
1
+ /*! Package version @n8n/chat@0.62.0 */
2
+ import { o as __toESM } from "./chunk-DZXZ2BO8.mjs";
3
+ import "./isArrayLikeObject-BPcFdnyK.mjs";
4
+ import { g as utils_default, p as parseFontSize, t as ZERO_WIDTH_SPACE } from "./chunk-S3R3BYOJ-BhFsv0Go.mjs";
5
+ import { g as log, h as __name, p as select_default } from "./src-DdwtiGjk.mjs";
6
+ import { B as setAccTitle, C as getDiagramTitle, E as getUrl, H as setConfig2, I as sanitizeText, N as renderKatexSanitized, O as hasKatex, U as setDiagramTitle, _ as getAccDescription, a as clear, b as getConfig2, c as configureSvgSize, i as calculateMathMLDimensions, r as assignWithDepth_default, s as common_default, v as getAccTitle, y as getConfig, z as setAccDescription } from "./chunk-ABZYJK2D-_NXv778f.mjs";
7
+ import "./math-Byg0NvhS.mjs";
8
+ import { n as load, t as JSON_SCHEMA } from "./chunk-MI3HLSF2-B9GTCmLp.mjs";
9
+ import { t as require_dist } from "./dist-BT0fjU7K.mjs";
10
+ import { i as drawRect, n as drawEmbeddedImage, o as getNoteRect, r as drawImage, s as getTextObj, t as drawBackgroundRect } from "./chunk-TZMSLE5B-DVmJQ8eg.mjs";
11
+ import { t as ImperativeState } from "./chunk-QZHKN3VN-BF5N1pfB.mjs";
12
+ var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1), parser = (function() {
13
+ var i = /* @__PURE__ */ __name(function(i, l, u, d) {
14
+ for (u ||= {}, d = i.length; d--; u[i[d]] = l);
15
+ return u;
16
+ }, "o"), l = [1, 2], u = [1, 3], d = [1, 4], f = [2, 4], m = [1, 9], h = [1, 11], g = [1, 13], _ = [1, 14], v = [1, 16], y = [1, 17], b = [1, 18], x = [1, 24], S = [1, 25], C = [1, 26], w = [1, 27], T = [1, 28], E = [1, 29], D = [1, 30], O = [1, 31], k = [1, 32], A = [1, 33], j = [1, 34], M = [1, 35], N = [1, 36], P = [1, 37], F = [1, 38], I = [1, 39], L = [1, 41], R = [1, 42], z = [1, 43], B = [1, 44], V = [1, 45], H = [1, 46], U = [
17
+ 1,
18
+ 4,
19
+ 5,
20
+ 13,
21
+ 14,
22
+ 16,
23
+ 18,
24
+ 21,
25
+ 23,
26
+ 29,
27
+ 30,
28
+ 31,
29
+ 33,
30
+ 35,
31
+ 36,
32
+ 37,
33
+ 38,
34
+ 39,
35
+ 41,
36
+ 43,
37
+ 44,
38
+ 46,
39
+ 47,
40
+ 48,
41
+ 49,
42
+ 50,
43
+ 52,
44
+ 53,
45
+ 55,
46
+ 60,
47
+ 61,
48
+ 62,
49
+ 63,
50
+ 71
51
+ ], W = [2, 71], G = [
52
+ 4,
53
+ 5,
54
+ 16,
55
+ 50,
56
+ 52,
57
+ 53
58
+ ], K = [
59
+ 4,
60
+ 5,
61
+ 13,
62
+ 14,
63
+ 16,
64
+ 18,
65
+ 21,
66
+ 23,
67
+ 29,
68
+ 30,
69
+ 31,
70
+ 33,
71
+ 35,
72
+ 36,
73
+ 37,
74
+ 38,
75
+ 39,
76
+ 41,
77
+ 43,
78
+ 44,
79
+ 46,
80
+ 50,
81
+ 52,
82
+ 53,
83
+ 55,
84
+ 60,
85
+ 61,
86
+ 62,
87
+ 63,
88
+ 71
89
+ ], q = [
90
+ 4,
91
+ 5,
92
+ 13,
93
+ 14,
94
+ 16,
95
+ 18,
96
+ 21,
97
+ 23,
98
+ 29,
99
+ 30,
100
+ 31,
101
+ 33,
102
+ 35,
103
+ 36,
104
+ 37,
105
+ 38,
106
+ 39,
107
+ 41,
108
+ 43,
109
+ 44,
110
+ 46,
111
+ 49,
112
+ 50,
113
+ 52,
114
+ 53,
115
+ 55,
116
+ 60,
117
+ 61,
118
+ 62,
119
+ 63,
120
+ 71
121
+ ], J = [
122
+ 4,
123
+ 5,
124
+ 13,
125
+ 14,
126
+ 16,
127
+ 18,
128
+ 21,
129
+ 23,
130
+ 29,
131
+ 30,
132
+ 31,
133
+ 33,
134
+ 35,
135
+ 36,
136
+ 37,
137
+ 38,
138
+ 39,
139
+ 41,
140
+ 43,
141
+ 44,
142
+ 46,
143
+ 48,
144
+ 50,
145
+ 52,
146
+ 53,
147
+ 55,
148
+ 60,
149
+ 61,
150
+ 62,
151
+ 63,
152
+ 71
153
+ ], Y = [
154
+ 4,
155
+ 5,
156
+ 13,
157
+ 14,
158
+ 16,
159
+ 18,
160
+ 21,
161
+ 23,
162
+ 29,
163
+ 30,
164
+ 31,
165
+ 33,
166
+ 35,
167
+ 36,
168
+ 37,
169
+ 38,
170
+ 39,
171
+ 41,
172
+ 43,
173
+ 44,
174
+ 46,
175
+ 47,
176
+ 50,
177
+ 52,
178
+ 53,
179
+ 55,
180
+ 60,
181
+ 61,
182
+ 62,
183
+ 63,
184
+ 71
185
+ ], X = [
186
+ 69,
187
+ 70,
188
+ 71
189
+ ], Z = [1, 127], Q = {
190
+ trace: /* @__PURE__ */ __name(function() {}, "trace"),
191
+ yy: {},
192
+ symbols_: {
193
+ error: 2,
194
+ start: 3,
195
+ SPACE: 4,
196
+ NEWLINE: 5,
197
+ SD: 6,
198
+ document: 7,
199
+ line: 8,
200
+ statement: 9,
201
+ box_section: 10,
202
+ box_line: 11,
203
+ participant_statement: 12,
204
+ create: 13,
205
+ box: 14,
206
+ restOfLine: 15,
207
+ end: 16,
208
+ signal: 17,
209
+ autonumber: 18,
210
+ NUM: 19,
211
+ off: 20,
212
+ activate: 21,
213
+ actor: 22,
214
+ deactivate: 23,
215
+ note_statement: 24,
216
+ links_statement: 25,
217
+ link_statement: 26,
218
+ properties_statement: 27,
219
+ details_statement: 28,
220
+ title: 29,
221
+ legacy_title: 30,
222
+ acc_title: 31,
223
+ acc_title_value: 32,
224
+ acc_descr: 33,
225
+ acc_descr_value: 34,
226
+ acc_descr_multiline_value: 35,
227
+ loop: 36,
228
+ rect: 37,
229
+ opt: 38,
230
+ alt: 39,
231
+ else_sections: 40,
232
+ par: 41,
233
+ par_sections: 42,
234
+ par_over: 43,
235
+ critical: 44,
236
+ option_sections: 45,
237
+ break: 46,
238
+ option: 47,
239
+ and: 48,
240
+ else: 49,
241
+ participant: 50,
242
+ AS: 51,
243
+ participant_actor: 52,
244
+ destroy: 53,
245
+ actor_with_config: 54,
246
+ note: 55,
247
+ placement: 56,
248
+ text2: 57,
249
+ over: 58,
250
+ actor_pair: 59,
251
+ links: 60,
252
+ link: 61,
253
+ properties: 62,
254
+ details: 63,
255
+ spaceList: 64,
256
+ ",": 65,
257
+ left_of: 66,
258
+ right_of: 67,
259
+ signaltype: 68,
260
+ "+": 69,
261
+ "-": 70,
262
+ ACTOR: 71,
263
+ config_object: 72,
264
+ CONFIG_START: 73,
265
+ CONFIG_CONTENT: 74,
266
+ CONFIG_END: 75,
267
+ SOLID_OPEN_ARROW: 76,
268
+ DOTTED_OPEN_ARROW: 77,
269
+ SOLID_ARROW: 78,
270
+ BIDIRECTIONAL_SOLID_ARROW: 79,
271
+ DOTTED_ARROW: 80,
272
+ BIDIRECTIONAL_DOTTED_ARROW: 81,
273
+ SOLID_CROSS: 82,
274
+ DOTTED_CROSS: 83,
275
+ SOLID_POINT: 84,
276
+ DOTTED_POINT: 85,
277
+ TXT: 86,
278
+ $accept: 0,
279
+ $end: 1
280
+ },
281
+ terminals_: {
282
+ 2: "error",
283
+ 4: "SPACE",
284
+ 5: "NEWLINE",
285
+ 6: "SD",
286
+ 13: "create",
287
+ 14: "box",
288
+ 15: "restOfLine",
289
+ 16: "end",
290
+ 18: "autonumber",
291
+ 19: "NUM",
292
+ 20: "off",
293
+ 21: "activate",
294
+ 23: "deactivate",
295
+ 29: "title",
296
+ 30: "legacy_title",
297
+ 31: "acc_title",
298
+ 32: "acc_title_value",
299
+ 33: "acc_descr",
300
+ 34: "acc_descr_value",
301
+ 35: "acc_descr_multiline_value",
302
+ 36: "loop",
303
+ 37: "rect",
304
+ 38: "opt",
305
+ 39: "alt",
306
+ 41: "par",
307
+ 43: "par_over",
308
+ 44: "critical",
309
+ 46: "break",
310
+ 47: "option",
311
+ 48: "and",
312
+ 49: "else",
313
+ 50: "participant",
314
+ 51: "AS",
315
+ 52: "participant_actor",
316
+ 53: "destroy",
317
+ 55: "note",
318
+ 58: "over",
319
+ 60: "links",
320
+ 61: "link",
321
+ 62: "properties",
322
+ 63: "details",
323
+ 65: ",",
324
+ 66: "left_of",
325
+ 67: "right_of",
326
+ 69: "+",
327
+ 70: "-",
328
+ 71: "ACTOR",
329
+ 73: "CONFIG_START",
330
+ 74: "CONFIG_CONTENT",
331
+ 75: "CONFIG_END",
332
+ 76: "SOLID_OPEN_ARROW",
333
+ 77: "DOTTED_OPEN_ARROW",
334
+ 78: "SOLID_ARROW",
335
+ 79: "BIDIRECTIONAL_SOLID_ARROW",
336
+ 80: "DOTTED_ARROW",
337
+ 81: "BIDIRECTIONAL_DOTTED_ARROW",
338
+ 82: "SOLID_CROSS",
339
+ 83: "DOTTED_CROSS",
340
+ 84: "SOLID_POINT",
341
+ 85: "DOTTED_POINT",
342
+ 86: "TXT"
343
+ },
344
+ productions_: [
345
+ 0,
346
+ [3, 2],
347
+ [3, 2],
348
+ [3, 2],
349
+ [7, 0],
350
+ [7, 2],
351
+ [8, 2],
352
+ [8, 1],
353
+ [8, 1],
354
+ [10, 0],
355
+ [10, 2],
356
+ [11, 2],
357
+ [11, 1],
358
+ [11, 1],
359
+ [9, 1],
360
+ [9, 2],
361
+ [9, 4],
362
+ [9, 2],
363
+ [9, 4],
364
+ [9, 3],
365
+ [9, 3],
366
+ [9, 2],
367
+ [9, 3],
368
+ [9, 3],
369
+ [9, 2],
370
+ [9, 2],
371
+ [9, 2],
372
+ [9, 2],
373
+ [9, 2],
374
+ [9, 1],
375
+ [9, 1],
376
+ [9, 2],
377
+ [9, 2],
378
+ [9, 1],
379
+ [9, 4],
380
+ [9, 4],
381
+ [9, 4],
382
+ [9, 4],
383
+ [9, 4],
384
+ [9, 4],
385
+ [9, 4],
386
+ [9, 4],
387
+ [45, 1],
388
+ [45, 4],
389
+ [42, 1],
390
+ [42, 4],
391
+ [40, 1],
392
+ [40, 4],
393
+ [12, 5],
394
+ [12, 3],
395
+ [12, 5],
396
+ [12, 3],
397
+ [12, 3],
398
+ [12, 3],
399
+ [24, 4],
400
+ [24, 4],
401
+ [25, 3],
402
+ [26, 3],
403
+ [27, 3],
404
+ [28, 3],
405
+ [64, 2],
406
+ [64, 1],
407
+ [59, 3],
408
+ [59, 1],
409
+ [56, 1],
410
+ [56, 1],
411
+ [17, 5],
412
+ [17, 5],
413
+ [17, 4],
414
+ [54, 2],
415
+ [72, 3],
416
+ [22, 1],
417
+ [68, 1],
418
+ [68, 1],
419
+ [68, 1],
420
+ [68, 1],
421
+ [68, 1],
422
+ [68, 1],
423
+ [68, 1],
424
+ [68, 1],
425
+ [68, 1],
426
+ [68, 1],
427
+ [57, 1]
428
+ ],
429
+ performAction: /* @__PURE__ */ __name(function(i, l, u, d, f, p, m) {
430
+ var h = p.length - 1;
431
+ switch (f) {
432
+ case 3: return d.apply(p[h]), p[h];
433
+ case 4:
434
+ case 9:
435
+ this.$ = [];
436
+ break;
437
+ case 5:
438
+ case 10:
439
+ p[h - 1].push(p[h]), this.$ = p[h - 1];
440
+ break;
441
+ case 6:
442
+ case 7:
443
+ case 11:
444
+ case 12:
445
+ this.$ = p[h];
446
+ break;
447
+ case 8:
448
+ case 13:
449
+ this.$ = [];
450
+ break;
451
+ case 15:
452
+ p[h].type = "createParticipant", this.$ = p[h];
453
+ break;
454
+ case 16:
455
+ p[h - 1].unshift({
456
+ type: "boxStart",
457
+ boxData: d.parseBoxData(p[h - 2])
458
+ }), p[h - 1].push({
459
+ type: "boxEnd",
460
+ boxText: p[h - 2]
461
+ }), this.$ = p[h - 1];
462
+ break;
463
+ case 18:
464
+ this.$ = {
465
+ type: "sequenceIndex",
466
+ sequenceIndex: Number(p[h - 2]),
467
+ sequenceIndexStep: Number(p[h - 1]),
468
+ sequenceVisible: !0,
469
+ signalType: d.LINETYPE.AUTONUMBER
470
+ };
471
+ break;
472
+ case 19:
473
+ this.$ = {
474
+ type: "sequenceIndex",
475
+ sequenceIndex: Number(p[h - 1]),
476
+ sequenceIndexStep: 1,
477
+ sequenceVisible: !0,
478
+ signalType: d.LINETYPE.AUTONUMBER
479
+ };
480
+ break;
481
+ case 20:
482
+ this.$ = {
483
+ type: "sequenceIndex",
484
+ sequenceVisible: !1,
485
+ signalType: d.LINETYPE.AUTONUMBER
486
+ };
487
+ break;
488
+ case 21:
489
+ this.$ = {
490
+ type: "sequenceIndex",
491
+ sequenceVisible: !0,
492
+ signalType: d.LINETYPE.AUTONUMBER
493
+ };
494
+ break;
495
+ case 22:
496
+ this.$ = {
497
+ type: "activeStart",
498
+ signalType: d.LINETYPE.ACTIVE_START,
499
+ actor: p[h - 1].actor
500
+ };
501
+ break;
502
+ case 23:
503
+ this.$ = {
504
+ type: "activeEnd",
505
+ signalType: d.LINETYPE.ACTIVE_END,
506
+ actor: p[h - 1].actor
507
+ };
508
+ break;
509
+ case 29:
510
+ d.setDiagramTitle(p[h].substring(6)), this.$ = p[h].substring(6);
511
+ break;
512
+ case 30:
513
+ d.setDiagramTitle(p[h].substring(7)), this.$ = p[h].substring(7);
514
+ break;
515
+ case 31:
516
+ this.$ = p[h].trim(), d.setAccTitle(this.$);
517
+ break;
518
+ case 32:
519
+ case 33:
520
+ this.$ = p[h].trim(), d.setAccDescription(this.$);
521
+ break;
522
+ case 34:
523
+ p[h - 1].unshift({
524
+ type: "loopStart",
525
+ loopText: d.parseMessage(p[h - 2]),
526
+ signalType: d.LINETYPE.LOOP_START
527
+ }), p[h - 1].push({
528
+ type: "loopEnd",
529
+ loopText: p[h - 2],
530
+ signalType: d.LINETYPE.LOOP_END
531
+ }), this.$ = p[h - 1];
532
+ break;
533
+ case 35:
534
+ p[h - 1].unshift({
535
+ type: "rectStart",
536
+ color: d.parseMessage(p[h - 2]),
537
+ signalType: d.LINETYPE.RECT_START
538
+ }), p[h - 1].push({
539
+ type: "rectEnd",
540
+ color: d.parseMessage(p[h - 2]),
541
+ signalType: d.LINETYPE.RECT_END
542
+ }), this.$ = p[h - 1];
543
+ break;
544
+ case 36:
545
+ p[h - 1].unshift({
546
+ type: "optStart",
547
+ optText: d.parseMessage(p[h - 2]),
548
+ signalType: d.LINETYPE.OPT_START
549
+ }), p[h - 1].push({
550
+ type: "optEnd",
551
+ optText: d.parseMessage(p[h - 2]),
552
+ signalType: d.LINETYPE.OPT_END
553
+ }), this.$ = p[h - 1];
554
+ break;
555
+ case 37:
556
+ p[h - 1].unshift({
557
+ type: "altStart",
558
+ altText: d.parseMessage(p[h - 2]),
559
+ signalType: d.LINETYPE.ALT_START
560
+ }), p[h - 1].push({
561
+ type: "altEnd",
562
+ signalType: d.LINETYPE.ALT_END
563
+ }), this.$ = p[h - 1];
564
+ break;
565
+ case 38:
566
+ p[h - 1].unshift({
567
+ type: "parStart",
568
+ parText: d.parseMessage(p[h - 2]),
569
+ signalType: d.LINETYPE.PAR_START
570
+ }), p[h - 1].push({
571
+ type: "parEnd",
572
+ signalType: d.LINETYPE.PAR_END
573
+ }), this.$ = p[h - 1];
574
+ break;
575
+ case 39:
576
+ p[h - 1].unshift({
577
+ type: "parStart",
578
+ parText: d.parseMessage(p[h - 2]),
579
+ signalType: d.LINETYPE.PAR_OVER_START
580
+ }), p[h - 1].push({
581
+ type: "parEnd",
582
+ signalType: d.LINETYPE.PAR_END
583
+ }), this.$ = p[h - 1];
584
+ break;
585
+ case 40:
586
+ p[h - 1].unshift({
587
+ type: "criticalStart",
588
+ criticalText: d.parseMessage(p[h - 2]),
589
+ signalType: d.LINETYPE.CRITICAL_START
590
+ }), p[h - 1].push({
591
+ type: "criticalEnd",
592
+ signalType: d.LINETYPE.CRITICAL_END
593
+ }), this.$ = p[h - 1];
594
+ break;
595
+ case 41:
596
+ p[h - 1].unshift({
597
+ type: "breakStart",
598
+ breakText: d.parseMessage(p[h - 2]),
599
+ signalType: d.LINETYPE.BREAK_START
600
+ }), p[h - 1].push({
601
+ type: "breakEnd",
602
+ optText: d.parseMessage(p[h - 2]),
603
+ signalType: d.LINETYPE.BREAK_END
604
+ }), this.$ = p[h - 1];
605
+ break;
606
+ case 43:
607
+ this.$ = p[h - 3].concat([{
608
+ type: "option",
609
+ optionText: d.parseMessage(p[h - 1]),
610
+ signalType: d.LINETYPE.CRITICAL_OPTION
611
+ }, p[h]]);
612
+ break;
613
+ case 45:
614
+ this.$ = p[h - 3].concat([{
615
+ type: "and",
616
+ parText: d.parseMessage(p[h - 1]),
617
+ signalType: d.LINETYPE.PAR_AND
618
+ }, p[h]]);
619
+ break;
620
+ case 47:
621
+ this.$ = p[h - 3].concat([{
622
+ type: "else",
623
+ altText: d.parseMessage(p[h - 1]),
624
+ signalType: d.LINETYPE.ALT_ELSE
625
+ }, p[h]]);
626
+ break;
627
+ case 48:
628
+ p[h - 3].draw = "participant", p[h - 3].type = "addParticipant", p[h - 3].description = d.parseMessage(p[h - 1]), this.$ = p[h - 3];
629
+ break;
630
+ case 49:
631
+ p[h - 1].draw = "participant", p[h - 1].type = "addParticipant", this.$ = p[h - 1];
632
+ break;
633
+ case 50:
634
+ p[h - 3].draw = "actor", p[h - 3].type = "addParticipant", p[h - 3].description = d.parseMessage(p[h - 1]), this.$ = p[h - 3];
635
+ break;
636
+ case 51:
637
+ p[h - 1].draw = "actor", p[h - 1].type = "addParticipant", this.$ = p[h - 1];
638
+ break;
639
+ case 52:
640
+ p[h - 1].type = "destroyParticipant", this.$ = p[h - 1];
641
+ break;
642
+ case 53:
643
+ p[h - 1].draw = "participant", p[h - 1].type = "addParticipant", this.$ = p[h - 1];
644
+ break;
645
+ case 54:
646
+ this.$ = [p[h - 1], {
647
+ type: "addNote",
648
+ placement: p[h - 2],
649
+ actor: p[h - 1].actor,
650
+ text: p[h]
651
+ }];
652
+ break;
653
+ case 55:
654
+ p[h - 2] = [].concat(p[h - 1], p[h - 1]).slice(0, 2), p[h - 2][0] = p[h - 2][0].actor, p[h - 2][1] = p[h - 2][1].actor, this.$ = [p[h - 1], {
655
+ type: "addNote",
656
+ placement: d.PLACEMENT.OVER,
657
+ actor: p[h - 2].slice(0, 2),
658
+ text: p[h]
659
+ }];
660
+ break;
661
+ case 56:
662
+ this.$ = [p[h - 1], {
663
+ type: "addLinks",
664
+ actor: p[h - 1].actor,
665
+ text: p[h]
666
+ }];
667
+ break;
668
+ case 57:
669
+ this.$ = [p[h - 1], {
670
+ type: "addALink",
671
+ actor: p[h - 1].actor,
672
+ text: p[h]
673
+ }];
674
+ break;
675
+ case 58:
676
+ this.$ = [p[h - 1], {
677
+ type: "addProperties",
678
+ actor: p[h - 1].actor,
679
+ text: p[h]
680
+ }];
681
+ break;
682
+ case 59:
683
+ this.$ = [p[h - 1], {
684
+ type: "addDetails",
685
+ actor: p[h - 1].actor,
686
+ text: p[h]
687
+ }];
688
+ break;
689
+ case 62:
690
+ this.$ = [p[h - 2], p[h]];
691
+ break;
692
+ case 63:
693
+ this.$ = p[h];
694
+ break;
695
+ case 64:
696
+ this.$ = d.PLACEMENT.LEFTOF;
697
+ break;
698
+ case 65:
699
+ this.$ = d.PLACEMENT.RIGHTOF;
700
+ break;
701
+ case 66:
702
+ this.$ = [
703
+ p[h - 4],
704
+ p[h - 1],
705
+ {
706
+ type: "addMessage",
707
+ from: p[h - 4].actor,
708
+ to: p[h - 1].actor,
709
+ signalType: p[h - 3],
710
+ msg: p[h],
711
+ activate: !0
712
+ },
713
+ {
714
+ type: "activeStart",
715
+ signalType: d.LINETYPE.ACTIVE_START,
716
+ actor: p[h - 1].actor
717
+ }
718
+ ];
719
+ break;
720
+ case 67:
721
+ this.$ = [
722
+ p[h - 4],
723
+ p[h - 1],
724
+ {
725
+ type: "addMessage",
726
+ from: p[h - 4].actor,
727
+ to: p[h - 1].actor,
728
+ signalType: p[h - 3],
729
+ msg: p[h]
730
+ },
731
+ {
732
+ type: "activeEnd",
733
+ signalType: d.LINETYPE.ACTIVE_END,
734
+ actor: p[h - 4].actor
735
+ }
736
+ ];
737
+ break;
738
+ case 68:
739
+ this.$ = [
740
+ p[h - 3],
741
+ p[h - 1],
742
+ {
743
+ type: "addMessage",
744
+ from: p[h - 3].actor,
745
+ to: p[h - 1].actor,
746
+ signalType: p[h - 2],
747
+ msg: p[h]
748
+ }
749
+ ];
750
+ break;
751
+ case 69:
752
+ this.$ = {
753
+ type: "addParticipant",
754
+ actor: p[h - 1],
755
+ config: p[h]
756
+ };
757
+ break;
758
+ case 70:
759
+ this.$ = p[h - 1].trim();
760
+ break;
761
+ case 71:
762
+ this.$ = {
763
+ type: "addParticipant",
764
+ actor: p[h]
765
+ };
766
+ break;
767
+ case 72:
768
+ this.$ = d.LINETYPE.SOLID_OPEN;
769
+ break;
770
+ case 73:
771
+ this.$ = d.LINETYPE.DOTTED_OPEN;
772
+ break;
773
+ case 74:
774
+ this.$ = d.LINETYPE.SOLID;
775
+ break;
776
+ case 75:
777
+ this.$ = d.LINETYPE.BIDIRECTIONAL_SOLID;
778
+ break;
779
+ case 76:
780
+ this.$ = d.LINETYPE.DOTTED;
781
+ break;
782
+ case 77:
783
+ this.$ = d.LINETYPE.BIDIRECTIONAL_DOTTED;
784
+ break;
785
+ case 78:
786
+ this.$ = d.LINETYPE.SOLID_CROSS;
787
+ break;
788
+ case 79:
789
+ this.$ = d.LINETYPE.DOTTED_CROSS;
790
+ break;
791
+ case 80:
792
+ this.$ = d.LINETYPE.SOLID_POINT;
793
+ break;
794
+ case 81:
795
+ this.$ = d.LINETYPE.DOTTED_POINT;
796
+ break;
797
+ case 82:
798
+ this.$ = d.parseMessage(p[h].trim().substring(1));
799
+ break;
800
+ }
801
+ }, "anonymous"),
802
+ table: [
803
+ {
804
+ 3: 1,
805
+ 4: l,
806
+ 5: u,
807
+ 6: d
808
+ },
809
+ { 1: [3] },
810
+ {
811
+ 3: 5,
812
+ 4: l,
813
+ 5: u,
814
+ 6: d
815
+ },
816
+ {
817
+ 3: 6,
818
+ 4: l,
819
+ 5: u,
820
+ 6: d
821
+ },
822
+ i([
823
+ 1,
824
+ 4,
825
+ 5,
826
+ 13,
827
+ 14,
828
+ 18,
829
+ 21,
830
+ 23,
831
+ 29,
832
+ 30,
833
+ 31,
834
+ 33,
835
+ 35,
836
+ 36,
837
+ 37,
838
+ 38,
839
+ 39,
840
+ 41,
841
+ 43,
842
+ 44,
843
+ 46,
844
+ 50,
845
+ 52,
846
+ 53,
847
+ 55,
848
+ 60,
849
+ 61,
850
+ 62,
851
+ 63,
852
+ 71
853
+ ], f, { 7: 7 }),
854
+ { 1: [2, 1] },
855
+ { 1: [2, 2] },
856
+ {
857
+ 1: [2, 3],
858
+ 4: m,
859
+ 5: h,
860
+ 8: 8,
861
+ 9: 10,
862
+ 12: 12,
863
+ 13: g,
864
+ 14: _,
865
+ 17: 15,
866
+ 18: v,
867
+ 21: y,
868
+ 22: 40,
869
+ 23: b,
870
+ 24: 19,
871
+ 25: 20,
872
+ 26: 21,
873
+ 27: 22,
874
+ 28: 23,
875
+ 29: x,
876
+ 30: S,
877
+ 31: C,
878
+ 33: w,
879
+ 35: T,
880
+ 36: E,
881
+ 37: D,
882
+ 38: O,
883
+ 39: k,
884
+ 41: A,
885
+ 43: j,
886
+ 44: M,
887
+ 46: N,
888
+ 50: P,
889
+ 52: F,
890
+ 53: I,
891
+ 55: L,
892
+ 60: R,
893
+ 61: z,
894
+ 62: B,
895
+ 63: V,
896
+ 71: H
897
+ },
898
+ i(U, [2, 5]),
899
+ {
900
+ 9: 47,
901
+ 12: 12,
902
+ 13: g,
903
+ 14: _,
904
+ 17: 15,
905
+ 18: v,
906
+ 21: y,
907
+ 22: 40,
908
+ 23: b,
909
+ 24: 19,
910
+ 25: 20,
911
+ 26: 21,
912
+ 27: 22,
913
+ 28: 23,
914
+ 29: x,
915
+ 30: S,
916
+ 31: C,
917
+ 33: w,
918
+ 35: T,
919
+ 36: E,
920
+ 37: D,
921
+ 38: O,
922
+ 39: k,
923
+ 41: A,
924
+ 43: j,
925
+ 44: M,
926
+ 46: N,
927
+ 50: P,
928
+ 52: F,
929
+ 53: I,
930
+ 55: L,
931
+ 60: R,
932
+ 61: z,
933
+ 62: B,
934
+ 63: V,
935
+ 71: H
936
+ },
937
+ i(U, [2, 7]),
938
+ i(U, [2, 8]),
939
+ i(U, [2, 14]),
940
+ {
941
+ 12: 48,
942
+ 50: P,
943
+ 52: F,
944
+ 53: I
945
+ },
946
+ { 15: [1, 49] },
947
+ { 5: [1, 50] },
948
+ {
949
+ 5: [1, 53],
950
+ 19: [1, 51],
951
+ 20: [1, 52]
952
+ },
953
+ {
954
+ 22: 54,
955
+ 71: H
956
+ },
957
+ {
958
+ 22: 55,
959
+ 71: H
960
+ },
961
+ { 5: [1, 56] },
962
+ { 5: [1, 57] },
963
+ { 5: [1, 58] },
964
+ { 5: [1, 59] },
965
+ { 5: [1, 60] },
966
+ i(U, [2, 29]),
967
+ i(U, [2, 30]),
968
+ { 32: [1, 61] },
969
+ { 34: [1, 62] },
970
+ i(U, [2, 33]),
971
+ { 15: [1, 63] },
972
+ { 15: [1, 64] },
973
+ { 15: [1, 65] },
974
+ { 15: [1, 66] },
975
+ { 15: [1, 67] },
976
+ { 15: [1, 68] },
977
+ { 15: [1, 69] },
978
+ { 15: [1, 70] },
979
+ {
980
+ 22: 71,
981
+ 54: 72,
982
+ 71: [1, 73]
983
+ },
984
+ {
985
+ 22: 74,
986
+ 71: H
987
+ },
988
+ {
989
+ 22: 75,
990
+ 71: H
991
+ },
992
+ {
993
+ 68: 76,
994
+ 76: [1, 77],
995
+ 77: [1, 78],
996
+ 78: [1, 79],
997
+ 79: [1, 80],
998
+ 80: [1, 81],
999
+ 81: [1, 82],
1000
+ 82: [1, 83],
1001
+ 83: [1, 84],
1002
+ 84: [1, 85],
1003
+ 85: [1, 86]
1004
+ },
1005
+ {
1006
+ 56: 87,
1007
+ 58: [1, 88],
1008
+ 66: [1, 89],
1009
+ 67: [1, 90]
1010
+ },
1011
+ {
1012
+ 22: 91,
1013
+ 71: H
1014
+ },
1015
+ {
1016
+ 22: 92,
1017
+ 71: H
1018
+ },
1019
+ {
1020
+ 22: 93,
1021
+ 71: H
1022
+ },
1023
+ {
1024
+ 22: 94,
1025
+ 71: H
1026
+ },
1027
+ i([
1028
+ 5,
1029
+ 51,
1030
+ 65,
1031
+ 76,
1032
+ 77,
1033
+ 78,
1034
+ 79,
1035
+ 80,
1036
+ 81,
1037
+ 82,
1038
+ 83,
1039
+ 84,
1040
+ 85,
1041
+ 86
1042
+ ], W),
1043
+ i(U, [2, 6]),
1044
+ i(U, [2, 15]),
1045
+ i(G, [2, 9], { 10: 95 }),
1046
+ i(U, [2, 17]),
1047
+ {
1048
+ 5: [1, 97],
1049
+ 19: [1, 96]
1050
+ },
1051
+ { 5: [1, 98] },
1052
+ i(U, [2, 21]),
1053
+ { 5: [1, 99] },
1054
+ { 5: [1, 100] },
1055
+ i(U, [2, 24]),
1056
+ i(U, [2, 25]),
1057
+ i(U, [2, 26]),
1058
+ i(U, [2, 27]),
1059
+ i(U, [2, 28]),
1060
+ i(U, [2, 31]),
1061
+ i(U, [2, 32]),
1062
+ i(K, f, { 7: 101 }),
1063
+ i(K, f, { 7: 102 }),
1064
+ i(K, f, { 7: 103 }),
1065
+ i(q, f, {
1066
+ 40: 104,
1067
+ 7: 105
1068
+ }),
1069
+ i(J, f, {
1070
+ 42: 106,
1071
+ 7: 107
1072
+ }),
1073
+ i(J, f, {
1074
+ 7: 107,
1075
+ 42: 108
1076
+ }),
1077
+ i(Y, f, {
1078
+ 45: 109,
1079
+ 7: 110
1080
+ }),
1081
+ i(K, f, { 7: 111 }),
1082
+ {
1083
+ 5: [1, 113],
1084
+ 51: [1, 112]
1085
+ },
1086
+ { 5: [1, 114] },
1087
+ i([5, 51], W, {
1088
+ 72: 115,
1089
+ 73: [1, 116]
1090
+ }),
1091
+ {
1092
+ 5: [1, 118],
1093
+ 51: [1, 117]
1094
+ },
1095
+ { 5: [1, 119] },
1096
+ {
1097
+ 22: 122,
1098
+ 69: [1, 120],
1099
+ 70: [1, 121],
1100
+ 71: H
1101
+ },
1102
+ i(X, [2, 72]),
1103
+ i(X, [2, 73]),
1104
+ i(X, [2, 74]),
1105
+ i(X, [2, 75]),
1106
+ i(X, [2, 76]),
1107
+ i(X, [2, 77]),
1108
+ i(X, [2, 78]),
1109
+ i(X, [2, 79]),
1110
+ i(X, [2, 80]),
1111
+ i(X, [2, 81]),
1112
+ {
1113
+ 22: 123,
1114
+ 71: H
1115
+ },
1116
+ {
1117
+ 22: 125,
1118
+ 59: 124,
1119
+ 71: H
1120
+ },
1121
+ { 71: [2, 64] },
1122
+ { 71: [2, 65] },
1123
+ {
1124
+ 57: 126,
1125
+ 86: Z
1126
+ },
1127
+ {
1128
+ 57: 128,
1129
+ 86: Z
1130
+ },
1131
+ {
1132
+ 57: 129,
1133
+ 86: Z
1134
+ },
1135
+ {
1136
+ 57: 130,
1137
+ 86: Z
1138
+ },
1139
+ {
1140
+ 4: [1, 133],
1141
+ 5: [1, 135],
1142
+ 11: 132,
1143
+ 12: 134,
1144
+ 16: [1, 131],
1145
+ 50: P,
1146
+ 52: F,
1147
+ 53: I
1148
+ },
1149
+ { 5: [1, 136] },
1150
+ i(U, [2, 19]),
1151
+ i(U, [2, 20]),
1152
+ i(U, [2, 22]),
1153
+ i(U, [2, 23]),
1154
+ {
1155
+ 4: m,
1156
+ 5: h,
1157
+ 8: 8,
1158
+ 9: 10,
1159
+ 12: 12,
1160
+ 13: g,
1161
+ 14: _,
1162
+ 16: [1, 137],
1163
+ 17: 15,
1164
+ 18: v,
1165
+ 21: y,
1166
+ 22: 40,
1167
+ 23: b,
1168
+ 24: 19,
1169
+ 25: 20,
1170
+ 26: 21,
1171
+ 27: 22,
1172
+ 28: 23,
1173
+ 29: x,
1174
+ 30: S,
1175
+ 31: C,
1176
+ 33: w,
1177
+ 35: T,
1178
+ 36: E,
1179
+ 37: D,
1180
+ 38: O,
1181
+ 39: k,
1182
+ 41: A,
1183
+ 43: j,
1184
+ 44: M,
1185
+ 46: N,
1186
+ 50: P,
1187
+ 52: F,
1188
+ 53: I,
1189
+ 55: L,
1190
+ 60: R,
1191
+ 61: z,
1192
+ 62: B,
1193
+ 63: V,
1194
+ 71: H
1195
+ },
1196
+ {
1197
+ 4: m,
1198
+ 5: h,
1199
+ 8: 8,
1200
+ 9: 10,
1201
+ 12: 12,
1202
+ 13: g,
1203
+ 14: _,
1204
+ 16: [1, 138],
1205
+ 17: 15,
1206
+ 18: v,
1207
+ 21: y,
1208
+ 22: 40,
1209
+ 23: b,
1210
+ 24: 19,
1211
+ 25: 20,
1212
+ 26: 21,
1213
+ 27: 22,
1214
+ 28: 23,
1215
+ 29: x,
1216
+ 30: S,
1217
+ 31: C,
1218
+ 33: w,
1219
+ 35: T,
1220
+ 36: E,
1221
+ 37: D,
1222
+ 38: O,
1223
+ 39: k,
1224
+ 41: A,
1225
+ 43: j,
1226
+ 44: M,
1227
+ 46: N,
1228
+ 50: P,
1229
+ 52: F,
1230
+ 53: I,
1231
+ 55: L,
1232
+ 60: R,
1233
+ 61: z,
1234
+ 62: B,
1235
+ 63: V,
1236
+ 71: H
1237
+ },
1238
+ {
1239
+ 4: m,
1240
+ 5: h,
1241
+ 8: 8,
1242
+ 9: 10,
1243
+ 12: 12,
1244
+ 13: g,
1245
+ 14: _,
1246
+ 16: [1, 139],
1247
+ 17: 15,
1248
+ 18: v,
1249
+ 21: y,
1250
+ 22: 40,
1251
+ 23: b,
1252
+ 24: 19,
1253
+ 25: 20,
1254
+ 26: 21,
1255
+ 27: 22,
1256
+ 28: 23,
1257
+ 29: x,
1258
+ 30: S,
1259
+ 31: C,
1260
+ 33: w,
1261
+ 35: T,
1262
+ 36: E,
1263
+ 37: D,
1264
+ 38: O,
1265
+ 39: k,
1266
+ 41: A,
1267
+ 43: j,
1268
+ 44: M,
1269
+ 46: N,
1270
+ 50: P,
1271
+ 52: F,
1272
+ 53: I,
1273
+ 55: L,
1274
+ 60: R,
1275
+ 61: z,
1276
+ 62: B,
1277
+ 63: V,
1278
+ 71: H
1279
+ },
1280
+ { 16: [1, 140] },
1281
+ {
1282
+ 4: m,
1283
+ 5: h,
1284
+ 8: 8,
1285
+ 9: 10,
1286
+ 12: 12,
1287
+ 13: g,
1288
+ 14: _,
1289
+ 16: [2, 46],
1290
+ 17: 15,
1291
+ 18: v,
1292
+ 21: y,
1293
+ 22: 40,
1294
+ 23: b,
1295
+ 24: 19,
1296
+ 25: 20,
1297
+ 26: 21,
1298
+ 27: 22,
1299
+ 28: 23,
1300
+ 29: x,
1301
+ 30: S,
1302
+ 31: C,
1303
+ 33: w,
1304
+ 35: T,
1305
+ 36: E,
1306
+ 37: D,
1307
+ 38: O,
1308
+ 39: k,
1309
+ 41: A,
1310
+ 43: j,
1311
+ 44: M,
1312
+ 46: N,
1313
+ 49: [1, 141],
1314
+ 50: P,
1315
+ 52: F,
1316
+ 53: I,
1317
+ 55: L,
1318
+ 60: R,
1319
+ 61: z,
1320
+ 62: B,
1321
+ 63: V,
1322
+ 71: H
1323
+ },
1324
+ { 16: [1, 142] },
1325
+ {
1326
+ 4: m,
1327
+ 5: h,
1328
+ 8: 8,
1329
+ 9: 10,
1330
+ 12: 12,
1331
+ 13: g,
1332
+ 14: _,
1333
+ 16: [2, 44],
1334
+ 17: 15,
1335
+ 18: v,
1336
+ 21: y,
1337
+ 22: 40,
1338
+ 23: b,
1339
+ 24: 19,
1340
+ 25: 20,
1341
+ 26: 21,
1342
+ 27: 22,
1343
+ 28: 23,
1344
+ 29: x,
1345
+ 30: S,
1346
+ 31: C,
1347
+ 33: w,
1348
+ 35: T,
1349
+ 36: E,
1350
+ 37: D,
1351
+ 38: O,
1352
+ 39: k,
1353
+ 41: A,
1354
+ 43: j,
1355
+ 44: M,
1356
+ 46: N,
1357
+ 48: [1, 143],
1358
+ 50: P,
1359
+ 52: F,
1360
+ 53: I,
1361
+ 55: L,
1362
+ 60: R,
1363
+ 61: z,
1364
+ 62: B,
1365
+ 63: V,
1366
+ 71: H
1367
+ },
1368
+ { 16: [1, 144] },
1369
+ { 16: [1, 145] },
1370
+ {
1371
+ 4: m,
1372
+ 5: h,
1373
+ 8: 8,
1374
+ 9: 10,
1375
+ 12: 12,
1376
+ 13: g,
1377
+ 14: _,
1378
+ 16: [2, 42],
1379
+ 17: 15,
1380
+ 18: v,
1381
+ 21: y,
1382
+ 22: 40,
1383
+ 23: b,
1384
+ 24: 19,
1385
+ 25: 20,
1386
+ 26: 21,
1387
+ 27: 22,
1388
+ 28: 23,
1389
+ 29: x,
1390
+ 30: S,
1391
+ 31: C,
1392
+ 33: w,
1393
+ 35: T,
1394
+ 36: E,
1395
+ 37: D,
1396
+ 38: O,
1397
+ 39: k,
1398
+ 41: A,
1399
+ 43: j,
1400
+ 44: M,
1401
+ 46: N,
1402
+ 47: [1, 146],
1403
+ 50: P,
1404
+ 52: F,
1405
+ 53: I,
1406
+ 55: L,
1407
+ 60: R,
1408
+ 61: z,
1409
+ 62: B,
1410
+ 63: V,
1411
+ 71: H
1412
+ },
1413
+ {
1414
+ 4: m,
1415
+ 5: h,
1416
+ 8: 8,
1417
+ 9: 10,
1418
+ 12: 12,
1419
+ 13: g,
1420
+ 14: _,
1421
+ 16: [1, 147],
1422
+ 17: 15,
1423
+ 18: v,
1424
+ 21: y,
1425
+ 22: 40,
1426
+ 23: b,
1427
+ 24: 19,
1428
+ 25: 20,
1429
+ 26: 21,
1430
+ 27: 22,
1431
+ 28: 23,
1432
+ 29: x,
1433
+ 30: S,
1434
+ 31: C,
1435
+ 33: w,
1436
+ 35: T,
1437
+ 36: E,
1438
+ 37: D,
1439
+ 38: O,
1440
+ 39: k,
1441
+ 41: A,
1442
+ 43: j,
1443
+ 44: M,
1444
+ 46: N,
1445
+ 50: P,
1446
+ 52: F,
1447
+ 53: I,
1448
+ 55: L,
1449
+ 60: R,
1450
+ 61: z,
1451
+ 62: B,
1452
+ 63: V,
1453
+ 71: H
1454
+ },
1455
+ { 15: [1, 148] },
1456
+ i(U, [2, 49]),
1457
+ i(U, [2, 53]),
1458
+ { 5: [2, 69] },
1459
+ { 74: [1, 149] },
1460
+ { 15: [1, 150] },
1461
+ i(U, [2, 51]),
1462
+ i(U, [2, 52]),
1463
+ {
1464
+ 22: 151,
1465
+ 71: H
1466
+ },
1467
+ {
1468
+ 22: 152,
1469
+ 71: H
1470
+ },
1471
+ {
1472
+ 57: 153,
1473
+ 86: Z
1474
+ },
1475
+ {
1476
+ 57: 154,
1477
+ 86: Z
1478
+ },
1479
+ {
1480
+ 57: 155,
1481
+ 86: Z
1482
+ },
1483
+ {
1484
+ 65: [1, 156],
1485
+ 86: [2, 63]
1486
+ },
1487
+ { 5: [2, 56] },
1488
+ { 5: [2, 82] },
1489
+ { 5: [2, 57] },
1490
+ { 5: [2, 58] },
1491
+ { 5: [2, 59] },
1492
+ i(U, [2, 16]),
1493
+ i(G, [2, 10]),
1494
+ {
1495
+ 12: 157,
1496
+ 50: P,
1497
+ 52: F,
1498
+ 53: I
1499
+ },
1500
+ i(G, [2, 12]),
1501
+ i(G, [2, 13]),
1502
+ i(U, [2, 18]),
1503
+ i(U, [2, 34]),
1504
+ i(U, [2, 35]),
1505
+ i(U, [2, 36]),
1506
+ i(U, [2, 37]),
1507
+ { 15: [1, 158] },
1508
+ i(U, [2, 38]),
1509
+ { 15: [1, 159] },
1510
+ i(U, [2, 39]),
1511
+ i(U, [2, 40]),
1512
+ { 15: [1, 160] },
1513
+ i(U, [2, 41]),
1514
+ { 5: [1, 161] },
1515
+ { 75: [1, 162] },
1516
+ { 5: [1, 163] },
1517
+ {
1518
+ 57: 164,
1519
+ 86: Z
1520
+ },
1521
+ {
1522
+ 57: 165,
1523
+ 86: Z
1524
+ },
1525
+ { 5: [2, 68] },
1526
+ { 5: [2, 54] },
1527
+ { 5: [2, 55] },
1528
+ {
1529
+ 22: 166,
1530
+ 71: H
1531
+ },
1532
+ i(G, [2, 11]),
1533
+ i(q, f, {
1534
+ 7: 105,
1535
+ 40: 167
1536
+ }),
1537
+ i(J, f, {
1538
+ 7: 107,
1539
+ 42: 168
1540
+ }),
1541
+ i(Y, f, {
1542
+ 7: 110,
1543
+ 45: 169
1544
+ }),
1545
+ i(U, [2, 48]),
1546
+ { 5: [2, 70] },
1547
+ i(U, [2, 50]),
1548
+ { 5: [2, 66] },
1549
+ { 5: [2, 67] },
1550
+ { 86: [2, 62] },
1551
+ { 16: [2, 47] },
1552
+ { 16: [2, 45] },
1553
+ { 16: [2, 43] }
1554
+ ],
1555
+ defaultActions: {
1556
+ 5: [2, 1],
1557
+ 6: [2, 2],
1558
+ 89: [2, 64],
1559
+ 90: [2, 65],
1560
+ 115: [2, 69],
1561
+ 126: [2, 56],
1562
+ 127: [2, 82],
1563
+ 128: [2, 57],
1564
+ 129: [2, 58],
1565
+ 130: [2, 59],
1566
+ 153: [2, 68],
1567
+ 154: [2, 54],
1568
+ 155: [2, 55],
1569
+ 162: [2, 70],
1570
+ 164: [2, 66],
1571
+ 165: [2, 67],
1572
+ 166: [2, 62],
1573
+ 167: [2, 47],
1574
+ 168: [2, 45],
1575
+ 169: [2, 43]
1576
+ },
1577
+ parseError: /* @__PURE__ */ __name(function(i, l) {
1578
+ if (l.recoverable) this.trace(i);
1579
+ else {
1580
+ var u = Error(i);
1581
+ throw u.hash = l, u;
1582
+ }
1583
+ }, "parseError"),
1584
+ parse: /* @__PURE__ */ __name(function(i) {
1585
+ var l = this, u = [0], d = [], f = [null], m = [], h = this.table, g = "", _ = 0, v = 0, y = 0, b = 2, x = 1, S = m.slice.call(arguments, 1), C = Object.create(this.lexer), w = { yy: {} };
1586
+ for (var T in this.yy) Object.prototype.hasOwnProperty.call(this.yy, T) && (w.yy[T] = this.yy[T]);
1587
+ C.setInput(i, w.yy), w.yy.lexer = C, w.yy.parser = this, C.yylloc === void 0 && (C.yylloc = {});
1588
+ var E = C.yylloc;
1589
+ m.push(E);
1590
+ var D = C.options && C.options.ranges;
1591
+ typeof w.yy.parseError == "function" ? this.parseError = w.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
1592
+ function O(i) {
1593
+ u.length -= 2 * i, f.length -= i, m.length -= i;
1594
+ }
1595
+ __name(O, "popStack");
1596
+ function k() {
1597
+ var i = d.pop() || C.lex() || x;
1598
+ return typeof i != "number" && (i instanceof Array && (d = i, i = d.pop()), i = l.symbols_[i] || i), i;
1599
+ }
1600
+ __name(k, "lex");
1601
+ for (var A, j, M, N, P, F = {}, I, L, R, z;;) {
1602
+ if (M = u[u.length - 1], this.defaultActions[M] ? N = this.defaultActions[M] : (A ??= k(), N = h[M] && h[M][A]), N === void 0 || !N.length || !N[0]) {
1603
+ var B = "";
1604
+ for (I in z = [], h[M]) this.terminals_[I] && I > b && z.push("'" + this.terminals_[I] + "'");
1605
+ B = C.showPosition ? "Parse error on line " + (_ + 1) + ":\n" + C.showPosition() + "\nExpecting " + z.join(", ") + ", got '" + (this.terminals_[A] || A) + "'" : "Parse error on line " + (_ + 1) + ": Unexpected " + (A == x ? "end of input" : "'" + (this.terminals_[A] || A) + "'"), this.parseError(B, {
1606
+ text: C.match,
1607
+ token: this.terminals_[A] || A,
1608
+ line: C.yylineno,
1609
+ loc: E,
1610
+ expected: z
1611
+ });
1612
+ }
1613
+ if (N[0] instanceof Array && N.length > 1) throw Error("Parse Error: multiple actions possible at state: " + M + ", token: " + A);
1614
+ switch (N[0]) {
1615
+ case 1:
1616
+ u.push(A), f.push(C.yytext), m.push(C.yylloc), u.push(N[1]), A = null, j ? (A = j, j = null) : (v = C.yyleng, g = C.yytext, _ = C.yylineno, E = C.yylloc, y > 0 && y--);
1617
+ break;
1618
+ case 2:
1619
+ if (L = this.productions_[N[1]][1], F.$ = f[f.length - L], F._$ = {
1620
+ first_line: m[m.length - (L || 1)].first_line,
1621
+ last_line: m[m.length - 1].last_line,
1622
+ first_column: m[m.length - (L || 1)].first_column,
1623
+ last_column: m[m.length - 1].last_column
1624
+ }, D && (F._$.range = [m[m.length - (L || 1)].range[0], m[m.length - 1].range[1]]), P = this.performAction.apply(F, [
1625
+ g,
1626
+ v,
1627
+ _,
1628
+ w.yy,
1629
+ N[1],
1630
+ f,
1631
+ m
1632
+ ].concat(S)), P !== void 0) return P;
1633
+ L && (u = u.slice(0, -1 * L * 2), f = f.slice(0, -1 * L), m = m.slice(0, -1 * L)), u.push(this.productions_[N[1]][0]), f.push(F.$), m.push(F._$), R = h[u[u.length - 2]][u[u.length - 1]], u.push(R);
1634
+ break;
1635
+ case 3: return !0;
1636
+ }
1637
+ }
1638
+ return !0;
1639
+ }, "parse")
1640
+ };
1641
+ Q.lexer = /* @__PURE__ */ (function() {
1642
+ return {
1643
+ EOF: 1,
1644
+ parseError: /* @__PURE__ */ __name(function(i, l) {
1645
+ if (this.yy.parser) this.yy.parser.parseError(i, l);
1646
+ else throw Error(i);
1647
+ }, "parseError"),
1648
+ setInput: /* @__PURE__ */ __name(function(i, l) {
1649
+ return this.yy = l || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
1650
+ first_line: 1,
1651
+ first_column: 0,
1652
+ last_line: 1,
1653
+ last_column: 0
1654
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
1655
+ }, "setInput"),
1656
+ input: /* @__PURE__ */ __name(function() {
1657
+ var i = this._input[0];
1658
+ return this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i, i.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i;
1659
+ }, "input"),
1660
+ unput: /* @__PURE__ */ __name(function(i) {
1661
+ var l = i.length, u = i.split(/(?:\r\n?|\n)/g);
1662
+ this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l;
1663
+ var d = this.match.split(/(?:\r\n?|\n)/g);
1664
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), u.length - 1 && (this.yylineno -= u.length - 1);
1665
+ var f = this.yylloc.range;
1666
+ return this.yylloc = {
1667
+ first_line: this.yylloc.first_line,
1668
+ last_line: this.yylineno + 1,
1669
+ first_column: this.yylloc.first_column,
1670
+ last_column: u ? (u.length === d.length ? this.yylloc.first_column : 0) + d[d.length - u.length].length - u[0].length : this.yylloc.first_column - l
1671
+ }, this.options.ranges && (this.yylloc.range = [f[0], f[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this;
1672
+ }, "unput"),
1673
+ more: /* @__PURE__ */ __name(function() {
1674
+ return this._more = !0, this;
1675
+ }, "more"),
1676
+ reject: /* @__PURE__ */ __name(function() {
1677
+ if (this.options.backtrack_lexer) this._backtrack = !0;
1678
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
1679
+ text: "",
1680
+ token: null,
1681
+ line: this.yylineno
1682
+ });
1683
+ return this;
1684
+ }, "reject"),
1685
+ less: /* @__PURE__ */ __name(function(i) {
1686
+ this.unput(this.match.slice(i));
1687
+ }, "less"),
1688
+ pastInput: /* @__PURE__ */ __name(function() {
1689
+ var i = this.matched.substr(0, this.matched.length - this.match.length);
1690
+ return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
1691
+ }, "pastInput"),
1692
+ upcomingInput: /* @__PURE__ */ __name(function() {
1693
+ var i = this.match;
1694
+ return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
1695
+ }, "upcomingInput"),
1696
+ showPosition: /* @__PURE__ */ __name(function() {
1697
+ var i = this.pastInput(), l = Array(i.length + 1).join("-");
1698
+ return i + this.upcomingInput() + "\n" + l + "^";
1699
+ }, "showPosition"),
1700
+ test_match: /* @__PURE__ */ __name(function(i, l) {
1701
+ var u, d, f;
1702
+ if (this.options.backtrack_lexer && (f = {
1703
+ yylineno: this.yylineno,
1704
+ yylloc: {
1705
+ first_line: this.yylloc.first_line,
1706
+ last_line: this.last_line,
1707
+ first_column: this.yylloc.first_column,
1708
+ last_column: this.yylloc.last_column
1709
+ },
1710
+ yytext: this.yytext,
1711
+ match: this.match,
1712
+ matches: this.matches,
1713
+ matched: this.matched,
1714
+ yyleng: this.yyleng,
1715
+ offset: this.offset,
1716
+ _more: this._more,
1717
+ _input: this._input,
1718
+ yy: this.yy,
1719
+ conditionStack: this.conditionStack.slice(0),
1720
+ done: this.done
1721
+ }, this.options.ranges && (f.yylloc.range = this.yylloc.range.slice(0))), d = i[0].match(/(?:\r\n?|\n).*/g), d && (this.yylineno += d.length), this.yylloc = {
1722
+ first_line: this.yylloc.last_line,
1723
+ last_line: this.yylineno + 1,
1724
+ first_column: this.yylloc.last_column,
1725
+ last_column: d ? d[d.length - 1].length - d[d.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
1726
+ }, this.yytext += i[0], this.match += i[0], this.matches = i, 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(i[0].length), this.matched += i[0], u = this.performAction.call(this, this.yy, this, l, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), u) return u;
1727
+ if (this._backtrack) {
1728
+ for (var p in f) this[p] = f[p];
1729
+ return !1;
1730
+ }
1731
+ return !1;
1732
+ }, "test_match"),
1733
+ next: /* @__PURE__ */ __name(function() {
1734
+ if (this.done) return this.EOF;
1735
+ this._input || (this.done = !0);
1736
+ var i, l, u, d;
1737
+ this._more || (this.yytext = "", this.match = "");
1738
+ for (var f = this._currentRules(), p = 0; p < f.length; p++) if (u = this._input.match(this.rules[f[p]]), u && (!l || u[0].length > l[0].length)) {
1739
+ if (l = u, d = p, this.options.backtrack_lexer) {
1740
+ if (i = this.test_match(u, f[p]), i !== !1) return i;
1741
+ if (this._backtrack) {
1742
+ l = !1;
1743
+ continue;
1744
+ } else return !1;
1745
+ } else if (!this.options.flex) break;
1746
+ }
1747
+ return l ? (i = this.test_match(l, f[d]), i === !1 ? !1 : i) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
1748
+ text: "",
1749
+ token: null,
1750
+ line: this.yylineno
1751
+ });
1752
+ }, "next"),
1753
+ lex: /* @__PURE__ */ __name(function() {
1754
+ return this.next() || this.lex();
1755
+ }, "lex"),
1756
+ begin: /* @__PURE__ */ __name(function(i) {
1757
+ this.conditionStack.push(i);
1758
+ }, "begin"),
1759
+ popState: /* @__PURE__ */ __name(function() {
1760
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
1761
+ }, "popState"),
1762
+ _currentRules: /* @__PURE__ */ __name(function() {
1763
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
1764
+ }, "_currentRules"),
1765
+ topState: /* @__PURE__ */ __name(function(i) {
1766
+ return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
1767
+ }, "topState"),
1768
+ pushState: /* @__PURE__ */ __name(function(i) {
1769
+ this.begin(i);
1770
+ }, "pushState"),
1771
+ stateStackSize: /* @__PURE__ */ __name(function() {
1772
+ return this.conditionStack.length;
1773
+ }, "stateStackSize"),
1774
+ options: { "case-insensitive": !0 },
1775
+ performAction: /* @__PURE__ */ __name(function(i, l, u, d) {
1776
+ switch (u) {
1777
+ case 0: return 5;
1778
+ case 1: break;
1779
+ case 2: break;
1780
+ case 3: break;
1781
+ case 4: break;
1782
+ case 5: break;
1783
+ case 6: return 19;
1784
+ case 7: return this.begin("CONFIG"), 73;
1785
+ case 8: return 74;
1786
+ case 9: return this.popState(), this.popState(), 75;
1787
+ case 10: return l.yytext = l.yytext.trim(), 71;
1788
+ case 11: return l.yytext = l.yytext.trim(), this.begin("ALIAS"), 71;
1789
+ case 12: return this.begin("LINE"), 14;
1790
+ case 13: return this.begin("ID"), 50;
1791
+ case 14: return this.begin("ID"), 52;
1792
+ case 15: return 13;
1793
+ case 16: return this.begin("ID"), 53;
1794
+ case 17: return l.yytext = l.yytext.trim(), this.begin("ALIAS"), 71;
1795
+ case 18: return this.popState(), this.popState(), this.begin("LINE"), 51;
1796
+ case 19: return this.popState(), this.popState(), 5;
1797
+ case 20: return this.begin("LINE"), 36;
1798
+ case 21: return this.begin("LINE"), 37;
1799
+ case 22: return this.begin("LINE"), 38;
1800
+ case 23: return this.begin("LINE"), 39;
1801
+ case 24: return this.begin("LINE"), 49;
1802
+ case 25: return this.begin("LINE"), 41;
1803
+ case 26: return this.begin("LINE"), 43;
1804
+ case 27: return this.begin("LINE"), 48;
1805
+ case 28: return this.begin("LINE"), 44;
1806
+ case 29: return this.begin("LINE"), 47;
1807
+ case 30: return this.begin("LINE"), 46;
1808
+ case 31: return this.popState(), 15;
1809
+ case 32: return 16;
1810
+ case 33: return 66;
1811
+ case 34: return 67;
1812
+ case 35: return 60;
1813
+ case 36: return 61;
1814
+ case 37: return 62;
1815
+ case 38: return 63;
1816
+ case 39: return 58;
1817
+ case 40: return 55;
1818
+ case 41: return this.begin("ID"), 21;
1819
+ case 42: return this.begin("ID"), 23;
1820
+ case 43: return 29;
1821
+ case 44: return 30;
1822
+ case 45: return this.begin("acc_title"), 31;
1823
+ case 46: return this.popState(), "acc_title_value";
1824
+ case 47: return this.begin("acc_descr"), 33;
1825
+ case 48: return this.popState(), "acc_descr_value";
1826
+ case 49:
1827
+ this.begin("acc_descr_multiline");
1828
+ break;
1829
+ case 50:
1830
+ this.popState();
1831
+ break;
1832
+ case 51: return "acc_descr_multiline_value";
1833
+ case 52: return 6;
1834
+ case 53: return 18;
1835
+ case 54: return 20;
1836
+ case 55: return 65;
1837
+ case 56: return 5;
1838
+ case 57: return l.yytext = l.yytext.trim(), 71;
1839
+ case 58: return 78;
1840
+ case 59: return 79;
1841
+ case 60: return 80;
1842
+ case 61: return 81;
1843
+ case 62: return 76;
1844
+ case 63: return 77;
1845
+ case 64: return 82;
1846
+ case 65: return 83;
1847
+ case 66: return 84;
1848
+ case 67: return 85;
1849
+ case 68: return 86;
1850
+ case 69: return 86;
1851
+ case 70: return 69;
1852
+ case 71: return 70;
1853
+ case 72: return 5;
1854
+ case 73: return "INVALID";
1855
+ }
1856
+ }, "anonymous"),
1857
+ rules: [
1858
+ /^(?:[\n]+)/i,
1859
+ /^(?:\s+)/i,
1860
+ /^(?:((?!\n)\s)+)/i,
1861
+ /^(?:#[^\n]*)/i,
1862
+ /^(?:%(?!\{)[^\n]*)/i,
1863
+ /^(?:[^\}]%%[^\n]*)/i,
1864
+ /^(?:[0-9]+(?=[ \n]+))/i,
1865
+ /^(?:@\{)/i,
1866
+ /^(?:[^\}]+)/i,
1867
+ /^(?:\})/i,
1868
+ /^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,
1869
+ /^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,
1870
+ /^(?:box\b)/i,
1871
+ /^(?:participant\b)/i,
1872
+ /^(?:actor\b)/i,
1873
+ /^(?:create\b)/i,
1874
+ /^(?:destroy\b)/i,
1875
+ /^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,
1876
+ /^(?:as\b)/i,
1877
+ /^(?:(?:))/i,
1878
+ /^(?:loop\b)/i,
1879
+ /^(?:rect\b)/i,
1880
+ /^(?:opt\b)/i,
1881
+ /^(?:alt\b)/i,
1882
+ /^(?:else\b)/i,
1883
+ /^(?:par\b)/i,
1884
+ /^(?:par_over\b)/i,
1885
+ /^(?:and\b)/i,
1886
+ /^(?:critical\b)/i,
1887
+ /^(?:option\b)/i,
1888
+ /^(?:break\b)/i,
1889
+ /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,
1890
+ /^(?:end\b)/i,
1891
+ /^(?:left of\b)/i,
1892
+ /^(?:right of\b)/i,
1893
+ /^(?:links\b)/i,
1894
+ /^(?:link\b)/i,
1895
+ /^(?:properties\b)/i,
1896
+ /^(?:details\b)/i,
1897
+ /^(?:over\b)/i,
1898
+ /^(?:note\b)/i,
1899
+ /^(?:activate\b)/i,
1900
+ /^(?:deactivate\b)/i,
1901
+ /^(?:title\s[^#\n;]+)/i,
1902
+ /^(?:title:\s[^#\n;]+)/i,
1903
+ /^(?:accTitle\s*:\s*)/i,
1904
+ /^(?:(?!\n||)*[^\n]*)/i,
1905
+ /^(?:accDescr\s*:\s*)/i,
1906
+ /^(?:(?!\n||)*[^\n]*)/i,
1907
+ /^(?:accDescr\s*\{\s*)/i,
1908
+ /^(?:[\}])/i,
1909
+ /^(?:[^\}]*)/i,
1910
+ /^(?:sequenceDiagram\b)/i,
1911
+ /^(?:autonumber\b)/i,
1912
+ /^(?:off\b)/i,
1913
+ /^(?:,)/i,
1914
+ /^(?:;)/i,
1915
+ /^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,
1916
+ /^(?:->>)/i,
1917
+ /^(?:<<->>)/i,
1918
+ /^(?:-->>)/i,
1919
+ /^(?:<<-->>)/i,
1920
+ /^(?:->)/i,
1921
+ /^(?:-->)/i,
1922
+ /^(?:-[x])/i,
1923
+ /^(?:--[x])/i,
1924
+ /^(?:-[\)])/i,
1925
+ /^(?:--[\)])/i,
1926
+ /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,
1927
+ /^(?::)/i,
1928
+ /^(?:\+)/i,
1929
+ /^(?:-)/i,
1930
+ /^(?:$)/i,
1931
+ /^(?:.)/i
1932
+ ],
1933
+ conditions: {
1934
+ acc_descr_multiline: {
1935
+ rules: [50, 51],
1936
+ inclusive: !1
1937
+ },
1938
+ acc_descr: {
1939
+ rules: [48],
1940
+ inclusive: !1
1941
+ },
1942
+ acc_title: {
1943
+ rules: [46],
1944
+ inclusive: !1
1945
+ },
1946
+ ID: {
1947
+ rules: [
1948
+ 2,
1949
+ 3,
1950
+ 7,
1951
+ 10,
1952
+ 11,
1953
+ 17
1954
+ ],
1955
+ inclusive: !1
1956
+ },
1957
+ ALIAS: {
1958
+ rules: [
1959
+ 2,
1960
+ 3,
1961
+ 18,
1962
+ 19
1963
+ ],
1964
+ inclusive: !1
1965
+ },
1966
+ LINE: {
1967
+ rules: [
1968
+ 2,
1969
+ 3,
1970
+ 31
1971
+ ],
1972
+ inclusive: !1
1973
+ },
1974
+ CONFIG: {
1975
+ rules: [8, 9],
1976
+ inclusive: !1
1977
+ },
1978
+ CONFIG_DATA: {
1979
+ rules: [],
1980
+ inclusive: !1
1981
+ },
1982
+ INITIAL: {
1983
+ rules: [
1984
+ 0,
1985
+ 1,
1986
+ 3,
1987
+ 4,
1988
+ 5,
1989
+ 6,
1990
+ 12,
1991
+ 13,
1992
+ 14,
1993
+ 15,
1994
+ 16,
1995
+ 20,
1996
+ 21,
1997
+ 22,
1998
+ 23,
1999
+ 24,
2000
+ 25,
2001
+ 26,
2002
+ 27,
2003
+ 28,
2004
+ 29,
2005
+ 30,
2006
+ 32,
2007
+ 33,
2008
+ 34,
2009
+ 35,
2010
+ 36,
2011
+ 37,
2012
+ 38,
2013
+ 39,
2014
+ 40,
2015
+ 41,
2016
+ 42,
2017
+ 43,
2018
+ 44,
2019
+ 45,
2020
+ 47,
2021
+ 49,
2022
+ 52,
2023
+ 53,
2024
+ 54,
2025
+ 55,
2026
+ 56,
2027
+ 57,
2028
+ 58,
2029
+ 59,
2030
+ 60,
2031
+ 61,
2032
+ 62,
2033
+ 63,
2034
+ 64,
2035
+ 65,
2036
+ 66,
2037
+ 67,
2038
+ 68,
2039
+ 69,
2040
+ 70,
2041
+ 71,
2042
+ 72,
2043
+ 73
2044
+ ],
2045
+ inclusive: !0
2046
+ }
2047
+ }
2048
+ };
2049
+ })();
2050
+ function $() {
2051
+ this.yy = {};
2052
+ }
2053
+ return __name($, "Parser"), $.prototype = Q, Q.Parser = $, new $();
2054
+ })();
2055
+ parser.parser = parser;
2056
+ var sequenceDiagram_default = parser, LINETYPE = {
2057
+ SOLID: 0,
2058
+ DOTTED: 1,
2059
+ NOTE: 2,
2060
+ SOLID_CROSS: 3,
2061
+ DOTTED_CROSS: 4,
2062
+ SOLID_OPEN: 5,
2063
+ DOTTED_OPEN: 6,
2064
+ LOOP_START: 10,
2065
+ LOOP_END: 11,
2066
+ ALT_START: 12,
2067
+ ALT_ELSE: 13,
2068
+ ALT_END: 14,
2069
+ OPT_START: 15,
2070
+ OPT_END: 16,
2071
+ ACTIVE_START: 17,
2072
+ ACTIVE_END: 18,
2073
+ PAR_START: 19,
2074
+ PAR_AND: 20,
2075
+ PAR_END: 21,
2076
+ RECT_START: 22,
2077
+ RECT_END: 23,
2078
+ SOLID_POINT: 24,
2079
+ DOTTED_POINT: 25,
2080
+ AUTONUMBER: 26,
2081
+ CRITICAL_START: 27,
2082
+ CRITICAL_OPTION: 28,
2083
+ CRITICAL_END: 29,
2084
+ BREAK_START: 30,
2085
+ BREAK_END: 31,
2086
+ PAR_OVER_START: 32,
2087
+ BIDIRECTIONAL_SOLID: 33,
2088
+ BIDIRECTIONAL_DOTTED: 34
2089
+ }, ARROWTYPE = {
2090
+ FILLED: 0,
2091
+ OPEN: 1
2092
+ }, PLACEMENT = {
2093
+ LEFTOF: 0,
2094
+ RIGHTOF: 1,
2095
+ OVER: 2
2096
+ }, PARTICIPANT_TYPE = {
2097
+ ACTOR: "actor",
2098
+ BOUNDARY: "boundary",
2099
+ COLLECTIONS: "collections",
2100
+ CONTROL: "control",
2101
+ DATABASE: "database",
2102
+ ENTITY: "entity",
2103
+ PARTICIPANT: "participant",
2104
+ QUEUE: "queue"
2105
+ }, SequenceDB = class {
2106
+ constructor() {
2107
+ this.state = new ImperativeState(() => ({
2108
+ prevActor: void 0,
2109
+ actors: /* @__PURE__ */ new Map(),
2110
+ createdActors: /* @__PURE__ */ new Map(),
2111
+ destroyedActors: /* @__PURE__ */ new Map(),
2112
+ boxes: [],
2113
+ messages: [],
2114
+ notes: [],
2115
+ sequenceNumbersEnabled: !1,
2116
+ wrapEnabled: void 0,
2117
+ currentBox: void 0,
2118
+ lastCreated: void 0,
2119
+ lastDestroyed: void 0
2120
+ })), this.setAccTitle = setAccTitle, this.setAccDescription = setAccDescription, this.setDiagramTitle = setDiagramTitle, this.getAccTitle = getAccTitle, this.getAccDescription = getAccDescription, this.getDiagramTitle = getDiagramTitle, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(getConfig2().wrap), this.LINETYPE = LINETYPE, this.ARROWTYPE = ARROWTYPE, this.PLACEMENT = PLACEMENT;
2121
+ }
2122
+ static #_ = __name(this, "SequenceDB");
2123
+ addBox(i) {
2124
+ this.state.records.boxes.push({
2125
+ name: i.text,
2126
+ wrap: i.wrap ?? this.autoWrap(),
2127
+ fill: i.color,
2128
+ actorKeys: []
2129
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
2130
+ }
2131
+ addActor(i, l, u, d, f) {
2132
+ let p = this.state.records.currentBox, m;
2133
+ if (f !== void 0) {
2134
+ let i;
2135
+ i = f.includes("\n") ? f + "\n" : "{\n" + f + "\n}", m = load(i, { schema: JSON_SCHEMA });
2136
+ }
2137
+ d = m?.type ?? d;
2138
+ let h = this.state.records.actors.get(i);
2139
+ if (h) {
2140
+ if (this.state.records.currentBox && h.box && this.state.records.currentBox !== h.box) throw Error(`A same participant should only be defined in one Box: ${h.name} can't be in '${h.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);
2141
+ if (p = h.box ? h.box : this.state.records.currentBox, h.box = p, h && l === h.name && u == null) return;
2142
+ }
2143
+ if (u?.text ?? (u = {
2144
+ text: l,
2145
+ type: d
2146
+ }), (d == null || u.text == null) && (u = {
2147
+ text: l,
2148
+ type: d
2149
+ }), this.state.records.actors.set(i, {
2150
+ box: p,
2151
+ name: l,
2152
+ description: u.text,
2153
+ wrap: u.wrap ?? this.autoWrap(),
2154
+ prevActor: this.state.records.prevActor,
2155
+ links: {},
2156
+ properties: {},
2157
+ actorCnt: null,
2158
+ rectData: null,
2159
+ type: d ?? "participant"
2160
+ }), this.state.records.prevActor) {
2161
+ let l = this.state.records.actors.get(this.state.records.prevActor);
2162
+ l && (l.nextActor = i);
2163
+ }
2164
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(i), this.state.records.prevActor = i;
2165
+ }
2166
+ activationCount(i) {
2167
+ let l, u = 0;
2168
+ if (!i) return 0;
2169
+ for (l = 0; l < this.state.records.messages.length; l++) this.state.records.messages[l].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[l].from === i && u++, this.state.records.messages[l].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[l].from === i && u--;
2170
+ return u;
2171
+ }
2172
+ addMessage(i, l, u, d) {
2173
+ this.state.records.messages.push({
2174
+ id: this.state.records.messages.length.toString(),
2175
+ from: i,
2176
+ to: l,
2177
+ message: u.text,
2178
+ wrap: u.wrap ?? this.autoWrap(),
2179
+ answer: d
2180
+ });
2181
+ }
2182
+ addSignal(i, l, u, d, f = !1) {
2183
+ if (d === this.LINETYPE.ACTIVE_END && this.activationCount(i ?? "") < 1) {
2184
+ let l = /* @__PURE__ */ Error("Trying to inactivate an inactive participant (" + i + ")");
2185
+ throw l.hash = {
2186
+ text: "->>-",
2187
+ token: "->>-",
2188
+ line: "1",
2189
+ loc: {
2190
+ first_line: 1,
2191
+ last_line: 1,
2192
+ first_column: 1,
2193
+ last_column: 1
2194
+ },
2195
+ expected: ["'ACTIVE_PARTICIPANT'"]
2196
+ }, l;
2197
+ }
2198
+ return this.state.records.messages.push({
2199
+ id: this.state.records.messages.length.toString(),
2200
+ from: i,
2201
+ to: l,
2202
+ message: u?.text ?? "",
2203
+ wrap: u?.wrap ?? this.autoWrap(),
2204
+ type: d,
2205
+ activate: f
2206
+ }), !0;
2207
+ }
2208
+ hasAtLeastOneBox() {
2209
+ return this.state.records.boxes.length > 0;
2210
+ }
2211
+ hasAtLeastOneBoxWithTitle() {
2212
+ return this.state.records.boxes.some((i) => i.name);
2213
+ }
2214
+ getMessages() {
2215
+ return this.state.records.messages;
2216
+ }
2217
+ getBoxes() {
2218
+ return this.state.records.boxes;
2219
+ }
2220
+ getActors() {
2221
+ return this.state.records.actors;
2222
+ }
2223
+ getCreatedActors() {
2224
+ return this.state.records.createdActors;
2225
+ }
2226
+ getDestroyedActors() {
2227
+ return this.state.records.destroyedActors;
2228
+ }
2229
+ getActor(i) {
2230
+ return this.state.records.actors.get(i);
2231
+ }
2232
+ getActorKeys() {
2233
+ return [...this.state.records.actors.keys()];
2234
+ }
2235
+ enableSequenceNumbers() {
2236
+ this.state.records.sequenceNumbersEnabled = !0;
2237
+ }
2238
+ disableSequenceNumbers() {
2239
+ this.state.records.sequenceNumbersEnabled = !1;
2240
+ }
2241
+ showSequenceNumbers() {
2242
+ return this.state.records.sequenceNumbersEnabled;
2243
+ }
2244
+ setWrap(i) {
2245
+ this.state.records.wrapEnabled = i;
2246
+ }
2247
+ extractWrap(i) {
2248
+ if (i === void 0) return {};
2249
+ i = i.trim();
2250
+ let l = /^:?wrap:/.exec(i) === null ? /^:?nowrap:/.exec(i) === null ? void 0 : !1 : !0;
2251
+ return {
2252
+ cleanedText: (l === void 0 ? i : i.replace(/^:?(?:no)?wrap:/, "")).trim(),
2253
+ wrap: l
2254
+ };
2255
+ }
2256
+ autoWrap() {
2257
+ return this.state.records.wrapEnabled === void 0 ? getConfig2().sequence?.wrap ?? !1 : this.state.records.wrapEnabled;
2258
+ }
2259
+ clear() {
2260
+ this.state.reset(), clear();
2261
+ }
2262
+ parseMessage(i) {
2263
+ let l = i.trim(), { wrap: u, cleanedText: d } = this.extractWrap(l), p = {
2264
+ text: d,
2265
+ wrap: u
2266
+ };
2267
+ return log.debug(`parseMessage: ${JSON.stringify(p)}`), p;
2268
+ }
2269
+ parseBoxData(i) {
2270
+ let l = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(i), u = l?.[1] ? l[1].trim() : "transparent", d = l?.[2] ? l[2].trim() : void 0;
2271
+ if (window?.CSS) window.CSS.supports("color", u) || (u = "transparent", d = i.trim());
2272
+ else {
2273
+ let l = new Option().style;
2274
+ l.color = u, l.color !== u && (u = "transparent", d = i.trim());
2275
+ }
2276
+ let { wrap: f, cleanedText: p } = this.extractWrap(d);
2277
+ return {
2278
+ text: p ? sanitizeText(p, getConfig2()) : void 0,
2279
+ color: u,
2280
+ wrap: f
2281
+ };
2282
+ }
2283
+ addNote(i, l, u) {
2284
+ let d = {
2285
+ actor: i,
2286
+ placement: l,
2287
+ message: u.text,
2288
+ wrap: u.wrap ?? this.autoWrap()
2289
+ }, f = [].concat(i, i);
2290
+ this.state.records.notes.push(d), this.state.records.messages.push({
2291
+ id: this.state.records.messages.length.toString(),
2292
+ from: f[0],
2293
+ to: f[1],
2294
+ message: u.text,
2295
+ wrap: u.wrap ?? this.autoWrap(),
2296
+ type: this.LINETYPE.NOTE,
2297
+ placement: l
2298
+ });
2299
+ }
2300
+ addLinks(i, l) {
2301
+ let u = this.getActor(i);
2302
+ try {
2303
+ let i = sanitizeText(l.text, getConfig2());
2304
+ i = i.replace(/&equals;/g, "="), i = i.replace(/&amp;/g, "&");
2305
+ let d = JSON.parse(i);
2306
+ this.insertLinks(u, d);
2307
+ } catch (i) {
2308
+ log.error("error while parsing actor link text", i);
2309
+ }
2310
+ }
2311
+ addALink(i, l) {
2312
+ let u = this.getActor(i);
2313
+ try {
2314
+ let i = {}, d = sanitizeText(l.text, getConfig2()), f = d.indexOf("@");
2315
+ d = d.replace(/&equals;/g, "="), d = d.replace(/&amp;/g, "&");
2316
+ let p = d.slice(0, f - 1).trim();
2317
+ i[p] = d.slice(f + 1).trim(), this.insertLinks(u, i);
2318
+ } catch (i) {
2319
+ log.error("error while parsing actor link text", i);
2320
+ }
2321
+ }
2322
+ insertLinks(i, l) {
2323
+ if (i.links == null) i.links = l;
2324
+ else for (let u in l) i.links[u] = l[u];
2325
+ }
2326
+ addProperties(i, l) {
2327
+ let u = this.getActor(i);
2328
+ try {
2329
+ let i = sanitizeText(l.text, getConfig2()), d = JSON.parse(i);
2330
+ this.insertProperties(u, d);
2331
+ } catch (i) {
2332
+ log.error("error while parsing actor properties text", i);
2333
+ }
2334
+ }
2335
+ insertProperties(i, l) {
2336
+ if (i.properties == null) i.properties = l;
2337
+ else for (let u in l) i.properties[u] = l[u];
2338
+ }
2339
+ boxEnd() {
2340
+ this.state.records.currentBox = void 0;
2341
+ }
2342
+ addDetails(i, l) {
2343
+ let u = this.getActor(i), d = document.getElementById(l.text);
2344
+ try {
2345
+ let i = d.innerHTML, l = JSON.parse(i);
2346
+ l.properties && this.insertProperties(u, l.properties), l.links && this.insertLinks(u, l.links);
2347
+ } catch (i) {
2348
+ log.error("error while parsing actor details text", i);
2349
+ }
2350
+ }
2351
+ getActorProperty(i, l) {
2352
+ if (i?.properties !== void 0) return i.properties[l];
2353
+ }
2354
+ apply(i) {
2355
+ if (Array.isArray(i)) i.forEach((i) => {
2356
+ this.apply(i);
2357
+ });
2358
+ else switch (i.type) {
2359
+ case "sequenceIndex":
2360
+ this.state.records.messages.push({
2361
+ id: this.state.records.messages.length.toString(),
2362
+ from: void 0,
2363
+ to: void 0,
2364
+ message: {
2365
+ start: i.sequenceIndex,
2366
+ step: i.sequenceIndexStep,
2367
+ visible: i.sequenceVisible
2368
+ },
2369
+ wrap: !1,
2370
+ type: i.signalType
2371
+ });
2372
+ break;
2373
+ case "addParticipant":
2374
+ this.addActor(i.actor, i.actor, i.description, i.draw, i.config);
2375
+ break;
2376
+ case "createParticipant":
2377
+ if (this.state.records.actors.has(i.actor)) throw Error("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");
2378
+ this.state.records.lastCreated = i.actor, this.addActor(i.actor, i.actor, i.description, i.draw, i.config), this.state.records.createdActors.set(i.actor, this.state.records.messages.length);
2379
+ break;
2380
+ case "destroyParticipant":
2381
+ this.state.records.lastDestroyed = i.actor, this.state.records.destroyedActors.set(i.actor, this.state.records.messages.length);
2382
+ break;
2383
+ case "activeStart":
2384
+ this.addSignal(i.actor, void 0, void 0, i.signalType);
2385
+ break;
2386
+ case "activeEnd":
2387
+ this.addSignal(i.actor, void 0, void 0, i.signalType);
2388
+ break;
2389
+ case "addNote":
2390
+ this.addNote(i.actor, i.placement, i.text);
2391
+ break;
2392
+ case "addLinks":
2393
+ this.addLinks(i.actor, i.text);
2394
+ break;
2395
+ case "addALink":
2396
+ this.addALink(i.actor, i.text);
2397
+ break;
2398
+ case "addProperties":
2399
+ this.addProperties(i.actor, i.text);
2400
+ break;
2401
+ case "addDetails":
2402
+ this.addDetails(i.actor, i.text);
2403
+ break;
2404
+ case "addMessage":
2405
+ if (this.state.records.lastCreated) {
2406
+ if (i.to !== this.state.records.lastCreated) throw Error("The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram.");
2407
+ this.state.records.lastCreated = void 0;
2408
+ } else if (this.state.records.lastDestroyed) {
2409
+ if (i.to !== this.state.records.lastDestroyed && i.from !== this.state.records.lastDestroyed) throw Error("The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram.");
2410
+ this.state.records.lastDestroyed = void 0;
2411
+ }
2412
+ this.addSignal(i.from, i.to, i.msg, i.signalType, i.activate);
2413
+ break;
2414
+ case "boxStart":
2415
+ this.addBox(i.boxData);
2416
+ break;
2417
+ case "boxEnd":
2418
+ this.boxEnd();
2419
+ break;
2420
+ case "loopStart":
2421
+ this.addSignal(void 0, void 0, i.loopText, i.signalType);
2422
+ break;
2423
+ case "loopEnd":
2424
+ this.addSignal(void 0, void 0, void 0, i.signalType);
2425
+ break;
2426
+ case "rectStart":
2427
+ this.addSignal(void 0, void 0, i.color, i.signalType);
2428
+ break;
2429
+ case "rectEnd":
2430
+ this.addSignal(void 0, void 0, void 0, i.signalType);
2431
+ break;
2432
+ case "optStart":
2433
+ this.addSignal(void 0, void 0, i.optText, i.signalType);
2434
+ break;
2435
+ case "optEnd":
2436
+ this.addSignal(void 0, void 0, void 0, i.signalType);
2437
+ break;
2438
+ case "altStart":
2439
+ this.addSignal(void 0, void 0, i.altText, i.signalType);
2440
+ break;
2441
+ case "else":
2442
+ this.addSignal(void 0, void 0, i.altText, i.signalType);
2443
+ break;
2444
+ case "altEnd":
2445
+ this.addSignal(void 0, void 0, void 0, i.signalType);
2446
+ break;
2447
+ case "setAccTitle":
2448
+ setAccTitle(i.text);
2449
+ break;
2450
+ case "parStart":
2451
+ this.addSignal(void 0, void 0, i.parText, i.signalType);
2452
+ break;
2453
+ case "and":
2454
+ this.addSignal(void 0, void 0, i.parText, i.signalType);
2455
+ break;
2456
+ case "parEnd":
2457
+ this.addSignal(void 0, void 0, void 0, i.signalType);
2458
+ break;
2459
+ case "criticalStart":
2460
+ this.addSignal(void 0, void 0, i.criticalText, i.signalType);
2461
+ break;
2462
+ case "option":
2463
+ this.addSignal(void 0, void 0, i.optionText, i.signalType);
2464
+ break;
2465
+ case "criticalEnd":
2466
+ this.addSignal(void 0, void 0, void 0, i.signalType);
2467
+ break;
2468
+ case "breakStart":
2469
+ this.addSignal(void 0, void 0, i.breakText, i.signalType);
2470
+ break;
2471
+ case "breakEnd":
2472
+ this.addSignal(void 0, void 0, void 0, i.signalType);
2473
+ break;
2474
+ }
2475
+ }
2476
+ getConfig() {
2477
+ return getConfig2().sequence;
2478
+ }
2479
+ }, styles_default = /* @__PURE__ */ __name((i) => `.actor {
2480
+ stroke: ${i.actorBorder};
2481
+ fill: ${i.actorBkg};
2482
+ }
2483
+
2484
+ text.actor > tspan {
2485
+ fill: ${i.actorTextColor};
2486
+ stroke: none;
2487
+ }
2488
+
2489
+ .actor-line {
2490
+ stroke: ${i.actorLineColor};
2491
+ }
2492
+
2493
+ .innerArc {
2494
+ stroke-width: 1.5;
2495
+ stroke-dasharray: none;
2496
+ }
2497
+
2498
+ .messageLine0 {
2499
+ stroke-width: 1.5;
2500
+ stroke-dasharray: none;
2501
+ stroke: ${i.signalColor};
2502
+ }
2503
+
2504
+ .messageLine1 {
2505
+ stroke-width: 1.5;
2506
+ stroke-dasharray: 2, 2;
2507
+ stroke: ${i.signalColor};
2508
+ }
2509
+
2510
+ #arrowhead path {
2511
+ fill: ${i.signalColor};
2512
+ stroke: ${i.signalColor};
2513
+ }
2514
+
2515
+ .sequenceNumber {
2516
+ fill: ${i.sequenceNumberColor};
2517
+ }
2518
+
2519
+ #sequencenumber {
2520
+ fill: ${i.signalColor};
2521
+ }
2522
+
2523
+ #crosshead path {
2524
+ fill: ${i.signalColor};
2525
+ stroke: ${i.signalColor};
2526
+ }
2527
+
2528
+ .messageText {
2529
+ fill: ${i.signalTextColor};
2530
+ stroke: none;
2531
+ }
2532
+
2533
+ .labelBox {
2534
+ stroke: ${i.labelBoxBorderColor};
2535
+ fill: ${i.labelBoxBkgColor};
2536
+ }
2537
+
2538
+ .labelText, .labelText > tspan {
2539
+ fill: ${i.labelTextColor};
2540
+ stroke: none;
2541
+ }
2542
+
2543
+ .loopText, .loopText > tspan {
2544
+ fill: ${i.loopTextColor};
2545
+ stroke: none;
2546
+ }
2547
+
2548
+ .loopLine {
2549
+ stroke-width: 2px;
2550
+ stroke-dasharray: 2, 2;
2551
+ stroke: ${i.labelBoxBorderColor};
2552
+ fill: ${i.labelBoxBorderColor};
2553
+ }
2554
+
2555
+ .note {
2556
+ //stroke: #decc93;
2557
+ stroke: ${i.noteBorderColor};
2558
+ fill: ${i.noteBkgColor};
2559
+ }
2560
+
2561
+ .noteText, .noteText > tspan {
2562
+ fill: ${i.noteTextColor};
2563
+ stroke: none;
2564
+ }
2565
+
2566
+ .activation0 {
2567
+ fill: ${i.activationBkgColor};
2568
+ stroke: ${i.activationBorderColor};
2569
+ }
2570
+
2571
+ .activation1 {
2572
+ fill: ${i.activationBkgColor};
2573
+ stroke: ${i.activationBorderColor};
2574
+ }
2575
+
2576
+ .activation2 {
2577
+ fill: ${i.activationBkgColor};
2578
+ stroke: ${i.activationBorderColor};
2579
+ }
2580
+
2581
+ .actorPopupMenu {
2582
+ position: absolute;
2583
+ }
2584
+
2585
+ .actorPopupMenuPanel {
2586
+ position: absolute;
2587
+ fill: ${i.actorBkg};
2588
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
2589
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
2590
+ }
2591
+ .actor-man line {
2592
+ stroke: ${i.actorBorder};
2593
+ fill: ${i.actorBkg};
2594
+ }
2595
+ .actor-man circle, line {
2596
+ stroke: ${i.actorBorder};
2597
+ fill: ${i.actorBkg};
2598
+ stroke-width: 2px;
2599
+ }
2600
+
2601
+ `, "getStyles"), ACTOR_TYPE_WIDTH = 36, TOP_ACTOR_CLASS = "actor-top", BOTTOM_ACTOR_CLASS = "actor-bottom", ACTOR_BOX_CLASS = "actor-box", ACTOR_MAN_FIGURE_CLASS = "actor-man", drawRect2 = /* @__PURE__ */ __name(function(i, l) {
2602
+ return drawRect(i, l);
2603
+ }, "drawRect"), drawPopup = /* @__PURE__ */ __name(function(i, l, u, d, f) {
2604
+ if (l.links === void 0 || l.links === null || Object.keys(l.links).length === 0) return {
2605
+ height: 0,
2606
+ width: 0
2607
+ };
2608
+ let p = l.links, m = l.actorCnt, h = l.rectData;
2609
+ var g = "none";
2610
+ f && (g = "block !important");
2611
+ let _ = i.append("g");
2612
+ _.attr("id", "actor" + m + "_popup"), _.attr("class", "actorPopupMenu"), _.attr("display", g);
2613
+ var v = "";
2614
+ h.class !== void 0 && (v = " " + h.class);
2615
+ let y = h.width > u ? h.width : u, b = _.append("rect");
2616
+ if (b.attr("class", "actorPopupMenuPanel" + v), b.attr("x", h.x), b.attr("y", h.height), b.attr("fill", h.fill), b.attr("stroke", h.stroke), b.attr("width", y), b.attr("height", h.height), b.attr("rx", h.rx), b.attr("ry", h.ry), p != null) {
2617
+ var x = 20;
2618
+ for (let i in p) {
2619
+ var S = _.append("a"), C = (0, import_dist.sanitizeUrl)(p[i]);
2620
+ S.attr("xlink:href", C), S.attr("target", "_blank"), _drawMenuItemTextCandidateFunc(d)(i, S, h.x + 10, h.height + x, y, 20, { class: "actor" }, d), x += 30;
2621
+ }
2622
+ }
2623
+ return b.attr("height", x), {
2624
+ height: h.height + x,
2625
+ width: y
2626
+ };
2627
+ }, "drawPopup"), popupMenuToggle = /* @__PURE__ */ __name(function(i) {
2628
+ return "var pu = document.getElementById('" + i + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
2629
+ }, "popupMenuToggle"), drawKatex = /* @__PURE__ */ __name(async function(i, l, u = null) {
2630
+ let d = i.append("foreignObject"), f = await renderKatexSanitized(l.text, getConfig()), p = d.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(f).node().getBoundingClientRect();
2631
+ if (d.attr("height", Math.round(p.height)).attr("width", Math.round(p.width)), l.class === "noteText") {
2632
+ let u = i.node().firstChild;
2633
+ u.setAttribute("height", p.height + 2 * l.textMargin);
2634
+ let f = u.getBBox();
2635
+ d.attr("x", Math.round(f.x + f.width / 2 - p.width / 2)).attr("y", Math.round(f.y + f.height / 2 - p.height / 2));
2636
+ } else if (u) {
2637
+ let { startx: i, stopx: f, starty: m } = u;
2638
+ if (i > f) {
2639
+ let l = i;
2640
+ i = f, f = l;
2641
+ }
2642
+ d.attr("x", Math.round(i + Math.abs(i - f) / 2 - p.width / 2)), l.class === "loopText" ? d.attr("y", Math.round(m)) : d.attr("y", Math.round(m - p.height));
2643
+ }
2644
+ return [d];
2645
+ }, "drawKatex"), drawText = /* @__PURE__ */ __name(function(i, l) {
2646
+ let d = 0, f = 0, m = l.text.split(common_default.lineBreakRegex), [h, g] = parseFontSize(l.fontSize), _ = [], v = 0, y = /* @__PURE__ */ __name(() => l.y, "yfunc");
2647
+ if (l.valign !== void 0 && l.textMargin !== void 0 && l.textMargin > 0) switch (l.valign) {
2648
+ case "top":
2649
+ case "start":
2650
+ y = /* @__PURE__ */ __name(() => Math.round(l.y + l.textMargin), "yfunc");
2651
+ break;
2652
+ case "middle":
2653
+ case "center":
2654
+ y = /* @__PURE__ */ __name(() => Math.round(l.y + (d + f + l.textMargin) / 2), "yfunc");
2655
+ break;
2656
+ case "bottom":
2657
+ case "end":
2658
+ y = /* @__PURE__ */ __name(() => Math.round(l.y + (d + f + 2 * l.textMargin) - l.textMargin), "yfunc");
2659
+ break;
2660
+ }
2661
+ if (l.anchor !== void 0 && l.textMargin !== void 0 && l.width !== void 0) switch (l.anchor) {
2662
+ case "left":
2663
+ case "start":
2664
+ l.x = Math.round(l.x + l.textMargin), l.anchor = "start", l.dominantBaseline = "middle", l.alignmentBaseline = "middle";
2665
+ break;
2666
+ case "middle":
2667
+ case "center":
2668
+ l.x = Math.round(l.x + l.width / 2), l.anchor = "middle", l.dominantBaseline = "middle", l.alignmentBaseline = "middle";
2669
+ break;
2670
+ case "right":
2671
+ case "end":
2672
+ l.x = Math.round(l.x + l.width - l.textMargin), l.anchor = "end", l.dominantBaseline = "middle", l.alignmentBaseline = "middle";
2673
+ break;
2674
+ }
2675
+ for (let [u, p] of m.entries()) {
2676
+ l.textMargin !== void 0 && l.textMargin === 0 && h !== void 0 && (v = u * h);
2677
+ let m = i.append("text");
2678
+ m.attr("x", l.x), m.attr("y", y()), l.anchor !== void 0 && m.attr("text-anchor", l.anchor).attr("dominant-baseline", l.dominantBaseline).attr("alignment-baseline", l.alignmentBaseline), l.fontFamily !== void 0 && m.style("font-family", l.fontFamily), g !== void 0 && m.style("font-size", g), l.fontWeight !== void 0 && m.style("font-weight", l.fontWeight), l.fill !== void 0 && m.attr("fill", l.fill), l.class !== void 0 && m.attr("class", l.class), l.dy === void 0 ? v !== 0 && m.attr("dy", v) : m.attr("dy", l.dy);
2679
+ let b = p || "​";
2680
+ if (l.tspan) {
2681
+ let i = m.append("tspan");
2682
+ i.attr("x", l.x), l.fill !== void 0 && i.attr("fill", l.fill), i.text(b);
2683
+ } else m.text(b);
2684
+ l.valign !== void 0 && l.textMargin !== void 0 && l.textMargin > 0 && (f += (m._groups || m)[0][0].getBBox().height, d = f), _.push(m);
2685
+ }
2686
+ return _;
2687
+ }, "drawText"), drawLabel = /* @__PURE__ */ __name(function(i, l) {
2688
+ function u(i, l, u, d, f) {
2689
+ return i + "," + l + " " + (i + u) + "," + l + " " + (i + u) + "," + (l + d - f) + " " + (i + u - f * 1.2) + "," + (l + d) + " " + i + "," + (l + d);
2690
+ }
2691
+ __name(u, "genPoints");
2692
+ let d = i.append("polygon");
2693
+ return d.attr("points", u(l.x, l.y, l.width, l.height, 7)), d.attr("class", "labelBox"), l.y += l.height / 2, drawText(i, l), d;
2694
+ }, "drawLabel"), actorCnt = -1, fixLifeLineHeights = /* @__PURE__ */ __name((i, l, u, d) => {
2695
+ i.select && u.forEach((u) => {
2696
+ let f = l.get(u), p = i.select("#actor" + f.actorCnt);
2697
+ !d.mirrorActors && f.stopy ? p.attr("y2", f.stopy + f.height / 2) : d.mirrorActors && p.attr("y2", f.stopy);
2698
+ });
2699
+ }, "fixLifeLineHeights"), drawActorTypeParticipant = /* @__PURE__ */ __name(function(i, l, u, d) {
2700
+ let f = d ? l.stopy : l.starty, p = l.x + l.width / 2, m = f + l.height, h = i.append("g").lower();
2701
+ var g = h;
2702
+ d || (actorCnt++, Object.keys(l.links || {}).length && !u.forceMenus && g.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), g.append("line").attr("id", "actor" + actorCnt).attr("x1", p).attr("y1", m).attr("x2", p).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", l.name), g = h.append("g"), l.actorCnt = actorCnt, l.links != null && g.attr("id", "root-" + actorCnt));
2703
+ let _ = getNoteRect();
2704
+ var v = "actor";
2705
+ l.properties?.class ? v = l.properties.class : _.fill = "#eaeaea", d ? v += ` ${BOTTOM_ACTOR_CLASS}` : v += ` ${TOP_ACTOR_CLASS}`, _.x = l.x, _.y = f, _.width = l.width, _.height = l.height, _.class = v, _.rx = 3, _.ry = 3, _.name = l.name;
2706
+ let y = drawRect2(g, _);
2707
+ if (l.rectData = _, l.properties?.icon) {
2708
+ let i = l.properties.icon.trim();
2709
+ i.charAt(0) === "@" ? drawEmbeddedImage(g, _.x + _.width - 20, _.y + 10, i.substr(1)) : drawImage(g, _.x + _.width - 20, _.y + 10, i);
2710
+ }
2711
+ _drawTextCandidateFunc(u, hasKatex(l.description))(l.description, g, _.x, _.y, _.width, _.height, { class: `actor ${ACTOR_BOX_CLASS}` }, u);
2712
+ let b = l.height;
2713
+ if (y.node) {
2714
+ let i = y.node().getBBox();
2715
+ l.height = i.height, b = i.height;
2716
+ }
2717
+ return b;
2718
+ }, "drawActorTypeParticipant"), drawActorTypeCollections = /* @__PURE__ */ __name(function(i, l, u, d) {
2719
+ let f = d ? l.stopy : l.starty, p = l.x + l.width / 2, m = f + l.height, h = i.append("g").lower();
2720
+ var g = h;
2721
+ d || (actorCnt++, Object.keys(l.links || {}).length && !u.forceMenus && g.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), g.append("line").attr("id", "actor" + actorCnt).attr("x1", p).attr("y1", m).attr("x2", p).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", l.name), g = h.append("g"), l.actorCnt = actorCnt, l.links != null && g.attr("id", "root-" + actorCnt));
2722
+ let _ = getNoteRect();
2723
+ var v = "actor";
2724
+ l.properties?.class ? v = l.properties.class : _.fill = "#eaeaea", d ? v += ` ${BOTTOM_ACTOR_CLASS}` : v += ` ${TOP_ACTOR_CLASS}`, _.x = l.x, _.y = f, _.width = l.width, _.height = l.height, _.class = v, _.name = l.name;
2725
+ let y = {
2726
+ ..._,
2727
+ x: _.x + -6,
2728
+ y: _.y + 6,
2729
+ class: "actor"
2730
+ }, b = drawRect2(g, _);
2731
+ if (drawRect2(g, y), l.rectData = _, l.properties?.icon) {
2732
+ let i = l.properties.icon.trim();
2733
+ i.charAt(0) === "@" ? drawEmbeddedImage(g, _.x + _.width - 20, _.y + 10, i.substr(1)) : drawImage(g, _.x + _.width - 20, _.y + 10, i);
2734
+ }
2735
+ _drawTextCandidateFunc(u, hasKatex(l.description))(l.description, g, _.x - 6, _.y + 6, _.width, _.height, { class: `actor ${ACTOR_BOX_CLASS}` }, u);
2736
+ let S = l.height;
2737
+ if (b.node) {
2738
+ let i = b.node().getBBox();
2739
+ l.height = i.height, S = i.height;
2740
+ }
2741
+ return S;
2742
+ }, "drawActorTypeCollections"), drawActorTypeQueue = /* @__PURE__ */ __name(function(i, l, u, d) {
2743
+ let f = d ? l.stopy : l.starty, p = l.x + l.width / 2, m = f + l.height, h = i.append("g").lower(), g = h;
2744
+ d || (actorCnt++, Object.keys(l.links || {}).length && !u.forceMenus && g.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), g.append("line").attr("id", "actor" + actorCnt).attr("x1", p).attr("y1", m).attr("x2", p).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", l.name), g = h.append("g"), l.actorCnt = actorCnt, l.links != null && g.attr("id", "root-" + actorCnt));
2745
+ let _ = getNoteRect(), v = "actor";
2746
+ l.properties?.class ? v = l.properties.class : _.fill = "#eaeaea", d ? v += ` ${BOTTOM_ACTOR_CLASS}` : v += ` ${TOP_ACTOR_CLASS}`, _.x = l.x, _.y = f, _.width = l.width, _.height = l.height, _.class = v, _.name = l.name;
2747
+ let y = _.height / 2, b = y / (2.5 + _.height / 50), S = g.append("g"), C = g.append("g");
2748
+ if (S.append("path").attr("d", `M ${_.x},${_.y + y}
2749
+ a ${b},${y} 0 0 0 0,${_.height}
2750
+ h ${_.width - 2 * b}
2751
+ a ${b},${y} 0 0 0 0,-${_.height}
2752
+ Z
2753
+ `).attr("class", v), C.append("path").attr("d", `M ${_.x},${_.y + y}
2754
+ a ${b},${y} 0 0 0 0,${_.height}`).attr("stroke", "#666").attr("stroke-width", "1px").attr("class", v), S.attr("transform", `translate(${b}, ${-(_.height / 2)})`), C.attr("transform", `translate(${_.width - b}, ${-_.height / 2})`), l.rectData = _, l.properties?.icon) {
2755
+ let i = l.properties.icon.trim(), u = _.x + _.width - 20, d = _.y + 10;
2756
+ i.charAt(0) === "@" ? drawEmbeddedImage(g, u, d, i.substr(1)) : drawImage(g, u, d, i);
2757
+ }
2758
+ _drawTextCandidateFunc(u, hasKatex(l.description))(l.description, g, _.x, _.y, _.width, _.height, { class: `actor ${ACTOR_BOX_CLASS}` }, u);
2759
+ let w = l.height, T = S.select("path:last-child");
2760
+ if (T.node()) {
2761
+ let i = T.node().getBBox();
2762
+ l.height = i.height, w = i.height;
2763
+ }
2764
+ return w;
2765
+ }, "drawActorTypeQueue"), drawActorTypeControl = /* @__PURE__ */ __name(function(i, l, u, d) {
2766
+ let f = d ? l.stopy : l.starty, p = l.x + l.width / 2, m = f + 75, h = i.append("g").lower();
2767
+ d || (actorCnt++, h.append("line").attr("id", "actor" + actorCnt).attr("x1", p).attr("y1", m).attr("x2", p).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", l.name), l.actorCnt = actorCnt);
2768
+ let g = i.append("g"), _ = ACTOR_MAN_FIGURE_CLASS;
2769
+ d ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.attr("class", _), g.attr("name", l.name);
2770
+ let v = getNoteRect();
2771
+ v.x = l.x, v.y = f, v.fill = "#eaeaea", v.width = l.width, v.height = l.height, v.class = "actor";
2772
+ let y = l.x + l.width / 2, b = f + 30;
2773
+ return g.append("defs").append("marker").attr("id", "filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").append("path").attr("d", "M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"), g.append("circle").attr("cx", y).attr("cy", b).attr("r", 18).attr("fill", "#eaeaf7").attr("stroke", "#666").attr("stroke-width", 1.2), g.append("line").attr("marker-end", "url(#filled-head-control)").attr("transform", `translate(${y}, ${b - 18})`), l.height = g.node().getBBox().height + 2 * (u?.sequence?.labelBoxHeight ?? 0), _drawTextCandidateFunc(u, hasKatex(l.description))(l.description, g, v.x, v.y + 18 + (d ? 5 : 10), v.width, v.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, u), l.height;
2774
+ }, "drawActorTypeControl"), drawActorTypeEntity = /* @__PURE__ */ __name(function(i, l, u, d) {
2775
+ let f = d ? l.stopy : l.starty, p = l.x + l.width / 2, m = f + 75, h = i.append("g").lower(), g = i.append("g"), _ = ACTOR_MAN_FIGURE_CLASS;
2776
+ d ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.attr("class", _), g.attr("name", l.name);
2777
+ let v = getNoteRect();
2778
+ v.x = l.x, v.y = f, v.fill = "#eaeaea", v.width = l.width, v.height = l.height, v.class = "actor";
2779
+ let y = l.x + l.width / 2, b = f + (d ? 10 : 25);
2780
+ return g.append("circle").attr("cx", y).attr("cy", b).attr("r", 18).attr("width", l.width).attr("height", l.height), g.append("line").attr("x1", y - 18).attr("x2", y + 18).attr("y1", b + 18).attr("y2", b + 18).attr("stroke", "#333").attr("stroke-width", 2), l.height = g.node().getBBox().height + (u?.sequence?.labelBoxHeight ?? 0), d || (actorCnt++, h.append("line").attr("id", "actor" + actorCnt).attr("x1", p).attr("y1", m).attr("x2", p).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", l.name), l.actorCnt = actorCnt), _drawTextCandidateFunc(u, hasKatex(l.description))(l.description, g, v.x, v.y + (d ? (b - f + 18 - 5) / 2 : (b + 18 - f) / 2), v.width, v.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, u), g.attr("transform", `translate(0, ${18 / 2})`), l.height;
2781
+ }, "drawActorTypeEntity"), drawActorTypeDatabase = /* @__PURE__ */ __name(function(i, l, u, d) {
2782
+ let f = d ? l.stopy : l.starty, p = l.x + l.width / 2, m = f + l.height + 2 * u.boxTextMargin, h = i.append("g").lower(), g = h;
2783
+ d || (actorCnt++, Object.keys(l.links || {}).length && !u.forceMenus && g.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), g.append("line").attr("id", "actor" + actorCnt).attr("x1", p).attr("y1", m).attr("x2", p).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", l.name), g = h.append("g"), l.actorCnt = actorCnt, l.links != null && g.attr("id", "root-" + actorCnt));
2784
+ let _ = getNoteRect(), v = "actor";
2785
+ l.properties?.class ? v = l.properties.class : _.fill = "#eaeaea", d ? v += ` ${BOTTOM_ACTOR_CLASS}` : v += ` ${TOP_ACTOR_CLASS}`, _.x = l.x, _.y = f, _.width = l.width, _.height = l.height, _.class = v, _.name = l.name, _.x = l.x, _.y = f;
2786
+ let y = _.width / 4, b = _.width / 4, S = y / 2, C = S / (2.5 + y / 50), w = g.append("g"), T = `
2787
+ M ${_.x},${_.y + C}
2788
+ a ${S},${C} 0 0 0 ${y},0
2789
+ a ${S},${C} 0 0 0 -${y},0
2790
+ l 0,${b - 2 * C}
2791
+ a ${S},${C} 0 0 0 ${y},0
2792
+ l 0,-${b - 2 * C}
2793
+ `;
2794
+ w.append("path").attr("d", T).attr("fill", "#eaeaea").attr("stroke", "#000").attr("stroke-width", 1).attr("class", v), d ? w.attr("transform", `translate(${y * 1.5}, ${_.height / 4 - 2 * C})`) : w.attr("transform", `translate(${y * 1.5}, ${(_.height + C) / 4})`), l.rectData = _, _drawTextCandidateFunc(u, hasKatex(l.description))(l.description, g, _.x, _.y + (d ? (_.height + b) / 4 : (_.height + C) / 2), _.width, _.height, { class: `actor ${ACTOR_BOX_CLASS}` }, u);
2795
+ let E = w.select("path:last-child");
2796
+ return E.node() && (l.height = E.node().getBBox().height + (u.sequence.labelBoxHeight ?? 0)), l.height;
2797
+ }, "drawActorTypeDatabase"), drawActorTypeBoundary = /* @__PURE__ */ __name(function(i, l, u, d) {
2798
+ let f = d ? l.stopy : l.starty, p = l.x + l.width / 2, m = f + 80, h = i.append("g").lower();
2799
+ d || (actorCnt++, h.append("line").attr("id", "actor" + actorCnt).attr("x1", p).attr("y1", m).attr("x2", p).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", l.name), l.actorCnt = actorCnt);
2800
+ let g = i.append("g"), _ = ACTOR_MAN_FIGURE_CLASS;
2801
+ d ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.attr("class", _), g.attr("name", l.name);
2802
+ let v = getNoteRect();
2803
+ return v.x = l.x, v.y = f, v.fill = "#eaeaea", v.width = l.width, v.height = l.height, v.class = "actor", g.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", l.x + l.width / 2 - 30 * 2.5).attr("y1", f + 10).attr("x2", l.x + l.width / 2 - 15).attr("y2", f + 10), g.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", l.x + l.width / 2 - 30 * 2.5).attr("y1", f + 0).attr("x2", l.x + l.width / 2 - 30 * 2.5).attr("y2", f + 20), g.append("circle").attr("cx", l.x + l.width / 2).attr("cy", f + 10).attr("r", 30), l.height = g.node().getBBox().height + (u.sequence.labelBoxHeight ?? 0), _drawTextCandidateFunc(u, hasKatex(l.description))(l.description, g, v.x, v.y + (d ? 30 / 2 - 4 : 18), v.width, v.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, u), g.attr("transform", "translate(0,22)"), l.height;
2804
+ }, "drawActorTypeBoundary"), drawActorTypeActor = /* @__PURE__ */ __name(function(i, l, u, d) {
2805
+ let f = d ? l.stopy : l.starty, p = l.x + l.width / 2, m = f + 80, h = i.append("g").lower();
2806
+ d || (actorCnt++, h.append("line").attr("id", "actor" + actorCnt).attr("x1", p).attr("y1", m).attr("x2", p).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", l.name), l.actorCnt = actorCnt);
2807
+ let g = i.append("g"), _ = ACTOR_MAN_FIGURE_CLASS;
2808
+ d ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.attr("class", _), g.attr("name", l.name);
2809
+ let v = getNoteRect();
2810
+ v.x = l.x, v.y = f, v.fill = "#eaeaea", v.width = l.width, v.height = l.height, v.class = "actor", v.rx = 3, v.ry = 3, g.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", p).attr("y1", f + 25).attr("x2", p).attr("y2", f + 45), g.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", p - ACTOR_TYPE_WIDTH / 2).attr("y1", f + 33).attr("x2", p + ACTOR_TYPE_WIDTH / 2).attr("y2", f + 33), g.append("line").attr("x1", p - ACTOR_TYPE_WIDTH / 2).attr("y1", f + 60).attr("x2", p).attr("y2", f + 45), g.append("line").attr("x1", p).attr("y1", f + 45).attr("x2", p + ACTOR_TYPE_WIDTH / 2 - 2).attr("y2", f + 60);
2811
+ let y = g.append("circle");
2812
+ return y.attr("cx", l.x + l.width / 2), y.attr("cy", f + 10), y.attr("r", 15), y.attr("width", l.width), y.attr("height", l.height), l.height = g.node().getBBox().height, _drawTextCandidateFunc(u, hasKatex(l.description))(l.description, g, v.x, v.y + 35, v.width, v.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, u), l.height;
2813
+ }, "drawActorTypeActor"), drawActor = /* @__PURE__ */ __name(async function(i, l, u, d) {
2814
+ switch (l.type) {
2815
+ case "actor": return await drawActorTypeActor(i, l, u, d);
2816
+ case "participant": return await drawActorTypeParticipant(i, l, u, d);
2817
+ case "boundary": return await drawActorTypeBoundary(i, l, u, d);
2818
+ case "control": return await drawActorTypeControl(i, l, u, d);
2819
+ case "entity": return await drawActorTypeEntity(i, l, u, d);
2820
+ case "database": return await drawActorTypeDatabase(i, l, u, d);
2821
+ case "collections": return await drawActorTypeCollections(i, l, u, d);
2822
+ case "queue": return await drawActorTypeQueue(i, l, u, d);
2823
+ }
2824
+ }, "drawActor"), drawBox = /* @__PURE__ */ __name(function(i, l, u) {
2825
+ let d = i.append("g");
2826
+ drawBackgroundRect2(d, l), l.name && _drawTextCandidateFunc(u)(l.name, d, l.x, l.y + u.boxTextMargin + (l.textMaxHeight || 0) / 2, l.width, 0, { class: "text" }, u), d.lower();
2827
+ }, "drawBox"), anchorElement = /* @__PURE__ */ __name(function(i) {
2828
+ return i.append("g");
2829
+ }, "anchorElement"), drawActivation = /* @__PURE__ */ __name(function(i, l, u, d, f) {
2830
+ let p = getNoteRect(), m = l.anchored;
2831
+ p.x = l.startx, p.y = l.starty, p.class = "activation" + f % 3, p.width = l.stopx - l.startx, p.height = u - l.starty, drawRect2(m, p);
2832
+ }, "drawActivation"), drawLoop = /* @__PURE__ */ __name(async function(i, l, u, d) {
2833
+ let { boxMargin: f, boxTextMargin: m, labelBoxHeight: h, labelBoxWidth: g, messageFontFamily: _, messageFontSize: v, messageFontWeight: y } = d, b = i.append("g"), S = /* @__PURE__ */ __name(function(i, l, u, d) {
2834
+ return b.append("line").attr("x1", i).attr("y1", l).attr("x2", u).attr("y2", d).attr("class", "loopLine");
2835
+ }, "drawLoopLine");
2836
+ S(l.startx, l.starty, l.stopx, l.starty), S(l.stopx, l.starty, l.stopx, l.stopy), S(l.startx, l.stopy, l.stopx, l.stopy), S(l.startx, l.starty, l.startx, l.stopy), l.sections !== void 0 && l.sections.forEach(function(i) {
2837
+ S(l.startx, i.y, l.stopx, i.y).style("stroke-dasharray", "3, 3");
2838
+ });
2839
+ let C = getTextObj();
2840
+ C.text = u, C.x = l.startx, C.y = l.starty, C.fontFamily = _, C.fontSize = v, C.fontWeight = y, C.anchor = "middle", C.valign = "middle", C.tspan = !1, C.width = g || 50, C.height = h || 20, C.textMargin = m, C.class = "labelText", drawLabel(b, C), C = getTextObj2(), C.text = l.title, C.x = l.startx + g / 2 + (l.stopx - l.startx) / 2, C.y = l.starty + f + m, C.anchor = "middle", C.valign = "middle", C.textMargin = m, C.class = "loopText", C.fontFamily = _, C.fontSize = v, C.fontWeight = y, C.wrap = !0;
2841
+ let w = hasKatex(C.text) ? await drawKatex(b, C, l) : drawText(b, C);
2842
+ if (l.sectionTitles !== void 0) {
2843
+ for (let [i, u] of Object.entries(l.sectionTitles)) if (u.message) {
2844
+ C.text = u.message, C.x = l.startx + (l.stopx - l.startx) / 2, C.y = l.sections[i].y + f + m, C.class = "loopText", C.anchor = "middle", C.valign = "middle", C.tspan = !1, C.fontFamily = _, C.fontSize = v, C.fontWeight = y, C.wrap = l.wrap, hasKatex(C.text) ? (l.starty = l.sections[i].y, await drawKatex(b, C, l)) : drawText(b, C);
2845
+ let d = Math.round(w.map((i) => (i._groups || i)[0][0].getBBox().height).reduce((i, l) => i + l));
2846
+ l.sections[i].height += d - (f + m);
2847
+ }
2848
+ }
2849
+ return l.height = Math.round(l.stopy - l.starty), b;
2850
+ }, "drawLoop"), drawBackgroundRect2 = /* @__PURE__ */ __name(function(i, l) {
2851
+ drawBackgroundRect(i, l);
2852
+ }, "drawBackgroundRect"), insertDatabaseIcon = /* @__PURE__ */ __name(function(i) {
2853
+ i.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr("d", "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");
2854
+ }, "insertDatabaseIcon"), insertComputerIcon = /* @__PURE__ */ __name(function(i) {
2855
+ i.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr("d", "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");
2856
+ }, "insertComputerIcon"), insertClockIcon = /* @__PURE__ */ __name(function(i) {
2857
+ i.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr("d", "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");
2858
+ }, "insertClockIcon"), insertArrowHead = /* @__PURE__ */ __name(function(i) {
2859
+ i.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");
2860
+ }, "insertArrowHead"), insertArrowFilledHead = /* @__PURE__ */ __name(function(i) {
2861
+ i.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");
2862
+ }, "insertArrowFilledHead"), insertSequenceNumber = /* @__PURE__ */ __name(function(i) {
2863
+ i.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);
2864
+ }, "insertSequenceNumber"), insertArrowCrossHead = /* @__PURE__ */ __name(function(i) {
2865
+ i.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");
2866
+ }, "insertArrowCrossHead"), getTextObj2 = /* @__PURE__ */ __name(function() {
2867
+ return {
2868
+ x: 0,
2869
+ y: 0,
2870
+ fill: void 0,
2871
+ anchor: void 0,
2872
+ style: "#666",
2873
+ width: void 0,
2874
+ height: void 0,
2875
+ textMargin: 0,
2876
+ rx: 0,
2877
+ ry: 0,
2878
+ tspan: !0,
2879
+ valign: void 0
2880
+ };
2881
+ }, "getTextObj"), getNoteRect2 = /* @__PURE__ */ __name(function() {
2882
+ return {
2883
+ x: 0,
2884
+ y: 0,
2885
+ fill: "#EDF2AE",
2886
+ stroke: "#666",
2887
+ width: 100,
2888
+ anchor: "start",
2889
+ height: 100,
2890
+ rx: 0,
2891
+ ry: 0
2892
+ };
2893
+ }, "getNoteRect"), _drawTextCandidateFunc = /* @__PURE__ */ (function() {
2894
+ function i(i, l, u, d, f, p, h) {
2895
+ m(l.append("text").attr("x", u + f / 2).attr("y", d + p / 2 + 5).style("text-anchor", "middle").text(i), h);
2896
+ }
2897
+ __name(i, "byText");
2898
+ function l(i, l, d, f, p, h, g, _) {
2899
+ let { actorFontSize: v, actorFontFamily: y, actorFontWeight: b } = _, [x, S] = parseFontSize(v), C = i.split(common_default.lineBreakRegex);
2900
+ for (let i = 0; i < C.length; i++) {
2901
+ let u = i * x - x * (C.length - 1) / 2, _ = l.append("text").attr("x", d + p / 2).attr("y", f).style("text-anchor", "middle").style("font-size", S).style("font-weight", b).style("font-family", y);
2902
+ _.append("tspan").attr("x", d + p / 2).attr("dy", u).text(C[i]), _.attr("y", f + h / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), m(_, g);
2903
+ }
2904
+ }
2905
+ __name(l, "byTspan");
2906
+ function d(i, u, d, f, p, h, g, _) {
2907
+ let v = u.append("switch"), y = v.append("foreignObject").attr("x", d).attr("y", f).attr("width", p).attr("height", h).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
2908
+ y.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), l(i, v, d, f, p, h, g, _), m(y, g);
2909
+ }
2910
+ __name(d, "byFo");
2911
+ async function f(i, u, d, f, p, h, g, _) {
2912
+ let v = await calculateMathMLDimensions(i, getConfig()), y = u.append("switch"), x = y.append("foreignObject").attr("x", d + p / 2 - v.width / 2).attr("y", f + h / 2 - v.height / 2).attr("width", v.width).attr("height", v.height).append("xhtml:div").style("height", "100%").style("width", "100%");
2913
+ x.append("div").style("text-align", "center").style("vertical-align", "middle").html(await renderKatexSanitized(i, getConfig())), l(i, y, d, f, p, h, g, _), m(x, g);
2914
+ }
2915
+ __name(f, "byKatex");
2916
+ function m(i, l) {
2917
+ for (let u in l) l.hasOwnProperty(u) && i.attr(u, l[u]);
2918
+ }
2919
+ return __name(m, "_setTextAttrs"), function(u, p = !1) {
2920
+ return p ? f : u.textPlacement === "fo" ? d : u.textPlacement === "old" ? i : l;
2921
+ };
2922
+ })(), _drawMenuItemTextCandidateFunc = /* @__PURE__ */ (function() {
2923
+ function i(i, l, u, f, p, m, h) {
2924
+ d(l.append("text").attr("x", u).attr("y", f).style("text-anchor", "start").text(i), h);
2925
+ }
2926
+ __name(i, "byText");
2927
+ function l(i, l, u, f, p, m, h, g) {
2928
+ let { actorFontSize: _, actorFontFamily: v, actorFontWeight: y } = g, b = i.split(common_default.lineBreakRegex);
2929
+ for (let i = 0; i < b.length; i++) {
2930
+ let p = i * _ - _ * (b.length - 1) / 2, g = l.append("text").attr("x", u).attr("y", f).style("text-anchor", "start").style("font-size", _).style("font-weight", y).style("font-family", v);
2931
+ g.append("tspan").attr("x", u).attr("dy", p).text(b[i]), g.attr("y", f + m / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), d(g, h);
2932
+ }
2933
+ }
2934
+ __name(l, "byTspan");
2935
+ function u(i, u, f, p, m, h, g, _) {
2936
+ let v = u.append("switch"), y = v.append("foreignObject").attr("x", f).attr("y", p).attr("width", m).attr("height", h).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
2937
+ y.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), l(i, v, f, p, m, h, g, _), d(y, g);
2938
+ }
2939
+ __name(u, "byFo");
2940
+ function d(i, l) {
2941
+ for (let u in l) l.hasOwnProperty(u) && i.attr(u, l[u]);
2942
+ }
2943
+ return __name(d, "_setTextAttrs"), function(d) {
2944
+ return d.textPlacement === "fo" ? u : d.textPlacement === "old" ? i : l;
2945
+ };
2946
+ })(), svgDraw_default = {
2947
+ drawRect: drawRect2,
2948
+ drawText,
2949
+ drawLabel,
2950
+ drawActor,
2951
+ drawBox,
2952
+ drawPopup,
2953
+ anchorElement,
2954
+ drawActivation,
2955
+ drawLoop,
2956
+ drawBackgroundRect: drawBackgroundRect2,
2957
+ insertArrowHead,
2958
+ insertArrowFilledHead,
2959
+ insertSequenceNumber,
2960
+ insertArrowCrossHead,
2961
+ insertDatabaseIcon,
2962
+ insertComputerIcon,
2963
+ insertClockIcon,
2964
+ getTextObj: getTextObj2,
2965
+ getNoteRect: getNoteRect2,
2966
+ fixLifeLineHeights,
2967
+ sanitizeUrl: import_dist.sanitizeUrl
2968
+ }, conf = {}, bounds = {
2969
+ data: {
2970
+ startx: void 0,
2971
+ stopx: void 0,
2972
+ starty: void 0,
2973
+ stopy: void 0
2974
+ },
2975
+ verticalPos: 0,
2976
+ sequenceItems: [],
2977
+ activations: [],
2978
+ models: {
2979
+ getHeight: /* @__PURE__ */ __name(function() {
2980
+ return Math.max.apply(null, this.actors.length === 0 ? [0] : this.actors.map((i) => i.height || 0)) + (this.loops.length === 0 ? 0 : this.loops.map((i) => i.height || 0).reduce((i, l) => i + l)) + (this.messages.length === 0 ? 0 : this.messages.map((i) => i.height || 0).reduce((i, l) => i + l)) + (this.notes.length === 0 ? 0 : this.notes.map((i) => i.height || 0).reduce((i, l) => i + l));
2981
+ }, "getHeight"),
2982
+ clear: /* @__PURE__ */ __name(function() {
2983
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
2984
+ }, "clear"),
2985
+ addBox: /* @__PURE__ */ __name(function(i) {
2986
+ this.boxes.push(i);
2987
+ }, "addBox"),
2988
+ addActor: /* @__PURE__ */ __name(function(i) {
2989
+ this.actors.push(i);
2990
+ }, "addActor"),
2991
+ addLoop: /* @__PURE__ */ __name(function(i) {
2992
+ this.loops.push(i);
2993
+ }, "addLoop"),
2994
+ addMessage: /* @__PURE__ */ __name(function(i) {
2995
+ this.messages.push(i);
2996
+ }, "addMessage"),
2997
+ addNote: /* @__PURE__ */ __name(function(i) {
2998
+ this.notes.push(i);
2999
+ }, "addNote"),
3000
+ lastActor: /* @__PURE__ */ __name(function() {
3001
+ return this.actors[this.actors.length - 1];
3002
+ }, "lastActor"),
3003
+ lastLoop: /* @__PURE__ */ __name(function() {
3004
+ return this.loops[this.loops.length - 1];
3005
+ }, "lastLoop"),
3006
+ lastMessage: /* @__PURE__ */ __name(function() {
3007
+ return this.messages[this.messages.length - 1];
3008
+ }, "lastMessage"),
3009
+ lastNote: /* @__PURE__ */ __name(function() {
3010
+ return this.notes[this.notes.length - 1];
3011
+ }, "lastNote"),
3012
+ actors: [],
3013
+ boxes: [],
3014
+ loops: [],
3015
+ messages: [],
3016
+ notes: []
3017
+ },
3018
+ init: /* @__PURE__ */ __name(function() {
3019
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
3020
+ startx: void 0,
3021
+ stopx: void 0,
3022
+ starty: void 0,
3023
+ stopy: void 0
3024
+ }, this.verticalPos = 0, setConf(getConfig2());
3025
+ }, "init"),
3026
+ updateVal: /* @__PURE__ */ __name(function(i, l, u, d) {
3027
+ i[l] === void 0 ? i[l] = u : i[l] = d(u, i[l]);
3028
+ }, "updateVal"),
3029
+ updateBounds: /* @__PURE__ */ __name(function(i, l, u, d) {
3030
+ let f = this, m = 0;
3031
+ function h(h) {
3032
+ return /* @__PURE__ */ __name(function(p) {
3033
+ m++;
3034
+ let g = f.sequenceItems.length - m + 1;
3035
+ f.updateVal(p, "starty", l - g * conf.boxMargin, Math.min), f.updateVal(p, "stopy", d + g * conf.boxMargin, Math.max), f.updateVal(bounds.data, "startx", i - g * conf.boxMargin, Math.min), f.updateVal(bounds.data, "stopx", u + g * conf.boxMargin, Math.max), h !== "activation" && (f.updateVal(p, "startx", i - g * conf.boxMargin, Math.min), f.updateVal(p, "stopx", u + g * conf.boxMargin, Math.max), f.updateVal(bounds.data, "starty", l - g * conf.boxMargin, Math.min), f.updateVal(bounds.data, "stopy", d + g * conf.boxMargin, Math.max));
3036
+ }, "updateItemBounds");
3037
+ }
3038
+ __name(h, "updateFn"), this.sequenceItems.forEach(h()), this.activations.forEach(h("activation"));
3039
+ }, "updateBounds"),
3040
+ insert: /* @__PURE__ */ __name(function(i, l, u, d) {
3041
+ let f = common_default.getMin(i, u), p = common_default.getMax(i, u), m = common_default.getMin(l, d), h = common_default.getMax(l, d);
3042
+ this.updateVal(bounds.data, "startx", f, Math.min), this.updateVal(bounds.data, "starty", m, Math.min), this.updateVal(bounds.data, "stopx", p, Math.max), this.updateVal(bounds.data, "stopy", h, Math.max), this.updateBounds(f, m, p, h);
3043
+ }, "insert"),
3044
+ newActivation: /* @__PURE__ */ __name(function(i, l, u) {
3045
+ let d = u.get(i.from), f = actorActivations(i.from).length || 0, p = d.x + d.width / 2 + (f - 1) * conf.activationWidth / 2;
3046
+ this.activations.push({
3047
+ startx: p,
3048
+ starty: this.verticalPos + 2,
3049
+ stopx: p + conf.activationWidth,
3050
+ stopy: void 0,
3051
+ actor: i.from,
3052
+ anchored: svgDraw_default.anchorElement(l)
3053
+ });
3054
+ }, "newActivation"),
3055
+ endActivation: /* @__PURE__ */ __name(function(i) {
3056
+ let l = this.activations.map(function(i) {
3057
+ return i.actor;
3058
+ }).lastIndexOf(i.from);
3059
+ return this.activations.splice(l, 1)[0];
3060
+ }, "endActivation"),
3061
+ createLoop: /* @__PURE__ */ __name(function(i = {
3062
+ message: void 0,
3063
+ wrap: !1,
3064
+ width: void 0
3065
+ }, l) {
3066
+ return {
3067
+ startx: void 0,
3068
+ starty: this.verticalPos,
3069
+ stopx: void 0,
3070
+ stopy: void 0,
3071
+ title: i.message,
3072
+ wrap: i.wrap,
3073
+ width: i.width,
3074
+ height: 0,
3075
+ fill: l
3076
+ };
3077
+ }, "createLoop"),
3078
+ newLoop: /* @__PURE__ */ __name(function(i = {
3079
+ message: void 0,
3080
+ wrap: !1,
3081
+ width: void 0
3082
+ }, l) {
3083
+ this.sequenceItems.push(this.createLoop(i, l));
3084
+ }, "newLoop"),
3085
+ endLoop: /* @__PURE__ */ __name(function() {
3086
+ return this.sequenceItems.pop();
3087
+ }, "endLoop"),
3088
+ isLoopOverlap: /* @__PURE__ */ __name(function() {
3089
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
3090
+ }, "isLoopOverlap"),
3091
+ addSectionToLoop: /* @__PURE__ */ __name(function(i) {
3092
+ let l = this.sequenceItems.pop();
3093
+ l.sections = l.sections || [], l.sectionTitles = l.sectionTitles || [], l.sections.push({
3094
+ y: bounds.getVerticalPos(),
3095
+ height: 0
3096
+ }), l.sectionTitles.push(i), this.sequenceItems.push(l);
3097
+ }, "addSectionToLoop"),
3098
+ saveVerticalPos: /* @__PURE__ */ __name(function() {
3099
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
3100
+ }, "saveVerticalPos"),
3101
+ resetVerticalPos: /* @__PURE__ */ __name(function() {
3102
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
3103
+ }, "resetVerticalPos"),
3104
+ bumpVerticalPos: /* @__PURE__ */ __name(function(i) {
3105
+ this.verticalPos += i, this.data.stopy = common_default.getMax(this.data.stopy, this.verticalPos);
3106
+ }, "bumpVerticalPos"),
3107
+ getVerticalPos: /* @__PURE__ */ __name(function() {
3108
+ return this.verticalPos;
3109
+ }, "getVerticalPos"),
3110
+ getBounds: /* @__PURE__ */ __name(function() {
3111
+ return {
3112
+ bounds: this.data,
3113
+ models: this.models
3114
+ };
3115
+ }, "getBounds")
3116
+ }, drawNote = /* @__PURE__ */ __name(async function(i, l) {
3117
+ bounds.bumpVerticalPos(conf.boxMargin), l.height = conf.boxMargin, l.starty = bounds.getVerticalPos();
3118
+ let u = getNoteRect();
3119
+ u.x = l.startx, u.y = l.starty, u.width = l.width || conf.width, u.class = "note";
3120
+ let d = i.append("g"), f = svgDraw_default.drawRect(d, u), p = getTextObj();
3121
+ p.x = l.startx, p.y = l.starty, p.width = u.width, p.dy = "1em", p.text = l.message, p.class = "noteText", p.fontFamily = conf.noteFontFamily, p.fontSize = conf.noteFontSize, p.fontWeight = conf.noteFontWeight, p.anchor = conf.noteAlign, p.textMargin = conf.noteMargin, p.valign = "center";
3122
+ let m = hasKatex(p.text) ? await drawKatex(d, p) : drawText(d, p), h = Math.round(m.map((i) => (i._groups || i)[0][0].getBBox().height).reduce((i, l) => i + l));
3123
+ f.attr("height", h + 2 * conf.noteMargin), l.height += h + 2 * conf.noteMargin, bounds.bumpVerticalPos(h + 2 * conf.noteMargin), l.stopy = l.starty + h + 2 * conf.noteMargin, l.stopx = l.startx + u.width, bounds.insert(l.startx, l.starty, l.stopx, l.stopy), bounds.models.addNote(l);
3124
+ }, "drawNote"), messageFont = /* @__PURE__ */ __name((i) => ({
3125
+ fontFamily: i.messageFontFamily,
3126
+ fontSize: i.messageFontSize,
3127
+ fontWeight: i.messageFontWeight
3128
+ }), "messageFont"), noteFont = /* @__PURE__ */ __name((i) => ({
3129
+ fontFamily: i.noteFontFamily,
3130
+ fontSize: i.noteFontSize,
3131
+ fontWeight: i.noteFontWeight
3132
+ }), "noteFont"), actorFont = /* @__PURE__ */ __name((i) => ({
3133
+ fontFamily: i.actorFontFamily,
3134
+ fontSize: i.actorFontSize,
3135
+ fontWeight: i.actorFontWeight
3136
+ }), "actorFont");
3137
+ async function boundMessage(i, u) {
3138
+ bounds.bumpVerticalPos(10);
3139
+ let { startx: d, stopx: f, message: p } = u, m = common_default.splitBreaks(p).length, h = hasKatex(p), g = h ? await calculateMathMLDimensions(p, getConfig2()) : utils_default.calculateTextDimensions(p, messageFont(conf));
3140
+ if (!h) {
3141
+ let i = g.height / m;
3142
+ u.height += i, bounds.bumpVerticalPos(i);
3143
+ }
3144
+ let _, v = g.height - 10, y = g.width;
3145
+ if (d === f) {
3146
+ _ = bounds.getVerticalPos() + v, conf.rightAngles || (v += conf.boxMargin, _ = bounds.getVerticalPos() + v), v += 30;
3147
+ let i = common_default.getMax(y / 2, conf.width / 2);
3148
+ bounds.insert(d - i, bounds.getVerticalPos() - 10 + v, f + i, bounds.getVerticalPos() + 30 + v);
3149
+ } else v += conf.boxMargin, _ = bounds.getVerticalPos() + v, bounds.insert(d, _ - 10, f, _);
3150
+ return bounds.bumpVerticalPos(v), u.height += v, u.stopy = u.starty + u.height, bounds.insert(u.fromBounds, u.starty, u.toBounds, u.stopy), _;
3151
+ }
3152
+ __name(boundMessage, "boundMessage");
3153
+ var drawMessage = /* @__PURE__ */ __name(async function(i, u, d, f) {
3154
+ let { startx: p, stopx: m, starty: h, message: g, type: v, sequenceIndex: y, sequenceVisible: b } = u, S = utils_default.calculateTextDimensions(g, messageFont(conf)), C = getTextObj();
3155
+ C.x = p, C.y = h + 10, C.width = m - p, C.class = "messageText", C.dy = "1em", C.text = g, C.fontFamily = conf.messageFontFamily, C.fontSize = conf.messageFontSize, C.fontWeight = conf.messageFontWeight, C.anchor = conf.messageAlign, C.valign = "center", C.textMargin = conf.wrapPadding, C.tspan = !1, hasKatex(C.text) ? await drawKatex(i, C, {
3156
+ startx: p,
3157
+ stopx: m,
3158
+ starty: d
3159
+ }) : drawText(i, C);
3160
+ let w = S.width, T;
3161
+ p === m ? T = conf.rightAngles ? i.append("path").attr("d", `M ${p},${d} H ${p + common_default.getMax(conf.width / 2, w / 2)} V ${d + 25} H ${p}`) : i.append("path").attr("d", "M " + p + "," + d + " C " + (p + 60) + "," + (d - 10) + " " + (p + 60) + "," + (d + 30) + " " + p + "," + (d + 20)) : (T = i.append("line"), T.attr("x1", p), T.attr("y1", d), T.attr("x2", m), T.attr("y2", d)), v === f.db.LINETYPE.DOTTED || v === f.db.LINETYPE.DOTTED_CROSS || v === f.db.LINETYPE.DOTTED_POINT || v === f.db.LINETYPE.DOTTED_OPEN || v === f.db.LINETYPE.BIDIRECTIONAL_DOTTED ? (T.style("stroke-dasharray", "3, 3"), T.attr("class", "messageLine1")) : T.attr("class", "messageLine0");
3162
+ let E = "";
3163
+ conf.arrowMarkerAbsolute && (E = getUrl(!0)), T.attr("stroke-width", 2), T.attr("stroke", "none"), T.style("fill", "none"), (v === f.db.LINETYPE.SOLID || v === f.db.LINETYPE.DOTTED) && T.attr("marker-end", "url(" + E + "#arrowhead)"), (v === f.db.LINETYPE.BIDIRECTIONAL_SOLID || v === f.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (T.attr("marker-start", "url(" + E + "#arrowhead)"), T.attr("marker-end", "url(" + E + "#arrowhead)")), (v === f.db.LINETYPE.SOLID_POINT || v === f.db.LINETYPE.DOTTED_POINT) && T.attr("marker-end", "url(" + E + "#filled-head)"), (v === f.db.LINETYPE.SOLID_CROSS || v === f.db.LINETYPE.DOTTED_CROSS) && T.attr("marker-end", "url(" + E + "#crosshead)"), (b || conf.showSequenceNumbers) && ((v === f.db.LINETYPE.BIDIRECTIONAL_SOLID || v === f.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (p < m ? T.attr("x1", p + 12) : T.attr("x1", p + 6)), i.append("line").attr("x1", p).attr("y1", d).attr("x2", p).attr("y2", d).attr("stroke-width", 0).attr("marker-start", "url(" + E + "#sequencenumber)"), i.append("text").attr("x", p).attr("y", d + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(y));
3164
+ }, "drawMessage"), addActorRenderingData = /* @__PURE__ */ __name(function(i, l, u, d, f, p, m) {
3165
+ let h = 0, g = 0, _, v = 0;
3166
+ for (let i of d) {
3167
+ let d = l.get(i), p = d.box;
3168
+ _ && _ != p && (m || bounds.models.addBox(_), g += conf.boxMargin + _.margin), p && p != _ && (m || (p.x = h + g, p.y = f), g += p.margin), d.width = d.width || conf.width, d.height = common_default.getMax(d.height || conf.height, conf.height), d.margin = d.margin || conf.actorMargin, v = common_default.getMax(v, d.height), u.get(d.name) && (g += d.width / 2), d.x = h + g, d.starty = bounds.getVerticalPos(), bounds.insert(d.x, f, d.x + d.width, d.height), h += d.width + g, d.box && (d.box.width = h + p.margin - d.box.x), g = d.margin, _ = d.box, bounds.models.addActor(d);
3169
+ }
3170
+ _ && !m && bounds.models.addBox(_), bounds.bumpVerticalPos(v);
3171
+ }, "addActorRenderingData"), drawActors = /* @__PURE__ */ __name(async function(i, l, u, d) {
3172
+ if (d) {
3173
+ let d = 0;
3174
+ bounds.bumpVerticalPos(conf.boxMargin * 2);
3175
+ for (let f of u) {
3176
+ let u = l.get(f);
3177
+ u.stopy ||= bounds.getVerticalPos();
3178
+ let p = await svgDraw_default.drawActor(i, u, conf, !0);
3179
+ d = common_default.getMax(d, p);
3180
+ }
3181
+ bounds.bumpVerticalPos(d + conf.boxMargin);
3182
+ } else for (let d of u) {
3183
+ let u = l.get(d);
3184
+ await svgDraw_default.drawActor(i, u, conf, !1);
3185
+ }
3186
+ }, "drawActors"), drawActorsPopup = /* @__PURE__ */ __name(function(i, l, u, d) {
3187
+ let f = 0, p = 0;
3188
+ for (let m of u) {
3189
+ let u = l.get(m), h = getRequiredPopupWidth(u), g = svgDraw_default.drawPopup(i, u, h, conf, conf.forceMenus, d);
3190
+ g.height > f && (f = g.height), g.width + u.x > p && (p = g.width + u.x);
3191
+ }
3192
+ return {
3193
+ maxHeight: f,
3194
+ maxWidth: p
3195
+ };
3196
+ }, "drawActorsPopup"), setConf = /* @__PURE__ */ __name(function(i) {
3197
+ assignWithDepth_default(conf, i), i.fontFamily && (conf.actorFontFamily = conf.noteFontFamily = conf.messageFontFamily = i.fontFamily), i.fontSize && (conf.actorFontSize = conf.noteFontSize = conf.messageFontSize = i.fontSize), i.fontWeight && (conf.actorFontWeight = conf.noteFontWeight = conf.messageFontWeight = i.fontWeight);
3198
+ }, "setConf"), actorActivations = /* @__PURE__ */ __name(function(i) {
3199
+ return bounds.activations.filter(function(l) {
3200
+ return l.actor === i;
3201
+ });
3202
+ }, "actorActivations"), activationBounds = /* @__PURE__ */ __name(function(i, l) {
3203
+ let u = l.get(i), d = actorActivations(i);
3204
+ return [d.reduce(function(i, l) {
3205
+ return common_default.getMin(i, l.startx);
3206
+ }, u.x + u.width / 2 - 1), d.reduce(function(i, l) {
3207
+ return common_default.getMax(i, l.stopx);
3208
+ }, u.x + u.width / 2 + 1)];
3209
+ }, "activationBounds");
3210
+ function adjustLoopHeightForWrap(i, u, d, p, m) {
3211
+ bounds.bumpVerticalPos(d);
3212
+ let h = p;
3213
+ if (u.id && u.message && i[u.id]) {
3214
+ let d = i[u.id].width, m = messageFont(conf);
3215
+ u.message = utils_default.wrapLabel(`[${u.message}]`, d - 2 * conf.wrapPadding, m), u.width = d, u.wrap = !0;
3216
+ let g = utils_default.calculateTextDimensions(u.message, m), _ = common_default.getMax(g.height, conf.labelBoxHeight);
3217
+ h = p + _, log.debug(`${_} - ${u.message}`);
3218
+ }
3219
+ m(u), bounds.bumpVerticalPos(h);
3220
+ }
3221
+ __name(adjustLoopHeightForWrap, "adjustLoopHeightForWrap");
3222
+ function adjustCreatedDestroyedData(i, l, u, d, f, m, h) {
3223
+ function g(u, d) {
3224
+ u.x < f.get(i.from).x ? (bounds.insert(l.stopx - d, l.starty, l.startx, l.stopy + u.height / 2 + conf.noteMargin), l.stopx += d) : (bounds.insert(l.startx, l.starty, l.stopx + d, l.stopy + u.height / 2 + conf.noteMargin), l.stopx -= d);
3225
+ }
3226
+ __name(g, "receiverAdjustment");
3227
+ function _(u, d) {
3228
+ u.x < f.get(i.to).x ? (bounds.insert(l.startx - d, l.starty, l.stopx, l.stopy + u.height / 2 + conf.noteMargin), l.startx += d) : (bounds.insert(l.stopx, l.starty, l.startx + d, l.stopy + u.height / 2 + conf.noteMargin), l.startx -= d);
3229
+ }
3230
+ __name(_, "senderAdjustment");
3231
+ let v = [
3232
+ PARTICIPANT_TYPE.ACTOR,
3233
+ PARTICIPANT_TYPE.CONTROL,
3234
+ PARTICIPANT_TYPE.ENTITY,
3235
+ PARTICIPANT_TYPE.DATABASE
3236
+ ];
3237
+ if (m.get(i.to) == d) {
3238
+ let l = f.get(i.to);
3239
+ g(l, v.includes(l.type) ? ACTOR_TYPE_WIDTH / 2 + 3 : l.width / 2 + 3), l.starty = u - l.height / 2, bounds.bumpVerticalPos(l.height / 2);
3240
+ } else if (h.get(i.from) == d) {
3241
+ let l = f.get(i.from);
3242
+ conf.mirrorActors && _(l, v.includes(l.type) ? ACTOR_TYPE_WIDTH / 2 : l.width / 2), l.stopy = u - l.height / 2, bounds.bumpVerticalPos(l.height / 2);
3243
+ } else if (h.get(i.to) == d) {
3244
+ let l = f.get(i.to);
3245
+ conf.mirrorActors && g(l, v.includes(l.type) ? ACTOR_TYPE_WIDTH / 2 + 3 : l.width / 2 + 3), l.stopy = u - l.height / 2, bounds.bumpVerticalPos(l.height / 2);
3246
+ }
3247
+ }
3248
+ __name(adjustCreatedDestroyedData, "adjustCreatedDestroyedData");
3249
+ var draw = /* @__PURE__ */ __name(async function(i, l, u, d) {
3250
+ let { securityLevel: h, sequence: g } = getConfig2();
3251
+ conf = g;
3252
+ let _;
3253
+ h === "sandbox" && (_ = select_default("#i" + l));
3254
+ let v = select_default(h === "sandbox" ? _.nodes()[0].contentDocument.body : "body"), y = h === "sandbox" ? _.nodes()[0].contentDocument : document;
3255
+ bounds.init(), log.debug(d.db);
3256
+ let b = h === "sandbox" ? v.select(`[id="${l}"]`) : select_default(`[id="${l}"]`), x = d.db.getActors(), S = d.db.getCreatedActors(), C = d.db.getDestroyedActors(), w = d.db.getBoxes(), D = d.db.getActorKeys(), O = d.db.getMessages(), k = d.db.getDiagramTitle(), A = d.db.hasAtLeastOneBox(), j = d.db.hasAtLeastOneBoxWithTitle(), M = await getMaxMessageWidthPerActor(x, O, d);
3257
+ if (conf.height = await calculateActorMargins(x, M, w), svgDraw_default.insertComputerIcon(b), svgDraw_default.insertDatabaseIcon(b), svgDraw_default.insertClockIcon(b), A && (bounds.bumpVerticalPos(conf.boxMargin), j && bounds.bumpVerticalPos(w[0].textMaxHeight)), conf.hideUnusedParticipants === !0) {
3258
+ let i = /* @__PURE__ */ new Set();
3259
+ O.forEach((l) => {
3260
+ i.add(l.from), i.add(l.to);
3261
+ }), D = D.filter((l) => i.has(l));
3262
+ }
3263
+ addActorRenderingData(b, x, S, D, 0, O, !1);
3264
+ let N = await calculateLoopBounds(O, x, M, d);
3265
+ svgDraw_default.insertArrowHead(b), svgDraw_default.insertArrowCrossHead(b), svgDraw_default.insertArrowFilledHead(b), svgDraw_default.insertSequenceNumber(b);
3266
+ function P(i, l) {
3267
+ let u = bounds.endActivation(i);
3268
+ u.starty + 18 > l && (u.starty = l - 6, l += 12), svgDraw_default.drawActivation(b, u, l, conf, actorActivations(i.from).length), bounds.insert(u.startx, l - 10, u.stopx, l);
3269
+ }
3270
+ __name(P, "activeEnd");
3271
+ let F = 1, I = 1, L = [], R = [], z = 0;
3272
+ for (let i of O) {
3273
+ let l, u, p;
3274
+ switch (i.type) {
3275
+ case d.db.LINETYPE.NOTE:
3276
+ bounds.resetVerticalPos(), u = i.noteModel, await drawNote(b, u);
3277
+ break;
3278
+ case d.db.LINETYPE.ACTIVE_START:
3279
+ bounds.newActivation(i, b, x);
3280
+ break;
3281
+ case d.db.LINETYPE.ACTIVE_END:
3282
+ P(i, bounds.getVerticalPos());
3283
+ break;
3284
+ case d.db.LINETYPE.LOOP_START:
3285
+ adjustLoopHeightForWrap(N, i, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (i) => bounds.newLoop(i));
3286
+ break;
3287
+ case d.db.LINETYPE.LOOP_END:
3288
+ l = bounds.endLoop(), await svgDraw_default.drawLoop(b, l, "loop", conf), bounds.bumpVerticalPos(l.stopy - bounds.getVerticalPos()), bounds.models.addLoop(l);
3289
+ break;
3290
+ case d.db.LINETYPE.RECT_START:
3291
+ adjustLoopHeightForWrap(N, i, conf.boxMargin, conf.boxMargin, (i) => bounds.newLoop(void 0, i.message));
3292
+ break;
3293
+ case d.db.LINETYPE.RECT_END:
3294
+ l = bounds.endLoop(), R.push(l), bounds.models.addLoop(l), bounds.bumpVerticalPos(l.stopy - bounds.getVerticalPos());
3295
+ break;
3296
+ case d.db.LINETYPE.OPT_START:
3297
+ adjustLoopHeightForWrap(N, i, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (i) => bounds.newLoop(i));
3298
+ break;
3299
+ case d.db.LINETYPE.OPT_END:
3300
+ l = bounds.endLoop(), await svgDraw_default.drawLoop(b, l, "opt", conf), bounds.bumpVerticalPos(l.stopy - bounds.getVerticalPos()), bounds.models.addLoop(l);
3301
+ break;
3302
+ case d.db.LINETYPE.ALT_START:
3303
+ adjustLoopHeightForWrap(N, i, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (i) => bounds.newLoop(i));
3304
+ break;
3305
+ case d.db.LINETYPE.ALT_ELSE:
3306
+ adjustLoopHeightForWrap(N, i, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, (i) => bounds.addSectionToLoop(i));
3307
+ break;
3308
+ case d.db.LINETYPE.ALT_END:
3309
+ l = bounds.endLoop(), await svgDraw_default.drawLoop(b, l, "alt", conf), bounds.bumpVerticalPos(l.stopy - bounds.getVerticalPos()), bounds.models.addLoop(l);
3310
+ break;
3311
+ case d.db.LINETYPE.PAR_START:
3312
+ case d.db.LINETYPE.PAR_OVER_START:
3313
+ adjustLoopHeightForWrap(N, i, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (i) => bounds.newLoop(i)), bounds.saveVerticalPos();
3314
+ break;
3315
+ case d.db.LINETYPE.PAR_AND:
3316
+ adjustLoopHeightForWrap(N, i, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, (i) => bounds.addSectionToLoop(i));
3317
+ break;
3318
+ case d.db.LINETYPE.PAR_END:
3319
+ l = bounds.endLoop(), await svgDraw_default.drawLoop(b, l, "par", conf), bounds.bumpVerticalPos(l.stopy - bounds.getVerticalPos()), bounds.models.addLoop(l);
3320
+ break;
3321
+ case d.db.LINETYPE.AUTONUMBER:
3322
+ F = i.message.start || F, I = i.message.step || I, i.message.visible ? d.db.enableSequenceNumbers() : d.db.disableSequenceNumbers();
3323
+ break;
3324
+ case d.db.LINETYPE.CRITICAL_START:
3325
+ adjustLoopHeightForWrap(N, i, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (i) => bounds.newLoop(i));
3326
+ break;
3327
+ case d.db.LINETYPE.CRITICAL_OPTION:
3328
+ adjustLoopHeightForWrap(N, i, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, (i) => bounds.addSectionToLoop(i));
3329
+ break;
3330
+ case d.db.LINETYPE.CRITICAL_END:
3331
+ l = bounds.endLoop(), await svgDraw_default.drawLoop(b, l, "critical", conf), bounds.bumpVerticalPos(l.stopy - bounds.getVerticalPos()), bounds.models.addLoop(l);
3332
+ break;
3333
+ case d.db.LINETYPE.BREAK_START:
3334
+ adjustLoopHeightForWrap(N, i, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (i) => bounds.newLoop(i));
3335
+ break;
3336
+ case d.db.LINETYPE.BREAK_END:
3337
+ l = bounds.endLoop(), await svgDraw_default.drawLoop(b, l, "break", conf), bounds.bumpVerticalPos(l.stopy - bounds.getVerticalPos()), bounds.models.addLoop(l);
3338
+ break;
3339
+ default: try {
3340
+ p = i.msgModel, p.starty = bounds.getVerticalPos(), p.sequenceIndex = F, p.sequenceVisible = d.db.showSequenceNumbers();
3341
+ let l = await boundMessage(b, p);
3342
+ adjustCreatedDestroyedData(i, p, l, z, x, S, C), L.push({
3343
+ messageModel: p,
3344
+ lineStartY: l
3345
+ }), bounds.models.addMessage(p);
3346
+ } catch (i) {
3347
+ log.error("error while drawing message", i);
3348
+ }
3349
+ }
3350
+ [
3351
+ d.db.LINETYPE.SOLID_OPEN,
3352
+ d.db.LINETYPE.DOTTED_OPEN,
3353
+ d.db.LINETYPE.SOLID,
3354
+ d.db.LINETYPE.DOTTED,
3355
+ d.db.LINETYPE.SOLID_CROSS,
3356
+ d.db.LINETYPE.DOTTED_CROSS,
3357
+ d.db.LINETYPE.SOLID_POINT,
3358
+ d.db.LINETYPE.DOTTED_POINT,
3359
+ d.db.LINETYPE.BIDIRECTIONAL_SOLID,
3360
+ d.db.LINETYPE.BIDIRECTIONAL_DOTTED
3361
+ ].includes(i.type) && (F += I), z++;
3362
+ }
3363
+ log.debug("createdActors", S), log.debug("destroyedActors", C), await drawActors(b, x, D, !1);
3364
+ for (let i of L) await drawMessage(b, i.messageModel, i.lineStartY, d);
3365
+ conf.mirrorActors && await drawActors(b, x, D, !0), R.forEach((i) => svgDraw_default.drawBackgroundRect(b, i)), fixLifeLineHeights(b, x, D, conf);
3366
+ for (let i of bounds.models.boxes) {
3367
+ i.height = bounds.getVerticalPos() - i.y, bounds.insert(i.x, i.y, i.x + i.width, i.height);
3368
+ let l = conf.boxMargin * 2;
3369
+ i.startx = i.x - l, i.starty = i.y - l * .25, i.stopx = i.startx + i.width + 2 * l, i.stopy = i.starty + i.height + l * .75, i.stroke = "rgb(0,0,0, 0.5)", svgDraw_default.drawBox(b, i, conf);
3370
+ }
3371
+ A && bounds.bumpVerticalPos(conf.boxMargin);
3372
+ let B = drawActorsPopup(b, x, D, y), { bounds: V } = bounds.getBounds();
3373
+ V.startx === void 0 && (V.startx = 0), V.starty === void 0 && (V.starty = 0), V.stopx === void 0 && (V.stopx = 0), V.stopy === void 0 && (V.stopy = 0);
3374
+ let H = V.stopy - V.starty;
3375
+ H < B.maxHeight && (H = B.maxHeight);
3376
+ let U = H + 2 * conf.diagramMarginY;
3377
+ conf.mirrorActors && (U = U - conf.boxMargin + conf.bottomMarginAdj);
3378
+ let W = V.stopx - V.startx;
3379
+ W < B.maxWidth && (W = B.maxWidth);
3380
+ let G = W + 2 * conf.diagramMarginX;
3381
+ k && b.append("text").text(k).attr("x", (V.stopx - V.startx) / 2 - 2 * conf.diagramMarginX).attr("y", -25), configureSvgSize(b, U, G, conf.useMaxWidth);
3382
+ let K = k ? 40 : 0;
3383
+ b.attr("viewBox", V.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + K) + " " + G + " " + (U + K)), log.debug("models:", bounds.models);
3384
+ }, "draw");
3385
+ async function getMaxMessageWidthPerActor(i, u, d) {
3386
+ let p = {};
3387
+ for (let f of u) if (i.get(f.to) && i.get(f.from)) {
3388
+ let u = i.get(f.to);
3389
+ if (f.placement === d.db.PLACEMENT.LEFTOF && !u.prevActor || f.placement === d.db.PLACEMENT.RIGHTOF && !u.nextActor) continue;
3390
+ let m = f.placement !== void 0, h = !m, g = m ? noteFont(conf) : messageFont(conf), _ = f.wrap ? utils_default.wrapLabel(f.message, conf.width - 2 * conf.wrapPadding, g) : f.message, v = (hasKatex(_) ? await calculateMathMLDimensions(f.message, getConfig2()) : utils_default.calculateTextDimensions(_, g)).width + 2 * conf.wrapPadding;
3391
+ h && f.from === u.nextActor ? p[f.to] = common_default.getMax(p[f.to] || 0, v) : h && f.from === u.prevActor ? p[f.from] = common_default.getMax(p[f.from] || 0, v) : h && f.from === f.to ? (p[f.from] = common_default.getMax(p[f.from] || 0, v / 2), p[f.to] = common_default.getMax(p[f.to] || 0, v / 2)) : f.placement === d.db.PLACEMENT.RIGHTOF ? p[f.from] = common_default.getMax(p[f.from] || 0, v) : f.placement === d.db.PLACEMENT.LEFTOF ? p[u.prevActor] = common_default.getMax(p[u.prevActor] || 0, v) : f.placement === d.db.PLACEMENT.OVER && (u.prevActor && (p[u.prevActor] = common_default.getMax(p[u.prevActor] || 0, v / 2)), u.nextActor && (p[f.from] = common_default.getMax(p[f.from] || 0, v / 2)));
3392
+ }
3393
+ return log.debug("maxMessageWidthPerActor:", p), p;
3394
+ }
3395
+ __name(getMaxMessageWidthPerActor, "getMaxMessageWidthPerActor");
3396
+ var getRequiredPopupWidth = /* @__PURE__ */ __name(function(i) {
3397
+ let u = 0, d = actorFont(conf);
3398
+ for (let f in i.links) {
3399
+ let i = utils_default.calculateTextDimensions(f, d).width + 2 * conf.wrapPadding + 2 * conf.boxMargin;
3400
+ u < i && (u = i);
3401
+ }
3402
+ return u;
3403
+ }, "getRequiredPopupWidth");
3404
+ async function calculateActorMargins(i, u, d) {
3405
+ let f = 0;
3406
+ for (let u of i.keys()) {
3407
+ let d = i.get(u);
3408
+ d.wrap && (d.description = utils_default.wrapLabel(d.description, conf.width - 2 * conf.wrapPadding, actorFont(conf)));
3409
+ let p = hasKatex(d.description) ? await calculateMathMLDimensions(d.description, getConfig2()) : utils_default.calculateTextDimensions(d.description, actorFont(conf));
3410
+ d.width = d.wrap ? conf.width : common_default.getMax(conf.width, p.width + 2 * conf.wrapPadding), d.height = d.wrap ? common_default.getMax(p.height, conf.height) : conf.height, f = common_default.getMax(f, d.height);
3411
+ }
3412
+ for (let l in u) {
3413
+ let d = i.get(l);
3414
+ if (!d) continue;
3415
+ let f = i.get(d.nextActor);
3416
+ if (!f) {
3417
+ let i = u[l] + conf.actorMargin - d.width / 2;
3418
+ d.margin = common_default.getMax(i, conf.actorMargin);
3419
+ continue;
3420
+ }
3421
+ let p = u[l] + conf.actorMargin - d.width / 2 - f.width / 2;
3422
+ d.margin = common_default.getMax(p, conf.actorMargin);
3423
+ }
3424
+ let p = 0;
3425
+ return d.forEach((u) => {
3426
+ let d = messageFont(conf), f = u.actorKeys.reduce((l, u) => l += i.get(u).width + (i.get(u).margin || 0), 0), m = conf.boxMargin * 8;
3427
+ f += m, f -= 2 * conf.boxTextMargin, u.wrap && (u.name = utils_default.wrapLabel(u.name, f - 2 * conf.wrapPadding, d));
3428
+ let h = utils_default.calculateTextDimensions(u.name, d);
3429
+ p = common_default.getMax(h.height, p);
3430
+ let g = common_default.getMax(f, h.width + 2 * conf.wrapPadding);
3431
+ if (u.margin = conf.boxTextMargin, f < g) {
3432
+ let i = (g - f) / 2;
3433
+ u.margin += i;
3434
+ }
3435
+ }), d.forEach((i) => i.textMaxHeight = p), common_default.getMax(f, conf.height);
3436
+ }
3437
+ __name(calculateActorMargins, "calculateActorMargins");
3438
+ var buildNoteModel = /* @__PURE__ */ __name(async function(i, u, d) {
3439
+ let p = u.get(i.from), m = u.get(i.to), h = p.x, g = m.x, _ = i.wrap && i.message, v = hasKatex(i.message) ? await calculateMathMLDimensions(i.message, getConfig2()) : utils_default.calculateTextDimensions(_ ? utils_default.wrapLabel(i.message, conf.width, noteFont(conf)) : i.message, noteFont(conf)), y = {
3440
+ width: _ ? conf.width : common_default.getMax(conf.width, v.width + 2 * conf.noteMargin),
3441
+ height: 0,
3442
+ startx: p.x,
3443
+ stopx: 0,
3444
+ starty: 0,
3445
+ stopy: 0,
3446
+ message: i.message
3447
+ };
3448
+ return i.placement === d.db.PLACEMENT.RIGHTOF ? (y.width = _ ? common_default.getMax(conf.width, v.width) : common_default.getMax(p.width / 2 + m.width / 2, v.width + 2 * conf.noteMargin), y.startx = h + (p.width + conf.actorMargin) / 2) : i.placement === d.db.PLACEMENT.LEFTOF ? (y.width = _ ? common_default.getMax(conf.width, v.width + 2 * conf.noteMargin) : common_default.getMax(p.width / 2 + m.width / 2, v.width + 2 * conf.noteMargin), y.startx = h - y.width + (p.width - conf.actorMargin) / 2) : i.to === i.from ? (v = utils_default.calculateTextDimensions(_ ? utils_default.wrapLabel(i.message, common_default.getMax(conf.width, p.width), noteFont(conf)) : i.message, noteFont(conf)), y.width = _ ? common_default.getMax(conf.width, p.width) : common_default.getMax(p.width, conf.width, v.width + 2 * conf.noteMargin), y.startx = h + (p.width - y.width) / 2) : (y.width = Math.abs(h + p.width / 2 - (g + m.width / 2)) + conf.actorMargin, y.startx = h < g ? h + p.width / 2 - conf.actorMargin / 2 : g + m.width / 2 - conf.actorMargin / 2), _ && (y.message = utils_default.wrapLabel(i.message, y.width - 2 * conf.wrapPadding, noteFont(conf))), log.debug(`NM:[${y.startx},${y.stopx},${y.starty},${y.stopy}:${y.width},${y.height}=${i.message}]`), y;
3449
+ }, "buildNoteModel"), buildMessageModel = /* @__PURE__ */ __name(function(i, u, d) {
3450
+ if (![
3451
+ d.db.LINETYPE.SOLID_OPEN,
3452
+ d.db.LINETYPE.DOTTED_OPEN,
3453
+ d.db.LINETYPE.SOLID,
3454
+ d.db.LINETYPE.DOTTED,
3455
+ d.db.LINETYPE.SOLID_CROSS,
3456
+ d.db.LINETYPE.DOTTED_CROSS,
3457
+ d.db.LINETYPE.SOLID_POINT,
3458
+ d.db.LINETYPE.DOTTED_POINT,
3459
+ d.db.LINETYPE.BIDIRECTIONAL_SOLID,
3460
+ d.db.LINETYPE.BIDIRECTIONAL_DOTTED
3461
+ ].includes(i.type)) return {};
3462
+ let [f, m] = activationBounds(i.from, u), [h, g] = activationBounds(i.to, u), _ = f <= h, v = _ ? m : f, y = _ ? h : g, b = Math.abs(h - g) > 2, x = /* @__PURE__ */ __name((i) => _ ? -i : i, "adjustValue");
3463
+ i.from === i.to ? y = v : (i.activate && !b && (y += x(conf.activationWidth / 2 - 1)), [d.db.LINETYPE.SOLID_OPEN, d.db.LINETYPE.DOTTED_OPEN].includes(i.type) || (y += x(3)), [d.db.LINETYPE.BIDIRECTIONAL_SOLID, d.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(i.type) && (v -= x(3)));
3464
+ let S = [
3465
+ f,
3466
+ m,
3467
+ h,
3468
+ g
3469
+ ], C = Math.abs(v - y);
3470
+ i.wrap && i.message && (i.message = utils_default.wrapLabel(i.message, common_default.getMax(C + 2 * conf.wrapPadding, conf.width), messageFont(conf)));
3471
+ let w = utils_default.calculateTextDimensions(i.message, messageFont(conf));
3472
+ return {
3473
+ width: common_default.getMax(i.wrap ? 0 : w.width + 2 * conf.wrapPadding, C + 2 * conf.wrapPadding, conf.width),
3474
+ height: 0,
3475
+ startx: v,
3476
+ stopx: y,
3477
+ starty: 0,
3478
+ stopy: 0,
3479
+ message: i.message,
3480
+ type: i.type,
3481
+ wrap: i.wrap,
3482
+ fromBounds: Math.min.apply(null, S),
3483
+ toBounds: Math.max.apply(null, S)
3484
+ };
3485
+ }, "buildMessageModel"), calculateLoopBounds = /* @__PURE__ */ __name(async function(i, l, u, d) {
3486
+ let p = {}, m = [], h, g, _;
3487
+ for (let u of i) {
3488
+ switch (u.type) {
3489
+ case d.db.LINETYPE.LOOP_START:
3490
+ case d.db.LINETYPE.ALT_START:
3491
+ case d.db.LINETYPE.OPT_START:
3492
+ case d.db.LINETYPE.PAR_START:
3493
+ case d.db.LINETYPE.PAR_OVER_START:
3494
+ case d.db.LINETYPE.CRITICAL_START:
3495
+ case d.db.LINETYPE.BREAK_START:
3496
+ m.push({
3497
+ id: u.id,
3498
+ msg: u.message,
3499
+ from: 2 ** 53 - 1,
3500
+ to: -(2 ** 53 - 1),
3501
+ width: 0
3502
+ });
3503
+ break;
3504
+ case d.db.LINETYPE.ALT_ELSE:
3505
+ case d.db.LINETYPE.PAR_AND:
3506
+ case d.db.LINETYPE.CRITICAL_OPTION:
3507
+ u.message && (h = m.pop(), p[h.id] = h, p[u.id] = h, m.push(h));
3508
+ break;
3509
+ case d.db.LINETYPE.LOOP_END:
3510
+ case d.db.LINETYPE.ALT_END:
3511
+ case d.db.LINETYPE.OPT_END:
3512
+ case d.db.LINETYPE.PAR_END:
3513
+ case d.db.LINETYPE.CRITICAL_END:
3514
+ case d.db.LINETYPE.BREAK_END:
3515
+ h = m.pop(), p[h.id] = h;
3516
+ break;
3517
+ case d.db.LINETYPE.ACTIVE_START:
3518
+ {
3519
+ let i = l.get(u.from ? u.from : u.to.actor), d = actorActivations(u.from ? u.from : u.to.actor).length, f = i.x + i.width / 2 + (d - 1) * conf.activationWidth / 2, p = {
3520
+ startx: f,
3521
+ stopx: f + conf.activationWidth,
3522
+ actor: u.from,
3523
+ enabled: !0
3524
+ };
3525
+ bounds.activations.push(p);
3526
+ }
3527
+ break;
3528
+ case d.db.LINETYPE.ACTIVE_END:
3529
+ {
3530
+ let i = bounds.activations.map((i) => i.actor).lastIndexOf(u.from);
3531
+ bounds.activations.splice(i, 1).splice(0, 1);
3532
+ }
3533
+ break;
3534
+ }
3535
+ u.placement === void 0 ? (_ = buildMessageModel(u, l, d), u.msgModel = _, _.startx && _.stopx && m.length > 0 && m.forEach((i) => {
3536
+ if (h = i, _.startx === _.stopx) {
3537
+ let i = l.get(u.from), d = l.get(u.to);
3538
+ h.from = common_default.getMin(i.x - _.width / 2, i.x - i.width / 2, h.from), h.to = common_default.getMax(d.x + _.width / 2, d.x + i.width / 2, h.to), h.width = common_default.getMax(h.width, Math.abs(h.to - h.from)) - conf.labelBoxWidth;
3539
+ } else h.from = common_default.getMin(_.startx, h.from), h.to = common_default.getMax(_.stopx, h.to), h.width = common_default.getMax(h.width, _.width) - conf.labelBoxWidth;
3540
+ })) : (g = await buildNoteModel(u, l, d), u.noteModel = g, m.forEach((i) => {
3541
+ h = i, h.from = common_default.getMin(h.from, g.startx), h.to = common_default.getMax(h.to, g.startx + g.width), h.width = common_default.getMax(h.width, Math.abs(h.from - h.to)) - conf.labelBoxWidth;
3542
+ }));
3543
+ }
3544
+ return bounds.activations = [], log.debug("Loop type widths:", p), p;
3545
+ }, "calculateLoopBounds"), diagram = {
3546
+ parser: sequenceDiagram_default,
3547
+ get db() {
3548
+ return new SequenceDB();
3549
+ },
3550
+ renderer: {
3551
+ bounds,
3552
+ drawActors,
3553
+ drawActorsPopup,
3554
+ setConf,
3555
+ draw
3556
+ },
3557
+ styles: styles_default,
3558
+ init: /* @__PURE__ */ __name((i) => {
3559
+ i.sequence ||= {}, i.wrap && (i.sequence.wrap = i.wrap, setConfig2({ sequence: { wrap: i.wrap } }));
3560
+ }, "init")
3561
+ };
3562
+ export { diagram };