mermaid
Version:
Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.
1,080 lines (1,066 loc) • 108 kB
JavaScript
import { g as Ae, E as Ne, D as ve, c as ut, s as oe, b as Se, a as Me, m as Re, F as De, l as G, d as Mt, e as ce, f as w, a0 as le, a7 as Ve, a8 as Ce, h as Oe, j as St, k as Be, A as B } from "./mermaid-d733041c.js";
import { d as Ye, a as Fe, b as We, c as qe, e as Xt, g as Rt } from "./svgDrawCommon-05124e63.js";
var zt = function() {
var t = function(dt, m, _, k) {
for (_ = _ || {}, k = dt.length; k--; _[dt[k]] = m)
;
return _;
}, e = [1, 2], o = [1, 3], n = [1, 5], i = [1, 7], s = [2, 5], l = [1, 15], h = [1, 17], u = [1, 19], r = [1, 20], g = [1, 22], y = [1, 23], p = [1, 24], x = [1, 30], b = [1, 31], P = [1, 32], v = [1, 33], D = [1, 34], S = [1, 35], W = [1, 36], M = [1, 37], nt = [1, 38], z = [1, 39], X = [1, 40], Q = [1, 41], j = [1, 42], F = [1, 44], O = [1, 45], q = [1, 46], H = [1, 48], J = [1, 49], $ = [1, 50], tt = [1, 51], E = [1, 52], I = [1, 53], A = [1, 56], L = [1, 4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 53, 54, 55, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], U = [4, 5, 22, 56, 58, 59], N = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], te = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 55, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], Ct = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 54, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], ee = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 53, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], ht = [74, 75, 76], rt = [1, 133], ne = [1, 4, 5, 7, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 53, 54, 55, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], Ot = {
trace: function() {
},
yy: {},
symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, directive: 6, SD: 7, document: 8, line: 9, statement: 10, box_section: 11, box_line: 12, participant_statement: 13, openDirective: 14, typeDirective: 15, closeDirective: 16, ":": 17, argDirective: 18, create: 19, box: 20, restOfLine: 21, end: 22, signal: 23, autonumber: 24, NUM: 25, off: 26, activate: 27, actor: 28, deactivate: 29, note_statement: 30, links_statement: 31, link_statement: 32, properties_statement: 33, details_statement: 34, title: 35, legacy_title: 36, acc_title: 37, acc_title_value: 38, acc_descr: 39, acc_descr_value: 40, acc_descr_multiline_value: 41, loop: 42, rect: 43, opt: 44, alt: 45, else_sections: 46, par: 47, par_sections: 48, par_over: 49, critical: 50, option_sections: 51, break: 52, option: 53, and: 54, else: 55, participant: 56, AS: 57, participant_actor: 58, destroy: 59, note: 60, placement: 61, text2: 62, over: 63, actor_pair: 64, links: 65, link: 66, properties: 67, details: 68, spaceList: 69, ",": 70, left_of: 71, right_of: 72, signaltype: 73, "+": 74, "-": 75, ACTOR: 76, SOLID_OPEN_ARROW: 77, DOTTED_OPEN_ARROW: 78, SOLID_ARROW: 79, DOTTED_ARROW: 80, SOLID_CROSS: 81, DOTTED_CROSS: 82, SOLID_POINT: 83, DOTTED_POINT: 84, TXT: 85, open_directive: 86, type_directive: 87, arg_directive: 88, close_directive: 89, $accept: 0, $end: 1 },
terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 7: "SD", 17: ":", 19: "create", 20: "box", 21: "restOfLine", 22: "end", 24: "autonumber", 25: "NUM", 26: "off", 27: "activate", 29: "deactivate", 35: "title", 36: "legacy_title", 37: "acc_title", 38: "acc_title_value", 39: "acc_descr", 40: "acc_descr_value", 41: "acc_descr_multiline_value", 42: "loop", 43: "rect", 44: "opt", 45: "alt", 47: "par", 49: "par_over", 50: "critical", 52: "break", 53: "option", 54: "and", 55: "else", 56: "participant", 57: "AS", 58: "participant_actor", 59: "destroy", 60: "note", 63: "over", 65: "links", 66: "link", 67: "properties", 68: "details", 70: ",", 71: "left_of", 72: "right_of", 74: "+", 75: "-", 76: "ACTOR", 77: "SOLID_OPEN_ARROW", 78: "DOTTED_OPEN_ARROW", 79: "SOLID_ARROW", 80: "DOTTED_ARROW", 81: "SOLID_CROSS", 82: "DOTTED_CROSS", 83: "SOLID_POINT", 84: "DOTTED_POINT", 85: "TXT", 86: "open_directive", 87: "type_directive", 88: "arg_directive", 89: "close_directive" },
productions_: [0, [3, 2], [3, 2], [3, 2], [3, 2], [8, 0], [8, 2], [9, 2], [9, 1], [9, 1], [11, 0], [11, 2], [12, 2], [12, 1], [12, 1], [6, 4], [6, 6], [10, 1], [10, 2], [10, 4], [10, 2], [10, 4], [10, 3], [10, 3], [10, 2], [10, 3], [10, 3], [10, 2], [10, 2], [10, 2], [10, 2], [10, 2], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 1], [51, 1], [51, 4], [48, 1], [48, 4], [46, 1], [46, 4], [13, 5], [13, 3], [13, 5], [13, 3], [13, 3], [30, 4], [30, 4], [31, 3], [32, 3], [33, 3], [34, 3], [69, 2], [69, 1], [64, 3], [64, 1], [61, 1], [61, 1], [23, 5], [23, 5], [23, 4], [28, 1], [73, 1], [73, 1], [73, 1], [73, 1], [73, 1], [73, 1], [73, 1], [73, 1], [62, 1], [14, 1], [15, 1], [18, 1], [16, 1]],
performAction: function(m, _, k, T, R, c, _t) {
var d = c.length - 1;
switch (R) {
case 4:
return T.apply(c[d]), c[d];
case 5:
case 10:
this.$ = [];
break;
case 6:
case 11:
c[d - 1].push(c[d]), this.$ = c[d - 1];
break;
case 7:
case 8:
case 12:
case 13:
this.$ = c[d];
break;
case 9:
case 14:
this.$ = [];
break;
case 18:
c[d].type = "createParticipant", this.$ = c[d];
break;
case 19:
c[d - 1].unshift({ type: "boxStart", boxData: T.parseBoxData(c[d - 2]) }), c[d - 1].push({ type: "boxEnd", boxText: c[d - 2] }), this.$ = c[d - 1];
break;
case 21:
this.$ = { type: "sequenceIndex", sequenceIndex: Number(c[d - 2]), sequenceIndexStep: Number(c[d - 1]), sequenceVisible: !0, signalType: T.LINETYPE.AUTONUMBER };
break;
case 22:
this.$ = { type: "sequenceIndex", sequenceIndex: Number(c[d - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: T.LINETYPE.AUTONUMBER };
break;
case 23:
this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: T.LINETYPE.AUTONUMBER };
break;
case 24:
this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: T.LINETYPE.AUTONUMBER };
break;
case 25:
this.$ = { type: "activeStart", signalType: T.LINETYPE.ACTIVE_START, actor: c[d - 1] };
break;
case 26:
this.$ = { type: "activeEnd", signalType: T.LINETYPE.ACTIVE_END, actor: c[d - 1] };
break;
case 32:
T.setDiagramTitle(c[d].substring(6)), this.$ = c[d].substring(6);
break;
case 33:
T.setDiagramTitle(c[d].substring(7)), this.$ = c[d].substring(7);
break;
case 34:
this.$ = c[d].trim(), T.setAccTitle(this.$);
break;
case 35:
case 36:
this.$ = c[d].trim(), T.setAccDescription(this.$);
break;
case 37:
c[d - 1].unshift({ type: "loopStart", loopText: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.LOOP_START }), c[d - 1].push({ type: "loopEnd", loopText: c[d - 2], signalType: T.LINETYPE.LOOP_END }), this.$ = c[d - 1];
break;
case 38:
c[d - 1].unshift({ type: "rectStart", color: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.RECT_START }), c[d - 1].push({ type: "rectEnd", color: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.RECT_END }), this.$ = c[d - 1];
break;
case 39:
c[d - 1].unshift({ type: "optStart", optText: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.OPT_START }), c[d - 1].push({ type: "optEnd", optText: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.OPT_END }), this.$ = c[d - 1];
break;
case 40:
c[d - 1].unshift({ type: "altStart", altText: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.ALT_START }), c[d - 1].push({ type: "altEnd", signalType: T.LINETYPE.ALT_END }), this.$ = c[d - 1];
break;
case 41:
c[d - 1].unshift({ type: "parStart", parText: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.PAR_START }), c[d - 1].push({ type: "parEnd", signalType: T.LINETYPE.PAR_END }), this.$ = c[d - 1];
break;
case 42:
c[d - 1].unshift({ type: "parStart", parText: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.PAR_OVER_START }), c[d - 1].push({ type: "parEnd", signalType: T.LINETYPE.PAR_END }), this.$ = c[d - 1];
break;
case 43:
c[d - 1].unshift({ type: "criticalStart", criticalText: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.CRITICAL_START }), c[d - 1].push({ type: "criticalEnd", signalType: T.LINETYPE.CRITICAL_END }), this.$ = c[d - 1];
break;
case 44:
c[d - 1].unshift({ type: "breakStart", breakText: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.BREAK_START }), c[d - 1].push({ type: "breakEnd", optText: T.parseMessage(c[d - 2]), signalType: T.LINETYPE.BREAK_END }), this.$ = c[d - 1];
break;
case 47:
this.$ = c[d - 3].concat([{ type: "option", optionText: T.parseMessage(c[d - 1]), signalType: T.LINETYPE.CRITICAL_OPTION }, c[d]]);
break;
case 49:
this.$ = c[d - 3].concat([{ type: "and", parText: T.parseMessage(c[d - 1]), signalType: T.LINETYPE.PAR_AND }, c[d]]);
break;
case 51:
this.$ = c[d - 3].concat([{ type: "else", altText: T.parseMessage(c[d - 1]), signalType: T.LINETYPE.ALT_ELSE }, c[d]]);
break;
case 52:
c[d - 3].draw = "participant", c[d - 3].type = "addParticipant", c[d - 3].description = T.parseMessage(c[d - 1]), this.$ = c[d - 3];
break;
case 53:
c[d - 1].draw = "participant", c[d - 1].type = "addParticipant", this.$ = c[d - 1];
break;
case 54:
c[d - 3].draw = "actor", c[d - 3].type = "addParticipant", c[d - 3].description = T.parseMessage(c[d - 1]), this.$ = c[d - 3];
break;
case 55:
c[d - 1].draw = "actor", c[d - 1].type = "addParticipant", this.$ = c[d - 1];
break;
case 56:
c[d - 1].type = "destroyParticipant", this.$ = c[d - 1];
break;
case 57:
this.$ = [c[d - 1], { type: "addNote", placement: c[d - 2], actor: c[d - 1].actor, text: c[d] }];
break;
case 58:
c[d - 2] = [].concat(c[d - 1], c[d - 1]).slice(0, 2), c[d - 2][0] = c[d - 2][0].actor, c[d - 2][1] = c[d - 2][1].actor, this.$ = [c[d - 1], { type: "addNote", placement: T.PLACEMENT.OVER, actor: c[d - 2].slice(0, 2), text: c[d] }];
break;
case 59:
this.$ = [c[d - 1], { type: "addLinks", actor: c[d - 1].actor, text: c[d] }];
break;
case 60:
this.$ = [c[d - 1], { type: "addALink", actor: c[d - 1].actor, text: c[d] }];
break;
case 61:
this.$ = [c[d - 1], { type: "addProperties", actor: c[d - 1].actor, text: c[d] }];
break;
case 62:
this.$ = [c[d - 1], { type: "addDetails", actor: c[d - 1].actor, text: c[d] }];
break;
case 65:
this.$ = [c[d - 2], c[d]];
break;
case 66:
this.$ = c[d];
break;
case 67:
this.$ = T.PLACEMENT.LEFTOF;
break;
case 68:
this.$ = T.PLACEMENT.RIGHTOF;
break;
case 69:
this.$ = [
c[d - 4],
c[d - 1],
{ type: "addMessage", from: c[d - 4].actor, to: c[d - 1].actor, signalType: c[d - 3], msg: c[d] },
{ type: "activeStart", signalType: T.LINETYPE.ACTIVE_START, actor: c[d - 1] }
];
break;
case 70:
this.$ = [
c[d - 4],
c[d - 1],
{ type: "addMessage", from: c[d - 4].actor, to: c[d - 1].actor, signalType: c[d - 3], msg: c[d] },
{ type: "activeEnd", signalType: T.LINETYPE.ACTIVE_END, actor: c[d - 4] }
];
break;
case 71:
this.$ = [c[d - 3], c[d - 1], { type: "addMessage", from: c[d - 3].actor, to: c[d - 1].actor, signalType: c[d - 2], msg: c[d] }];
break;
case 72:
this.$ = { type: "addParticipant", actor: c[d] };
break;
case 73:
this.$ = T.LINETYPE.SOLID_OPEN;
break;
case 74:
this.$ = T.LINETYPE.DOTTED_OPEN;
break;
case 75:
this.$ = T.LINETYPE.SOLID;
break;
case 76:
this.$ = T.LINETYPE.DOTTED;
break;
case 77:
this.$ = T.LINETYPE.SOLID_CROSS;
break;
case 78:
this.$ = T.LINETYPE.DOTTED_CROSS;
break;
case 79:
this.$ = T.LINETYPE.SOLID_POINT;
break;
case 80:
this.$ = T.LINETYPE.DOTTED_POINT;
break;
case 81:
this.$ = T.parseMessage(c[d].trim().substring(1));
break;
case 82:
T.parseDirective("%%{", "open_directive");
break;
case 83:
T.parseDirective(c[d], "type_directive");
break;
case 84:
c[d] = c[d].trim().replace(/'/g, '"'), T.parseDirective(c[d], "arg_directive");
break;
case 85:
T.parseDirective("}%%", "close_directive", "sequence");
break;
}
},
table: [{ 3: 1, 4: e, 5: o, 6: 4, 7: n, 14: 6, 86: i }, { 1: [3] }, { 3: 8, 4: e, 5: o, 6: 4, 7: n, 14: 6, 86: i }, { 3: 9, 4: e, 5: o, 6: 4, 7: n, 14: 6, 86: i }, { 3: 10, 4: e, 5: o, 6: 4, 7: n, 14: 6, 86: i }, t([1, 4, 5, 19, 20, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], s, { 8: 11 }), { 15: 12, 87: [1, 13] }, { 87: [2, 82] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, { 1: [2, 4], 4: l, 5: h, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: u, 20: r, 23: 21, 24: g, 27: y, 28: 47, 29: p, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: x, 36: b, 37: P, 39: v, 41: D, 42: S, 43: W, 44: M, 45: nt, 47: z, 49: X, 50: Q, 52: j, 56: F, 58: O, 59: q, 60: H, 65: J, 66: $, 67: tt, 68: E, 76: I, 86: i }, { 16: 54, 17: [1, 55], 89: A }, t([17, 89], [2, 83]), t(L, [2, 6]), { 6: 43, 10: 57, 13: 18, 14: 6, 19: u, 20: r, 23: 21, 24: g, 27: y, 28: 47, 29: p, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: x, 36: b, 37: P, 39: v, 41: D, 42: S, 43: W, 44: M, 45: nt, 47: z, 49: X, 50: Q, 52: j, 56: F, 58: O, 59: q, 60: H, 65: J, 66: $, 67: tt, 68: E, 76: I, 86: i }, t(L, [2, 8]), t(L, [2, 9]), t(L, [2, 17]), { 13: 58, 56: F, 58: O, 59: q }, { 21: [1, 59] }, { 5: [1, 60] }, { 5: [1, 63], 25: [1, 61], 26: [1, 62] }, { 28: 64, 76: I }, { 28: 65, 76: I }, { 5: [1, 66] }, { 5: [1, 67] }, { 5: [1, 68] }, { 5: [1, 69] }, { 5: [1, 70] }, t(L, [2, 32]), t(L, [2, 33]), { 38: [1, 71] }, { 40: [1, 72] }, t(L, [2, 36]), { 21: [1, 73] }, { 21: [1, 74] }, { 21: [1, 75] }, { 21: [1, 76] }, { 21: [1, 77] }, { 21: [1, 78] }, { 21: [1, 79] }, { 21: [1, 80] }, t(L, [2, 45]), { 28: 81, 76: I }, { 28: 82, 76: I }, { 28: 83, 76: I }, { 73: 84, 77: [1, 85], 78: [1, 86], 79: [1, 87], 80: [1, 88], 81: [1, 89], 82: [1, 90], 83: [1, 91], 84: [1, 92] }, { 61: 93, 63: [1, 94], 71: [1, 95], 72: [1, 96] }, { 28: 97, 76: I }, { 28: 98, 76: I }, { 28: 99, 76: I }, { 28: 100, 76: I }, t([5, 57, 70, 77, 78, 79, 80, 81, 82, 83, 84, 85], [2, 72]), { 5: [1, 101] }, { 18: 102, 88: [1, 103] }, { 5: [2, 85] }, t(L, [2, 7]), t(L, [2, 18]), t(U, [2, 10], { 11: 104 }), t(L, [2, 20]), { 5: [1, 106], 25: [1, 105] }, { 5: [1, 107] }, t(L, [2, 24]), { 5: [1, 108] }, { 5: [1, 109] }, t(L, [2, 27]), t(L, [2, 28]), t(L, [2, 29]), t(L, [2, 30]), t(L, [2, 31]), t(L, [2, 34]), t(L, [2, 35]), t(N, s, { 8: 110 }), t(N, s, { 8: 111 }), t(N, s, { 8: 112 }), t(te, s, { 46: 113, 8: 114 }), t(Ct, s, { 48: 115, 8: 116 }), t(Ct, s, { 8: 116, 48: 117 }), t(ee, s, { 51: 118, 8: 119 }), t(N, s, { 8: 120 }), { 5: [1, 122], 57: [1, 121] }, { 5: [1, 124], 57: [1, 123] }, { 5: [1, 125] }, { 28: 128, 74: [1, 126], 75: [1, 127], 76: I }, t(ht, [2, 73]), t(ht, [2, 74]), t(ht, [2, 75]), t(ht, [2, 76]), t(ht, [2, 77]), t(ht, [2, 78]), t(ht, [2, 79]), t(ht, [2, 80]), { 28: 129, 76: I }, { 28: 131, 64: 130, 76: I }, { 76: [2, 67] }, { 76: [2, 68] }, { 62: 132, 85: rt }, { 62: 134, 85: rt }, { 62: 135, 85: rt }, { 62: 136, 85: rt }, t(ne, [2, 15]), { 16: 137, 89: A }, { 89: [2, 84] }, { 4: [1, 140], 5: [1, 142], 12: 139, 13: 141, 22: [1, 138], 56: F, 58: O, 59: q }, { 5: [1, 143] }, t(L, [2, 22]), t(L, [2, 23]), t(L, [2, 25]), t(L, [2, 26]), { 4: l, 5: h, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: u, 20: r, 22: [1, 144], 23: 21, 24: g, 27: y, 28: 47, 29: p, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: x, 36: b, 37: P, 39: v, 41: D, 42: S, 43: W, 44: M, 45: nt, 47: z, 49: X, 50: Q, 52: j, 56: F, 58: O, 59: q, 60: H, 65: J, 66: $, 67: tt, 68: E, 76: I, 86: i }, { 4: l, 5: h, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: u, 20: r, 22: [1, 145], 23: 21, 24: g, 27: y, 28: 47, 29: p, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: x, 36: b, 37: P, 39: v, 41: D, 42: S, 43: W, 44: M, 45: nt, 47: z, 49: X, 50: Q, 52: j, 56: F, 58: O, 59: q, 60: H, 65: J, 66: $, 67: tt, 68: E, 76: I, 86: i }, { 4: l, 5: h, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: u, 20: r, 22: [1, 146], 23: 21, 24: g, 27: y, 28: 47, 29: p, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: x, 36: b, 37: P, 39: v, 41: D, 42: S, 43: W, 44: M, 45: nt, 47: z, 49: X, 50: Q, 52: j, 56: F, 58: O, 59: q, 60: H, 65: J, 66: $, 67: tt, 68: E, 76: I, 86: i }, { 22: [1, 147] }, { 4: l, 5: h, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: u, 20: r, 22: [2, 50], 23: 21, 24: g, 27: y, 28: 47, 29: p, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: x, 36: b, 37: P, 39: v, 41: D, 42: S, 43: W, 44: M, 45: nt, 47: z, 49: X, 50: Q, 52: j, 55: [1, 148], 56: F, 58: O, 59: q, 60: H, 65: J, 66: $, 67: tt, 68: E, 76: I, 86: i }, { 22: [1, 149] }, { 4: l, 5: h, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: u, 20: r, 22: [2, 48], 23: 21, 24: g, 27: y, 28: 47, 29: p, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: x, 36: b, 37: P, 39: v, 41: D, 42: S, 43: W, 44: M, 45: nt, 47: z, 49: X, 50: Q, 52: j, 54: [1, 150], 56: F, 58: O, 59: q, 60: H, 65: J, 66: $, 67: tt, 68: E, 76: I, 86: i }, { 22: [1, 151] }, { 22: [1, 152] }, { 4: l, 5: h, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: u, 20: r, 22: [2, 46], 23: 21, 24: g, 27: y, 28: 47, 29: p, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: x, 36: b, 37: P, 39: v, 41: D, 42: S, 43: W, 44: M, 45: nt, 47: z, 49: X, 50: Q, 52: j, 53: [1, 153], 56: F, 58: O, 59: q, 60: H, 65: J, 66: $, 67: tt, 68: E, 76: I, 86: i }, { 4: l, 5: h, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: u, 20: r, 22: [1, 154], 23: 21, 24: g, 27: y, 28: 47, 29: p, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: x, 36: b, 37: P, 39: v, 41: D, 42: S, 43: W, 44: M, 45: nt, 47: z, 49: X, 50: Q, 52: j, 56: F, 58: O, 59: q, 60: H, 65: J, 66: $, 67: tt, 68: E, 76: I, 86: i }, { 21: [1, 155] }, t(L, [2, 53]), { 21: [1, 156] }, t(L, [2, 55]), t(L, [2, 56]), { 28: 157, 76: I }, { 28: 158, 76: I }, { 62: 159, 85: rt }, { 62: 160, 85: rt }, { 62: 161, 85: rt }, { 70: [1, 162], 85: [2, 66] }, { 5: [2, 59] }, { 5: [2, 81] }, { 5: [2, 60] }, { 5: [2, 61] }, { 5: [2, 62] }, { 5: [1, 163] }, t(L, [2, 19]), t(U, [2, 11]), { 13: 164, 56: F, 58: O, 59: q }, t(U, [2, 13]), t(U, [2, 14]), t(L, [2, 21]), t(L, [2, 37]), t(L, [2, 38]), t(L, [2, 39]), t(L, [2, 40]), { 21: [1, 165] }, t(L, [2, 41]), { 21: [1, 166] }, t(L, [2, 42]), t(L, [2, 43]), { 21: [1, 167] }, t(L, [2, 44]), { 5: [1, 168] }, { 5: [1, 169] }, { 62: 170, 85: rt }, { 62: 171, 85: rt }, { 5: [2, 71] }, { 5: [2, 57] }, { 5: [2, 58] }, { 28: 172, 76: I }, t(ne, [2, 16]), t(U, [2, 12]), t(te, s, { 8: 114, 46: 173 }), t(Ct, s, { 8: 116, 48: 174 }), t(ee, s, { 8: 119, 51: 175 }), t(L, [2, 52]), t(L, [2, 54]), { 5: [2, 69] }, { 5: [2, 70] }, { 85: [2, 65] }, { 22: [2, 51] }, { 22: [2, 49] }, { 22: [2, 47] }],
defaultActions: { 7: [2, 82], 8: [2, 1], 9: [2, 2], 10: [2, 3], 56: [2, 85], 95: [2, 67], 96: [2, 68], 103: [2, 84], 132: [2, 59], 133: [2, 81], 134: [2, 60], 135: [2, 61], 136: [2, 62], 159: [2, 71], 160: [2, 57], 161: [2, 58], 170: [2, 69], 171: [2, 70], 172: [2, 65], 173: [2, 51], 174: [2, 49], 175: [2, 47] },
parseError: function(m, _) {
if (_.recoverable)
this.trace(m);
else {
var k = new Error(m);
throw k.hash = _, k;
}
},
parse: function(m) {
var _ = this, k = [0], T = [], R = [null], c = [], _t = this.table, d = "", At = 0, ie = 0, ke = 2, se = 1, Pe = c.slice.call(arguments, 1), Y = Object.create(this.lexer), pt = { yy: {} };
for (var Yt in this.yy)
Object.prototype.hasOwnProperty.call(this.yy, Yt) && (pt.yy[Yt] = this.yy[Yt]);
Y.setInput(m, pt.yy), pt.yy.lexer = Y, pt.yy.parser = this, typeof Y.yylloc > "u" && (Y.yylloc = {});
var Ft = Y.yylloc;
c.push(Ft);
var Le = Y.options && Y.options.ranges;
typeof pt.yy.parseError == "function" ? this.parseError = pt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
function Ie() {
var ot;
return ot = T.pop() || Y.lex() || se, typeof ot != "number" && (ot instanceof Array && (T = ot, ot = T.pop()), ot = _.symbols_[ot] || ot), ot;
}
for (var K, ft, et, Wt, yt = {}, Nt, at, re, vt; ; ) {
if (ft = k[k.length - 1], this.defaultActions[ft] ? et = this.defaultActions[ft] : ((K === null || typeof K > "u") && (K = Ie()), et = _t[ft] && _t[ft][K]), typeof et > "u" || !et.length || !et[0]) {
var qt = "";
vt = [];
for (Nt in _t[ft])
this.terminals_[Nt] && Nt > ke && vt.push("'" + this.terminals_[Nt] + "'");
Y.showPosition ? qt = "Parse error on line " + (At + 1) + `:
` + Y.showPosition() + `
Expecting ` + vt.join(", ") + ", got '" + (this.terminals_[K] || K) + "'" : qt = "Parse error on line " + (At + 1) + ": Unexpected " + (K == se ? "end of input" : "'" + (this.terminals_[K] || K) + "'"), this.parseError(qt, {
text: Y.match,
token: this.terminals_[K] || K,
line: Y.yylineno,
loc: Ft,
expected: vt
});
}
if (et[0] instanceof Array && et.length > 1)
throw new Error("Parse Error: multiple actions possible at state: " + ft + ", token: " + K);
switch (et[0]) {
case 1:
k.push(K), R.push(Y.yytext), c.push(Y.yylloc), k.push(et[1]), K = null, ie = Y.yyleng, d = Y.yytext, At = Y.yylineno, Ft = Y.yylloc;
break;
case 2:
if (at = this.productions_[et[1]][1], yt.$ = R[R.length - at], yt._$ = {
first_line: c[c.length - (at || 1)].first_line,
last_line: c[c.length - 1].last_line,
first_column: c[c.length - (at || 1)].first_column,
last_column: c[c.length - 1].last_column
}, Le && (yt._$.range = [
c[c.length - (at || 1)].range[0],
c[c.length - 1].range[1]
]), Wt = this.performAction.apply(yt, [
d,
ie,
At,
pt.yy,
et[1],
R,
c
].concat(Pe)), typeof Wt < "u")
return Wt;
at && (k = k.slice(0, -1 * at * 2), R = R.slice(0, -1 * at), c = c.slice(0, -1 * at)), k.push(this.productions_[et[1]][0]), R.push(yt.$), c.push(yt._$), re = _t[k[k.length - 2]][k[k.length - 1]], k.push(re);
break;
case 3:
return !0;
}
}
return !0;
}
}, _e = function() {
var dt = {
EOF: 1,
parseError: function(_, k) {
if (this.yy.parser)
this.yy.parser.parseError(_, k);
else
throw new Error(_);
},
// resets the lexer, sets new input
setInput: function(m, _) {
return this.yy = _ || this.yy || {}, this._input = m, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
first_line: 1,
first_column: 0,
last_line: 1,
last_column: 0
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
},
// consumes and returns one char from the input
input: function() {
var m = this._input[0];
this.yytext += m, this.yyleng++, this.offset++, this.match += m, this.matched += m;
var _ = m.match(/(?:\r\n?|\n).*/g);
return _ ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), m;
},
// unshifts one char (or a string) into the input
unput: function(m) {
var _ = m.length, k = m.split(/(?:\r\n?|\n)/g);
this._input = m + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - _), this.offset -= _;
var T = this.match.split(/(?:\r\n?|\n)/g);
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), k.length - 1 && (this.yylineno -= k.length - 1);
var R = this.yylloc.range;
return this.yylloc = {
first_line: this.yylloc.first_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.first_column,
last_column: k ? (k.length === T.length ? this.yylloc.first_column : 0) + T[T.length - k.length].length - k[0].length : this.yylloc.first_column - _
}, this.options.ranges && (this.yylloc.range = [R[0], R[0] + this.yyleng - _]), this.yyleng = this.yytext.length, this;
},
// When called from action, caches matched text and appends it on next action
more: function() {
return this._more = !0, this;
},
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
reject: function() {
if (this.options.backtrack_lexer)
this._backtrack = !0;
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).
` + this.showPosition(), {
text: "",
token: null,
line: this.yylineno
});
return this;
},
// retain first n characters of the match
less: function(m) {
this.unput(this.match.slice(m));
},
// displays already matched input, i.e. for error messages
pastInput: function() {
var m = this.matched.substr(0, this.matched.length - this.match.length);
return (m.length > 20 ? "..." : "") + m.substr(-20).replace(/\n/g, "");
},
// displays upcoming input, i.e. for error messages
upcomingInput: function() {
var m = this.match;
return m.length < 20 && (m += this._input.substr(0, 20 - m.length)), (m.substr(0, 20) + (m.length > 20 ? "..." : "")).replace(/\n/g, "");
},
// displays the character position where the lexing error occurred, i.e. for error messages
showPosition: function() {
var m = this.pastInput(), _ = new Array(m.length + 1).join("-");
return m + this.upcomingInput() + `
` + _ + "^";
},
// test the lexed token: return FALSE when not a match, otherwise return token
test_match: function(m, _) {
var k, T, R;
if (this.options.backtrack_lexer && (R = {
yylineno: this.yylineno,
yylloc: {
first_line: this.yylloc.first_line,
last_line: this.last_line,
first_column: this.yylloc.first_column,
last_column: this.yylloc.last_column
},
yytext: this.yytext,
match: this.match,
matches: this.matches,
matched: this.matched,
yyleng: this.yyleng,
offset: this.offset,
_more: this._more,
_input: this._input,
yy: this.yy,
conditionStack: this.conditionStack.slice(0),
done: this.done
}, this.options.ranges && (R.yylloc.range = this.yylloc.range.slice(0))), T = m[0].match(/(?:\r\n?|\n).*/g), T && (this.yylineno += T.length), this.yylloc = {
first_line: this.yylloc.last_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.last_column,
last_column: T ? T[T.length - 1].length - T[T.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + m[0].length
}, this.yytext += m[0], this.match += m[0], this.matches = m, 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(m[0].length), this.matched += m[0], k = this.performAction.call(this, this.yy, this, _, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), k)
return k;
if (this._backtrack) {
for (var c in R)
this[c] = R[c];
return !1;
}
return !1;
},
// return next match in input
next: function() {
if (this.done)
return this.EOF;
this._input || (this.done = !0);
var m, _, k, T;
this._more || (this.yytext = "", this.match = "");
for (var R = this._currentRules(), c = 0; c < R.length; c++)
if (k = this._input.match(this.rules[R[c]]), k && (!_ || k[0].length > _[0].length)) {
if (_ = k, T = c, this.options.backtrack_lexer) {
if (m = this.test_match(k, R[c]), m !== !1)
return m;
if (this._backtrack) {
_ = !1;
continue;
} else
return !1;
} else if (!this.options.flex)
break;
}
return _ ? (m = this.test_match(_, R[T]), m !== !1 ? m : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
` + this.showPosition(), {
text: "",
token: null,
line: this.yylineno
});
},
// return next match that has a token
lex: function() {
var _ = this.next();
return _ || this.lex();
},
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
begin: function(_) {
this.conditionStack.push(_);
},
// pop the previously active lexer condition state off the condition stack
popState: function() {
var _ = this.conditionStack.length - 1;
return _ > 0 ? this.conditionStack.pop() : this.conditionStack[0];
},
// produce the lexer rule set which is active for the currently active lexer condition state
_currentRules: function() {
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
},
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
topState: function(_) {
return _ = this.conditionStack.length - 1 - Math.abs(_ || 0), _ >= 0 ? this.conditionStack[_] : "INITIAL";
},
// alias for begin(condition)
pushState: function(_) {
this.begin(_);
},
// return the number of states currently on the stack
stateStackSize: function() {
return this.conditionStack.length;
},
options: { "case-insensitive": !0 },
performAction: function(_, k, T, R) {
switch (T) {
case 0:
return this.begin("open_directive"), 86;
case 1:
return this.begin("type_directive"), 87;
case 2:
return this.popState(), this.begin("arg_directive"), 17;
case 3:
return this.popState(), this.popState(), 89;
case 4:
return 88;
case 5:
return 5;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
case 10:
break;
case 11:
return 25;
case 12:
return this.begin("LINE"), 20;
case 13:
return this.begin("ID"), 56;
case 14:
return this.begin("ID"), 58;
case 15:
return 19;
case 16:
return this.begin("ID"), 59;
case 17:
return k.yytext = k.yytext.trim(), this.begin("ALIAS"), 76;
case 18:
return this.popState(), this.popState(), this.begin("LINE"), 57;
case 19:
return this.popState(), this.popState(), 5;
case 20:
return this.begin("LINE"), 42;
case 21:
return this.begin("LINE"), 43;
case 22:
return this.begin("LINE"), 44;
case 23:
return this.begin("LINE"), 45;
case 24:
return this.begin("LINE"), 55;
case 25:
return this.begin("LINE"), 47;
case 26:
return this.begin("LINE"), 49;
case 27:
return this.begin("LINE"), 54;
case 28:
return this.begin("LINE"), 50;
case 29:
return this.begin("LINE"), 53;
case 30:
return this.begin("LINE"), 52;
case 31:
return this.popState(), 21;
case 32:
return 22;
case 33:
return 71;
case 34:
return 72;
case 35:
return 65;
case 36:
return 66;
case 37:
return 67;
case 38:
return 68;
case 39:
return 63;
case 40:
return 60;
case 41:
return this.begin("ID"), 27;
case 42:
return this.begin("ID"), 29;
case 43:
return 35;
case 44:
return 36;
case 45:
return this.begin("acc_title"), 37;
case 46:
return this.popState(), "acc_title_value";
case 47:
return this.begin("acc_descr"), 39;
case 48:
return this.popState(), "acc_descr_value";
case 49:
this.begin("acc_descr_multiline");
break;
case 50:
this.popState();
break;
case 51:
return "acc_descr_multiline_value";
case 52:
return 7;
case 53:
return 24;
case 54:
return 26;
case 55:
return 70;
case 56:
return 5;
case 57:
return k.yytext = k.yytext.trim(), 76;
case 58:
return 79;
case 59:
return 80;
case 60:
return 77;
case 61:
return 78;
case 62:
return 81;
case 63:
return 82;
case 64:
return 83;
case 65:
return 84;
case 66:
return 85;
case 67:
return 74;
case 68:
return 75;
case 69:
return 5;
case 70:
return "INVALID";
}
},
rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
conditions: { acc_descr_multiline: { rules: [50, 51], inclusive: !1 }, acc_descr: { rules: [48], inclusive: !1 }, acc_title: { rules: [46], inclusive: !1 }, open_directive: { rules: [1, 8], inclusive: !1 }, type_directive: { rules: [2, 3, 8], inclusive: !1 }, arg_directive: { rules: [3, 4, 8], inclusive: !1 }, ID: { rules: [7, 8, 17], inclusive: !1 }, ALIAS: { rules: [7, 8, 18, 19], inclusive: !1 }, LINE: { rules: [7, 8, 31], inclusive: !1 }, INITIAL: { rules: [0, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 49, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70], inclusive: !0 } }
};
return dt;
}();
Ot.lexer = _e;
function Bt() {
this.yy = {};
}
return Bt.prototype = Ot, Ot.Parser = Bt, new Bt();
}();
zt.parser = zt;
const ze = zt;
let kt, lt = {}, Jt = {}, Zt = {}, mt = [], Z = [], Dt = !1, Ht, ct, Pt, Et;
const He = function(t, e, o) {
Re.parseDirective(this, t, e, o);
}, Ue = function(t) {
mt.push({
name: t.text,
wrap: t.wrap === void 0 && xt() || !!t.wrap,
fill: t.color,
actorKeys: []
}), ct = mt.slice(-1)[0];
}, Ut = function(t, e, o, n) {
let i = ct;
const s = lt[t];
if (s) {
if (ct && s.box && ct !== s.box)
throw new Error(
"A same participant should only be defined in one Box: " + s.name + " can't be in '" + s.box.name + "' and in '" + ct.name + "' at the same time."
);
if (i = s.box ? s.box : ct, s.box = i, s && e === s.name && o == null)
return;
}
(o == null || o.text == null) && (o = { text: e, wrap: null, type: n }), (n == null || o.text == null) && (o = { text: e, wrap: null, type: n }), lt[t] = {
box: i,
name: e,
description: o.text,
wrap: o.wrap === void 0 && xt() || !!o.wrap,
prevActor: kt,
links: {},
properties: {},
actorCnt: null,
rectData: null,
type: n || "participant"
}, kt && lt[kt] && (lt[kt].nextActor = t), ct && ct.actorKeys.push(t), kt = t;
}, Ke = (t) => {
let e, o = 0;
for (e = 0; e < Z.length; e++)
Z[e].type === Lt.ACTIVE_START && Z[e].from.actor === t && o++, Z[e].type === Lt.ACTIVE_END && Z[e].from.actor === t && o--;
return o;
}, Ge = function(t, e, o, n) {
Z.push({
from: t,
to: e,
message: o.text,
wrap: o.wrap === void 0 && xt() || !!o.wrap,
answer: n
});
}, V = function(t, e, o = { text: void 0, wrap: void 0 }, n) {
if (n === Lt.ACTIVE_END && Ke(t.actor) < 1) {
let s = new Error("Trying to inactivate an inactive participant (" + t.actor + ")");
throw s.hash = {
text: "->>-",
token: "->>-",
line: "1",
loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
expected: ["'ACTIVE_PARTICIPANT'"]
}, s;
}
return Z.push({
from: t,
to: e,
message: o.text,
wrap: o.wrap === void 0 && xt() || !!o.wrap,
type: n
}), !0;
}, Xe = function() {
return mt.length > 0;
}, Je = function() {
return mt.some((t) => t.name);
}, Ze = function() {
return Z;
}, Qe = function() {
return mt;
}, je = function() {
return lt;
}, $e = function() {
return Jt;
}, t0 = function() {
return Zt;
}, It = function(t) {
return lt[t];
}, e0 = function() {
return Object.keys(lt);
}, n0 = function() {
Dt = !0;
}, i0 = function() {
Dt = !1;
}, s0 = () => Dt, r0 = function(t) {
Ht = t;
}, xt = () => Ht !== void 0 ? Ht : ut().sequence.wrap, a0 = function() {
lt = {}, Jt = {}, Zt = {}, mt = [], Z = [], Dt = !1, De();
}, o0 = function(t) {
const e = t.trim(), o = {
text: e.replace(/^:?(?:no)?wrap:/, "").trim(),
wrap: e.match(/^:?wrap:/) !== null ? !0 : e.match(/^:?nowrap:/) !== null ? !1 : void 0
};
return G.debug("parseMessage:", o), o;
}, c0 = function(t) {
const e = t.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/);
let o = e != null && e[1] ? e[1].trim() : "transparent", n = e != null && e[2] ? e[2].trim() : void 0;
if (window && window.CSS)
window.CSS.supports("color", o) || (o = "transparent", n = t.trim());
else {
const s = new Option().style;
s.color = o, s.color !== o && (o = "transparent", n = t.trim());
}
return {
color: o,
text: n !== void 0 ? Mt(n.replace(/^:?(?:no)?wrap:/, ""), ut()) : void 0,
wrap: n !== void 0 ? n.match(/^:?wrap:/) !== null ? !0 : n.match(/^:?nowrap:/) !== null ? !1 : void 0 : void 0
};
}, Lt = {
SOLID: 0,
DOTTED: 1,
NOTE: 2,
SOLID_CROSS: 3,
DOTTED_CROSS: 4,
SOLID_OPEN: 5,
DOTTED_OPEN: 6,
LOOP_START: 10,
LOOP_END: 11,
ALT_START: 12,
ALT_ELSE: 13,
ALT_END: 14,
OPT_START: 15,
OPT_END: 16,
ACTIVE_START: 17,
ACTIVE_END: 18,
PAR_START: 19,
PAR_AND: 20,
PAR_END: 21,
RECT_START: 22,
RECT_END: 23,
SOLID_POINT: 24,
DOTTED_POINT: 25,
AUTONUMBER: 26,
CRITICAL_START: 27,
CRITICAL_OPTION: 28,
CRITICAL_END: 29,
BREAK_START: 30,
BREAK_END: 31,
PAR_OVER_START: 32
}, l0 = {
FILLED: 0,
OPEN: 1
}, h0 = {
LEFTOF: 0,
RIGHTOF: 1,
OVER: 2
}, he = function(t, e, o) {
o.text, o.wrap === void 0 && xt() || o.wrap;
const n = [].concat(t, t);
Z.push({
from: n[0],
to: n[1],
message: o.text,
wrap: o.wrap === void 0 && xt() || !!o.wrap,
type: Lt.NOTE,
placement: e
});
}, de = function(t, e) {
const o = It(t);
try {
let n = Mt(e.text, ut());
n = n.replace(/&/g, "&"), n = n.replace(/=/g, "=");
const i = JSON.parse(n);
Qt(o, i);
} catch (n) {
G.error("error while parsing actor link text", n);
}
}, d0 = function(t, e) {
const o = It(t);
try {
const l = {};
let h = Mt(e.text, ut());
var n = h.indexOf("@");
h = h.replace(/&/g, "&"), h = h.replace(/=/g, "=");
var i = h.slice(0, n - 1).trim(), s = h.slice(n + 1).trim();
l[i] = s, Qt(o, l);
} catch (l) {
G.error("error while parsing actor link text", l);
}
};
function Qt(t, e) {
if (t.links == null)
t.links = e;
else
for (let o in e)
t.links[o] = e[o];
}
const ue = function(t, e) {
const o = It(t);
try {
let n = Mt(e.text, ut());
const i = JSON.parse(n);
pe(o, i);
} catch (n) {
G.error("error while parsing actor properties text", n);
}
};
function pe(t, e) {
if (t.properties == null)
t.properties = e;
else
for (let o in e)
t.properties[o] = e[o];
}
function u0() {
ct = void 0;
}
const fe = function(t, e) {
const o = It(t), n = document.getElementById(e.text);
try {
const i = n.innerHTML, s = JSON.parse(i);
s.properties && pe(o, s.properties), s.links && Qt(o, s.links);
} catch (i) {
G.error("error while parsing actor details text", i);
}
}, p0 = function(t, e) {
if (t !== void 0 && t.properties !== void 0)
return t.properties[e];
}, ge = function(t) {
if (Array.isArray(t))
t.forEach(function(e) {
ge(e);
});
else
switch (t.type) {
case "sequenceIndex":
Z.push({
from: void 0,
to: void 0,
message: {
start: t.sequenceIndex,
step: t.sequenceIndexStep,
visible: t.sequenceVisible
},
wrap: !1,
type: t.signalType
});
break;
case "addParticipant":
Ut(t.actor, t.actor, t.description, t.draw);
break;
case "createParticipant":
if (lt[t.actor])
throw new 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"
);
Pt = t.actor, Ut(t.actor, t.actor, t.description, t.draw), Jt[t.actor] = Z.length;
break;
case "destroyParticipant":
Et = t.actor, Zt[t.actor] = Z.length;
break;
case "activeStart":
V(t.actor, void 0, void 0, t.signalType);
break;
case "activeEnd":
V(t.actor, void 0, void 0, t.signalType);
break;
case "addNote":
he(t.actor, t.placement, t.text);
break;
case "addLinks":
de(t.actor, t.text);
break;
case "addALink":
d0(t.actor, t.text);
break;
case "addProperties":
ue(t.actor, t.text);
break;
case "addDetails":
fe(t.actor, t.text);
break;
case "addMessage":
if (Pt) {
if (t.to !== Pt)
throw new Error(
"The created participant " + Pt + " does not have an associated creating message after its declaration. Please check the sequence diagram."
);
Pt = void 0;
} else if (Et) {
if (t.to !== Et && t.from !== Et)
throw new Error(
"The destroyed participant " + Et + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
);
Et = void 0;
}
V(t.from, t.to, t.msg, t.signalType);
break;
case "boxStart":
Ue(t.boxData);
break;
case "boxEnd":
u0();
break;
case "loopStart":
V(void 0, void 0, t.loopText, t.signalType);
break;
case "loopEnd":
V(void 0, void 0, void 0, t.signalType);
break;
case "rectStart":
V(void 0, void 0, t.color, t.signalType);
break;
case "rectEnd":
V(void 0, void 0, void 0, t.signalType);
break;
case "optStart":
V(void 0, void 0, t.optText, t.signalType);
break;
case "optEnd":
V(void 0, void 0, void 0, t.signalType);
break;
case "altStart":
V(void 0, void 0, t.altText, t.signalType);
break;
case "else":
V(void 0, void 0, t.altText, t.signalType);
break;
case "altEnd":
V(void 0, void 0, void 0, t.signalType);
break;
case "setAccTitle":
oe(t.text);
break;
case "parStart":
V(void 0, void 0, t.parText, t.signalType);
break;
case "and":
V(void 0, void 0, t.parText, t.signalType);
break;
case "parEnd":
V(void 0, void 0, void 0, t.signalType);
break;
case "criticalStart":
V(void 0, void 0, t.criticalText, t.signalType);
break;
case "option":
V(void 0, void 0, t.optionText, t.signalType);
break;
case "criticalEnd":
V(void 0, void 0, void 0, t.signalType);
break;
case "breakStart":
V(void 0, void 0, t.breakText, t.signalType);
break;
case "breakEnd":
V(void 0, void 0, void 0, t.signalType);
break;
}
}, f0 = {
addActor: Ut,
addMessage: Ge,
addSignal: V,
addLinks: de,
addDetails: fe,
addProperties: ue,
autoWrap: xt,
setWrap: r0,
enableSequenceNumbers: n0,
disableSequenceNumbers: i0,
showSequenceNumbers: s0,
getMessages: Ze,
getActors: je,
getCreatedActors: $e,
getDestroyedActors: t0,
getActor: It,
getActorKeys: e0,
getActorProperty: p0,
getAccTitle: Ae,
getBoxes: Qe,
getDiagramTitle: Ne,
setDiagramTitle: ve,
parseDirective: He,
getConfig: () => ut().sequence,
clear: a0,
parseMessage: o0,
parseBoxData: c0,
LINETYPE: Lt,
ARROWTYPE: l0,
PLACEMENT: h0,
addNote: he,
setAccTitle: oe,
apply: ge,
setAccDescription: Se,
getAccDescription: Me,
hasAtLeastOneBox: Xe,
hasAtLeastOneBoxWithTitle: Je
}, g0 = (t) => `.actor {
stroke: ${t.actorBorder};
fill: ${t.actorBkg};
}
text.actor > tspan {
fill: ${t.actorTextColor};
stroke: none;
}
.actor-line {
stroke: ${t.actorLineColor};
}
.messageLine0 {
stroke-width: 1.5;
stroke-dasharray: none;
stroke: ${t.signalColor};
}
.messageLine1 {
stroke-width: 1.5;
stroke-dasharray: 2, 2;
stroke: ${t.signalColor};
}
#arrowhead path {
fill: ${t.signalColor};
stroke: ${t.signalColor};
}
.sequenceNumber {
fill: ${t.sequenceNumberColor};
}
#sequencenumber {
fill: ${t.signalColor};
}
#crosshead path {
fill: ${t.signalColor};
stroke: ${t.signalColor};
}
.messageText {
fill: ${t.signalTextColor};
stroke: none;
}
.labelBox {
stroke: ${t.labelBoxBorderColor};
fill: ${t.labelBoxBkgColor};
}
.labelText, .labelText > tspan {
fill: ${t.labelTextColor};
stroke: none;
}
.loopText, .loopText > tspan {
fill: ${t.loopTextColor};
stroke: none;
}
.loopLine {
stroke-width: 2px;
stroke-dasharray: 2, 2;
stroke: ${t.labelBoxBorderColor};
fill: ${t.labelBoxBorderColor};
}
.note {
//stroke: