UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.

1,077 lines 141 kB
import { g as getAccTitle, t as getDiagramTitle, r as setDiagramTitle, c as getConfig, s as setAccTitle, b as setAccDescription, a as getAccDescription, m as mermaidAPI, v as clear$1, l as log, d as sanitizeText, e as common, F as parseFontSize, H as addFunction, Z as ZERO_WIDTH_SPACE, f as assignWithDepth, i as configureSvgSize, u as utils } from "./mermaid-768dc893.js"; import { select } from "d3"; import { d as drawRect$1, a as drawBackgroundRect$1, b as drawEmbeddedImage, c as drawImage, e as getTextObj$1, g as getNoteRect$1 } from "./svgDrawCommon-42e92da3.js"; import { sanitizeUrl } from "@braintree/sanitize-url"; import "ts-dedent"; import "dayjs"; import "dompurify"; import "khroma"; import "lodash-es/memoize.js"; import "lodash-es/merge.js"; import "stylis"; import "lodash-es/isEmpty.js"; var parser = function() { var o = function(k, v, o2, l) { for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ; return o2; }, $V0 = [1, 2], $V1 = [1, 3], $V2 = [1, 5], $V3 = [1, 7], $V4 = [2, 5], $V5 = [1, 15], $V6 = [1, 17], $V7 = [1, 19], $V8 = [1, 20], $V9 = [1, 22], $Va = [1, 23], $Vb = [1, 24], $Vc = [1, 30], $Vd = [1, 31], $Ve = [1, 32], $Vf = [1, 33], $Vg = [1, 34], $Vh = [1, 35], $Vi = [1, 36], $Vj = [1, 37], $Vk = [1, 38], $Vl = [1, 39], $Vm = [1, 40], $Vn = [1, 41], $Vo = [1, 42], $Vp = [1, 44], $Vq = [1, 45], $Vr = [1, 46], $Vs = [1, 48], $Vt = [1, 49], $Vu = [1, 50], $Vv = [1, 51], $Vw = [1, 52], $Vx = [1, 53], $Vy = [1, 56], $Vz = [1, 4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 53, 54, 55, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], $VA = [4, 5, 22, 56, 58, 59], $VB = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], $VC = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 55, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], $VD = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 54, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], $VE = [4, 5, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 53, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], $VF = [74, 75, 76], $VG = [1, 133], $VH = [1, 4, 5, 7, 19, 20, 22, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 53, 54, 55, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86]; var parser2 = { trace: function trace() { }, yy: {}, symbols_: { "error": 2, "start": 3, "SPACE": 4, "NEWLINE": 5, "directive": 6, "SD": 7, "document": 8, "line": 9, "statement": 10, "box_section": 11, "box_line": 12, "participant_statement": 13, "openDirective": 14, "typeDirective": 15, "closeDirective": 16, ":": 17, "argDirective": 18, "create": 19, "box": 20, "restOfLine": 21, "end": 22, "signal": 23, "autonumber": 24, "NUM": 25, "off": 26, "activate": 27, "actor": 28, "deactivate": 29, "note_statement": 30, "links_statement": 31, "link_statement": 32, "properties_statement": 33, "details_statement": 34, "title": 35, "legacy_title": 36, "acc_title": 37, "acc_title_value": 38, "acc_descr": 39, "acc_descr_value": 40, "acc_descr_multiline_value": 41, "loop": 42, "rect": 43, "opt": 44, "alt": 45, "else_sections": 46, "par": 47, "par_sections": 48, "par_over": 49, "critical": 50, "option_sections": 51, "break": 52, "option": 53, "and": 54, "else": 55, "participant": 56, "AS": 57, "participant_actor": 58, "destroy": 59, "note": 60, "placement": 61, "text2": 62, "over": 63, "actor_pair": 64, "links": 65, "link": 66, "properties": 67, "details": 68, "spaceList": 69, ",": 70, "left_of": 71, "right_of": 72, "signaltype": 73, "+": 74, "-": 75, "ACTOR": 76, "SOLID_OPEN_ARROW": 77, "DOTTED_OPEN_ARROW": 78, "SOLID_ARROW": 79, "DOTTED_ARROW": 80, "SOLID_CROSS": 81, "DOTTED_CROSS": 82, "SOLID_POINT": 83, "DOTTED_POINT": 84, "TXT": 85, "open_directive": 86, "type_directive": 87, "arg_directive": 88, "close_directive": 89, "$accept": 0, "$end": 1 }, terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 7: "SD", 17: ":", 19: "create", 20: "box", 21: "restOfLine", 22: "end", 24: "autonumber", 25: "NUM", 26: "off", 27: "activate", 29: "deactivate", 35: "title", 36: "legacy_title", 37: "acc_title", 38: "acc_title_value", 39: "acc_descr", 40: "acc_descr_value", 41: "acc_descr_multiline_value", 42: "loop", 43: "rect", 44: "opt", 45: "alt", 47: "par", 49: "par_over", 50: "critical", 52: "break", 53: "option", 54: "and", 55: "else", 56: "participant", 57: "AS", 58: "participant_actor", 59: "destroy", 60: "note", 63: "over", 65: "links", 66: "link", 67: "properties", 68: "details", 70: ",", 71: "left_of", 72: "right_of", 74: "+", 75: "-", 76: "ACTOR", 77: "SOLID_OPEN_ARROW", 78: "DOTTED_OPEN_ARROW", 79: "SOLID_ARROW", 80: "DOTTED_ARROW", 81: "SOLID_CROSS", 82: "DOTTED_CROSS", 83: "SOLID_POINT", 84: "DOTTED_POINT", 85: "TXT", 86: "open_directive", 87: "type_directive", 88: "arg_directive", 89: "close_directive" }, productions_: [0, [3, 2], [3, 2], [3, 2], [3, 2], [8, 0], [8, 2], [9, 2], [9, 1], [9, 1], [11, 0], [11, 2], [12, 2], [12, 1], [12, 1], [6, 4], [6, 6], [10, 1], [10, 2], [10, 4], [10, 2], [10, 4], [10, 3], [10, 3], [10, 2], [10, 3], [10, 3], [10, 2], [10, 2], [10, 2], [10, 2], [10, 2], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [10, 1], [51, 1], [51, 4], [48, 1], [48, 4], [46, 1], [46, 4], [13, 5], [13, 3], [13, 5], [13, 3], [13, 3], [30, 4], [30, 4], [31, 3], [32, 3], [33, 3], [34, 3], [69, 2], [69, 1], [64, 3], [64, 1], [61, 1], [61, 1], [23, 5], [23, 5], [23, 4], [28, 1], [73, 1], [73, 1], [73, 1], [73, 1], [73, 1], [73, 1], [73, 1], [73, 1], [62, 1], [14, 1], [15, 1], [18, 1], [16, 1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { var $0 = $$.length - 1; switch (yystate) { case 4: yy.apply($$[$0]); return $$[$0]; case 5: case 10: this.$ = []; break; case 6: case 11: $$[$0 - 1].push($$[$0]); this.$ = $$[$0 - 1]; break; case 7: case 8: case 12: case 13: this.$ = $$[$0]; break; case 9: case 14: this.$ = []; break; case 18: $$[$0].type = "createParticipant"; this.$ = $$[$0]; break; case 19: $$[$0 - 1].unshift({ type: "boxStart", boxData: yy.parseBoxData($$[$0 - 2]) }); $$[$0 - 1].push({ type: "boxEnd", boxText: $$[$0 - 2] }); this.$ = $$[$0 - 1]; break; case 21: this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 2]), sequenceIndexStep: Number($$[$0 - 1]), sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; break; case 22: this.$ = { type: "sequenceIndex", sequenceIndex: Number($$[$0 - 1]), sequenceIndexStep: 1, sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; break; case 23: this.$ = { type: "sequenceIndex", sequenceVisible: false, signalType: yy.LINETYPE.AUTONUMBER }; break; case 24: this.$ = { type: "sequenceIndex", sequenceVisible: true, signalType: yy.LINETYPE.AUTONUMBER }; break; case 25: this.$ = { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] }; break; case 26: this.$ = { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 1] }; break; case 32: yy.setDiagramTitle($$[$0].substring(6)); this.$ = $$[$0].substring(6); break; case 33: yy.setDiagramTitle($$[$0].substring(7)); this.$ = $$[$0].substring(7); break; case 34: this.$ = $$[$0].trim(); yy.setAccTitle(this.$); break; case 35: case 36: this.$ = $$[$0].trim(); yy.setAccDescription(this.$); break; case 37: $$[$0 - 1].unshift({ type: "loopStart", loopText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.LOOP_START }); $$[$0 - 1].push({ type: "loopEnd", loopText: $$[$0 - 2], signalType: yy.LINETYPE.LOOP_END }); this.$ = $$[$0 - 1]; break; case 38: $$[$0 - 1].unshift({ type: "rectStart", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_START }); $$[$0 - 1].push({ type: "rectEnd", color: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.RECT_END }); this.$ = $$[$0 - 1]; break; case 39: $$[$0 - 1].unshift({ type: "optStart", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_START }); $$[$0 - 1].push({ type: "optEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.OPT_END }); this.$ = $$[$0 - 1]; break; case 40: $$[$0 - 1].unshift({ type: "altStart", altText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.ALT_START }); $$[$0 - 1].push({ type: "altEnd", signalType: yy.LINETYPE.ALT_END }); this.$ = $$[$0 - 1]; break; case 41: $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_START }); $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END }); this.$ = $$[$0 - 1]; break; case 42: $$[$0 - 1].unshift({ type: "parStart", parText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.PAR_OVER_START }); $$[$0 - 1].push({ type: "parEnd", signalType: yy.LINETYPE.PAR_END }); this.$ = $$[$0 - 1]; break; case 43: $$[$0 - 1].unshift({ type: "criticalStart", criticalText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.CRITICAL_START }); $$[$0 - 1].push({ type: "criticalEnd", signalType: yy.LINETYPE.CRITICAL_END }); this.$ = $$[$0 - 1]; break; case 44: $$[$0 - 1].unshift({ type: "breakStart", breakText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_START }); $$[$0 - 1].push({ type: "breakEnd", optText: yy.parseMessage($$[$0 - 2]), signalType: yy.LINETYPE.BREAK_END }); this.$ = $$[$0 - 1]; break; case 47: this.$ = $$[$0 - 3].concat([{ type: "option", optionText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.CRITICAL_OPTION }, $$[$0]]); break; case 49: this.$ = $$[$0 - 3].concat([{ type: "and", parText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.PAR_AND }, $$[$0]]); break; case 51: this.$ = $$[$0 - 3].concat([{ type: "else", altText: yy.parseMessage($$[$0 - 1]), signalType: yy.LINETYPE.ALT_ELSE }, $$[$0]]); break; case 52: $$[$0 - 3].draw = "participant"; $$[$0 - 3].type = "addParticipant"; $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]); this.$ = $$[$0 - 3]; break; case 53: $$[$0 - 1].draw = "participant"; $$[$0 - 1].type = "addParticipant"; this.$ = $$[$0 - 1]; break; case 54: $$[$0 - 3].draw = "actor"; $$[$0 - 3].type = "addParticipant"; $$[$0 - 3].description = yy.parseMessage($$[$0 - 1]); this.$ = $$[$0 - 3]; break; case 55: $$[$0 - 1].draw = "actor"; $$[$0 - 1].type = "addParticipant"; this.$ = $$[$0 - 1]; break; case 56: $$[$0 - 1].type = "destroyParticipant"; this.$ = $$[$0 - 1]; break; case 57: this.$ = [$$[$0 - 1], { type: "addNote", placement: $$[$0 - 2], actor: $$[$0 - 1].actor, text: $$[$0] }]; break; case 58: $$[$0 - 2] = [].concat($$[$0 - 1], $$[$0 - 1]).slice(0, 2); $$[$0 - 2][0] = $$[$0 - 2][0].actor; $$[$0 - 2][1] = $$[$0 - 2][1].actor; this.$ = [$$[$0 - 1], { type: "addNote", placement: yy.PLACEMENT.OVER, actor: $$[$0 - 2].slice(0, 2), text: $$[$0] }]; break; case 59: this.$ = [$$[$0 - 1], { type: "addLinks", actor: $$[$0 - 1].actor, text: $$[$0] }]; break; case 60: this.$ = [$$[$0 - 1], { type: "addALink", actor: $$[$0 - 1].actor, text: $$[$0] }]; break; case 61: this.$ = [$$[$0 - 1], { type: "addProperties", actor: $$[$0 - 1].actor, text: $$[$0] }]; break; case 62: this.$ = [$$[$0 - 1], { type: "addDetails", actor: $$[$0 - 1].actor, text: $$[$0] }]; break; case 65: this.$ = [$$[$0 - 2], $$[$0]]; break; case 66: this.$ = $$[$0]; break; case 67: this.$ = yy.PLACEMENT.LEFTOF; break; case 68: this.$ = yy.PLACEMENT.RIGHTOF; break; case 69: this.$ = [ $$[$0 - 4], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: "activeStart", signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0 - 1] } ]; break; case 70: this.$ = [ $$[$0 - 4], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 4].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 3], msg: $$[$0] }, { type: "activeEnd", signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0 - 4] } ]; break; case 71: this.$ = [$$[$0 - 3], $$[$0 - 1], { type: "addMessage", from: $$[$0 - 3].actor, to: $$[$0 - 1].actor, signalType: $$[$0 - 2], msg: $$[$0] }]; break; case 72: this.$ = { type: "addParticipant", actor: $$[$0] }; break; case 73: this.$ = yy.LINETYPE.SOLID_OPEN; break; case 74: this.$ = yy.LINETYPE.DOTTED_OPEN; break; case 75: this.$ = yy.LINETYPE.SOLID; break; case 76: this.$ = yy.LINETYPE.DOTTED; break; case 77: this.$ = yy.LINETYPE.SOLID_CROSS; break; case 78: this.$ = yy.LINETYPE.DOTTED_CROSS; break; case 79: this.$ = yy.LINETYPE.SOLID_POINT; break; case 80: this.$ = yy.LINETYPE.DOTTED_POINT; break; case 81: this.$ = yy.parseMessage($$[$0].trim().substring(1)); break; case 82: yy.parseDirective("%%{", "open_directive"); break; case 83: yy.parseDirective($$[$0], "type_directive"); break; case 84: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], "arg_directive"); break; case 85: yy.parseDirective("}%%", "close_directive", "sequence"); break; } }, table: [{ 3: 1, 4: $V0, 5: $V1, 6: 4, 7: $V2, 14: 6, 86: $V3 }, { 1: [3] }, { 3: 8, 4: $V0, 5: $V1, 6: 4, 7: $V2, 14: 6, 86: $V3 }, { 3: 9, 4: $V0, 5: $V1, 6: 4, 7: $V2, 14: 6, 86: $V3 }, { 3: 10, 4: $V0, 5: $V1, 6: 4, 7: $V2, 14: 6, 86: $V3 }, o([1, 4, 5, 19, 20, 24, 27, 29, 35, 36, 37, 39, 41, 42, 43, 44, 45, 47, 49, 50, 52, 56, 58, 59, 60, 65, 66, 67, 68, 76, 86], $V4, { 8: 11 }), { 15: 12, 87: [1, 13] }, { 87: [2, 82] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, { 1: [2, 4], 4: $V5, 5: $V6, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 20: $V8, 23: 21, 24: $V9, 27: $Va, 28: 47, 29: $Vb, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: $Vc, 36: $Vd, 37: $Ve, 39: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 45: $Vk, 47: $Vl, 49: $Vm, 50: $Vn, 52: $Vo, 56: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 65: $Vt, 66: $Vu, 67: $Vv, 68: $Vw, 76: $Vx, 86: $V3 }, { 16: 54, 17: [1, 55], 89: $Vy }, o([17, 89], [2, 83]), o($Vz, [2, 6]), { 6: 43, 10: 57, 13: 18, 14: 6, 19: $V7, 20: $V8, 23: 21, 24: $V9, 27: $Va, 28: 47, 29: $Vb, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: $Vc, 36: $Vd, 37: $Ve, 39: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 45: $Vk, 47: $Vl, 49: $Vm, 50: $Vn, 52: $Vo, 56: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 65: $Vt, 66: $Vu, 67: $Vv, 68: $Vw, 76: $Vx, 86: $V3 }, o($Vz, [2, 8]), o($Vz, [2, 9]), o($Vz, [2, 17]), { 13: 58, 56: $Vp, 58: $Vq, 59: $Vr }, { 21: [1, 59] }, { 5: [1, 60] }, { 5: [1, 63], 25: [1, 61], 26: [1, 62] }, { 28: 64, 76: $Vx }, { 28: 65, 76: $Vx }, { 5: [1, 66] }, { 5: [1, 67] }, { 5: [1, 68] }, { 5: [1, 69] }, { 5: [1, 70] }, o($Vz, [2, 32]), o($Vz, [2, 33]), { 38: [1, 71] }, { 40: [1, 72] }, o($Vz, [2, 36]), { 21: [1, 73] }, { 21: [1, 74] }, { 21: [1, 75] }, { 21: [1, 76] }, { 21: [1, 77] }, { 21: [1, 78] }, { 21: [1, 79] }, { 21: [1, 80] }, o($Vz, [2, 45]), { 28: 81, 76: $Vx }, { 28: 82, 76: $Vx }, { 28: 83, 76: $Vx }, { 73: 84, 77: [1, 85], 78: [1, 86], 79: [1, 87], 80: [1, 88], 81: [1, 89], 82: [1, 90], 83: [1, 91], 84: [1, 92] }, { 61: 93, 63: [1, 94], 71: [1, 95], 72: [1, 96] }, { 28: 97, 76: $Vx }, { 28: 98, 76: $Vx }, { 28: 99, 76: $Vx }, { 28: 100, 76: $Vx }, o([5, 57, 70, 77, 78, 79, 80, 81, 82, 83, 84, 85], [2, 72]), { 5: [1, 101] }, { 18: 102, 88: [1, 103] }, { 5: [2, 85] }, o($Vz, [2, 7]), o($Vz, [2, 18]), o($VA, [2, 10], { 11: 104 }), o($Vz, [2, 20]), { 5: [1, 106], 25: [1, 105] }, { 5: [1, 107] }, o($Vz, [2, 24]), { 5: [1, 108] }, { 5: [1, 109] }, o($Vz, [2, 27]), o($Vz, [2, 28]), o($Vz, [2, 29]), o($Vz, [2, 30]), o($Vz, [2, 31]), o($Vz, [2, 34]), o($Vz, [2, 35]), o($VB, $V4, { 8: 110 }), o($VB, $V4, { 8: 111 }), o($VB, $V4, { 8: 112 }), o($VC, $V4, { 46: 113, 8: 114 }), o($VD, $V4, { 48: 115, 8: 116 }), o($VD, $V4, { 8: 116, 48: 117 }), o($VE, $V4, { 51: 118, 8: 119 }), o($VB, $V4, { 8: 120 }), { 5: [1, 122], 57: [1, 121] }, { 5: [1, 124], 57: [1, 123] }, { 5: [1, 125] }, { 28: 128, 74: [1, 126], 75: [1, 127], 76: $Vx }, o($VF, [2, 73]), o($VF, [2, 74]), o($VF, [2, 75]), o($VF, [2, 76]), o($VF, [2, 77]), o($VF, [2, 78]), o($VF, [2, 79]), o($VF, [2, 80]), { 28: 129, 76: $Vx }, { 28: 131, 64: 130, 76: $Vx }, { 76: [2, 67] }, { 76: [2, 68] }, { 62: 132, 85: $VG }, { 62: 134, 85: $VG }, { 62: 135, 85: $VG }, { 62: 136, 85: $VG }, o($VH, [2, 15]), { 16: 137, 89: $Vy }, { 89: [2, 84] }, { 4: [1, 140], 5: [1, 142], 12: 139, 13: 141, 22: [1, 138], 56: $Vp, 58: $Vq, 59: $Vr }, { 5: [1, 143] }, o($Vz, [2, 22]), o($Vz, [2, 23]), o($Vz, [2, 25]), o($Vz, [2, 26]), { 4: $V5, 5: $V6, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 20: $V8, 22: [1, 144], 23: 21, 24: $V9, 27: $Va, 28: 47, 29: $Vb, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: $Vc, 36: $Vd, 37: $Ve, 39: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 45: $Vk, 47: $Vl, 49: $Vm, 50: $Vn, 52: $Vo, 56: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 65: $Vt, 66: $Vu, 67: $Vv, 68: $Vw, 76: $Vx, 86: $V3 }, { 4: $V5, 5: $V6, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 20: $V8, 22: [1, 145], 23: 21, 24: $V9, 27: $Va, 28: 47, 29: $Vb, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: $Vc, 36: $Vd, 37: $Ve, 39: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 45: $Vk, 47: $Vl, 49: $Vm, 50: $Vn, 52: $Vo, 56: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 65: $Vt, 66: $Vu, 67: $Vv, 68: $Vw, 76: $Vx, 86: $V3 }, { 4: $V5, 5: $V6, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 20: $V8, 22: [1, 146], 23: 21, 24: $V9, 27: $Va, 28: 47, 29: $Vb, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: $Vc, 36: $Vd, 37: $Ve, 39: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 45: $Vk, 47: $Vl, 49: $Vm, 50: $Vn, 52: $Vo, 56: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 65: $Vt, 66: $Vu, 67: $Vv, 68: $Vw, 76: $Vx, 86: $V3 }, { 22: [1, 147] }, { 4: $V5, 5: $V6, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 20: $V8, 22: [2, 50], 23: 21, 24: $V9, 27: $Va, 28: 47, 29: $Vb, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: $Vc, 36: $Vd, 37: $Ve, 39: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 45: $Vk, 47: $Vl, 49: $Vm, 50: $Vn, 52: $Vo, 55: [1, 148], 56: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 65: $Vt, 66: $Vu, 67: $Vv, 68: $Vw, 76: $Vx, 86: $V3 }, { 22: [1, 149] }, { 4: $V5, 5: $V6, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 20: $V8, 22: [2, 48], 23: 21, 24: $V9, 27: $Va, 28: 47, 29: $Vb, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: $Vc, 36: $Vd, 37: $Ve, 39: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 45: $Vk, 47: $Vl, 49: $Vm, 50: $Vn, 52: $Vo, 54: [1, 150], 56: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 65: $Vt, 66: $Vu, 67: $Vv, 68: $Vw, 76: $Vx, 86: $V3 }, { 22: [1, 151] }, { 22: [1, 152] }, { 4: $V5, 5: $V6, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 20: $V8, 22: [2, 46], 23: 21, 24: $V9, 27: $Va, 28: 47, 29: $Vb, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: $Vc, 36: $Vd, 37: $Ve, 39: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 45: $Vk, 47: $Vl, 49: $Vm, 50: $Vn, 52: $Vo, 53: [1, 153], 56: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 65: $Vt, 66: $Vu, 67: $Vv, 68: $Vw, 76: $Vx, 86: $V3 }, { 4: $V5, 5: $V6, 6: 43, 9: 14, 10: 16, 13: 18, 14: 6, 19: $V7, 20: $V8, 22: [1, 154], 23: 21, 24: $V9, 27: $Va, 28: 47, 29: $Vb, 30: 25, 31: 26, 32: 27, 33: 28, 34: 29, 35: $Vc, 36: $Vd, 37: $Ve, 39: $Vf, 41: $Vg, 42: $Vh, 43: $Vi, 44: $Vj, 45: $Vk, 47: $Vl, 49: $Vm, 50: $Vn, 52: $Vo, 56: $Vp, 58: $Vq, 59: $Vr, 60: $Vs, 65: $Vt, 66: $Vu, 67: $Vv, 68: $Vw, 76: $Vx, 86: $V3 }, { 21: [1, 155] }, o($Vz, [2, 53]), { 21: [1, 156] }, o($Vz, [2, 55]), o($Vz, [2, 56]), { 28: 157, 76: $Vx }, { 28: 158, 76: $Vx }, { 62: 159, 85: $VG }, { 62: 160, 85: $VG }, { 62: 161, 85: $VG }, { 70: [1, 162], 85: [2, 66] }, { 5: [2, 59] }, { 5: [2, 81] }, { 5: [2, 60] }, { 5: [2, 61] }, { 5: [2, 62] }, { 5: [1, 163] }, o($Vz, [2, 19]), o($VA, [2, 11]), { 13: 164, 56: $Vp, 58: $Vq, 59: $Vr }, o($VA, [2, 13]), o($VA, [2, 14]), o($Vz, [2, 21]), o($Vz, [2, 37]), o($Vz, [2, 38]), o($Vz, [2, 39]), o($Vz, [2, 40]), { 21: [1, 165] }, o($Vz, [2, 41]), { 21: [1, 166] }, o($Vz, [2, 42]), o($Vz, [2, 43]), { 21: [1, 167] }, o($Vz, [2, 44]), { 5: [1, 168] }, { 5: [1, 169] }, { 62: 170, 85: $VG }, { 62: 171, 85: $VG }, { 5: [2, 71] }, { 5: [2, 57] }, { 5: [2, 58] }, { 28: 172, 76: $Vx }, o($VH, [2, 16]), o($VA, [2, 12]), o($VC, $V4, { 8: 114, 46: 173 }), o($VD, $V4, { 8: 116, 48: 174 }), o($VE, $V4, { 8: 119, 51: 175 }), o($Vz, [2, 52]), o($Vz, [2, 54]), { 5: [2, 69] }, { 5: [2, 70] }, { 85: [2, 65] }, { 22: [2, 51] }, { 22: [2, 49] }, { 22: [2, 47] }], defaultActions: { 7: [2, 82], 8: [2, 1], 9: [2, 2], 10: [2, 3], 56: [2, 85], 95: [2, 67], 96: [2, 68], 103: [2, 84], 132: [2, 59], 133: [2, 81], 134: [2, 60], 135: [2, 61], 136: [2, 62], 159: [2, 71], 160: [2, 57], 161: [2, 58], 170: [2, 69], 171: [2, 70], 172: [2, 65], 173: [2, 51], 174: [2, 49], 175: [2, 47] }, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { var error = new Error(str); error.hash = hash; throw error; } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer2 = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer2.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer2; sharedState.yy.parser = this; if (typeof lexer2.yylloc == "undefined") { lexer2.yylloc = {}; } var yyloc = lexer2.yylloc; lstack.push(yyloc); var ranges = lexer2.options && lexer2.options.ranges; if (typeof sharedState.yy.parseError === "function") { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function lex() { var token; token = tstack.pop() || lexer2.lex() || EOF; if (typeof token !== "number") { if (token instanceof Array) { tstack = token; token = tstack.pop(); } token = self.symbols_[token] || token; } return token; } var symbol, state, action, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == "undefined") { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === "undefined" || !action.length || !action[0]) { var errStr = ""; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push("'" + this.terminals_[p] + "'"); } } if (lexer2.showPosition) { errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; } else { errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); } this.parseError(errStr, { text: lexer2.match, token: this.terminals_[symbol] || symbol, line: lexer2.yylineno, loc: yyloc, expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer2.yytext); lstack.push(lexer2.yylloc); stack.push(action[1]); symbol = null; { yyleng = lexer2.yyleng; yytext = lexer2.yytext; yylineno = lexer2.yylineno; yyloc = lexer2.yylloc; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== "undefined") { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; } }; var lexer = function() { var lexer2 = { EOF: 1, parseError: function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput: function(input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; 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 }; if (this.options.ranges) { this.yylloc.range = [0, 0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input: function() { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput: function(ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); this.offset -= len; var oldLines = 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); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more: function() { this._more = true; return 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 = true; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less: function(n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput: function() { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput: function() { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20 - next.length); } return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition: function() { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match: function(match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { backup = { 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 }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { for (var k in backup) { this[k] = backup[k]; } return false; } return false; }, // return next match in input next: function() { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ""; this.match = ""; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; } else { return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } return false; } if (this._input === "") { return this.EOF; } else { return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex: function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: function begin(condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState: function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return 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 topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState: function pushState(condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize: function stateStackSize() { return this.conditionStack.length; }, options: { "case-insensitive": true }, performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { switch ($avoiding_name_collisions) { case 0: this.begin("open_directive"); return 86; case 1: this.begin("type_directive"); return 87; case 2: this.popState(); this.begin("arg_directive"); return 17; case 3: this.popState(); this.popState(); return 89; case 4: return 88; case 5: return 5; case 6: break; case 7: break; case 8: break; case 9: break; case 10: break; case 11: return 25; case 12: this.begin("LINE"); return 20; case 13: this.begin("ID"); return 56; case 14: this.begin("ID"); return 58; case 15: return 19; case 16: this.begin("ID"); return 59; case 17: yy_.yytext = yy_.yytext.trim(); this.begin("ALIAS"); return 76; case 18: this.popState(); this.popState(); this.begin("LINE"); return 57; case 19: this.popState(); this.popState(); return 5; case 20: this.begin("LINE"); return 42; case 21: this.begin("LINE"); return 43; case 22: this.begin("LINE"); return 44; case 23: this.begin("LINE"); return 45; case 24: this.begin("LINE"); return 55; case 25: this.begin("LINE"); return 47; case 26: this.begin("LINE"); return 49; case 27: this.begin("LINE"); return 54; case 28: this.begin("LINE"); return 50; case 29: this.begin("LINE"); return 53; case 30: this.begin("LINE"); return 52; case 31: this.popState(); return 21; case 32: return 22; case 33: return 71; case 34: return 72; case 35: return 65; case 36: return 66; case 37: return 67; case 38: return 68; case 39: return 63; case 40: return 60; case 41: this.begin("ID"); return 27; case 42: this.begin("ID"); return 29; case 43: return 35; case 44: return 36; case 45: this.begin("acc_title"); return 37; case 46: this.popState(); return "acc_title_value"; case 47: this.begin("acc_descr"); return 39; case 48: this.popState(); return "acc_descr_value"; case 49: this.begin("acc_descr_multiline"); break; case 50: this.popState(); break; case 51: return "acc_descr_multiline_value"; case 52: return 7; case 53: return 24; case 54: return 26; case 55: return 70; case 56: return 5; case 57: yy_.yytext = yy_.yytext.trim(); return 76; case 58: return 79; case 59: return 80; case 60: return 77; case 61: return 78; case 62: return 81; case 63: return 82; case 64: return 83; case 65: return 84; case 66: return 85; case 67: return 74; case 68: return 75; case 69: return 5; case 70: return "INVALID"; } }, rules: [/^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^\->:\n,;]+?([\-]*[^\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]+)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i], conditions: { "acc_descr_multiline": { "rules": [50, 51], "inclusive": false }, "acc_descr": { "rules": [48], "inclusive": false }, "acc_title": { "rules": [46], "inclusive": false }, "open_directive": { "rules": [1, 8], "inclusive": false }, "type_directive": { "rules": [2, 3, 8], "inclusive": false }, "arg_directive": { "rules": [3, 4, 8], "inclusive": false }, "ID": { "rules": [7, 8, 17], "inclusive": false }, "ALIAS": { "rules": [7, 8, 18, 19], "inclusive": false }, "LINE": { "rules": [7, 8, 31], "inclusive": false }, "INITIAL": { "rules": [0, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 49, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70], "inclusive": true } } }; return lexer2; }(); parser2.lexer = lexer; function Parser() { this.yy = {}; } Parser.prototype = parser2; parser2.Parser = Parser; return new Parser(); }(); parser.parser = parser; const parser$1 = parser; let prevActor = void 0; let actors = {}; let createdActors = {}; let destroyedActors = {}; let boxes = []; let messages = []; let sequenceNumbersEnabled = false; let wrapEnabled; let currentBox = void 0; let lastCreated = void 0; let lastDestroyed = void 0; const parseDirective = function(statement, context, type) { mermaidAPI.parseDirective(this, statement, context, type); }; const addBox = function(data) { boxes.push({ name: data.text, wrap: data.wrap === void 0 && autoWrap() || !!data.wrap, fill: data.color, actorKeys: [] }); currentBox = boxes.slice(-1)[0]; }; const addActor = function(id, name, description, type) { let assignedBox = currentBox; const old = actors[id]; if (old) { if (currentBox && old.box && currentBox !== old.box) { throw new Error( "A same participant should only be defined in one Box: " + old.name + " can't be in '" + old.box.name + "' and in '" + currentBox.name + "' at the same time." ); } assignedBox = old.box ? old.box : currentBox; old.box = assignedBox; if (old && name === old.name && description == null) { return; } } if (description == null || description.text == null) { description = { text: name, wrap: null, type }; } if (type == null || description.text == null) { description = { text: name, wrap: null, type }; } actors[id] = { box: assignedBox, name, description: description.text, wrap: description.wrap === void 0 && autoWrap() || !!description.wrap, prevActor, links: {}, properties: {}, actorCnt: null, rectData: null, type: type || "participant" }; if (prevActor && actors[prevActor]) { actors[prevActor].nextActor = id; } if (currentBox) { currentBox.actorKeys.push(id); } prevActor = id; }; const activationCount = (part) => { let i; let count = 0; for (i = 0; i < messages.length; i++) { if (messages[i].type === LINETYPE.ACTIVE_START && messages[i].from.actor === part) { count++; } if (messages[i].type === LINETYPE.ACTIVE_END && messages[i].from.actor === part) { count--; } } return count; }; const addMessage = function(idFrom, idTo, message, answer) { messages.push({ from: idFrom, to: idTo, message: message.text, wrap: message.wrap === void 0 && autoWrap() || !!message.wrap, answer }); }; const addSignal = function(idFrom, idTo, message = { text: void 0, wrap: void 0 }, messageType) { if (messageType === LINETYPE.ACTIVE_END) { const cnt = activationCount(idFrom.actor); if (cnt < 1) { let error = new Error("Trying to inactivate an inactive participant (" + idFrom.actor + ")"); error.hash = { text: "->>-", token: "->>-", line: "1", loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 }, expected: ["'ACTIVE_PARTICIPANT'"] }; throw error; } } messages.push({ from: idFrom, to: idTo, message: message.text, wrap: message.wrap === void 0 && autoWrap() || !!message.wrap, type: messageType }); return true; }; const hasAtLeastOneBox = function() { return boxes.length > 0; }; const hasAtLeastOneBoxWithTitle = function() { return boxes.some((b) => b.name); }; const getMessages = function() { return messages; }; const getBoxes = function() { return boxes; }; const getActors = function() { return actors; }; const getCreatedActors = function() { return createdActors; }; const getDestroyedActors = function() { return destroyedActors; }; const getActor = function(id) { return actors[id]; }; const getActorKeys = function() { return Object.keys(actors); }; const enableSequenceNumbers = function() { sequenceNumbersEnabled = true; }; const disableSequenceNumbers = function() { sequenceNumbersEnabled = false; }; const showSequenceNumbers = () => sequenceNumbersEnabled; const setWrap = function(wrapSetting) { wrapEnabled = wrapSetting; }; const autoWrap = () => { if (wrapEnabled !== void 0) { return wrapEnabled; } return getConfig().sequence.wrap; }; const clear = function() { actors = {}; createdActors = {}; destroyedActors = {}; boxes = []; messages = []; sequenceNumbersEnabled = false; clear$1(); }; const parseMessage = function(str) { const _str = str.trim(); const message = { text: _str.replace(/^:?(?:no)?wrap:/, "").trim(), wrap: _str.match(/^:?wrap:/) !== null ? true : _str.match(/^:?nowrap:/) !== null ? false : void 0 }; log.debug("parseMessage:", message); return message; }; const parseBoxData = function(str) { const match = str.match(/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/); let color = match != null && match[1] ? match[1].trim() : "transparent"; let title = match != null && match[2] ? match[2].trim() : void 0; if (window && window.CSS) { if (!window.CSS.supports("color", color)) { color = "transparent"; title = str.trim(); } } else { const style = new Option().style; style.color = color; if (style.color !== color) { color = "transparent"; title = str.trim(); } } const boxData = { color, text: title !== void 0 ? sanitizeText(tit