import { g as Le, D as Ie, B as Ae, c as dt, s as ae, b as Ne, a as ve, E as Se, l as U, d as Mt, e as re, f as w, Z as oe, a5 as Me, a6 as Re, h as De, j as St, k as Ve, z as O } from "./mermaid-e4a58915.js"; import { d as Ce, a as Oe, b as Be, c as Ye, e as Gt, g as Rt } from "./svgDrawCommon-1021982e.js"; var qt = function() { var t = function(ht, m, P, L) { for (P = P || {}, L = ht.length; L--; P[ht[L]] = m) ; return P; }, e = [1, 2], o = [1, 3], n = [1, 4], i = [2, 4], s = [1, 9], c = [1, 11], h = [1, 13], u = [1, 14], a = [1, 16], x = [1, 17], E = [1, 18], p = [1, 24], g = [1, 25], b = [1, 26], k = [1, 27], A = [1, 28], R = [1, 29], v = [1, 30], F = [1, 31], S = [1, 32], tt = [1, 33], W = [1, 34], K = [1, 35], Z = [1, 36], q = [1, 37], Y = [1, 38], C = [1, 39], G = [1, 41], z = [1, 42], X = [1, 43], Q = [1, 44], j = [1, 45], y = [1, 46], _ = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], I = [4, 5, 16, 50, 52, 53], ut = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], et = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 54, 59, 60, 61, 62, 70], N = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 54, 59, 60, 61, 62, 70], $t = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 54, 59, 60, 61, 62, 70], lt = [68, 69, 70], st = [1, 120], Ct = { trace: function() { }, yy: {}, symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, box_section: 10, box_line: 11, participant_statement: 12, create: 13, box: 14, restOfLine: 15, end: 16, signal: 17, autonumber: 18, NUM: 19, off: 20, activate: 21, actor: 22, deactivate: 23, note_statement: 24, links_statement: 25, link_statement: 26, properties_statement: 27, details_statement: 28, title: 29, legacy_title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, loop: 36, rect: 37, opt: 38, alt: 39, else_sections: 40, par: 41, par_sections: 42, par_over: 43, critical: 44, option_sections: 45, break: 46, option: 47, and: 48, else: 49, participant: 50, AS: 51, participant_actor: 52, destroy: 53, note: 54, placement: 55, text2: 56, over: 57, actor_pair: 58, links: 59, link: 60, properties: 61, details: 62, spaceList: 63, ",": 64, left_of: 65, right_of: 66, signaltype: 67, "+": 68, "-": 69, ACTOR: 70, SOLID_OPEN_ARROW: 71, DOTTED_OPEN_ARROW: 72, SOLID_ARROW: 73, DOTTED_ARROW: 74, SOLID_CROSS: 75, DOTTED_CROSS: 76, SOLID_POINT: 77, DOTTED_POINT: 78, TXT: 79, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 54: "note", 57: "over", 59: "links", 60: "link", 61: "properties", 62: "details", 64: ",", 65: "left_of", 66: "right_of", 68: "+", 69: "-", 70: "ACTOR", 71: "SOLID_OPEN_ARROW", 72: "DOTTED_OPEN_ARROW", 73: "SOLID_ARROW", 74: "DOTTED_ARROW", 75: "SOLID_CROSS", 76: "DOTTED_CROSS", 77: "SOLID_POINT", 78: "DOTTED_POINT", 79: "TXT" }, productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [63, 2], [63, 1], [58, 3], [58, 1], [55, 1], [55, 1], [17, 5], [17, 5], [17, 4], [22, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [67, 1], [56, 1]], performAction: function(m, P, L, T, M, l, _t) { var d = l.length - 1; switch (M) { case 3: return T.apply(l[d]), l[d]; case 4: case 9: this.$ = []; break; case 5: case 10: l[d - 1].push(l[d]), this.$ = l[d - 1]; break; case 6: case 7: case 11: case 12: this.$ = l[d]; break; case 8: case 13: this.$ = []; break; case 15: l[d].type = "createParticipant", this.$ = l[d]; break; case 16: l[d - 1].unshift({ type: "boxStart", boxData: T.parseBoxData(l[d - 2]) }), l[d - 1].push({ type: "boxEnd", boxText: l[d - 2] }), this.$ = l[d - 1]; break; case 18: this.$ = { type: "sequenceIndex", sequenceIndex: Number(l[d - 2]), sequenceIndexStep: Number(l[d - 1]), sequenceVisible: !0, signalType: T.LINETYPE.AUTONUMBER }; break; case 19: this.$ = { type: "sequenceIndex", sequenceIndex: Number(l[d - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: T.LINETYPE.AUTONUMBER }; break; case 20: this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: T.LINETYPE.AUTONUMBER }; break; case 21: this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: T.LINETYPE.AUTONUMBER }; break; case 22: this.$ = { type: "activeStart", signalType: T.LINETYPE.ACTIVE_START, actor: l[d - 1] }; break; case 23: this.$ = { type: "activeEnd", signalType: T.LINETYPE.ACTIVE_END, actor: l[d - 1] }; break; case 29: T.setDiagramTitle(l[d].substring(6)), this.$ = l[d].substring(6); break; case 30: T.setDiagramTitle(l[d].substring(7)), this.$ = l[d].substring(7); break; case 31: this.$ = l[d].trim(), T.setAccTitle(this.$); break; case 32: case 33: this.$ = l[d].trim(), T.setAccDescription(this.$); break; case 34: l[d - 1].unshift({ type: "loopStart", loopText: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.LOOP_START }), l[d - 1].push({ type: "loopEnd", loopText: l[d - 2], signalType: T.LINETYPE.LOOP_END }), this.$ = l[d - 1]; break; case 35: l[d - 1].unshift({ type: "rectStart", color: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.RECT_START }), l[d - 1].push({ type: "rectEnd", color: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.RECT_END }), this.$ = l[d - 1]; break; case 36: l[d - 1].unshift({ type: "optStart", optText: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.OPT_START }), l[d - 1].push({ type: "optEnd", optText: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.OPT_END }), this.$ = l[d - 1]; break; case 37: l[d - 1].unshift({ type: "altStart", altText: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.ALT_START }), l[d - 1].push({ type: "altEnd", signalType: T.LINETYPE.ALT_END }), this.$ = l[d - 1]; break; case 38: l[d - 1].unshift({ type: "parStart", parText: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.PAR_START }), l[d - 1].push({ type: "parEnd", signalType: T.LINETYPE.PAR_END }), this.$ = l[d - 1]; break; case 39: l[d - 1].unshift({ type: "parStart", parText: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.PAR_OVER_START }), l[d - 1].push({ type: "parEnd", signalType: T.LINETYPE.PAR_END }), this.$ = l[d - 1]; break; case 40: l[d - 1].unshift({ type: "criticalStart", criticalText: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.CRITICAL_START }), l[d - 1].push({ type: "criticalEnd", signalType: T.LINETYPE.CRITICAL_END }), this.$ = l[d - 1]; break; case 41: l[d - 1].unshift({ type: "breakStart", breakText: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.BREAK_START }), l[d - 1].push({ type: "breakEnd", optText: T.parseMessage(l[d - 2]), signalType: T.LINETYPE.BREAK_END }), this.$ = l[d - 1]; break; case 43: this.$ = l[d - 3].concat([{ type: "option", optionText: T.parseMessage(l[d - 1]), signalType: T.LINETYPE.CRITICAL_OPTION }, l[d]]); break; case 45: this.$ = l[d - 3].concat([{ type: "and", parText: T.parseMessage(l[d - 1]), signalType: T.LINETYPE.PAR_AND }, l[d]]); break; case 47: this.$ = l[d - 3].concat([{ type: "else", altText: T.parseMessage(l[d - 1]), signalType: T.LINETYPE.ALT_ELSE }, l[d]]); break; case 48: l[d - 3].draw = "participant", l[d - 3].type = "addParticipant", l[d - 3].description = T.parseMessage(l[d - 1]), this.$ = l[d - 3]; break; case 49: l[d - 1].draw = "participant", l[d - 1].type = "addParticipant", this.$ = l[d - 1]; break; case 50: l[d - 3].draw = "actor", l[d - 3].type = "addParticipant", l[d - 3].description = T.parseMessage(l[d - 1]), this.$ = l[d - 3]; break; case 51: l[d - 1].draw = "actor", l[d - 1].type = "addParticipant", this.$ = l[d - 1]; break; case 52: l[d - 1].type = "destroyParticipant", this.$ = l[d - 1]; break; case 53: this.$ = [l[d - 1], { type: "addNote", placement: l[d - 2], actor: l[d - 1].actor, text: l[d] }]; break; case 54: l[d - 2] = [].concat(l[d - 1], l[d - 1]).slice(0, 2), l[d - 2][0] = l[d - 2][0].actor, l[d - 2][1] = l[d - 2][1].actor, this.$ = [l[d - 1], { type: "addNote", placement: T.PLACEMENT.OVER, actor: l[d - 2].slice(0, 2), text: l[d] }]; break; case 55: this.$ = [l[d - 1], { type: "addLinks", actor: l[d - 1].actor, text: l[d] }]; break; case 56: this.$ = [l[d - 1], { type: "addALink", actor: l[d - 1].actor, text: l[d] }]; break; case 57: this.$ = [l[d - 1], { type: "addProperties", actor: l[d - 1].actor, text: l[d] }]; break; case 58: this.$ = [l[d - 1], { type: "addDetails", actor: l[d - 1].actor, text: l[d] }]; break; case 61: this.$ = [l[d - 2], l[d]]; break; case 62: this.$ = l[d]; break; case 63: this.$ = T.PLACEMENT.LEFTOF; break; case 64: this.$ = T.PLACEMENT.RIGHTOF; break; case 65: this.$ = [ l[d - 4], l[d - 1], { type: "addMessage", from: l[d - 4].actor, to: l[d - 1].actor, signalType: l[d - 3], msg: l[d], activate: !0 }, { type: "activeStart", signalType: T.LINETYPE.ACTIVE_START, actor: l[d - 1] } ]; break; case 66: this.$ = [ l[d - 4], l[d - 1], { type: "addMessage", from: l[d - 4].actor, to: l[d - 1].actor, signalType: l[d - 3], msg: l[d] }, { type: "activeEnd", signalType: T.LINETYPE.ACTIVE_END, actor: l[d - 4] } ]; break; case 67: this.$ = [l[d - 3], l[d - 1], { type: "addMessage", from: l[d - 3].actor, to: l[d - 1].actor, signalType: l[d - 2], msg: l[d] }]; break; case 68: this.$ = { type: "addParticipant", actor: l[d] }; break; case 69: this.$ = T.LINETYPE.SOLID_OPEN; break; case 70: this.$ = T.LINETYPE.DOTTED_OPEN; break; case 71: this.$ = T.LINETYPE.SOLID; break; case 72: this.$ = T.LINETYPE.DOTTED; break; case 73: this.$ = T.LINETYPE.SOLID_CROSS; break; case 74: this.$ = T.LINETYPE.DOTTED_CROSS; break; case 75: this.$ = T.LINETYPE.SOLID_POINT; break; case 76: this.$ = T.LINETYPE.DOTTED_POINT; break; case 77: this.$ = T.parseMessage(l[d].trim().substring(1)); break; } }, table: [{ 3: 1, 4: e, 5: o, 6: n }, { 1: [3] }, { 3: 5, 4: e, 5: o, 6: n }, { 3: 6, 4: e, 5: o, 6: n }, t([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 54, 59, 60, 61, 62, 70], i, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 17: 15, 18: a, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: b, 33: k, 35: A, 36: R, 37: v, 38: F, 39: S, 41: tt, 43: W, 44: K, 46: Z, 50: q, 52: Y, 53: C, 54: G, 59: z, 60: X, 61: Q, 62: j, 70: y }, t(_, [2, 5]), { 9: 47, 12: 12, 13: h, 14: u, 17: 15, 18: a, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: b, 33: k, 35: A, 36: R, 37: v, 38: F, 39: S, 41: tt, 43: W, 44: K, 46: Z, 50: q, 52: Y, 53: C, 54: G, 59: z, 60: X, 61: Q, 62: j, 70: y }, t(_, [2, 7]), t(_, [2, 8]), t(_, [2, 14]), { 12: 48, 50: q, 52: Y, 53: C }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 70: y }, { 22: 55, 70: y }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, t(_, [2, 29]), t(_, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, t(_, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 70: y }, { 22: 72, 70: y }, { 22: 73, 70: y }, { 67: 74, 71: [1, 75], 72: [1, 76], 73: [1, 77], 74: [1, 78], 75: [1, 79], 76: [1, 80], 77: [1, 81], 78: [1, 82] }, { 55: 83, 57: [1, 84], 65: [1, 85], 66: [1, 86] }, { 22: 87, 70: y }, { 22: 88, 70: y }, { 22: 89, 70: y }, { 22: 90, 70: y }, t([5, 51, 64, 71, 72, 73, 74, 75, 76, 77, 78, 79], [2, 68]), t(_, [2, 6]), t(_, [2, 15]), t(I, [2, 9], { 10: 91 }), t(_, [2, 17]), { 5: [1, 93], 19: [1, 92] }, { 5: [1, 94] }, t(_, [2, 21]), { 5: [1, 95] }, { 5: [1, 96] }, t(_, [2, 24]), t(_, [2, 25]), t(_, [2, 26]), t(_, [2, 27]), t(_, [2, 28]), t(_, [2, 31]), t(_, [2, 32]), t(ut, i, { 7: 97 }), t(ut, i, { 7: 98 }), t(ut, i, { 7: 99 }), t(et, i, { 40: 100, 7: 101 }), t(N, i, { 42: 102, 7: 103 }), t(N, i, { 7: 103, 42: 104 }), t($t, i, { 45: 105, 7: 106 }), t(ut, i, { 7: 107 }), { 5: [1, 109], 51: [1, 108] }, { 5: [1, 111], 51: [1, 110] }, { 5: [1, 112] }, { 22: 115, 68: [1, 113], 69: [1, 114], 70: y }, t(lt, [2, 69]), t(lt, [2, 70]), t(lt, [2, 71]), t(lt, [2, 72]), t(lt, [2, 73]), t(lt, [2, 74]), t(lt, [2, 75]), t(lt, [2, 76]), { 22: 116, 70: y }, { 22: 118, 58: 117, 70: y }, { 70: [2, 63] }, { 70: [2, 64] }, { 56: 119, 79: st }, { 56: 121, 79: st }, { 56: 122, 79: st }, { 56: 123, 79: st }, { 4: [1, 126], 5: [1, 128], 11: 125, 12: 127, 16: [1, 124], 50: q, 52: Y, 53: C }, { 5: [1, 129] }, t(_, [2, 19]), t(_, [2, 20]), t(_, [2, 22]), t(_, [2, 23]), { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [1, 130], 17: 15, 18: a, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: b, 33: k, 35: A, 36: R, 37: v, 38: F, 39: S, 41: tt, 43: W, 44: K, 46: Z, 50: q, 52: Y, 53: C, 54: G, 59: z, 60: X, 61: Q, 62: j, 70: y }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [1, 131], 17: 15, 18: a, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: b, 33: k, 35: A, 36: R, 37: v, 38: F, 39: S, 41: tt, 43: W, 44: K, 46: Z, 50: q, 52: Y, 53: C, 54: G, 59: z, 60: X, 61: Q, 62: j, 70: y }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [1, 132], 17: 15, 18: a, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: b, 33: k, 35: A, 36: R, 37: v, 38: F, 39: S, 41: tt, 43: W, 44: K, 46: Z, 50: q, 52: Y, 53: C, 54: G, 59: z, 60: X, 61: Q, 62: j, 70: y }, { 16: [1, 133] }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [2, 46], 17: 15, 18: a, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: b, 33: k, 35: A, 36: R, 37: v, 38: F, 39: S, 41: tt, 43: W, 44: K, 46: Z, 49: [1, 134], 50: q, 52: Y, 53: C, 54: G, 59: z, 60: X, 61: Q, 62: j, 70: y }, { 16: [1, 135] }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [2, 44], 17: 15, 18: a, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: b, 33: k, 35: A, 36: R, 37: v, 38: F, 39: S, 41: tt, 43: W, 44: K, 46: Z, 48: [1, 136], 50: q, 52: Y, 53: C, 54: G, 59: z, 60: X, 61: Q, 62: j, 70: y }, { 16: [1, 137] }, { 16: [1, 138] }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [2, 42], 17: 15, 18: a, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: b, 33: k, 35: A, 36: R, 37: v, 38: F, 39: S, 41: tt, 43: W, 44: K, 46: Z, 47: [1, 139], 50: q, 52: Y, 53: C, 54: G, 59: z, 60: X, 61: Q, 62: j, 70: y }, { 4: s, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: u, 16: [1, 140], 17: 15, 18: a, 21: x, 22: 40, 23: E, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: p, 30: g, 31: b, 33: k, 35: A, 36: R, 37: v, 38: F, 39: S, 41: tt, 43: W, 44: K, 46: Z, 50: q, 52: Y, 53: C, 54: G, 59: z, 60: X, 61: Q, 62: j, 70: y }, { 15: [1, 141] }, t(_, [2, 49]), { 15: [1, 142] }, t(_, [2, 51]), t(_, [2, 52]), { 22: 143, 70: y }, { 22: 144, 70: y }, { 56: 145, 79: st }, { 56: 146, 79: st }, { 56: 147, 79: st }, { 64: [1, 148], 79: [2, 62] }, { 5: [2, 55] }, { 5: [2, 77] }, { 5: [2, 56] }, { 5: [2, 57] }, { 5: [2, 58] }, t(_, [2, 16]), t(I, [2, 10]), { 12: 149, 50: q, 52: Y, 53: C }, t(I, [2, 12]), t(I, [2, 13]), t(_, [2, 18]), t(_, [2, 34]), t(_, [2, 35]), t(_, [2, 36]), t(_, [2, 37]), { 15: [1, 150] }, t(_, [2, 38]), { 15: [1, 151] }, t(_, [2, 39]), t(_, [2, 40]), { 15: [1, 152] }, t(_, [2, 41]), { 5: [1, 153] }, { 5: [1, 154] }, { 56: 155, 79: st }, { 56: 156, 79: st }, { 5: [2, 67] }, { 5: [2, 53] }, { 5: [2, 54] }, { 22: 157, 70: y }, t(I, [2, 11]), t(et, i, { 7: 101, 40: 158 }), t(N, i, { 7: 103, 42: 159 }), t($t, i, { 7: 106, 45: 160 }), t(_, [2, 48]), t(_, [2, 50]), { 5: [2, 65] }, { 5: [2, 66] }, { 79: [2, 61] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }], defaultActions: { 5: [2, 1], 6: [2, 2], 85: [2, 63], 86: [2, 64], 119: [2, 55], 120: [2, 77], 121: [2, 56], 122: [2, 57], 123: [2, 58], 145: [2, 67], 146: [2, 53], 147: [2, 54], 155: [2, 65], 156: [2, 66], 157: [2, 61], 158: [2, 47], 159: [2, 45], 160: [2, 43] }, parseError: function(m, P) { if (P.recoverable) this.trace(m); else { var L = new Error(m); throw L.hash = P, L; } }, parse: function(m) { var P = this, L = [0], T = [], M = [null], l = [], _t = this.table, d = "", At = 0, te = 0, we = 2, ee = 1, _e = l.slice.call(arguments, 1), B = Object.create(this.lexer), pt = { yy: {} }; for (var Bt in this.yy) Object.prototype.hasOwnProperty.call(this.yy, Bt) && (pt.yy[Bt] = this.yy[Bt]); B.setInput(m, pt.yy), pt.yy.lexer = B, pt.yy.parser = this, typeof B.yylloc > "u" && (B.yylloc = {}); var Yt = B.yylloc; l.push(Yt); var Pe = B.options && B.options.ranges; typeof pt.yy.parseError == "function" ? this.parseError = pt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function ke() { var rt; return rt = T.pop() || B.lex() || ee, typeof rt != "number" && (rt instanceof Array && (T = rt, rt = T.pop()), rt = P.symbols_[rt] || rt), rt; } for (var H, ft, $, Ft, yt = {}, Nt, at, ne, vt; ; ) { if (ft = L[L.length - 1], this.defaultActions[ft] ? $ = this.defaultActions[ft] : ((H === null || typeof H > "u") && (H = ke()), $ = _t[ft] && _t[ft][H]), typeof $ > "u" || !$.length || !$[0]) { var Wt = ""; vt = []; for (Nt in _t[ft]) this.terminals_[Nt] && Nt > we && vt.push("'" + this.terminals_[Nt] + "'"); B.showPosition ? Wt = "Parse error on line " + (At + 1) + `: ` + B.showPosition() + ` Expecting ` + vt.join(", ") + ", got '" + (this.terminals_[H] || H) + "'" : Wt = "Parse error on line " + (At + 1) + ": Unexpected " + (H == ee ? "end of input" : "'" + (this.terminals_[H] || H) + "'"), this.parseError(Wt, { text: B.match, token: this.terminals_[H] || H, line: B.yylineno, loc: Yt, expected: vt }); } if ($[0] instanceof Array && $.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + ft + ", token: " + H); switch ($[0]) { case 1: L.push(H), M.push(B.yytext), l.push(B.yylloc), L.push($[1]), H = null, te = B.yyleng, d = B.yytext, At = B.yylineno, Yt = B.yylloc; break; case 2: if (at = this.productions_[$[1]][1], yt.$ = M[M.length - at], yt._$ = { first_line: l[l.length - (at || 1)].first_line, last_line: l[l.length - 1].last_line, first_column: l[l.length - (at || 1)].first_column, last_column: l[l.length - 1].last_column }, Pe && (yt._$.range = [ l[l.length - (at || 1)].range[0], l[l.length - 1].range[1] ]), Ft = this.performAction.apply(yt, [ d, te, At, pt.yy, $[1], M, l ].concat(_e)), typeof Ft < "u") return Ft; at && (L = L.slice(0, -1 * at * 2), M = M.slice(0, -1 * at), l = l.slice(0, -1 * at)), L.push(this.productions_[$[1]][0]), M.push(yt.$), l.push(yt._$), ne = _t[L[L.length - 2]][L[L.length - 1]], L.push(ne); break; case 3: return !0; } } return !0; } }, me = function() { var ht = { EOF: 1, parseError: function(P, L) { if (this.yy.parser) this.yy.parser.parseError(P, L); else throw new Error(P); }, // resets the lexer, sets new input setInput: function(m, P) { return this.yy = P || 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 P = m.match(/(?:\r\n?|\n).*/g); return P ? (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 P = m.length, L = m.split(/(?:\r\n?|\n)/g); this._input = m + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - P), this.offset -= P; 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), L.length - 1 && (this.yylineno -= L.length - 1); var M = 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: L ? (L.length === T.length ? this.yylloc.first_column : 0) + T[T.length - L.length].length - L[0].length : this.yylloc.first_column - P }, this.options.ranges && (this.yylloc.range = [M[0], M[0] + this.yyleng - P]), 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(), P = new Array(m.length + 1).join("-"); return m + this.upcomingInput() + ` ` + P + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match: function(m, P) { var L, T, M; if (this.options.backtrack_lexer && (M = { 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 && (M.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], L = this.performAction.call(this, this.yy, this, P, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), L) return L; if (this._backtrack) { for (var l in M) this[l] = M[l]; return !1; } return !1; }, // return next match in input next: function() { if (this.done) return this.EOF; this._input || (this.done = !0); var m, P, L, T; this._more || (this.yytext = "", this.match = ""); for (var M = this._currentRules(), l = 0; l < M.length; l++) if (L = this._input.match(this.rules[M[l]]), L && (!P || L[0].length > P[0].length)) { if (P = L, T = l, this.options.backtrack_lexer) { if (m = this.test_match(L, M[l]), m !== !1) return m; if (this._backtrack) { P = !1; continue; } else return !1; } else if (!this.options.flex) break; } return P ? (m = this.test_match(P, M[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 P = this.next(); return P || this.lex(); }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: function(P) { this.conditionStack.push(P); }, // pop the previously active lexer condition state off the condition stack popState: function() { var P = this.conditionStack.length - 1; return P > 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(P) { return P = this.conditionStack.length - 1 - Math.abs(P || 0), P >= 0 ? this.conditionStack[P] : "INITIAL"; }, // alias for begin(condition) pushState: function(P) { this.begin(P); }, // return the number of states currently on the stack stateStackSize: function() { return this.conditionStack.length; }, options: { "case-insensitive": !0 }, performAction: function(P, L, T, M) { switch (T) { case 0: return 5; case 1: break; case 2: break; case 3: break; case 4: break; case 5: break; case 6: return 19; case 7: return this.begin("LINE"), 14; case 8: return this.begin("ID"), 50; case 9: return this.begin("ID"), 52; case 10: return 13; case 11: return this.begin("ID"), 53; case 12: return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 70; case 13: return this.popState(), this.popState(), this.begin("LINE"), 51; case 14: return this.popState(), this.popState(), 5; case 15: return this.begin("LINE"), 36; case 16: return this.begin("LINE"), 37; case 17: return this.begin("LINE"), 38; case 18: return this.begin("LINE"), 39; case 19: return this.begin("LINE"), 49; case 20: return this.begin("LINE"), 41; case 21: return this.begin("LINE"), 43; case 22: return this.begin("LINE"), 48; case 23: return this.begin("LINE"), 44; case 24: return this.begin("LINE"), 47; case 25: return this.begin("LINE"), 46; case 26: return this.popState(), 15; case 27: return 16; case 28: return 65; case 29: return 66; case 30: return 59; case 31: return 60; case 32: return 61; case 33: return 62; case 34: return 57; case 35: return 54; case 36: return this.begin("ID"), 21; case 37: return this.begin("ID"), 23; case 38: return 29; case 39: return 30; case 40: return this.begin("acc_title"), 31; case 41: return this.popState(), "acc_title_value"; case 42: return this.begin("acc_descr"), 33; case 43: return this.popState(), "acc_descr_value"; case 44: this.begin("acc_descr_multiline"); break; case 45: this.popState(); break; case 46: return "acc_descr_multiline_value"; case 47: return 6; case 48: return 18; case 49: return 20; case 50: return 64; case 51: return 5; case 52: return L.yytext = L.yytext.trim(), 70; case 53: return 73; case 54: return 74; case 55: return 71; case 56: return 72; case 57: return 75; case 58: return 76; case 59: return 77; case 60: return 78; case 61: return 79; case 62: return 68; case 63: return 69; case 64: return 5; case 65: return "INVALID"; } }, rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i], conditions: { acc_descr_multiline: { rules: [45, 46], inclusive: !1 }, acc_descr: { rules: [43], inclusive: !1 }, acc_title: { rules: [41], inclusive: !1 }, ID: { rules: [2, 3, 12], inclusive: !1 }, ALIAS: { rules: [2, 3, 13, 14], inclusive: !1 }, LINE: { rules: [2, 3, 26], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65], inclusive: !0 } } }; return ht; }(); Ct.lexer = me; function Ot() { this.yy = {}; } return Ot.prototype = Ct, Ct.Parser = Ot, new Ot(); }(); qt.parser = qt; const Fe = qt; let Pt, ct = {}, Xt = {}, Jt = {}, mt = [], J = [], Dt = !1, zt, ot, kt, Et; const We = function(t) { mt.push({ name: t.text, wrap: t.wrap === void 0 && xt() || !!t.wrap, fill: t.color, actorKeys: [] }), ot = mt.slice(-1)[0]; }, Ht = function(t, e, o, n) { let i = ot; const s = ct[t]; if (s) { if (ot && s.box && ot !== 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 '" + ot.name + "' at the same time." ); if (i = s.box ? s.box : ot, 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 }), ct[t] = { box: i, name: e, description: o.text, wrap: o.wrap === void 0 && xt() || !!o.wrap, prevActor: Pt, links: {}, properties: {}, actorCnt: null, rectData: null, type: n || "participant" }, Pt && ct[Pt] && (ct[Pt].nextActor = t), ot && ot.actorKeys.push(t), Pt = t; }, qe = (t) => { let e, o = 0; for (e = 0; e < J.length; e++) J[e].type === Lt.ACTIVE_START && J[e].from.actor === t && o++, J[e].type === Lt.ACTIVE_END && J[e].from.actor === t && o--; return o; }, ze = function(t, e, o, n) { J.push({ from: t, to: e, message: o.text, wrap: o.wrap === void 0 && xt() || !!o.wrap, answer: n }); }, D = function(t, e, o = { text: void 0, wrap: void 0 }, n, i = !1) { if (n === Lt.ACTIVE_END && qe(t.actor) < 1) { let c = new Error("Trying to inactivate an inactive participant (" + t.actor + ")"); throw c.hash = { text: "->>-", token: "->>-", line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["'ACTIVE_PARTICIPANT'"] }, c; } return J.push({ from: t, to: e, message: o.text, wrap: o.wrap === void 0 && xt() || !!o.wrap, type: n, activate: i }), !0; }, He = function() { return mt.length > 0; }, Ue = function() { return mt.some((t) => t.name); }, Ke = function() { return J; }, Ge = function() { return mt; }, Xe = function() { return ct; }, Je = function() { return Xt; }, Ze = function() { return Jt; }, It = function(t) { return ct[t]; }, Qe = function() { return Object.keys(ct); }, je = function() { Dt = !0; }, $e = function() { Dt = !1; }, t0 = () => Dt, e0 = function(t) { zt = t; }, xt = () => zt !== void 0 ? zt : dt().sequence.wrap, n0 = function() { ct = {}, Xt = {}, Jt = {}, mt = [], J = [], Dt = !1, Se(); }, i0 = 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 U.debug("parseMessage:", o), o; }, s0 = 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:/, ""), dt()) : 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 }, a0 = { FILLED: 0, OPEN: 1 }, r0 = { LEFTOF: 0, RIGHTOF: 1, OVER: 2 }, ce = function(t, e, o) { o.text, o.wrap === void 0 && xt() || o.wrap; const n = [].concat(t, t); J.push({ from: n[0], to: n[1], message: o.text, wrap: o.wrap === void 0 && xt() || !!o.wrap, type: Lt.NOTE, placement: e }); }, le = function(t, e) { const o = It(t); try { let n = Mt(e.text, dt()); n = n.replace(/&/g, "&"), n = n.replace(/=/g, "="); const i = JSON.parse(n); Zt(o, i); } catch (n) { U.error("error while parsing actor link text", n); } }, o0 = function(t, e) { const o = It(t); try { const c = {}; let h = Mt(e.text, dt()); 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(); c[i] = s, Zt(o, c); } catch (c) { U.error("error while parsing actor link text", c); } }; function Zt(t, e) { if (t.links == null) t.links = e; else for (let o in e) t.links[o] = e[o]; } const he = function(t, e) { const o = It(t); try { let n = Mt(e.text, dt()); const i = JSON.parse(n); de(o, i); } catch (n) { U.error("error while parsing actor properties text", n); } }; function de(t, e) { if (t.properties == null) t.properties = e; else for (let o in e) t.properties[o] = e[o]; } function c0() { ot = void 0; } const ue = function(t, e) { const o = It(t), n = document.getElementById(e.text); try { const i = n.innerHTML, s = JSON.parse(i); s.properties && de(o, s.properties), s.links && Zt(o, s.links); } catch (i) { U.error("error while parsing actor details text", i); } }, l0 = function(t, e) { if (t !== void 0 && t.properties !== void 0) return t.properties[e]; }, pe = function(t) { if (Array.isArray(t)) t.forEach(function(e) { pe(e); }); else switch (t.type) { case "sequenceIndex": J.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": Ht(t.actor, t.actor, t.description, t.draw); break; case "createParticipant": if (ct[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" ); kt = t.actor, Ht(t.actor, t.actor, t.description, t.draw), Xt[t.actor] = J.length; break; case "destroyParticipant": Et = t.actor, Jt[t.actor] = J.length; break; case "activeStart": D(t.actor, void 0, void 0, t.signalType); break; case "activeEnd": D(t.actor, void 0, void 0, t.signalType); break; case "addNote": ce(t.actor, t.placement, t.text); break; case "addLinks": le(t.actor, t.text); break; case "addALink": o0(t.actor, t.text); break; case "addProperties": he(t.actor, t.text); break; case "addDetails": ue(t.actor, t.text); break; case "addMessage": if (kt) { if (t.to !== kt) throw new Error( "The created participant " + kt + " does not have an associated creating message after its declaration. Please check the sequence diagram." ); kt = 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; } D(t.from, t.to, t.msg, t.signalType, t.activate); break; case "boxStart": We(t.boxData); break; case "boxEnd": c0(); break; case "loopStart": D(void 0, void 0, t.loopText, t.signalType); break; case "loopEnd": D(void 0, void 0, void 0, t.signalType); break; case "rectStart": D(void 0, void 0, t.color, t.signalType); break; case "rectEnd": D(void 0, void 0, void 0, t.signalType); break; case "optStart": D(void 0, void 0, t.optText, t.signalType); break; case "optEnd": D(void 0, void 0, void 0, t.signalType); break; case "altStart": D(void 0, void 0, t.altText, t.signalType); break; case "else": D(void 0, void 0, t.altText, t.signalType); break; case "altEnd": D(void 0, void 0, void 0, t.signalType); break; case "setAccTitle": ae(t.text); break; case "parStart": D(void 0, void 0, t.parText, t.signalType); break; case "and": D(void 0, void 0, t.parText, t.signalType); break; case "parEnd": D(void 0, void 0, void 0, t.signalType); break; case "criticalStart": D(void 0, void 0, t.criticalText, t.signalType); break; case "option": D(void 0, void 0, t.optionText, t.signalType); break; case "criticalEnd": D(void 0, void 0, void 0, t.signalType); break; case "breakStart": D(void 0, void 0, t.breakText, t.signalType); break; case "breakEnd": D(void 0, void 0, void 0, t.signalType); break; } }, ie = { addActor: Ht, addMessage: ze, addSignal: D, addLinks: le, addDetails: ue, addProperties: he, autoWrap: xt, setWrap: e0, enableSequenceNumbers: je, disableSequenceNumbers: $e, showSequenceNumbers: t0, getMessages: Ke, getActors: Xe, getCreatedActors: Je, getDestroyedActors: Ze, getActor: It, getActorKeys: Qe, getActorProperty: l0, getAccTitle: Le, getBoxes: Ge, getDiagramTitle: Ie, setDiagramTitle: Ae, getConfig: () => dt().sequence, clear: n0, parseMessage: i0, parseBoxData: s0, LINETYPE: Lt, ARROWTYPE: a0, PLACEMENT: r0, addNote: ce, setAccTitle: ae, apply: pe, setAccDescription: Ne, getAccDescription: ve, hasAtLeastOneBox: He, hasAtLeastOneBoxWithTitle: Ue }, h0 = (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: #decc93; stroke: ${t.noteBorderColor}; fill: ${t.noteBkgColor}; } .noteText, .noteText > tspan { fill: ${t.noteTextColor}; stroke: none; } .activation0 { fill: ${t.activationBkgColor}; stroke: ${t.activationBorderColor}; } .activation1 { fill: ${t.activationBkgColor}; stroke: ${t.activationBorderColor}; } .activation2 { fill: ${t.activationBkgColor}; stroke: ${t.activationBorderColor}; } .actorPopupMenu { position: absolute; } .actorPopupMenuPanel { position: absolute; fill: ${t.actorBkg}; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); } .actor-man line { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; } .actor-man circle, line { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: 2px; } `, d0 = h0, gt = 18 * 2, Qt = function(t, e) { return Ce(t, e); }, fe = (t, e) => { Me(() => { const o = document.querySelectorAll(t); o.length !== 0 && (o[0].addEventListener("mouseover", function() { g0("actor" + e + "_popup"); }), o[0].addEventListener("mouseout", function() { x0("actor" + e + "_popup"); })); }); }, u0 = function(t, e, o, n, i) { if (e.links === void 0 || e.links === null || Object.keys(e.links).length === 0) return { height: 0, width: 0 }; const s = e.links, c = e.actorCnt, h = e.rectData; var u = "none"; i && (u = "block !important"); const a = t.append("g"); a.attr("id", "actor" + c + "_popup"), a.attr("class", "actorPopupMenu"), a.attr("display", u), fe("#actor" + c + "_popup", c); var x = ""; h.class !== void 0 && (x = " " + h.class); let E = h.width > o ? h.width : o; const p = a.append("rect"); if (p.attr("class", "actorPopupMenuPanel" + x), p.attr("x", h.x), p.attr("y", h.height), p.attr("fill", h.fill), p.attr("stroke", h.stroke), p.attr("width", E), p.attr("height", h.height), p.attr("rx", h.rx), p.attr("ry", h.ry), s != null) { var g = 20; for (let A in s) { var b = a.append("a"), k = re(s[A]); b.attr("xlink:href", k), b.attr("target", "_blank"), M0(n)( A, b, h.x + 10, h.height + g, E, 20, { class: "actor" }, n ), g += 30; } } return p.attr("height", g), { height: h.height + g, width: E }; }, p0 = function(t) { return "var pu = document.getElementById('" + t + "'); if (pu != null) { pu.style.display = 'block'; }"; }, f0 = function(t) { return "var pu = document.getElementById('" + t + "'); if (pu != null) { pu.style.display = 'none'; }"; }, g0 = function(t) { var e = document.getElementById(t); e != null && (e.style.display = "block"); }, x0 = function(t) { var e = document.getElementById(t); e != null && (e.style.display = "none"); }, wt = function(t, e) { let o = 0, n = 0; const i = e.text.split(w.lineBreakRegex), [s, c] = oe(e.fontSize); let h = [], u = 0, a = () => e.y; if (e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0) switch (e.valign) { case "top": case "start": a = () => Math.round(e.y + e.textMargin); break; case "middle": case "center": a = () => Math.round(e.y + (o + n + e.textMargin) / 2); break; case "bottom": case "end": a = () => Math.round( e.y + (o + n + 2 * e.textMargin) - e.textMargin ); break; } if (e.anchor !== void 0 && e.textMargin !== void 0 && e.width !== void 0) switch (e.anchor) { case "left": case "start": e.x = Math.round(e.x + e.textMargin), e.anchor = "start", e.dominantBaseline = "middle", e.alignmentBaseline = "middle"; break; case "middle": case "center": e.x = Math.round(e.x + e.width / 2), e.anchor = "middle", e.dominantBaseline = "middle", e.alignmentBaseline = "middle"; break; case "right": case "end": e.x = Math.round(e.x + e.width - e.textMargin), e.anchor = "end", e.dominantBaseline = "middle", e.alignmentBaseline = "middle"; break; } for (let [x, E] of i.entries()) { e.textMargin !== void 0 && e.textMargin === 0 && s !== void 0 && (u = x * s); const p = t.append("text"); p.attr("x", e.x), p.attr("y", a()), e.anchor !== void 0 && p.attr("text-anchor", e.anchor).attr("dominant-baseline", e.dominantBaseline).attr("alignment-baseline", e.alignmentBaseline), e.fontFamily !== void 0 && p.style("font-family", e.fontFamily), c !== void 0 && p.style("font-size", c), e.fontWeight !== void 0 && p.style("font-weight", e.fontWeight), e.fill !== void 0 && p.attr("fill", e.fill), e.class !== void 0 && p.attr("class", e.class), e.dy !== void 0 ? p.attr("dy", e.dy) : u !== 0 && p.attr("dy", u); const g = E || Re; if (e.tspan) { const b = p.append("tspan"); b.attr("x", e.x), e.fill !== void 0 && b.attr("fill", e.fill), b.text(g); } else p.text(g); e.valign !== void 0 && e.textMargin !== void 0 && e.textMargin > 0 && (n += (p._groups || p)[0][0].getBBox().height, o = n), h.push(p); } return h; }, ge = function(t, e) { function o(i, s, c, h, u) { return i + "," + s + " " + (i + c) + "," + s + " " + (i + c) + "," + (s + h - u) + " " + (i + c - u * 1.2) + "," + (s + h) + " " + i + "," + (s + h); } const n = t.append("polygon"); return n.attr("points", o(e.x, e.y, e.width, e.height, 7)), n.attr("class", "labelBox"), e.y = e.y + e.height / 2, wt(t, e), n; }; let nt = -1; const xe = (t, e, o, n) => { t.select && o.forEach((i) => { const s = e[i], c = t.select("#actor" + s.actorCnt); !n.mirrorActors && s.stopy ? c.attr("y2", s.stopy + s.height / 2) : n.mirrorActors && c.attr("y2", s.stopy); }); }, T0 = function(t, e, o, n) { const i = n ? e.stopy : e.starty, s = e.x + e.width / 2, c = i + 5, h = t.append("g").lower(); var u = h; n || (nt++, u.append("line").attr("id", "actor" + nt).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line").attr("class", "200").attr("stroke-width", "0.5px").attr("stroke", "#999"), u = h.append("g"), e.actorCnt = nt, e.links != null && (u.attr("id", "root-" + nt), fe("#root-" + nt, nt))); const a = Rt(); var x = "actor"; e.properties != null && e.properties.class ? x = e.properties.class : a.fill = "#eaeaea", a.x = e.x, a.y = i, a.width = e.width, a.height = e.height, a.class = x, a.rx = 3, a.ry = 3; const E = Qt(u, a); if (e.rectData = a, e.properties != null && e.properties.icon) { const g = e.properties.icon.trim(); g.charAt(0) === "@" ? Be(u, a.x + a.width - 20, a.y + 10, g.substr(1)) : Ye(u, a.x + a.width - 20, a.y + 10, g); } jt(o)( e.description, u, a.x, a.y, a.width, a.height, { class: "actor" }, o ); let p = e.height; if (E.node) { const g = E.node().getBBox(); e.height = g.height, p = g.height; } return p; }, y0 = function(t, e, o, n) { const i = n ? e.stopy : e.starty, s = e.x + e.width / 2, c = i + 80; t.lower(), n || (nt++, t.append("line").attr("id", "actor" + nt).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line").attr("class", "200").attr("stroke-width", "0.5px").attr("stroke", "#999"), e.actorCnt = nt); const h = t.append("g"); h.attr("class", "actor-man"); const u = Rt(); u.x = e.x, u.y = i, u.fill = "#eaeaea", u.width = e.width, u.height = e.height, u.class = "actor", u.rx = 3, u.ry = 3, h.append("line").attr("id", "actor-man-torso" + nt).attr("x1", s).attr("y1", i + 25).attr("x2", s).attr("y2", i + 45), h.append("line").attr("id", "actor-man-arms" + nt).attr("x1", s - gt / 2).attr("y1", i + 33).attr("x2", s + gt / 2).attr("y2", i + 33), h.append("line").attr("x1", s - gt / 2).attr("y1", i + 60).attr("x2", s).attr("y2", i + 45), h.append("line").attr("x1", s).attr("y1", i + 45).attr("x2", s + gt / 2 - 2).attr("y2", i + 60); const a = h.append("circle"); a.attr("cx", e.x + e.width / 2), a.attr("cy", i + 10), a.attr("r", 15), a.attr("width", e.width), a.attr("height", e.height); const x = h.node().getBBox(); return e.height = x.height, jt(o)( e.description, h, u.x, u.y + 35, u.width, u.height, { class: "actor" }, o ), e.height; }, E0 = function(t, e, o, n) { switch (e.type) { case "actor": return y0(t, e, o, n); case "participant": return T0(t, e, o, n); } }, b0 = function(t, e, o) { const i = t.append("g"); Te(i, e), e.name && jt(o)( e.name, i, e.x, e.y + (e.textMaxHeight || 0) / 2, e.width, 0, { class: "text" }, o ), i.lower(); }, m0 = function(t) { return t.append("g"); }, w0 = function(t, e, o, n, i) { const s = Rt(), c = e.anchored; s.x = e.startx, s.y = e.starty, s.class = "activation" + i % 3, s.width = e.stopx - e.startx, s.height = o - e.starty, Qt(c, s); }, _0 = function(t, e, o, n) { const { boxMargin: i, boxTextMargin: s, labelBoxHeight: c, labelBoxWidth: h, messageFontFamily: u, messageFontSize: a, messageFontWeight: x } = n, E = t.append("g"), p = function(k, A, R, v) { return E.append("line").attr("x1", k).attr("y1", A).attr("x2", R).attr("y2", v).attr("class", "loopLine"); }; p(e.startx, e.starty, e.stopx, e.starty), p(e.stopx, e.starty, e.stopx, e.stopy), p(e.startx, e.stopy, e.stopx, e.stopy), p(e.startx, e.starty, e.startx, e.stopy), e.sections !== void 0 && e.sections.forEach(function(k) { p(e.startx, k.y, e.stopx, k.y).style( "stroke-dasharray", "3, 3" ); }); let g = Gt(); g.text = o, g.x = e.startx, g.y = e.starty, g.fontFamily = u, g.fontSize = a, g.fontWeight = x, g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.width = h || 50, g.height = c || 20, g.textMargin = s, g.class = "labelText", ge(E, g), g = ye(), g.text = e.title, g.x = e.startx + h / 2 + (e.stopx - e.startx) / 2, g.y = e.starty + i + s, g.anchor = "middle", g.valign = "middle", g.textMargin = s, g.class = "loopText", g.fontFamily = u, g.fontSize = a, g.fontWeight = x, g.wrap = !0; let b = wt(E, g); return e.sectionTitles !== void 0 && e.sectionTitles.forEach(function(k, A) { if (k.message) { g.text = k.message, g.x = e.startx + (e.stopx - e.startx) / 2, g.y = e.sections[A].y + i + s, g.class = "loopText", g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.fontFamily = u, g.fontSize = a, g.fontWeight = x, g.wrap = e.wrap, b = wt(E, g); let R = Math.round( b.map((v) => (v._groups || v)[0][0].getBBox().height).reduce((v, F) => v + F) ); e.sections[A].height += R - (i + s); } }), e.height = Math.round(e.stopy - e.starty), E; }, Te = function(t, e) { Oe(t, e); }, P0 = function(t) { t.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" ); }, k0 = function(t) { t.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" ); }, L0 = function(t) { t.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" ); }, I0 = function(t) { t.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").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z"); }, A0 = function(t) { t.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"); }, N0 = function(t) { t.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); }, v0 = function(t) { t.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"); }, ye = function() { return { x: 0, y: 0, fill: void 0, anchor: void 0, style: "#666", width: void 0, height: void 0, textMargin: 0, rx: 0, ry: 0, tspan: !0, valign: void 0 }; }, S0 = function() { return { x: 0, y: 0, fill: "#EDF2AE", stroke: "#666", width: 100, anchor: "start", height: 100, rx: 0, ry: 0 }; }, jt = function() { function t(i, s, c, h, u, a, x) { const E = s.append("text").attr("x", c + u / 2).attr("y", h + a / 2 + 5).style("text-anchor", "middle").text(i); n(E, x); } function e(i, s, c, h, u, a, x, E) { const { actorFontSize: p, actorFontFamily: g, actorFontWeight: b } = E, [k, A] = oe(p), R = i.split(w.lineBreakRegex); for (let v = 0; v < R.length; v++) { const F = v * k - k * (R.length - 1) / 2, S = s.append("text").attr("x", c + u / 2).attr("y", h).style("text-anchor", "middle").style("font-size", A).style("font-weight", b).style("font-family", g); S.append("tspan").attr("x", c + u / 2).attr("dy", F).text(R[v]), S.attr("y", h + a / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), n(S, x); } } function o(i, s, c, h, u, a, x, E) { const p = s.append("switch"), b = p.append("foreignObject").attr("x", c).attr("y", h).attr("width", u).attr("height", a).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); b.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), e(i, p, c, h, u, a, x, E), n(b, x); } function n(i, s) { for (const c in s) s.hasOwnProperty(c) && i.attr(c, s[c]); } return function(i) { return i.textPlacement === "fo" ? o : i.textPlacement === "old" ? t : e; }; }(), M0 = function() { function t(i, s, c, h, u, a, x) { const E = s.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").text(i); n(E, x); } function e(i, s, c, h, u, a, x, E) { const { actorFontSize: p, actorFontFamily: g, actorFontWeight: b } = E, k = i.split(w.lineBreakRegex); for (let A = 0; A < k.length; A++) { const R = A * p - p * (k.length - 1) / 2, v = s.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").style("font-size", p).style("font-weight", b).style("font-family", g); v.append("tspan").attr("x", c).attr("dy", R).text(k[A]), v.attr("y", h + a / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), n(v, x); } } function o(i, s, c, h, u, a, x, E) { const p = s.append("switch"), b = p.append("foreignObject").attr("x", c).attr("y", h).attr("width", u).attr("height", a).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); b.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), e(i, p, c, h, u, a, x, E), n(b, x); } function n(i, s) { for (const c in s) s.hasOwnProperty(c) && i.attr(c, s[c]); } return function(i) { return i.textPlacement === "fo" ? o : i.textPlacement === "old" ? t : e; }; }(), V = { drawRect: Qt, drawText: wt, drawLabel: ge, drawActor: E0, drawBox: b0, drawPopup: u0, anchorElement: m0, drawActivation: w0, drawLoop: _0, drawBackgroundRect: Te, insertArrowHead: I0, insertArrowFilledHead: A0, insertSequenceNumber: N0, insertArrowCrossHead: v0, insertDatabaseIcon: P0, insertComputerIcon: k0, insertClockIcon: L0, getTextObj: ye, getNoteRect: S0, popupMenu: p0, popdownMenu: f0, fixLifeLineHeights: xe, sanitizeUrl: re }; let r = {}; const f = { data: { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }, verticalPos: 0, sequenceItems: [], activations: [], models: { getHeight: function() { return Math.max.apply( null, this.actors.length === 0 ? [0] : this.actors.map((t) => t.height || 0) ) + (this.loops.length === 0 ? 0 : this.loops.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.messages.length === 0 ? 0 : this.messages.map((t) => t.height || 0).reduce((t, e) => t + e)) + (this.notes.length === 0 ? 0 : this.notes.map((t) => t.height || 0).reduce((t, e) => t + e)); }, clear: function() { this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = []; }, addBox: function(t) { this.boxes.push(t); }, addActor: function(t) { this.actors.push(t); }, addLoop: function(t) { this.loops.push(t); }, addMessage: function(t) { this.messages.push(t); }, addNote: function(t) { this.notes.push(t); }, lastActor: function() { return this.actors[this.actors.length - 1]; }, lastLoop: function() { return this.loops[this.loops.length - 1]; }, lastMessage: function() { return this.messages[this.messages.length - 1]; }, lastNote: function() { return this.notes[this.notes.length - 1]; }, actors: [], boxes: [], loops: [], messages: [], notes: [] }, init: function() { this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }, this.verticalPos = 0, be(dt()); }, updateVal: function(t, e, o, n) { t[e] === void 0 ? t[e] = o : t[e] = n(o, t[e]); }, updateBounds: function(t, e, o, n) { const i = this; let s = 0; function c(h) { return function(a) { s++; const x = i.sequenceItems.length - s + 1; i.updateVal(a, "starty", e - x * r.boxMargin, Math.min), i.updateVal(a, "stopy", n + x * r.boxMargin, Math.max), i.updateVal(f.data, "startx", t - x * r.boxMargin, Math.min), i.updateVal(f.data, "stopx", o + x * r.boxMargin, Math.max), h !== "activation" && (i.updateVal(a, "startx", t - x * r.boxMargin, Math.min), i.updateVal(a, "stopx", o + x * r.boxMargin, Math.max), i.updateVal(f.data, "starty", e - x * r.boxMargin, Math.min), i.updateVal(f.data, "stopy", n + x * r.boxMargin, Math.max)); }; } this.sequenceItems.forEach(c()), this.activations.forEach(c("activation")); }, insert: function(t, e, o, n) { const i = w.getMin(t, o), s = w.getMax(t, o), c = w.getMin(e, n), h = w.getMax(e, n); this.updateVal(f.data, "startx", i, Math.min), this.updateVal(f.data, "starty", c, Math.min), this.updateVal(f.data, "stopx", s, Math.max), this.updateVal(f.data, "stopy", h, Math.max), this.updateBounds(i, c, s, h); }, newActivation: function(t, e, o) { const n = o[t.from.actor], i = Vt(t.from.actor).length || 0, s = n.x + n.width / 2 + (i - 1) * r.activationWidth / 2; this.activations.push({ startx: s, starty: this.verticalPos + 2, stopx: s + r.activationWidth, stopy: void 0, actor: t.from.actor, anchored: V.anchorElement(e) }); }, endActivation: function(t) { const e = this.activations.map(function(o) { return o.actor; }).lastIndexOf(t.from.actor); return this.activations.splice(e, 1)[0]; }, createLoop: function(t = { message: void 0, wrap: !1, width: void 0 }, e) { return { startx: void 0, starty: this.verticalPos, stopx: void 0, stopy: void 0, title: t.message, wrap: t.wrap, width: t.width, height: 0, fill: e }; }, newLoop: function(t = { message: void 0, wrap: !1, width: void 0 }, e) { this.sequenceItems.push(this.createLoop(t, e)); }, endLoop: function() { return this.sequenceItems.pop(); }, isLoopOverlap: function() { return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1; }, addSectionToLoop: function(t) { const e = this.sequenceItems.pop(); e.sections = e.sections || [], e.sectionTitles = e.sectionTitles || [], e.sections.push({ y: f.getVerticalPos(), height: 0 }), e.sectionTitles.push(t), this.sequenceItems.push(e); }, saveVerticalPos: function() { this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos); }, resetVerticalPos: function() { this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos); }, bumpVerticalPos: function(t) { this.verticalPos = this.verticalPos + t, this.data.stopy = w.getMax(this.data.stopy, this.verticalPos); }, getVerticalPos: function() { return this.verticalPos; }, getBounds: function() { return { bounds: this.data, models: this.models }; } }, R0 = function(t, e) { f.bumpVerticalPos(r.boxMargin), e.height = r.boxMargin, e.starty = f.getVerticalPos(); const o = Rt(); o.x = e.startx, o.y = e.starty, o.width = e.width || r.width, o.class = "note"; const n = t.append("g"), i = V.drawRect(n, o), s = Gt(); s.x = e.startx, s.y = e.starty, s.width = o.width, s.dy = "1em", s.text = e.message, s.class = "noteText", s.fontFamily = r.noteFontFamily, s.fontSize = r.noteFontSize, s.fontWeight = r.noteFontWeight, s.anchor = r.noteAlign, s.textMargin = r.noteMargin, s.valign = "center"; const c = wt(n, s), h = Math.round( c.map((u) => (u._groups || u)[0][0].getBBox().height).reduce((u, a) => u + a) ); i.attr("height", h + 2 * r.noteMargin), e.height += h + 2 * r.noteMargin, f.bumpVerticalPos(h + 2 * r.noteMargin), e.stopy = e.starty + h + 2 * r.noteMargin, e.stopx = e.startx + o.width, f.insert(e.startx, e.starty, e.stopx, e.stopy), f.models.addNote(e); }, Tt = (t) => ({ fontFamily: t.messageFontFamily, fontSize: t.messageFontSize, fontWeight: t.messageFontWeight }), bt = (t) => ({ fontFamily: t.noteFontFamily, fontSize: t.noteFontSize, fontWeight: t.noteFontWeight }), Ut = (t) => ({ fontFamily: t.actorFontFamily, fontSize: t.actorFontSize, fontWeight: t.actorFontWeight }); function D0(t, e) { f.bumpVerticalPos(10); const { startx: o, stopx: n, message: i } = e, s = w.splitBreaks(i).length, c = O.calculateTextDimensions(i, Tt(r)), h = c.height / s; e.height += h, f.bumpVerticalPos(h); let u, a = c.height - 10; const x = c.width; if (o === n) { u = f.getVerticalPos() + a, r.rightAngles || (a += r.boxMargin, u = f.getVerticalPos() + a), a += 30; const E = w.getMax(x / 2, r.width / 2); f.insert( o - E, f.getVerticalPos() - 10 + a, n + E, f.getVerticalPos() + 30 + a ); } else a += r.boxMargin, u = f.getVerticalPos() + a, f.insert(o, u - 10, n, u); return f.bumpVerticalPos(a), e.height += a, e.stopy = e.starty + e.height, f.insert(e.fromBounds, e.starty, e.toBounds, e.stopy), u; } const V0 = function(t, e, o, n) { const { startx: i, stopx: s, starty: c, message: h, type: u, sequenceIndex: a, sequenceVisible: x } = e, E = O.calculateTextDimensions(h, Tt(r)), p = Gt(); p.x = i, p.y = c + 10, p.width = s - i, p.class = "messageText", p.dy = "1em", p.text = h, p.fontFamily = r.messageFontFamily, p.fontSize = r.messageFontSize, p.fontWeight = r.messageFontWeight, p.anchor = r.messageAlign, p.valign = "center", p.textMargin = r.wrapPadding, p.tspan = !1, wt(t, p); const g = E.width; let b; i === s ? r.rightAngles ? b = t.append("path").attr( "d", `M ${i},${o} H ${i + w.getMax(r.width / 2, g / 2)} V ${o + 25} H ${i}` ) : b = t.append("path").attr( "d", "M " + i + "," + o + " C " + (i + 60) + "," + (o - 10) + " " + (i + 60) + "," + (o + 30) + " " + i + "," + (o + 20) ) : (b = t.append("line"), b.attr("x1", i), b.attr("y1", o), b.attr("x2", s), b.attr("y2", o)), u === n.db.LINETYPE.DOTTED || u === n.db.LINETYPE.DOTTED_CROSS || u === n.db.LINETYPE.DOTTED_POINT || u === n.db.LINETYPE.DOTTED_OPEN ? (b.style("stroke-dasharray", "3, 3"), b.attr("class", "messageLine1")) : b.attr("class", "messageLine0"); let k = ""; r.arrowMarkerAbsolute && (k = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, k = k.replace(/\(/g, "\\("), k = k.replace(/\)/g, "\\)")), b.attr("stroke-width", 2), b.attr("stroke", "none"), b.style("fill", "none"), (u === n.db.LINETYPE.SOLID || u === n.db.LINETYPE.DOTTED) && b.attr("marker-end", "url(" + k + "#arrowhead)"), (u === n.db.LINETYPE.SOLID_POINT || u === n.db.LINETYPE.DOTTED_POINT) && b.attr("marker-end", "url(" + k + "#filled-head)"), (u === n.db.LINETYPE.SOLID_CROSS || u === n.db.LINETYPE.DOTTED_CROSS) && b.attr("marker-end", "url(" + k + "#crosshead)"), (x || r.showSequenceNumbers) && (b.attr("marker-start", "url(" + k + "#sequencenumber)"), t.append("text").attr("x", i).attr("y", o + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(a)); }, C0 = function(t, e, o, n, i, s, c) { let h = 0, u = 0, a, x = 0; for (const E of n) { const p = e[E], g = p.box; a && a != g && (c || f.models.addBox(a), u += r.boxMargin + a.margin), g && g != a && (c || (g.x = h + u, g.y = i), u += g.margin), p.width = p.width || r.width, p.height = w.getMax(p.height || r.height, r.height), p.margin = p.margin || r.actorMargin, x = w.getMax(x, p.height), o[p.name] && (u += p.width / 2), p.x = h + u, p.starty = f.getVerticalPos(), f.insert(p.x, i, p.x + p.width, p.height), h += p.width + u, p.box && (p.box.width = h + g.margin - p.box.x), u = p.margin, a = p.box, f.models.addActor(p); } a && !c && f.models.addBox(a), f.bumpVerticalPos(x); }, Kt = function(t, e, o, n) { if (n) { let i = 0; f.bumpVerticalPos(r.boxMargin * 2); for (const s of o) { const c = e[s]; c.stopy || (c.stopy = f.getVerticalPos()); const h = V.drawActor(t, c, r, !0); i = w.getMax(i, h); } f.bumpVerticalPos(i + r.boxMargin); } else for (const i of o) { const s = e[i]; V.drawActor(t, s, r, !1); } }, Ee = function(t, e, o, n) { let i = 0, s = 0; for (const c of o) { const h = e[c], u = F0(h), a = V.drawPopup( t, h, u, r, r.forceMenus, n ); a.height > i && (i = a.height), a.width + h.x > s && (s = a.width + h.x); } return { maxHeight: i, maxWidth: s }; }, be = function(t) { De(r, t), t.fontFamily && (r.actorFontFamily = r.noteFontFamily = r.messageFontFamily = t.fontFamily), t.fontSize && (r.actorFontSize = r.noteFontSize = r.messageFontSize = t.fontSize), t.fontWeight && (r.actorFontWeight = r.noteFontWeight = r.messageFontWeight = t.fontWeight); }, Vt = function(t) { return f.activations.filter(function(e) { return e.actor === t; }); }, se = function(t, e) { const o = e[t], n = Vt(t), i = n.reduce(function(c, h) { return w.getMin(c, h.startx); }, o.x + o.width / 2 - 1), s = n.reduce(function(c, h) { return w.getMax(c, h.stopx); }, o.x + o.width / 2 + 1); return [i, s]; }; function it(t, e, o, n, i) { f.bumpVerticalPos(o); let s = n; if (e.id && e.message && t[e.id]) { const c = t[e.id].width, h = Tt(r); e.message = O.wrapLabel(`[${e.message}]`, c - 2 * r.wrapPadding, h), e.width = c, e.wrap = !0; const u = O.calculateTextDimensions(e.message, h), a = w.getMax(u.height, r.labelBoxHeight); s = n + a, U.debug(`${a} - ${e.message}`); } i(e), f.bumpVerticalPos(s); } function O0(t, e, o, n, i, s, c) { function h(a, x) { a.x < i[t.from].x ? (f.insert( e.stopx - x, e.starty, e.startx, e.stopy + a.height / 2 + r.noteMargin ), e.stopx = e.stopx + x) : (f.insert( e.startx, e.starty, e.stopx + x, e.stopy + a.height / 2 + r.noteMargin ), e.stopx = e.stopx - x); } function u(a, x) { a.x < i[t.to].x ? (f.insert( e.startx - x, e.starty, e.stopx, e.stopy + a.height / 2 + r.noteMargin ), e.startx = e.startx + x) : (f.insert( e.stopx, e.starty, e.startx + x, e.stopy + a.height / 2 + r.noteMargin ), e.startx = e.startx - x); } if (s[t.to] == n) { const a = i[t.to], x = a.type == "actor" ? gt / 2 + 3 : a.width / 2 + 3; h(a, x), a.starty = o - a.height / 2, f.bumpVerticalPos(a.height / 2); } else if (c[t.from] == n) { const a = i[t.from]; if (r.mirrorActors) { const x = a.type == "actor" ? gt / 2 : a.width / 2; u(a, x); } a.stopy = o - a.height / 2, f.bumpVerticalPos(a.height / 2); } else if (c[t.to] == n) { const a = i[t.to]; if (r.mirrorActors) { const x = a.type == "actor" ? gt / 2 + 3 : a.width / 2 + 3; h(a, x); } a.stopy = o - a.height / 2, f.bumpVerticalPos(a.height / 2); } } const B0 = function(t, e, o, n) { const { securityLevel: i, sequence: s } = dt(); r = s; let c; i === "sandbox" && (c = St("#i" + e)); const h = i === "sandbox" ? St(c.nodes()[0].contentDocument.body) : St("body"), u = i === "sandbox" ? c.nodes()[0].contentDocument : document; f.init(), U.debug(n.db); const a = i === "sandbox" ? h.select(`[id="${e}"]`) : St(`[id="${e}"]`), x = n.db.getActors(), E = n.db.getCreatedActors(), p = n.db.getDestroyedActors(), g = n.db.getBoxes(); let b = n.db.getActorKeys(); const k = n.db.getMessages(), A = n.db.getDiagramTitle(), R = n.db.hasAtLeastOneBox(), v = n.db.hasAtLeastOneBoxWithTitle(), F = Y0(x, k, n); if (r.height = W0(x, F, g), V.insertComputerIcon(a), V.insertDatabaseIcon(a), V.insertClockIcon(a), R && (f.bumpVerticalPos(r.boxMargin), v && f.bumpVerticalPos(g[0].textMaxHeight)), r.hideUnusedParticipants === !0) { const y = /* @__PURE__ */ new Set(); k.forEach((_) => { y.add(_.from), y.add(_.to); }), b = b.filter((_) => y.has(_)); } C0(a, x, E, b, 0, k, !1); const S = H0(k, x, F, n); V.insertArrowHead(a), V.insertArrowCrossHead(a), V.insertArrowFilledHead(a), V.insertSequenceNumber(a); function tt(y, _) { const I = f.endActivation(y); I.starty + 18 > _ && (I.starty = _ - 6, _ += 12), V.drawActivation( a, I, _, r, Vt(y.from.actor).length ), f.insert(I.startx, _ - 10, I.stopx, _); } let W = 1, K = 1; const Z = [], q = []; k.forEach(function(y, _) { let I, ut, et; switch (y.type) { case n.db.LINETYPE.NOTE: f.resetVerticalPos(), ut = y.noteModel, R0(a, ut); break; case n.db.LINETYPE.ACTIVE_START: f.newActivation(y, a, x); break; case n.db.LINETYPE.ACTIVE_END: tt(y, f.getVerticalPos()); break; case n.db.LINETYPE.LOOP_START: it( S, y, r.boxMargin, r.boxMargin + r.boxTextMargin, (N) => f.newLoop(N) ); break; case n.db.LINETYPE.LOOP_END: I = f.endLoop(), V.drawLoop(a, I, "loop", r), f.bumpVerticalPos(I.stopy - f.getVerticalPos()), f.models.addLoop(I); break; case n.db.LINETYPE.RECT_START: it( S, y, r.boxMargin, r.boxMargin, (N) => f.newLoop(void 0, N.message) ); break; case n.db.LINETYPE.RECT_END: I = f.endLoop(), q.push(I), f.models.addLoop(I), f.bumpVerticalPos(I.stopy - f.getVerticalPos()); break; case n.db.LINETYPE.OPT_START: it( S, y, r.boxMargin, r.boxMargin + r.boxTextMargin, (N) => f.newLoop(N) ); break; case n.db.LINETYPE.OPT_END: I = f.endLoop(), V.drawLoop(a, I, "opt", r), f.bumpVerticalPos(I.stopy - f.getVerticalPos()), f.models.addLoop(I); break; case n.db.LINETYPE.ALT_START: it( S, y, r.boxMargin, r.boxMargin + r.boxTextMargin, (N) => f.newLoop(N) ); break; case n.db.LINETYPE.ALT_ELSE: it( S, y, r.boxMargin + r.boxTextMargin, r.boxMargin, (N) => f.addSectionToLoop(N) ); break; case n.db.LINETYPE.ALT_END: I = f.endLoop(), V.drawLoop(a, I, "alt", r), f.bumpVerticalPos(I.stopy - f.getVerticalPos()), f.models.addLoop(I); break; case n.db.LINETYPE.PAR_START: case n.db.LINETYPE.PAR_OVER_START: it( S, y, r.boxMargin, r.boxMargin + r.boxTextMargin, (N) => f.newLoop(N) ), f.saveVerticalPos(); break; case n.db.LINETYPE.PAR_AND: it( S, y, r.boxMargin + r.boxTextMargin, r.boxMargin, (N) => f.addSectionToLoop(N) ); break; case n.db.LINETYPE.PAR_END: I = f.endLoop(), V.drawLoop(a, I, "par", r), f.bumpVerticalPos(I.stopy - f.getVerticalPos()), f.models.addLoop(I); break; case n.db.LINETYPE.AUTONUMBER: W = y.message.start || W, K = y.message.step || K, y.message.visible ? n.db.enableSequenceNumbers() : n.db.disableSequenceNumbers(); break; case n.db.LINETYPE.CRITICAL_START: it( S, y, r.boxMargin, r.boxMargin + r.boxTextMargin, (N) => f.newLoop(N) ); break; case n.db.LINETYPE.CRITICAL_OPTION: it( S, y, r.boxMargin + r.boxTextMargin, r.boxMargin, (N) => f.addSectionToLoop(N) ); break; case n.db.LINETYPE.CRITICAL_END: I = f.endLoop(), V.drawLoop(a, I, "critical", r), f.bumpVerticalPos(I.stopy - f.getVerticalPos()), f.models.addLoop(I); break; case n.db.LINETYPE.BREAK_START: it( S, y, r.boxMargin, r.boxMargin + r.boxTextMargin, (N) => f.newLoop(N) ); break; case n.db.LINETYPE.BREAK_END: I = f.endLoop(), V.drawLoop(a, I, "break", r), f.bumpVerticalPos(I.stopy - f.getVerticalPos()), f.models.addLoop(I); break; default: try { et = y.msgModel, et.starty = f.getVerticalPos(), et.sequenceIndex = W, et.sequenceVisible = n.db.showSequenceNumbers(); const N = D0(a, et); O0( y, et, N, _, x, E, p ), Z.push({ messageModel: et, lineStartY: N }), f.models.addMessage(et); } catch (N) { U.error("error while drawing message", N); } } [ n.db.LINETYPE.SOLID_OPEN, n.db.LINETYPE.DOTTED_OPEN, n.db.LINETYPE.SOLID, n.db.LINETYPE.DOTTED, n.db.LINETYPE.SOLID_CROSS, n.db.LINETYPE.DOTTED_CROSS, n.db.LINETYPE.SOLID_POINT, n.db.LINETYPE.DOTTED_POINT ].includes(y.type) && (W = W + K); }), U.debug("createdActors", E), U.debug("destroyedActors", p), Kt(a, x, b, !1), Z.forEach((y) => V0(a, y.messageModel, y.lineStartY, n)), r.mirrorActors && Kt(a, x, b, !0), q.forEach((y) => V.drawBackgroundRect(a, y)), xe(a, x, b, r), f.models.boxes.forEach(function(y) { y.height = f.getVerticalPos() - y.y, f.insert(y.x, y.y, y.x + y.width, y.height), y.startx = y.x, y.starty = y.y, y.stopx = y.startx + y.width, y.stopy = y.starty + y.height, y.stroke = "rgb(0,0,0, 0.5)", V.drawBox(a, y, r); }), R && f.bumpVerticalPos(r.boxMargin); const Y = Ee(a, x, b, u), { bounds: C } = f.getBounds(); let G = C.stopy - C.starty; G < Y.maxHeight && (G = Y.maxHeight); let z = G + 2 * r.diagramMarginY; r.mirrorActors && (z = z - r.boxMargin + r.bottomMarginAdj); let X = C.stopx - C.startx; X < Y.maxWidth && (X = Y.maxWidth); const Q = X + 2 * r.diagramMarginX; A && a.append("text").text(A).attr("x", (C.stopx - C.startx) / 2 - 2 * r.diagramMarginX).attr("y", -25), Ve(a, z, Q, r.useMaxWidth); const j = A ? 40 : 0; a.attr( "viewBox", C.startx - r.diagramMarginX + " -" + (r.diagramMarginY + j) + " " + Q + " " + (z + j) ), U.debug("models:", f.models); }; function Y0(t, e, o) { const n = {}; return e.forEach(function(i) { if (t[i.to] && t[i.from]) { const s = t[i.to]; if (i.placement === o.db.PLACEMENT.LEFTOF && !s.prevActor || i.placement === o.db.PLACEMENT.RIGHTOF && !s.nextActor) return; const c = i.placement !== void 0, h = !c, u = c ? bt(r) : Tt(r), a = i.wrap ? O.wrapLabel(i.message, r.width - 2 * r.wrapPadding, u) : i.message, E = O.calculateTextDimensions(a, u).width + 2 * r.wrapPadding; h && i.from === s.nextActor ? n[i.to] = w.getMax( n[i.to] || 0, E ) : h && i.from === s.prevActor ? n[i.from] = w.getMax( n[i.from] || 0, E ) : h && i.from === i.to ? (n[i.from] = w.getMax( n[i.from] || 0, E / 2 ), n[i.to] = w.getMax( n[i.to] || 0, E / 2 )) : i.placement === o.db.PLACEMENT.RIGHTOF ? n[i.from] = w.getMax( n[i.from] || 0, E ) : i.placement === o.db.PLACEMENT.LEFTOF ? n[s.prevActor] = w.getMax( n[s.prevActor] || 0, E ) : i.placement === o.db.PLACEMENT.OVER && (s.prevActor && (n[s.prevActor] = w.getMax( n[s.prevActor] || 0, E / 2 )), s.nextActor && (n[i.from] = w.getMax( n[i.from] || 0, E / 2 ))); } }), U.debug("maxMessageWidthPerActor:", n), n; } const F0 = function(t) { let e = 0; const o = Ut(r); for (const n in t.links) { const s = O.calculateTextDimensions(n, o).width + 2 * r.wrapPadding + 2 * r.boxMargin; e < s && (e = s); } return e; }; function W0(t, e, o) { let n = 0; Object.keys(t).forEach((s) => { const c = t[s]; c.wrap && (c.description = O.wrapLabel( c.description, r.width - 2 * r.wrapPadding, Ut(r) )); const h = O.calculateTextDimensions(c.description, Ut(r)); c.width = c.wrap ? r.width : w.getMax(r.width, h.width + 2 * r.wrapPadding), c.height = c.wrap ? w.getMax(h.height, r.height) : r.height, n = w.getMax(n, c.height); }); for (const s in e) { const c = t[s]; if (!c) continue; const h = t[c.nextActor]; if (!h) { const E = e[s] + r.actorMargin - c.width / 2; c.margin = w.getMax(E, r.actorMargin); continue; } const a = e[s] + r.actorMargin - c.width / 2 - h.width / 2; c.margin = w.getMax(a, r.actorMargin); } let i = 0; return o.forEach((s) => { const c = Tt(r); let h = s.actorKeys.reduce((x, E) => x += t[E].width + (t[E].margin || 0), 0); h -= 2 * r.boxTextMargin, s.wrap && (s.name = O.wrapLabel(s.name, h - 2 * r.wrapPadding, c)); const u = O.calculateTextDimensions(s.name, c); i = w.getMax(u.height, i); const a = w.getMax(h, u.width + 2 * r.wrapPadding); if (s.margin = r.boxTextMargin, h < a) { const x = (a - h) / 2; s.margin += x; } }), o.forEach((s) => s.textMaxHeight = i), w.getMax(n, r.height); } const q0 = function(t, e, o) { const n = e[t.from].x, i = e[t.to].x, s = t.wrap && t.message; let c = O.calculateTextDimensions( s ? O.wrapLabel(t.message, r.width, bt(r)) : t.message, bt(r) ); const h = { width: s ? r.width : w.getMax(r.width, c.width + 2 * r.noteMargin), height: 0, startx: e[t.from].x, stopx: 0, starty: 0, stopy: 0, message: t.message }; return t.placement === o.db.PLACEMENT.RIGHTOF ? (h.width = s ? w.getMax(r.width, c.width) : w.getMax( e[t.from].width / 2 + e[t.to].width / 2, c.width + 2 * r.noteMargin ), h.startx = n + (e[t.from].width + r.actorMargin) / 2) : t.placement === o.db.PLACEMENT.LEFTOF ? (h.width = s ? w.getMax(r.width, c.width + 2 * r.noteMargin) : w.getMax( e[t.from].width / 2 + e[t.to].width / 2, c.width + 2 * r.noteMargin ), h.startx = n - h.width + (e[t.from].width - r.actorMargin) / 2) : t.to === t.from ? (c = O.calculateTextDimensions( s ? O.wrapLabel( t.message, w.getMax(r.width, e[t.from].width), bt(r) ) : t.message, bt(r) ), h.width = s ? w.getMax(r.width, e[t.from].width) : w.getMax( e[t.from].width, r.width, c.width + 2 * r.noteMargin ), h.startx = n + (e[t.from].width - h.width) / 2) : (h.width = Math.abs(n + e[t.from].width / 2 - (i + e[t.to].width / 2)) + r.actorMargin, h.startx = n < i ? n + e[t.from].width / 2 - r.actorMargin / 2 : i + e[t.to].width / 2 - r.actorMargin / 2), s && (h.message = O.wrapLabel( t.message, h.width - 2 * r.wrapPadding, bt(r) )), U.debug( `NM:[${h.startx},${h.stopx},${h.starty},${h.stopy}:${h.width},${h.height}=${t.message}]` ), h; }, z0 = function(t, e, o) { if (![ o.db.LINETYPE.SOLID_OPEN, o.db.LINETYPE.DOTTED_OPEN, o.db.LINETYPE.SOLID, o.db.LINETYPE.DOTTED, o.db.LINETYPE.SOLID_CROSS, o.db.LINETYPE.DOTTED_CROSS, o.db.LINETYPE.SOLID_POINT, o.db.LINETYPE.DOTTED_POINT ].includes(t.type)) return {}; const [n, i] = se(t.from, e), [s, c] = se(t.to, e), h = n <= s, u = h ? i : n; let a = h ? s : c; const x = Math.abs(s - c) > 2, E = (k) => h ? -k : k; t.from === t.to ? a = u : (t.activate && !x && (a += E(r.activationWidth / 2 - 1)), [o.db.LINETYPE.SOLID_OPEN, o.db.LINETYPE.DOTTED_OPEN].includes(t.type) || (a += E(3))); const p = [n, i, s, c], g = Math.abs(u - a); t.wrap && t.message && (t.message = O.wrapLabel( t.message, w.getMax(g + 2 * r.wrapPadding, r.width), Tt(r) )); const b = O.calculateTextDimensions(t.message, Tt(r)); return { width: w.getMax( t.wrap ? 0 : b.width + 2 * r.wrapPadding, g + 2 * r.wrapPadding, r.width ), height: 0, startx: u, stopx: a, starty: 0, stopy: 0, message: t.message, type: t.type, wrap: t.wrap, fromBounds: Math.min.apply(null, p), toBounds: Math.max.apply(null, p) }; }, H0 = function(t, e, o, n) { const i = {}, s = []; let c, h, u; return t.forEach(function(a) { switch (a.id = O.random({ length: 10 }), a.type) { case n.db.LINETYPE.LOOP_START: case n.db.LINETYPE.ALT_START: case n.db.LINETYPE.OPT_START: case n.db.LINETYPE.PAR_START: case n.db.LINETYPE.PAR_OVER_START: case n.db.LINETYPE.CRITICAL_START: case n.db.LINETYPE.BREAK_START: s.push({ id: a.id, msg: a.message, from: Number.MAX_SAFE_INTEGER, to: Number.MIN_SAFE_INTEGER, width: 0 }); break; case n.db.LINETYPE.ALT_ELSE: case n.db.LINETYPE.PAR_AND: case n.db.LINETYPE.CRITICAL_OPTION: a.message && (c = s.pop(), i[c.id] = c, i[a.id] = c, s.push(c)); break; case n.db.LINETYPE.LOOP_END: case n.db.LINETYPE.ALT_END: case n.db.LINETYPE.OPT_END: case n.db.LINETYPE.PAR_END: case n.db.LINETYPE.CRITICAL_END: case n.db.LINETYPE.BREAK_END: c = s.pop(), i[c.id] = c; break; case n.db.LINETYPE.ACTIVE_START: { const E = e[a.from ? a.from.actor : a.to.actor], p = Vt(a.from ? a.from.actor : a.to.actor).length, g = E.x + E.width / 2 + (p - 1) * r.activationWidth / 2, b = { startx: g, stopx: g + r.activationWidth, actor: a.from.actor, enabled: !0 }; f.activations.push(b); } break; case n.db.LINETYPE.ACTIVE_END: { const E = f.activations.map((p) => p.actor).lastIndexOf(a.from.actor); delete f.activations.splice(E, 1)[0]; } break; } a.placement !== void 0 ? (h = q0(a, e, n), a.noteModel = h, s.forEach((E) => { c = E, c.from = w.getMin(c.from, h.startx), c.to = w.getMax(c.to, h.startx + h.width), c.width = w.getMax(c.width, Math.abs(c.from - c.to)) - r.labelBoxWidth; })) : (u = z0(a, e, n), a.msgModel = u, u.startx && u.stopx && s.length > 0 && s.forEach((E) => { if (c = E, u.startx === u.stopx) { const p = e[a.from], g = e[a.to]; c.from = w.getMin( p.x - u.width / 2, p.x - p.width / 2, c.from ), c.to = w.getMax( g.x + u.width / 2, g.x + p.width / 2, c.to ), c.width = w.getMax(c.width, Math.abs(c.to - c.from)) - r.labelBoxWidth; } else c.from = w.getMin(u.startx, c.from), c.to = w.getMax(u.stopx, c.to), c.width = w.getMax(c.width, u.width) - r.labelBoxWidth; })); }), f.activations = [], U.debug("Loop type widths:", i), i; }, U0 = { bounds: f, drawActors: Kt, drawActorsPopup: Ee, setConf: be, draw: B0 }, X0 = { parser: Fe, db: ie, renderer: U0, styles: d0, init: ({ wrap: t }) => { ie.setWrap(t); } }; export { X0 as diagram };