{"version":3,"file":"sequenceDiagram-5072c6f4.js","sources":["../src/diagrams/sequence/parser/sequenceDiagram.jison","../src/diagrams/sequence/sequenceDb.js","../src/diagrams/sequence/styles.js","../src/diagrams/sequence/svgDraw.js","../src/diagrams/sequence/sequenceRenderer.ts","../src/diagrams/sequence/sequenceDiagram.ts"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2014-2015 Knut Sveidqvist\n * MIT license.\n *\n * Based on js sequence diagrams jison grammr\n * https://bramp.github.io/js-sequence-diagrams/\n * (c) 2012-2013 Andrew Brampton (bramp.net)\n * Simplified BSD license.\n */\n%lex\n\n%options case-insensitive\n\n// Special states for recognizing aliases\n// A special state for grabbing text up to the first comment/newline\n%x ID ALIAS LINE\n\n// Directive states\n%x open_directive type_directive arg_directive\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n%%\n\n\\%\\%\\{ { this.begin('open_directive'); return 'open_directive'; }\n((?:(?!\\}\\%\\%)[^:.])*) { this.begin('type_directive'); return 'type_directive'; }\n\":\" { this.popState(); this.begin('arg_directive'); return ':'; }\n\\}\\%\\% { this.popState(); this.popState(); return 'close_directive'; }\n((?:(?!\\}\\%\\%).|\\n)*) return 'arg_directive';\n[\\n]+ return 'NEWLINE';\n\\s+ /* skip all whitespace */\n((?!\\n)\\s)+ /* skip same-line whitespace */\n\\#[^\\n]* /* skip comments */\n\\%%(?!\\{)[^\\n]* /* skip comments */\n[^\\}]\\%\\%[^\\n]* /* skip comments */\n[0-9]+(?=[ \\n]+) \t\t\t\t\t\t\t\t\t\t\treturn 'NUM';\n\"box\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ this.begin('LINE'); return 'box'; }\n\"participant\" { this.begin('ID'); return 'participant'; }\n\"actor\" \t\t{ this.begin('ID'); return 'participant_actor'; }\n[^\\->:\\n,;]+?([\\-]*[^\\->:\\n,;]+?)*?(?=((?!\\n)\\s)+\"as\"(?!\\n)\\s|[#\\n;]|$) { yytext = yytext.trim(); this.begin('ALIAS'); return 'ACTOR'; }\n\"as\" { this.popState(); this.popState(); this.begin('LINE'); return 'AS'; }\n(?:) { this.popState(); this.popState(); return 'NEWLINE'; }\n\"loop\" { this.begin('LINE'); return 'loop'; }\n\"rect\" { this.begin('LINE'); return 'rect'; }\n\"opt\" { this.begin('LINE'); return 'opt'; }\n\"alt\" { this.begin('LINE'); return 'alt'; }\n\"else\" { this.begin('LINE'); return 'else'; }\n\"par\" { this.begin('LINE'); return 'par'; }\n\"and\" { this.begin('LINE'); return 'and'; }\n\"critical\" { this.begin('LINE'); return 'critical'; }\n\"option\" { this.begin('LINE'); return 'option'; }\n\"break\" { this.begin('LINE'); return 'break'; }\n(?:[:]?(?:no)?wrap:)?[^#\\n;]* { this.popState(); return 'restOfLine'; }\n\"end\" return 'end';\n\"left of\" return 'left_of';\n\"right of\" return 'right_of';\n\"links\" return 'links';\n\"link\" return 'link';\n\"properties\" return 'properties';\n\"details\" return 'details';\n\"over\" return 'over';\n\"note\" return 'note';\n\"activate\" { this.begin('ID'); return 'activate'; }\n\"deactivate\" { this.begin('ID'); return 'deactivate'; }\n\"title\"\\s[^#\\n;]+ return 'title';\n\"title:\"\\s[^#\\n;]+ return 'legacy_title';\naccTitle\\s*\":\"\\s* { this.begin(\"acc_title\");return 'acc_title'; }\n(?!\\n|;|#)*[^\\n]* { this.popState(); return \"acc_title_value\"; }\naccDescr\\s*\":\"\\s* { this.begin(\"acc_descr\");return 'acc_descr'; }\n(?!\\n|;|#)*[^\\n]* { this.popState(); return \"acc_descr_value\"; }\naccDescr\\s*\"{\"\\s* { this.begin(\"acc_descr_multiline\");}\n[\\}] { this.popState(); }\n[^\\}]* return \"acc_descr_multiline_value\";\n\"sequenceDiagram\" return 'SD';\n\"autonumber\" return 'autonumber';\n\"off\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn 'off';\n\",\" return ',';\n\";\" return 'NEWLINE';\n[^\\+\\->:\\n,;]+((?!(\\-x|\\-\\-x|\\-\\)|\\-\\-\\)))[\\-]*[^\\+\\->:\\n,;]+)* { yytext = yytext.trim(); return 'ACTOR'; }\n\"->>\" return 'SOLID_ARROW';\n\"-->>\" return 'DOTTED_ARROW';\n\"->\" return 'SOLID_OPEN_ARROW';\n\"-->\" return 'DOTTED_OPEN_ARROW';\n\\-[x] return 'SOLID_CROSS';\n\\-\\-[x] return 'DOTTED_CROSS';\n\\-[\\)] return 'SOLID_POINT';\n\\-\\-[\\)] return 'DOTTED_POINT';\n\":\"(?:(?:no)?wrap:)?[^#\\n;]+ return 'TXT';\n\"+\" return '+';\n\"-\" return '-';\n<> return 'NEWLINE';\n. return 'INVALID';\n\n/lex\n\n%left '^'\n\n%start start\n\n%% /* language grammar */\n\nstart\n\t: SPACE start\n\t| NEWLINE start\n\t| directive start\n\t| SD document { yy.apply($2);return $2; }\n\t;\n\ndocument\n\t: /* empty */ { $$ = [] }\n\t| document line {$1.push($2);$$ = $1}\n\t;\n\nline\n\t: SPACE statement { $$ = $2 }\n\t| statement { $$ = $1 }\n\t| NEWLINE { $$=[]; }\n\t;\n\nbox_section\n\t: /* empty */ { $$ = [] }\n\t| box_section box_line {$1.push($2);$$ = $1}\n\t;\n\nbox_line\n\t: SPACE participant_statement { $$ = $2 }\n\t| participant_statement { $$ = $1 }\n\t| NEWLINE { $$=[]; }\n\t;\n\n\ndirective\n : openDirective typeDirective closeDirective 'NEWLINE'\n | openDirective typeDirective ':' argDirective closeDirective 'NEWLINE'\n ;\n\nstatement\n\t: participant_statement\n\t| 'box' restOfLine box_section end\n\t{\n\t\t$3.unshift({type: 'boxStart', boxData:yy.parseBoxData($2) });\n\t\t$3.push({type: 'boxEnd', boxText:$2});\n\t\t$$=$3;}\n\t| signal 'NEWLINE'\n\t| autonumber NUM NUM 'NEWLINE' { $$= {type:'sequenceIndex',sequenceIndex: Number($2), sequenceIndexStep:Number($3), sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER};}\n\t| autonumber NUM 'NEWLINE' { $$ = {type:'sequenceIndex',sequenceIndex: Number($2), sequenceIndexStep:1, sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER};}\n\t| autonumber off 'NEWLINE' { $$ = {type:'sequenceIndex', sequenceVisible:false, signalType:yy.LINETYPE.AUTONUMBER};}\n\t| autonumber 'NEWLINE' {$$ = {type:'sequenceIndex', sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; }\n\t| 'activate' actor 'NEWLINE' {$$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $2};}\n\t| 'deactivate' actor 'NEWLINE' {$$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $2};}\n\t| note_statement 'NEWLINE'\n\t| links_statement 'NEWLINE'\n\t| link_statement 'NEWLINE'\n\t| properties_statement 'NEWLINE'\n\t| details_statement 'NEWLINE'\n\t| title {yy.setDiagramTitle($1.substring(6));$$=$1.substring(6);}\n\t| legacy_title {yy.setDiagramTitle($1.substring(7));$$=$1.substring(7);}\n | acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }\n | acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }\n | acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); }\n\t| 'loop' restOfLine document end\n\t{\n\t\t$3.unshift({type: 'loopStart', loopText:yy.parseMessage($2), signalType: yy.LINETYPE.LOOP_START});\n\t\t$3.push({type: 'loopEnd', loopText:$2, signalType: yy.LINETYPE.LOOP_END});\n\t\t$$=$3;}\n\t| 'rect' restOfLine document end\n\t{\n\t\t$3.unshift({type: 'rectStart', color:yy.parseMessage($2), signalType: yy.LINETYPE.RECT_START });\n\t\t$3.push({type: 'rectEnd', color:yy.parseMessage($2), signalType: yy.LINETYPE.RECT_END });\n\t\t$$=$3;}\n\t| opt restOfLine document end\n\t{\n\t\t$3.unshift({type: 'optStart', optText:yy.parseMessage($2), signalType: yy.LINETYPE.OPT_START});\n\t\t$3.push({type: 'optEnd', optText:yy.parseMessage($2), signalType: yy.LINETYPE.OPT_END});\n\t\t$$=$3;}\n\t| alt restOfLine else_sections end\n\t{\n\t\t// Alt start\n\t\t$3.unshift({type: 'altStart', altText:yy.parseMessage($2), signalType: yy.LINETYPE.ALT_START});\n\t\t// Content in alt is already in $3\n\t\t// End\n\t\t$3.push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END});\n\t\t$$=$3;}\n\t| par restOfLine par_sections end\n\t{\n\t\t// Parallel start\n\t\t$3.unshift({type: 'parStart', parText:yy.parseMessage($2), signalType: yy.LINETYPE.PAR_START});\n\t\t// Content in par is already in $3\n\t\t// End\n\t\t$3.push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END});\n\t\t$$=$3;}\n\t| critical restOfLine option_sections end\n\t{\n\t\t// critical start\n\t\t$3.unshift({type: 'criticalStart', criticalText:yy.parseMessage($2), signalType: yy.LINETYPE.CRITICAL_START});\n\t\t// Content in critical is already in $3\n\t\t// critical end\n\t\t$3.push({type: 'criticalEnd', signalType: yy.LINETYPE.CRITICAL_END});\n\t\t$$=$3;}\n\t| break restOfLine document end\n\t{\n\t\t$3.unshift({type: 'breakStart', breakText:yy.parseMessage($2), signalType: yy.LINETYPE.BREAK_START});\n\t\t$3.push({type: 'breakEnd', optText:yy.parseMessage($2), signalType: yy.LINETYPE.BREAK_END});\n\t\t$$=$3;}\n | directive\n\t;\n\noption_sections\n\t: document\n\t| document option restOfLine option_sections\n\t{ $$ = $1.concat([{type: 'option', optionText:yy.parseMessage($3), signalType: yy.LINETYPE.CRITICAL_OPTION}, $4]); }\n\t;\n\npar_sections\n\t: document\n\t| document and restOfLine par_sections\n\t{ $$ = $1.concat([{type: 'and', parText:yy.parseMessage($3), signalType: yy.LINETYPE.PAR_AND}, $4]); }\n\t;\n\nelse_sections\n\t: document\n\t| document else restOfLine else_sections\n\t{ $$ = $1.concat([{type: 'else', altText:yy.parseMessage($3), signalType: yy.LINETYPE.ALT_ELSE}, $4]); }\n\t;\n\nparticipant_statement\n\t: 'participant' actor 'AS' restOfLine 'NEWLINE' {$2.type='addParticipant';$2.description=yy.parseMessage($4); $$=$2;}\n\t| 'participant' actor 'NEWLINE' {$2.type='addParticipant';$$=$2;}\n\t| 'participant_actor' actor 'AS' restOfLine 'NEWLINE' {$2.type='addActor';$2.description=yy.parseMessage($4); $$=$2;}\n\t| 'participant_actor' actor 'NEWLINE' {$2.type='addActor'; $$=$2;}\n\t;\n\nnote_statement\n\t: 'note' placement actor text2\n\t{\n\t\t$$ = [$3, {type:'addNote', placement:$2, actor:$3.actor, text:$4}];}\n\t| 'note' 'over' actor_pair text2\n\t{\n\t\t// Coerce actor_pair into a [to, from, ...] array\n\t\t$2 = [].concat($3, $3).slice(0, 2);\n\t\t$2[0] = $2[0].actor;\n\t\t$2[1] = $2[1].actor;\n\t\t$$ = [$3, {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$2.slice(0, 2), text:$4}];}\n\t;\n\nlinks_statement\n\t: 'links' actor text2\n\t{\n\t\t$$ = [$2, {type:'addLinks', actor:$2.actor, text:$3}];\n }\n\t;\n\nlink_statement\n\t: 'link' actor text2\n\t{\n\t\t$$ = [$2, {type:'addALink', actor:$2.actor, text:$3}];\n }\n\t;\n\nproperties_statement\n\t: 'properties' actor text2\n\t{\n\t\t$$ = [$2, {type:'addProperties', actor:$2.actor, text:$3}];\n }\n\t;\n\ndetails_statement\n\t: 'details' actor text2\n\t{\n\t\t$$ = [$2, {type:'addDetails', actor:$2.actor, text:$3}];\n }\n\t;\n\nspaceList\n : SPACE spaceList\n | SPACE\n ;\nactor_pair\n\t: actor ',' actor { $$ = [$1, $3]; }\n\t| actor { $$ = $1; }\n\t;\n\nplacement\n\t: 'left_of' { $$ = yy.PLACEMENT.LEFTOF; }\n\t| 'right_of' { $$ = yy.PLACEMENT.RIGHTOF; }\n\t;\n\nsignal\n\t: actor signaltype '+' actor text2\n\t{ $$ = [$1,$4,{type: 'addMessage', from:$1.actor, to:$4.actor, signalType:$2, msg:$5},\n\t {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $4}\n\t ]}\n\t| actor signaltype '-' actor text2\n\t{ $$ = [$1,$4,{type: 'addMessage', from:$1.actor, to:$4.actor, signalType:$2, msg:$5},\n\t {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $1}\n\t ]}\n\t| actor signaltype actor text2\n\t{ $$ = [$1,$3,{type: 'addMessage', from:$1.actor, to:$3.actor, signalType:$2, msg:$4}]}\n\t;\n\n// actor\n// \t: actor_participant\n// \t| actor_actor\n// \t;\n\nactor: ACTOR {$$={ type: 'addParticipant', actor:$1}};\n// actor_actor: ACTOR {$$={type: 'addActor', actor:$1}};\n\nsignaltype\n\t: SOLID_OPEN_ARROW { $$ = yy.LINETYPE.SOLID_OPEN; }\n\t| DOTTED_OPEN_ARROW { $$ = yy.LINETYPE.DOTTED_OPEN; }\n\t| SOLID_ARROW { $$ = yy.LINETYPE.SOLID; }\n\t| DOTTED_ARROW { $$ = yy.LINETYPE.DOTTED; }\n\t| SOLID_CROSS { $$ = yy.LINETYPE.SOLID_CROSS; }\n\t| DOTTED_CROSS { $$ = yy.LINETYPE.DOTTED_CROSS; }\n\t| SOLID_POINT { $$ = yy.LINETYPE.SOLID_POINT; }\n\t| DOTTED_POINT { $$ = yy.LINETYPE.DOTTED_POINT; }\n\t;\n\ntext2\n : TXT {$$ = yy.parseMessage($1.trim().substring(1)) }\n ;\n\nopenDirective\n : open_directive { yy.parseDirective('%%{', 'open_directive'); }\n ;\n\ntypeDirective\n : type_directive { yy.parseDirective($1, 'type_directive'); }\n ;\n\nargDirective\n : arg_directive { $1 = $1.trim().replace(/'/g, '\"'); yy.parseDirective($1, 'arg_directive'); }\n ;\n\ncloseDirective\n : close_directive { yy.parseDirective('}%%', 'close_directive', 'sequence'); }\n ;\n\n%%\n","import mermaidAPI from '../../mermaidAPI';\nimport * as configApi from '../../config';\nimport { log } from '../../logger';\nimport { sanitizeText } from '../common/common';\nimport {\n setAccTitle,\n getAccTitle,\n setDiagramTitle,\n getDiagramTitle,\n getAccDescription,\n setAccDescription,\n clear as commonClear,\n} from '../../commonDb';\n\nlet prevActor = undefined;\nlet actors = {};\nlet boxes = [];\nlet messages = [];\nconst notes = [];\nlet sequenceNumbersEnabled = false;\nlet wrapEnabled;\nlet currentBox = undefined;\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nexport const addBox = function (data) {\n boxes.push({\n name: data.text,\n wrap: (data.wrap === undefined && autoWrap()) || !!data.wrap,\n fill: data.color,\n actorKeys: [],\n });\n currentBox = boxes.slice(-1)[0];\n};\n\nexport const addActor = function (id, name, description, type) {\n let assignedBox = currentBox;\n const old = actors[id];\n if (old) {\n // If already set and trying to set to a new one throw error\n if (currentBox && old.box && currentBox !== old.box) {\n throw new Error(\n 'A same participant should only be defined in one Box: ' +\n old.name +\n \" can't be in '\" +\n old.box.name +\n \"' and in '\" +\n currentBox.name +\n \"' at the same time.\"\n );\n }\n\n // Don't change the box if already\n assignedBox = old.box ? old.box : currentBox;\n old.box = assignedBox;\n\n // Don't allow description nulling\n if (old && name === old.name && description == null) {\n return;\n }\n }\n\n // Don't allow null descriptions, either\n if (description == null || description.text == null) {\n description = { text: name, wrap: null, type };\n }\n if (type == null || description.text == null) {\n description = { text: name, wrap: null, type };\n }\n\n actors[id] = {\n box: assignedBox,\n name: name,\n description: description.text,\n wrap: (description.wrap === undefined && autoWrap()) || !!description.wrap,\n prevActor: prevActor,\n links: {},\n properties: {},\n actorCnt: null,\n rectData: null,\n type: type || 'participant',\n };\n if (prevActor && actors[prevActor]) {\n actors[prevActor].nextActor = id;\n }\n\n if (currentBox) {\n currentBox.actorKeys.push(id);\n }\n prevActor = id;\n};\n\nconst activationCount = (part) => {\n let i;\n let count = 0;\n for (i = 0; i < messages.length; i++) {\n if (messages[i].type === LINETYPE.ACTIVE_START && messages[i].from.actor === part) {\n count++;\n }\n if (messages[i].type === LINETYPE.ACTIVE_END && messages[i].from.actor === part) {\n count--;\n }\n }\n return count;\n};\n\nexport const addMessage = function (idFrom, idTo, message, answer) {\n messages.push({\n from: idFrom,\n to: idTo,\n message: message.text,\n wrap: (message.wrap === undefined && autoWrap()) || !!message.wrap,\n answer: answer,\n });\n};\n\nexport const addSignal = function (\n idFrom,\n idTo,\n message = { text: undefined, wrap: undefined },\n messageType\n) {\n if (messageType === LINETYPE.ACTIVE_END) {\n const cnt = activationCount(idFrom.actor);\n if (cnt < 1) {\n // Bail out as there is an activation signal from an inactive participant\n let error = new Error('Trying to inactivate an inactive participant (' + idFrom.actor + ')');\n error.hash = {\n text: '->>-',\n token: '->>-',\n line: '1',\n loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },\n expected: [\"'ACTIVE_PARTICIPANT'\"],\n };\n throw error;\n }\n }\n messages.push({\n from: idFrom,\n to: idTo,\n message: message.text,\n wrap: (message.wrap === undefined && autoWrap()) || !!message.wrap,\n type: messageType,\n });\n return true;\n};\n\nexport const hasAtLeastOneBox = function () {\n return boxes.length > 0;\n};\n\nexport const hasAtLeastOneBoxWithTitle = function () {\n return boxes.some((b) => b.name);\n};\n\nexport const getMessages = function () {\n return messages;\n};\n\nexport const getBoxes = function () {\n return boxes;\n};\nexport const getActors = function () {\n return actors;\n};\nexport const getActor = function (id) {\n return actors[id];\n};\nexport const getActorKeys = function () {\n return Object.keys(actors);\n};\nexport const enableSequenceNumbers = function () {\n sequenceNumbersEnabled = true;\n};\nexport const disableSequenceNumbers = function () {\n sequenceNumbersEnabled = false;\n};\nexport const showSequenceNumbers = () => sequenceNumbersEnabled;\n\nexport const setWrap = function (wrapSetting) {\n wrapEnabled = wrapSetting;\n};\n\nexport const autoWrap = () => {\n // if setWrap has been called, use that value, otherwise use the value from the config\n // TODO: refactor, always use the config value let setWrap update the config value\n if (wrapEnabled !== undefined) {\n return wrapEnabled;\n }\n return configApi.getConfig().sequence.wrap;\n};\n\nexport const clear = function () {\n actors = {};\n boxes = [];\n messages = [];\n sequenceNumbersEnabled = false;\n commonClear();\n};\n\nexport const parseMessage = function (str) {\n const _str = str.trim();\n const message = {\n text: _str.replace(/^:?(?:no)?wrap:/, '').trim(),\n wrap:\n _str.match(/^:?wrap:/) !== null\n ? true\n : _str.match(/^:?nowrap:/) !== null\n ? false\n : undefined,\n };\n log.debug('parseMessage:', message);\n return message;\n};\n\n// We expect the box statement to be color first then description\n// The color can be rgb,rgba,hsl,hsla, or css code names #hex codes are not supported for now because of the way the char # is handled\n// We extract first segment as color, the rest of the line is considered as text\nexport const parseBoxData = function (str) {\n const match = str.match(/^((?:rgba?|hsla?)\\s*\\(.*\\)|\\w*)(.*)$/);\n let color = match != null && match[1] ? match[1].trim() : 'transparent';\n let title = match != null && match[2] ? match[2].trim() : undefined;\n\n // check that the string is a color\n if (window && window.CSS) {\n if (!window.CSS.supports('color', color)) {\n color = 'transparent';\n title = str.trim();\n }\n } else {\n const style = new Option().style;\n style.color = color;\n if (style.color !== color) {\n color = 'transparent';\n title = str.trim();\n }\n }\n\n const boxData = {\n color: color,\n text:\n title !== undefined\n ? sanitizeText(title.replace(/^:?(?:no)?wrap:/, ''), configApi.getConfig())\n : undefined,\n wrap:\n title !== undefined\n ? title.match(/^:?wrap:/) !== null\n ? true\n : title.match(/^:?nowrap:/) !== null\n ? false\n : undefined\n : undefined,\n };\n return boxData;\n};\n\nexport const LINETYPE = {\n SOLID: 0,\n DOTTED: 1,\n NOTE: 2,\n SOLID_CROSS: 3,\n DOTTED_CROSS: 4,\n SOLID_OPEN: 5,\n DOTTED_OPEN: 6,\n LOOP_START: 10,\n LOOP_END: 11,\n ALT_START: 12,\n ALT_ELSE: 13,\n ALT_END: 14,\n OPT_START: 15,\n OPT_END: 16,\n ACTIVE_START: 17,\n ACTIVE_END: 18,\n PAR_START: 19,\n PAR_AND: 20,\n PAR_END: 21,\n RECT_START: 22,\n RECT_END: 23,\n SOLID_POINT: 24,\n DOTTED_POINT: 25,\n AUTONUMBER: 26,\n CRITICAL_START: 27,\n CRITICAL_OPTION: 28,\n CRITICAL_END: 29,\n BREAK_START: 30,\n BREAK_END: 31,\n};\n\nexport const ARROWTYPE = {\n FILLED: 0,\n OPEN: 1,\n};\n\nexport const PLACEMENT = {\n LEFTOF: 0,\n RIGHTOF: 1,\n OVER: 2,\n};\n\nexport const addNote = function (actor, placement, message) {\n const note = {\n actor: actor,\n placement: placement,\n message: message.text,\n wrap: (message.wrap === undefined && autoWrap()) || !!message.wrap,\n };\n\n // Coerce actor into a [to, from, ...] array\n // eslint-disable-next-line unicorn/prefer-spread\n const actors = [].concat(actor, actor);\n\n notes.push(note);\n messages.push({\n from: actors[0],\n to: actors[1],\n message: message.text,\n wrap: (message.wrap === undefined && autoWrap()) || !!message.wrap,\n type: LINETYPE.NOTE,\n placement: placement,\n });\n};\n\nexport const addLinks = function (actorId, text) {\n // find the actor\n const actor = getActor(actorId);\n // JSON.parse the text\n try {\n let sanitizedText = sanitizeText(text.text, configApi.getConfig());\n sanitizedText = sanitizedText.replace(/&/g, '&');\n sanitizedText = sanitizedText.replace(/=/g, '=');\n const links = JSON.parse(sanitizedText);\n // add the deserialized text to the actor's links field.\n insertLinks(actor, links);\n } catch (e) {\n log.error('error while parsing actor link text', e);\n }\n};\n\nexport const addALink = function (actorId, text) {\n // find the actor\n const actor = getActor(actorId);\n try {\n const links = {};\n let sanitizedText = sanitizeText(text.text, configApi.getConfig());\n var sep = sanitizedText.indexOf('@');\n sanitizedText = sanitizedText.replace(/&/g, '&');\n sanitizedText = sanitizedText.replace(/=/g, '=');\n var label = sanitizedText.slice(0, sep - 1).trim();\n var link = sanitizedText.slice(sep + 1).trim();\n\n links[label] = link;\n // add the deserialized text to the actor's links field.\n insertLinks(actor, links);\n } catch (e) {\n log.error('error while parsing actor link text', e);\n }\n};\n\n/**\n * @param {any} actor\n * @param {any} links\n */\nfunction insertLinks(actor, links) {\n if (actor.links == null) {\n actor.links = links;\n } else {\n for (let key in links) {\n actor.links[key] = links[key];\n }\n }\n}\n\nexport const addProperties = function (actorId, text) {\n // find the actor\n const actor = getActor(actorId);\n // JSON.parse the text\n try {\n let sanitizedText = sanitizeText(text.text, configApi.getConfig());\n const properties = JSON.parse(sanitizedText);\n // add the deserialized text to the actor's property field.\n insertProperties(actor, properties);\n } catch (e) {\n log.error('error while parsing actor properties text', e);\n }\n};\n\n/**\n * @param {any} actor\n * @param {any} properties\n */\nfunction insertProperties(actor, properties) {\n if (actor.properties == null) {\n actor.properties = properties;\n } else {\n for (let key in properties) {\n actor.properties[key] = properties[key];\n }\n }\n}\n\n/**\n *\n */\nfunction boxEnd() {\n currentBox = undefined;\n}\n\nexport const addDetails = function (actorId, text) {\n // find the actor\n const actor = getActor(actorId);\n const elem = document.getElementById(text.text);\n\n // JSON.parse the text\n try {\n const text = elem.innerHTML;\n const details = JSON.parse(text);\n // add the deserialized text to the actor's property field.\n if (details['properties']) {\n insertProperties(actor, details['properties']);\n }\n\n if (details['links']) {\n insertLinks(actor, details['links']);\n }\n } catch (e) {\n log.error('error while parsing actor details text', e);\n }\n};\n\nexport const getActorProperty = function (actor, key) {\n if (actor !== undefined && actor.properties !== undefined) {\n return actor.properties[key];\n }\n\n return undefined;\n};\n\nexport const apply = function (param) {\n if (Array.isArray(param)) {\n param.forEach(function (item) {\n apply(item);\n });\n } else {\n switch (param.type) {\n case 'sequenceIndex':\n messages.push({\n from: undefined,\n to: undefined,\n message: {\n start: param.sequenceIndex,\n step: param.sequenceIndexStep,\n visible: param.sequenceVisible,\n },\n wrap: false,\n type: param.signalType,\n });\n break;\n case 'addParticipant':\n addActor(param.actor, param.actor, param.description, 'participant');\n break;\n case 'addActor':\n addActor(param.actor, param.actor, param.description, 'actor');\n break;\n case 'activeStart':\n addSignal(param.actor, undefined, undefined, param.signalType);\n break;\n case 'activeEnd':\n addSignal(param.actor, undefined, undefined, param.signalType);\n break;\n case 'addNote':\n addNote(param.actor, param.placement, param.text);\n break;\n case 'addLinks':\n addLinks(param.actor, param.text);\n break;\n case 'addALink':\n addALink(param.actor, param.text);\n break;\n case 'addProperties':\n addProperties(param.actor, param.text);\n break;\n case 'addDetails':\n addDetails(param.actor, param.text);\n break;\n case 'addMessage':\n addSignal(param.from, param.to, param.msg, param.signalType);\n break;\n case 'boxStart':\n addBox(param.boxData);\n break;\n case 'boxEnd':\n boxEnd();\n break;\n case 'loopStart':\n addSignal(undefined, undefined, param.loopText, param.signalType);\n break;\n case 'loopEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n case 'rectStart':\n addSignal(undefined, undefined, param.color, param.signalType);\n break;\n case 'rectEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n case 'optStart':\n addSignal(undefined, undefined, param.optText, param.signalType);\n break;\n case 'optEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n case 'altStart':\n addSignal(undefined, undefined, param.altText, param.signalType);\n break;\n case 'else':\n addSignal(undefined, undefined, param.altText, param.signalType);\n break;\n case 'altEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n case 'setAccTitle':\n setAccTitle(param.text);\n break;\n case 'parStart':\n addSignal(undefined, undefined, param.parText, param.signalType);\n break;\n case 'and':\n addSignal(undefined, undefined, param.parText, param.signalType);\n break;\n case 'parEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n case 'criticalStart':\n addSignal(undefined, undefined, param.criticalText, param.signalType);\n break;\n case 'option':\n addSignal(undefined, undefined, param.optionText, param.signalType);\n break;\n case 'criticalEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n case 'breakStart':\n addSignal(undefined, undefined, param.breakText, param.signalType);\n break;\n case 'breakEnd':\n addSignal(undefined, undefined, undefined, param.signalType);\n break;\n }\n }\n};\n\nexport default {\n addActor,\n addMessage,\n addSignal,\n addLinks,\n addDetails,\n addProperties,\n autoWrap,\n setWrap,\n enableSequenceNumbers,\n disableSequenceNumbers,\n showSequenceNumbers,\n getMessages,\n getActors,\n getActor,\n getActorKeys,\n getActorProperty,\n getAccTitle,\n getBoxes,\n getDiagramTitle,\n setDiagramTitle,\n parseDirective,\n getConfig: () => configApi.getConfig().sequence,\n clear,\n parseMessage,\n parseBoxData,\n LINETYPE,\n ARROWTYPE,\n PLACEMENT,\n addNote,\n setAccTitle,\n apply,\n setAccDescription,\n getAccDescription,\n hasAtLeastOneBox,\n hasAtLeastOneBoxWithTitle,\n};\n","const getStyles = (options) =>\n `.actor {\n stroke: ${options.actorBorder};\n fill: ${options.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${options.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${options.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${options.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${options.signalColor};\n }\n\n #arrowhead path {\n fill: ${options.signalColor};\n stroke: ${options.signalColor};\n }\n\n .sequenceNumber {\n fill: ${options.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${options.signalColor};\n }\n\n #crosshead path {\n fill: ${options.signalColor};\n stroke: ${options.signalColor};\n }\n\n .messageText {\n fill: ${options.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${options.labelBoxBorderColor};\n fill: ${options.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${options.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${options.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${options.labelBoxBorderColor};\n fill: ${options.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${options.noteBorderColor};\n fill: ${options.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${options.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${options.activationBkgColor};\n stroke: ${options.activationBorderColor};\n }\n\n .activation1 {\n fill: ${options.activationBkgColor};\n stroke: ${options.activationBorderColor};\n }\n\n .activation2 {\n fill: ${options.activationBkgColor};\n stroke: ${options.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${options.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${options.actorBorder};\n fill: ${options.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${options.actorBorder};\n fill: ${options.actorBkg};\n stroke-width: 2px;\n }\n`;\n\nexport default getStyles;\n","import common from '../common/common';\nimport { addFunction } from '../../interactionDb';\nimport { parseFontSize } from '../../utils';\nimport { sanitizeUrl } from '@braintree/sanitize-url';\n\nexport const drawRect = function (elem, rectData) {\n const rectElem = elem.append('rect');\n rectElem.attr('x', rectData.x);\n rectElem.attr('y', rectData.y);\n rectElem.attr('fill', rectData.fill);\n rectElem.attr('stroke', rectData.stroke);\n rectElem.attr('width', rectData.width);\n rectElem.attr('height', rectData.height);\n rectElem.attr('rx', rectData.rx);\n rectElem.attr('ry', rectData.ry);\n\n if (rectData.class !== undefined) {\n rectElem.attr('class', rectData.class);\n }\n\n return rectElem;\n};\n\n// const sanitizeUrl = function (s) {\n// return s\n// .replace(/&/g, '&')\n// .replace(/ {\n addFunction(() => {\n const arr = document.querySelectorAll(id);\n // This will be the case when running in sandboxed mode\n if (arr.length === 0) {\n return;\n }\n arr[0].addEventListener('mouseover', function () {\n popupMenuUpFunc('actor' + actorCnt + '_popup');\n });\n arr[0].addEventListener('mouseout', function () {\n popupMenuDownFunc('actor' + actorCnt + '_popup');\n });\n });\n};\nexport const drawPopup = function (elem, actor, minMenuWidth, textAttrs, forceMenus) {\n if (actor.links === undefined || actor.links === null || Object.keys(actor.links).length === 0) {\n return { height: 0, width: 0 };\n }\n\n const links = actor.links;\n const actorCnt = actor.actorCnt;\n const rectData = actor.rectData;\n\n var displayValue = 'none';\n if (forceMenus) {\n displayValue = 'block !important';\n }\n\n const g = elem.append('g');\n g.attr('id', 'actor' + actorCnt + '_popup');\n g.attr('class', 'actorPopupMenu');\n g.attr('display', displayValue);\n addPopupInteraction('#actor' + actorCnt + '_popup', actorCnt);\n var actorClass = '';\n if (rectData.class !== undefined) {\n actorClass = ' ' + rectData.class;\n }\n\n let menuWidth = rectData.width > minMenuWidth ? rectData.width : minMenuWidth;\n\n const rectElem = g.append('rect');\n rectElem.attr('class', 'actorPopupMenuPanel' + actorClass);\n rectElem.attr('x', rectData.x);\n rectElem.attr('y', rectData.height);\n rectElem.attr('fill', rectData.fill);\n rectElem.attr('stroke', rectData.stroke);\n rectElem.attr('width', menuWidth);\n rectElem.attr('height', rectData.height);\n rectElem.attr('rx', rectData.rx);\n rectElem.attr('ry', rectData.ry);\n if (links != null) {\n var linkY = 20;\n for (let key in links) {\n var linkElem = g.append('a');\n var sanitizedLink = sanitizeUrl(links[key]);\n linkElem.attr('xlink:href', sanitizedLink);\n linkElem.attr('target', '_blank');\n\n _drawMenuItemTextCandidateFunc(textAttrs)(\n key,\n linkElem,\n rectData.x + 10,\n rectData.height + linkY,\n menuWidth,\n 20,\n { class: 'actor' },\n textAttrs\n );\n\n linkY += 30;\n }\n }\n\n rectElem.attr('height', linkY);\n\n return { height: rectData.height + linkY, width: menuWidth };\n};\n\nexport const drawImage = function (elem, x, y, link) {\n const imageElem = elem.append('image');\n imageElem.attr('x', x);\n imageElem.attr('y', y);\n var sanitizedLink = sanitizeUrl(link);\n imageElem.attr('xlink:href', sanitizedLink);\n};\n\nexport const drawEmbeddedImage = function (elem, x, y, link) {\n const imageElem = elem.append('use');\n imageElem.attr('x', x);\n imageElem.attr('y', y);\n var sanitizedLink = sanitizeUrl(link);\n imageElem.attr('xlink:href', '#' + sanitizedLink);\n};\n\nexport const popupMenu = function (popid) {\n return (\n \"var pu = document.getElementById('\" +\n popid +\n \"'); if (pu != null) { pu.style.display = 'block'; }\"\n );\n};\n\nexport const popdownMenu = function (popid) {\n return (\n \"var pu = document.getElementById('\" +\n popid +\n \"'); if (pu != null) { pu.style.display = 'none'; }\"\n );\n};\n\nconst popupMenuUpFunc = function (popupId) {\n var pu = document.getElementById(popupId);\n if (pu != null) {\n pu.style.display = 'block';\n }\n};\n\nconst popupMenuDownFunc = function (popupId) {\n var pu = document.getElementById(popupId);\n if (pu != null) {\n pu.style.display = 'none';\n }\n};\nexport const drawText = function (elem, textData) {\n let prevTextHeight = 0,\n textHeight = 0;\n const lines = textData.text.split(common.lineBreakRegex);\n\n const [_textFontSize, _textFontSizePx] = parseFontSize(textData.fontSize);\n\n let textElems = [];\n let dy = 0;\n let yfunc = () => textData.y;\n if (\n textData.valign !== undefined &&\n textData.textMargin !== undefined &&\n textData.textMargin > 0\n ) {\n switch (textData.valign) {\n case 'top':\n case 'start':\n yfunc = () => Math.round(textData.y + textData.textMargin);\n break;\n case 'middle':\n case 'center':\n yfunc = () =>\n Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2);\n break;\n case 'bottom':\n case 'end':\n yfunc = () =>\n Math.round(\n textData.y +\n (prevTextHeight + textHeight + 2 * textData.textMargin) -\n textData.textMargin\n );\n break;\n }\n }\n if (\n textData.anchor !== undefined &&\n textData.textMargin !== undefined &&\n textData.width !== undefined\n ) {\n switch (textData.anchor) {\n case 'left':\n case 'start':\n textData.x = Math.round(textData.x + textData.textMargin);\n textData.anchor = 'start';\n textData.dominantBaseline = 'middle';\n textData.alignmentBaseline = 'middle';\n break;\n case 'middle':\n case 'center':\n textData.x = Math.round(textData.x + textData.width / 2);\n textData.anchor = 'middle';\n textData.dominantBaseline = 'middle';\n textData.alignmentBaseline = 'middle';\n break;\n case 'right':\n case 'end':\n textData.x = Math.round(textData.x + textData.width - textData.textMargin);\n textData.anchor = 'end';\n textData.dominantBaseline = 'middle';\n textData.alignmentBaseline = 'middle';\n break;\n }\n }\n for (let [i, line] of lines.entries()) {\n if (\n textData.textMargin !== undefined &&\n textData.textMargin === 0 &&\n _textFontSize !== undefined\n ) {\n dy = i * _textFontSize;\n }\n\n const textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', yfunc());\n if (textData.anchor !== undefined) {\n textElem\n .attr('text-anchor', textData.anchor)\n .attr('dominant-baseline', textData.dominantBaseline)\n .attr('alignment-baseline', textData.alignmentBaseline);\n }\n if (textData.fontFamily !== undefined) {\n textElem.style('font-family', textData.fontFamily);\n }\n if (_textFontSizePx !== undefined) {\n textElem.style('font-size', _textFontSizePx);\n }\n if (textData.fontWeight !== undefined) {\n textElem.style('font-weight', textData.fontWeight);\n }\n if (textData.fill !== undefined) {\n textElem.attr('fill', textData.fill);\n }\n if (textData.class !== undefined) {\n textElem.attr('class', textData.class);\n }\n if (textData.dy !== undefined) {\n textElem.attr('dy', textData.dy);\n } else if (dy !== 0) {\n textElem.attr('dy', dy);\n }\n\n if (textData.tspan) {\n const span = textElem.append('tspan');\n span.attr('x', textData.x);\n if (textData.fill !== undefined) {\n span.attr('fill', textData.fill);\n }\n span.text(line);\n } else {\n textElem.text(line);\n }\n if (\n textData.valign !== undefined &&\n textData.textMargin !== undefined &&\n textData.textMargin > 0\n ) {\n textHeight += (textElem._groups || textElem)[0][0].getBBox().height;\n prevTextHeight = textHeight;\n }\n\n textElems.push(textElem);\n }\n\n return textElems;\n};\n\nexport const drawLabel = function (elem, txtObject) {\n /**\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} cut\n * @returns {any}\n */\n function genPoints(x, y, width, height, cut) {\n return (\n x +\n ',' +\n y +\n ' ' +\n (x + width) +\n ',' +\n y +\n ' ' +\n (x + width) +\n ',' +\n (y + height - cut) +\n ' ' +\n (x + width - cut * 1.2) +\n ',' +\n (y + height) +\n ' ' +\n x +\n ',' +\n (y + height)\n );\n }\n const polygon = elem.append('polygon');\n polygon.attr('points', genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7));\n polygon.attr('class', 'labelBox');\n\n txtObject.y = txtObject.y + txtObject.height / 2;\n\n drawText(elem, txtObject);\n return polygon;\n};\n\nlet actorCnt = -1;\n\nexport const fixLifeLineHeights = (diagram, bounds) => {\n if (!diagram.selectAll) {\n return;\n }\n diagram\n .selectAll('.actor-line')\n .attr('class', '200')\n .attr('y2', bounds - 55);\n};\n\n/**\n * Draws an actor in the diagram with the attached line\n *\n * @param {any} elem - The diagram we'll draw to.\n * @param {any} actor - The actor to draw.\n * @param {any} conf - DrawText implementation discriminator object\n * @param {boolean} isFooter - If the actor is the footer one\n */\nconst drawActorTypeParticipant = function (elem, actor, conf, isFooter) {\n const center = actor.x + actor.width / 2;\n const centerY = actor.y + 5;\n\n const boxpluslineGroup = elem.append('g');\n var g = boxpluslineGroup;\n\n if (!isFooter) {\n actorCnt++;\n g.append('line')\n .attr('id', 'actor' + actorCnt)\n .attr('x1', center)\n .attr('y1', centerY)\n .attr('x2', center)\n .attr('y2', 2000)\n .attr('class', 'actor-line')\n .attr('stroke-width', '0.5px')\n .attr('stroke', '#999');\n\n g = boxpluslineGroup.append('g');\n actor.actorCnt = actorCnt;\n\n if (actor.links != null) {\n g.attr('id', 'root-' + actorCnt);\n addPopupInteraction('#root-' + actorCnt, actorCnt);\n }\n }\n\n const rect = getNoteRect();\n var cssclass = 'actor';\n if (actor.properties != null && actor.properties['class']) {\n cssclass = actor.properties['class'];\n } else {\n rect.fill = '#eaeaea';\n }\n rect.x = actor.x;\n rect.y = actor.y;\n rect.width = actor.width;\n rect.height = actor.height;\n rect.class = cssclass;\n rect.rx = 3;\n rect.ry = 3;\n const rectElem = drawRect(g, rect);\n actor.rectData = rect;\n\n if (actor.properties != null && actor.properties['icon']) {\n const iconSrc = actor.properties['icon'].trim();\n if (iconSrc.charAt(0) === '@') {\n drawEmbeddedImage(g, rect.x + rect.width - 20, rect.y + 10, iconSrc.substr(1));\n } else {\n drawImage(g, rect.x + rect.width - 20, rect.y + 10, iconSrc);\n }\n }\n\n _drawTextCandidateFunc(conf)(\n actor.description,\n g,\n rect.x,\n rect.y,\n rect.width,\n rect.height,\n { class: 'actor' },\n conf\n );\n\n let height = actor.height;\n if (rectElem.node) {\n const bounds = rectElem.node().getBBox();\n actor.height = bounds.height;\n height = bounds.height;\n }\n\n return height;\n};\n\nconst drawActorTypeActor = function (elem, actor, conf, isFooter) {\n const center = actor.x + actor.width / 2;\n const centerY = actor.y + 80;\n\n if (!isFooter) {\n actorCnt++;\n elem\n .append('line')\n .attr('id', 'actor' + actorCnt)\n .attr('x1', center)\n .attr('y1', centerY)\n .attr('x2', center)\n .attr('y2', 2000)\n .attr('class', 'actor-line')\n .attr('stroke-width', '0.5px')\n .attr('stroke', '#999');\n }\n const actElem = elem.append('g');\n actElem.attr('class', 'actor-man');\n\n const rect = getNoteRect();\n rect.x = actor.x;\n rect.y = actor.y;\n rect.fill = '#eaeaea';\n rect.width = actor.width;\n rect.height = actor.height;\n rect.class = 'actor';\n rect.rx = 3;\n rect.ry = 3;\n // drawRect(actElem, rect);\n\n actElem\n .append('line')\n .attr('id', 'actor-man-torso' + actorCnt)\n .attr('x1', center)\n .attr('y1', actor.y + 25)\n .attr('x2', center)\n .attr('y2', actor.y + 45);\n\n actElem\n .append('line')\n .attr('id', 'actor-man-arms' + actorCnt)\n .attr('x1', center - 18)\n .attr('y1', actor.y + 33)\n .attr('x2', center + 18)\n .attr('y2', actor.y + 33);\n actElem\n .append('line')\n .attr('x1', center - 18)\n .attr('y1', actor.y + 60)\n .attr('x2', center)\n .attr('y2', actor.y + 45);\n actElem\n .append('line')\n .attr('x1', center)\n .attr('y1', actor.y + 45)\n .attr('x2', center + 16)\n .attr('y2', actor.y + 60);\n\n const circle = actElem.append('circle');\n circle.attr('cx', actor.x + actor.width / 2);\n circle.attr('cy', actor.y + 10);\n circle.attr('r', 15);\n circle.attr('width', actor.width);\n circle.attr('height', actor.height);\n\n const bounds = actElem.node().getBBox();\n actor.height = bounds.height;\n\n _drawTextCandidateFunc(conf)(\n actor.description,\n actElem,\n rect.x,\n rect.y + 35,\n rect.width,\n rect.height,\n { class: 'actor' },\n conf\n );\n\n return actor.height;\n};\n\nexport const drawActor = function (elem, actor, conf, isFooter) {\n switch (actor.type) {\n case 'actor':\n return drawActorTypeActor(elem, actor, conf, isFooter);\n case 'participant':\n return drawActorTypeParticipant(elem, actor, conf, isFooter);\n }\n};\n\nexport const drawBox = function (elem, box, conf) {\n const boxplustextGroup = elem.append('g');\n const g = boxplustextGroup;\n drawBackgroundRect(g, box);\n if (box.name) {\n _drawTextCandidateFunc(conf)(\n box.name,\n g,\n box.x,\n box.y + (box.textMaxHeight || 0) / 2,\n box.width,\n 0,\n { class: 'text' },\n conf\n );\n }\n g.lower();\n};\n\nexport const anchorElement = function (elem) {\n return elem.append('g');\n};\n/**\n * Draws an activation in the diagram\n *\n * @param {any} elem - Element to append activation rect.\n * @param {any} bounds - Activation box bounds.\n * @param {any} verticalPos - Precise y coordinate of bottom activation box edge.\n * @param {any} conf - Sequence diagram config object.\n * @param {any} actorActivations - Number of activations on the actor.\n */\nexport const drawActivation = function (elem, bounds, verticalPos, conf, actorActivations) {\n const rect = getNoteRect();\n const g = bounds.anchored;\n rect.x = bounds.startx;\n rect.y = bounds.starty;\n rect.class = 'activation' + (actorActivations % 3); // Will evaluate to 0, 1 or 2\n rect.width = bounds.stopx - bounds.startx;\n rect.height = verticalPos - bounds.starty;\n drawRect(g, rect);\n};\n\n/**\n * Draws a loop in the diagram\n *\n * @param {any} elem - Element to append the loop to.\n * @param {any} loopModel - LoopModel of the given loop.\n * @param {any} labelText - Text within the loop.\n * @param {any} conf - Diagram configuration\n * @returns {any}\n */\nexport const drawLoop = function (elem, loopModel, labelText, conf) {\n const {\n boxMargin,\n boxTextMargin,\n labelBoxHeight,\n labelBoxWidth,\n messageFontFamily: fontFamily,\n messageFontSize: fontSize,\n messageFontWeight: fontWeight,\n } = conf;\n const g = elem.append('g');\n const drawLoopLine = function (startx, starty, stopx, stopy) {\n return g\n .append('line')\n .attr('x1', startx)\n .attr('y1', starty)\n .attr('x2', stopx)\n .attr('y2', stopy)\n .attr('class', 'loopLine');\n };\n drawLoopLine(loopModel.startx, loopModel.starty, loopModel.stopx, loopModel.starty);\n drawLoopLine(loopModel.stopx, loopModel.starty, loopModel.stopx, loopModel.stopy);\n drawLoopLine(loopModel.startx, loopModel.stopy, loopModel.stopx, loopModel.stopy);\n drawLoopLine(loopModel.startx, loopModel.starty, loopModel.startx, loopModel.stopy);\n if (loopModel.sections !== undefined) {\n loopModel.sections.forEach(function (item) {\n drawLoopLine(loopModel.startx, item.y, loopModel.stopx, item.y).style(\n 'stroke-dasharray',\n '3, 3'\n );\n });\n }\n\n let txt = getTextObj();\n txt.text = labelText;\n txt.x = loopModel.startx;\n txt.y = loopModel.starty;\n txt.fontFamily = fontFamily;\n txt.fontSize = fontSize;\n txt.fontWeight = fontWeight;\n txt.anchor = 'middle';\n txt.valign = 'middle';\n txt.tspan = false;\n txt.width = labelBoxWidth || 50;\n txt.height = labelBoxHeight || 20;\n txt.textMargin = boxTextMargin;\n txt.class = 'labelText';\n\n drawLabel(g, txt);\n txt = getTextObj();\n txt.text = loopModel.title;\n txt.x = loopModel.startx + labelBoxWidth / 2 + (loopModel.stopx - loopModel.startx) / 2;\n txt.y = loopModel.starty + boxMargin + boxTextMargin;\n txt.anchor = 'middle';\n txt.valign = 'middle';\n txt.textMargin = boxTextMargin;\n txt.class = 'loopText';\n txt.fontFamily = fontFamily;\n txt.fontSize = fontSize;\n txt.fontWeight = fontWeight;\n txt.wrap = true;\n\n let textElem = drawText(g, txt);\n\n if (loopModel.sectionTitles !== undefined) {\n loopModel.sectionTitles.forEach(function (item, idx) {\n if (item.message) {\n txt.text = item.message;\n txt.x = loopModel.startx + (loopModel.stopx - loopModel.startx) / 2;\n txt.y = loopModel.sections[idx].y + boxMargin + boxTextMargin;\n txt.class = 'loopText';\n txt.anchor = 'middle';\n txt.valign = 'middle';\n txt.tspan = false;\n txt.fontFamily = fontFamily;\n txt.fontSize = fontSize;\n txt.fontWeight = fontWeight;\n txt.wrap = loopModel.wrap;\n textElem = drawText(g, txt);\n let sectionHeight = Math.round(\n textElem\n .map((te) => (te._groups || te)[0][0].getBBox().height)\n .reduce((acc, curr) => acc + curr)\n );\n loopModel.sections[idx].height += sectionHeight - (boxMargin + boxTextMargin);\n }\n });\n }\n\n loopModel.height = Math.round(loopModel.stopy - loopModel.starty);\n return g;\n};\n\n/**\n * Draws a background rectangle\n *\n * @param {any} elem Diagram (reference for bounds)\n * @param {any} bounds Shape of the rectangle\n */\nexport const drawBackgroundRect = function (elem, bounds) {\n const rectElem = drawRect(elem, {\n x: bounds.startx,\n y: bounds.starty,\n width: bounds.stopx - bounds.startx,\n height: bounds.stopy - bounds.starty,\n fill: bounds.fill,\n stroke: bounds.stroke,\n class: 'rect',\n });\n rectElem.lower();\n};\n\nexport const insertDatabaseIcon = function (elem) {\n elem\n .append('defs')\n .append('symbol')\n .attr('id', 'database')\n .attr('fill-rule', 'evenodd')\n .attr('clip-rule', 'evenodd')\n .append('path')\n .attr('transform', 'scale(.5)')\n .attr(\n 'd',\n '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'\n );\n};\n\nexport const insertComputerIcon = function (elem) {\n elem\n .append('defs')\n .append('symbol')\n .attr('id', 'computer')\n .attr('width', '24')\n .attr('height', '24')\n .append('path')\n .attr('transform', 'scale(.5)')\n .attr(\n 'd',\n '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'\n );\n};\n\nexport const insertClockIcon = function (elem) {\n elem\n .append('defs')\n .append('symbol')\n .attr('id', 'clock')\n .attr('width', '24')\n .attr('height', '24')\n .append('path')\n .attr('transform', 'scale(.5)')\n .attr(\n 'd',\n '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'\n );\n};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param elem\n */\nexport const insertArrowHead = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'arrowhead')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 12)\n .attr('markerHeight', 12)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 0 0 L 10 5 L 0 10 z'); // this is actual shape for arrowhead\n};\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {any} elem\n */\nexport const insertArrowFilledHead = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'filled-head')\n .attr('refX', 18)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');\n};\n/**\n * Setup node number. The result is appended to the svg.\n *\n * @param {any} elem\n */\nexport const insertSequenceNumber = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'sequencenumber')\n .attr('refX', 15)\n .attr('refY', 15)\n .attr('markerWidth', 60)\n .attr('markerHeight', 40)\n .attr('orient', 'auto')\n .append('circle')\n .attr('cx', 15)\n .attr('cy', 15)\n .attr('r', 6);\n // .style(\"fill\", '#f00');\n};\n/**\n * Setup cross head and define the marker. The result is appended to the svg.\n *\n * @param {any} elem\n */\nexport const insertArrowCrossHead = function (elem) {\n const defs = elem.append('defs');\n const marker = defs\n .append('marker')\n .attr('id', 'crosshead')\n .attr('markerWidth', 15)\n .attr('markerHeight', 8)\n .attr('orient', 'auto')\n .attr('refX', 4)\n .attr('refY', 5);\n // The cross\n marker\n .append('path')\n .attr('fill', 'none')\n .attr('stroke', '#000000')\n .style('stroke-dasharray', '0, 0')\n .attr('stroke-width', '1pt')\n .attr('d', 'M 1,2 L 6,7 M 6,2 L 1,7');\n // this is actual shape for arrowhead\n};\n\nexport const getTextObj = function () {\n return {\n x: 0,\n y: 0,\n fill: undefined,\n anchor: undefined,\n style: '#666',\n width: undefined,\n height: undefined,\n textMargin: 0,\n rx: 0,\n ry: 0,\n tspan: true,\n valign: undefined,\n };\n};\n\nexport const getNoteRect = function () {\n return {\n x: 0,\n y: 0,\n fill: '#EDF2AE',\n stroke: '#666',\n width: 100,\n anchor: 'start',\n height: 100,\n rx: 0,\n ry: 0,\n };\n};\n\nconst _drawTextCandidateFunc = (function () {\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n */\n function byText(content, g, x, y, width, height, textAttrs) {\n const text = g\n .append('text')\n .attr('x', x + width / 2)\n .attr('y', y + height / 2 + 5)\n .style('text-anchor', 'middle')\n .text(content);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n */\n function byTspan(content, g, x, y, width, height, textAttrs, conf) {\n const { actorFontSize, actorFontFamily, actorFontWeight } = conf;\n\n const [_actorFontSize, _actorFontSizePx] = parseFontSize(actorFontSize);\n\n const lines = content.split(common.lineBreakRegex);\n for (let i = 0; i < lines.length; i++) {\n const dy = i * _actorFontSize - (_actorFontSize * (lines.length - 1)) / 2;\n const text = g\n .append('text')\n .attr('x', x + width / 2)\n .attr('y', y)\n .style('text-anchor', 'middle')\n .style('font-size', _actorFontSizePx)\n .style('font-weight', actorFontWeight)\n .style('font-family', actorFontFamily);\n text\n .append('tspan')\n .attr('x', x + width / 2)\n .attr('dy', dy)\n .text(lines[i]);\n\n text\n .attr('y', y + height / 2.0)\n .attr('dominant-baseline', 'central')\n .attr('alignment-baseline', 'central');\n\n _setTextAttrs(text, textAttrs);\n }\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n */\n function byFo(content, g, x, y, width, height, textAttrs, conf) {\n const s = g.append('switch');\n const f = s\n .append('foreignObject')\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height);\n\n const text = f\n .append('xhtml:div')\n .style('display', 'table')\n .style('height', '100%')\n .style('width', '100%');\n\n text\n .append('div')\n .style('display', 'table-cell')\n .style('text-align', 'center')\n .style('vertical-align', 'middle')\n .text(content);\n\n byTspan(content, s, x, y, width, height, textAttrs, conf);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} toText\n * @param {any} fromTextAttrsDict\n */\n function _setTextAttrs(toText, fromTextAttrsDict) {\n for (const key in fromTextAttrsDict) {\n if (fromTextAttrsDict.hasOwnProperty(key)) {\n toText.attr(key, fromTextAttrsDict[key]);\n }\n }\n }\n\n return function (conf) {\n return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;\n };\n})();\n\nconst _drawMenuItemTextCandidateFunc = (function () {\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n */\n function byText(content, g, x, y, width, height, textAttrs) {\n const text = g\n .append('text')\n .attr('x', x)\n .attr('y', y)\n .style('text-anchor', 'start')\n .text(content);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n */\n function byTspan(content, g, x, y, width, height, textAttrs, conf) {\n const { actorFontSize, actorFontFamily, actorFontWeight } = conf;\n\n const lines = content.split(common.lineBreakRegex);\n for (let i = 0; i < lines.length; i++) {\n const dy = i * actorFontSize - (actorFontSize * (lines.length - 1)) / 2;\n const text = g\n .append('text')\n .attr('x', x)\n .attr('y', y)\n .style('text-anchor', 'start')\n .style('font-size', actorFontSize)\n .style('font-weight', actorFontWeight)\n .style('font-family', actorFontFamily);\n text.append('tspan').attr('x', x).attr('dy', dy).text(lines[i]);\n\n text\n .attr('y', y + height / 2.0)\n .attr('dominant-baseline', 'central')\n .attr('alignment-baseline', 'central');\n\n _setTextAttrs(text, textAttrs);\n }\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n */\n function byFo(content, g, x, y, width, height, textAttrs, conf) {\n const s = g.append('switch');\n const f = s\n .append('foreignObject')\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height);\n\n const text = f\n .append('xhtml:div')\n .style('display', 'table')\n .style('height', '100%')\n .style('width', '100%');\n\n text\n .append('div')\n .style('display', 'table-cell')\n .style('text-align', 'center')\n .style('vertical-align', 'middle')\n .text(content);\n\n byTspan(content, s, x, y, width, height, textAttrs, conf);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} toText\n * @param {any} fromTextAttrsDict\n */\n function _setTextAttrs(toText, fromTextAttrsDict) {\n for (const key in fromTextAttrsDict) {\n if (fromTextAttrsDict.hasOwnProperty(key)) {\n toText.attr(key, fromTextAttrsDict[key]);\n }\n }\n }\n\n return function (conf) {\n return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;\n };\n})();\n\nexport default {\n drawRect,\n drawText,\n drawLabel,\n drawActor,\n drawBox,\n drawPopup,\n drawImage,\n drawEmbeddedImage,\n anchorElement,\n drawActivation,\n drawLoop,\n drawBackgroundRect,\n insertArrowHead,\n insertArrowFilledHead,\n insertSequenceNumber,\n insertArrowCrossHead,\n insertDatabaseIcon,\n insertComputerIcon,\n insertClockIcon,\n getTextObj,\n getNoteRect,\n popupMenu,\n popdownMenu,\n fixLifeLineHeights,\n sanitizeUrl,\n};\n","// @ts-nocheck TODO: fix file\nimport { select, selectAll } from 'd3';\nimport svgDraw, { drawText, fixLifeLineHeights } from './svgDraw';\nimport { log } from '../../logger';\nimport common from '../common/common';\nimport * as configApi from '../../config';\nimport assignWithDepth from '../../assignWithDepth';\nimport utils from '../../utils';\nimport { configureSvgSize } from '../../setupGraphViewbox';\nimport { Diagram } from '../../Diagram';\n\nlet conf = {};\n\nexport const bounds = {\n data: {\n startx: undefined,\n stopx: undefined,\n starty: undefined,\n stopy: undefined,\n },\n verticalPos: 0,\n sequenceItems: [],\n activations: [],\n models: {\n getHeight: function () {\n return (\n Math.max.apply(\n null,\n this.actors.length === 0 ? [0] : this.actors.map((actor) => actor.height || 0)\n ) +\n (this.loops.length === 0\n ? 0\n : this.loops.map((it) => it.height || 0).reduce((acc, h) => acc + h)) +\n (this.messages.length === 0\n ? 0\n : this.messages.map((it) => it.height || 0).reduce((acc, h) => acc + h)) +\n (this.notes.length === 0\n ? 0\n : this.notes.map((it) => it.height || 0).reduce((acc, h) => acc + h))\n );\n },\n clear: function () {\n this.actors = [];\n this.boxes = [];\n this.loops = [];\n this.messages = [];\n this.notes = [];\n },\n addBox: function (boxModel) {\n this.boxes.push(boxModel);\n },\n addActor: function (actorModel) {\n this.actors.push(actorModel);\n },\n addLoop: function (loopModel) {\n this.loops.push(loopModel);\n },\n addMessage: function (msgModel) {\n this.messages.push(msgModel);\n },\n addNote: function (noteModel) {\n this.notes.push(noteModel);\n },\n lastActor: function () {\n return this.actors[this.actors.length - 1];\n },\n lastLoop: function () {\n return this.loops[this.loops.length - 1];\n },\n lastMessage: function () {\n return this.messages[this.messages.length - 1];\n },\n lastNote: function () {\n return this.notes[this.notes.length - 1];\n },\n actors: [],\n boxes: [],\n loops: [],\n messages: [],\n notes: [],\n },\n init: function () {\n this.sequenceItems = [];\n this.activations = [];\n this.models.clear();\n this.data = {\n startx: undefined,\n stopx: undefined,\n starty: undefined,\n stopy: undefined,\n };\n this.verticalPos = 0;\n setConf(configApi.getConfig());\n },\n updateVal: function (obj, key, val, fun) {\n if (obj[key] === undefined) {\n obj[key] = val;\n } else {\n obj[key] = fun(val, obj[key]);\n }\n },\n updateBounds: function (startx, starty, stopx, stopy) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const _self = this;\n let cnt = 0;\n /** @param type - Either `activation` or `undefined` */\n function updateFn(type?: 'activation') {\n return function updateItemBounds(item) {\n cnt++;\n // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems\n const n = _self.sequenceItems.length - cnt + 1;\n\n _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min);\n _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max);\n\n _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min);\n _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max);\n\n if (!(type === 'activation')) {\n _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min);\n _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max);\n\n _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min);\n _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max);\n }\n };\n }\n\n this.sequenceItems.forEach(updateFn());\n this.activations.forEach(updateFn('activation'));\n },\n insert: function (startx, starty, stopx, stopy) {\n const _startx = Math.min(startx, stopx);\n const _stopx = Math.max(startx, stopx);\n const _starty = Math.min(starty, stopy);\n const _stopy = Math.max(starty, stopy);\n\n this.updateVal(bounds.data, 'startx', _startx, Math.min);\n this.updateVal(bounds.data, 'starty', _starty, Math.min);\n this.updateVal(bounds.data, 'stopx', _stopx, Math.max);\n this.updateVal(bounds.data, 'stopy', _stopy, Math.max);\n\n this.updateBounds(_startx, _starty, _stopx, _stopy);\n },\n newActivation: function (message, diagram, actors) {\n const actorRect = actors[message.from.actor];\n const stackedSize = actorActivations(message.from.actor).length || 0;\n const x = actorRect.x + actorRect.width / 2 + ((stackedSize - 1) * conf.activationWidth) / 2;\n this.activations.push({\n startx: x,\n starty: this.verticalPos + 2,\n stopx: x + conf.activationWidth,\n stopy: undefined,\n actor: message.from.actor,\n anchored: svgDraw.anchorElement(diagram),\n });\n },\n endActivation: function (message) {\n // find most recent activation for given actor\n const lastActorActivationIdx = this.activations\n .map(function (activation) {\n return activation.actor;\n })\n .lastIndexOf(message.from.actor);\n return this.activations.splice(lastActorActivationIdx, 1)[0];\n },\n createLoop: function (title = { message: undefined, wrap: false, width: undefined }, fill) {\n return {\n startx: undefined,\n starty: this.verticalPos,\n stopx: undefined,\n stopy: undefined,\n title: title.message,\n wrap: title.wrap,\n width: title.width,\n height: 0,\n fill: fill,\n };\n },\n newLoop: function (title = { message: undefined, wrap: false, width: undefined }, fill) {\n this.sequenceItems.push(this.createLoop(title, fill));\n },\n endLoop: function () {\n return this.sequenceItems.pop();\n },\n addSectionToLoop: function (message) {\n const loop = this.sequenceItems.pop();\n loop.sections = loop.sections || [];\n loop.sectionTitles = loop.sectionTitles || [];\n loop.sections.push({ y: bounds.getVerticalPos(), height: 0 });\n loop.sectionTitles.push(message);\n this.sequenceItems.push(loop);\n },\n bumpVerticalPos: function (bump) {\n this.verticalPos = this.verticalPos + bump;\n this.data.stopy = this.verticalPos;\n },\n getVerticalPos: function () {\n return this.verticalPos;\n },\n getBounds: function () {\n return { bounds: this.data, models: this.models };\n },\n};\n\n/** Options for drawing a note in {@link drawNote} */\ninterface NoteModel {\n /** x axis start position */\n startx: number;\n /** y axis position */\n starty: number;\n /** the message to be shown */\n message: string;\n /** Set this with a custom width to override the default configured width. */\n width: number;\n}\n\n/**\n * Draws an note in the diagram with the attached line\n *\n * @param elem - The diagram to draw to.\n * @param noteModel - Note model options.\n */\nconst drawNote = function (elem: any, noteModel: NoteModel) {\n bounds.bumpVerticalPos(conf.boxMargin);\n noteModel.height = conf.boxMargin;\n noteModel.starty = bounds.getVerticalPos();\n const rect = svgDraw.getNoteRect();\n rect.x = noteModel.startx;\n rect.y = noteModel.starty;\n rect.width = noteModel.width || conf.width;\n rect.class = 'note';\n\n const g = elem.append('g');\n const rectElem = svgDraw.drawRect(g, rect);\n const textObj = svgDraw.getTextObj();\n textObj.x = noteModel.startx;\n textObj.y = noteModel.starty;\n textObj.width = rect.width;\n textObj.dy = '1em';\n textObj.text = noteModel.message;\n textObj.class = 'noteText';\n textObj.fontFamily = conf.noteFontFamily;\n textObj.fontSize = conf.noteFontSize;\n textObj.fontWeight = conf.noteFontWeight;\n textObj.anchor = conf.noteAlign;\n textObj.textMargin = conf.noteMargin;\n textObj.valign = 'center';\n\n const textElem = drawText(g, textObj);\n\n const textHeight = Math.round(\n textElem\n .map((te) => (te._groups || te)[0][0].getBBox().height)\n .reduce((acc, curr) => acc + curr)\n );\n\n rectElem.attr('height', textHeight + 2 * conf.noteMargin);\n noteModel.height += textHeight + 2 * conf.noteMargin;\n bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin);\n noteModel.stopy = noteModel.starty + textHeight + 2 * conf.noteMargin;\n noteModel.stopx = noteModel.startx + rect.width;\n bounds.insert(noteModel.startx, noteModel.starty, noteModel.stopx, noteModel.stopy);\n bounds.models.addNote(noteModel);\n};\n\nconst messageFont = (cnf) => {\n return {\n fontFamily: cnf.messageFontFamily,\n fontSize: cnf.messageFontSize,\n fontWeight: cnf.messageFontWeight,\n };\n};\nconst noteFont = (cnf) => {\n return {\n fontFamily: cnf.noteFontFamily,\n fontSize: cnf.noteFontSize,\n fontWeight: cnf.noteFontWeight,\n };\n};\nconst actorFont = (cnf) => {\n return {\n fontFamily: cnf.actorFontFamily,\n fontSize: cnf.actorFontSize,\n fontWeight: cnf.actorFontWeight,\n };\n};\n\n/**\n * Process a message by adding its dimensions to the bound. It returns the Y coordinate of the\n * message so it can be drawn later. We do not draw the message at this point so the arrowhead can\n * be on top of the activation box.\n *\n * @param _diagram - The parent of the message element.\n * @param msgModel - The model containing fields describing a message\n * @returns `lineStartY` - The Y coordinate at which the message line starts\n */\nfunction boundMessage(_diagram, msgModel): number {\n bounds.bumpVerticalPos(10);\n const { startx, stopx, message } = msgModel;\n const lines = common.splitBreaks(message).length;\n const textDims = utils.calculateTextDimensions(message, messageFont(conf));\n const lineHeight = textDims.height / lines;\n msgModel.height += lineHeight;\n\n bounds.bumpVerticalPos(lineHeight);\n\n let lineStartY;\n let totalOffset = textDims.height - 10;\n const textWidth = textDims.width;\n\n if (startx === stopx) {\n lineStartY = bounds.getVerticalPos() + totalOffset;\n if (!conf.rightAngles) {\n totalOffset += conf.boxMargin;\n lineStartY = bounds.getVerticalPos() + totalOffset;\n }\n totalOffset += 30;\n const dx = Math.max(textWidth / 2, conf.width / 2);\n bounds.insert(\n startx - dx,\n bounds.getVerticalPos() - 10 + totalOffset,\n stopx + dx,\n bounds.getVerticalPos() + 30 + totalOffset\n );\n } else {\n totalOffset += conf.boxMargin;\n lineStartY = bounds.getVerticalPos() + totalOffset;\n bounds.insert(startx, lineStartY - 10, stopx, lineStartY);\n }\n bounds.bumpVerticalPos(totalOffset);\n msgModel.height += totalOffset;\n msgModel.stopy = msgModel.starty + msgModel.height;\n bounds.insert(msgModel.fromBounds, msgModel.starty, msgModel.toBounds, msgModel.stopy);\n\n return lineStartY;\n}\n\n/**\n * Draws a message. Note that the bounds have previously been updated by boundMessage.\n *\n * @param diagram - The parent of the message element\n * @param msgModel - The model containing fields describing a message\n * @param lineStartY - The Y coordinate at which the message line starts\n * @param diagObj - The diagram object.\n */\nconst drawMessage = function (diagram, msgModel, lineStartY: number, diagObj: Diagram) {\n const { startx, stopx, starty, message, type, sequenceIndex, sequenceVisible } = msgModel;\n const textDims = utils.calculateTextDimensions(message, messageFont(conf));\n const textObj = svgDraw.getTextObj();\n textObj.x = startx;\n textObj.y = starty + 10;\n textObj.width = stopx - startx;\n textObj.class = 'messageText';\n textObj.dy = '1em';\n textObj.text = message;\n textObj.fontFamily = conf.messageFontFamily;\n textObj.fontSize = conf.messageFontSize;\n textObj.fontWeight = conf.messageFontWeight;\n textObj.anchor = conf.messageAlign;\n textObj.valign = 'center';\n textObj.textMargin = conf.wrapPadding;\n textObj.tspan = false;\n\n drawText(diagram, textObj);\n\n const textWidth = textDims.width;\n\n let line;\n if (startx === stopx) {\n if (conf.rightAngles) {\n line = diagram\n .append('path')\n .attr(\n 'd',\n `M ${startx},${lineStartY} H ${startx + Math.max(conf.width / 2, textWidth / 2)} V ${\n lineStartY + 25\n } H ${startx}`\n );\n } else {\n line = diagram\n .append('path')\n .attr(\n 'd',\n 'M ' +\n startx +\n ',' +\n lineStartY +\n ' C ' +\n (startx + 60) +\n ',' +\n (lineStartY - 10) +\n ' ' +\n (startx + 60) +\n ',' +\n (lineStartY + 30) +\n ' ' +\n startx +\n ',' +\n (lineStartY + 20)\n );\n }\n } else {\n line = diagram.append('line');\n line.attr('x1', startx);\n line.attr('y1', lineStartY);\n line.attr('x2', stopx);\n line.attr('y2', lineStartY);\n }\n // Make an SVG Container\n // Draw the line\n if (\n type === diagObj.db.LINETYPE.DOTTED ||\n type === diagObj.db.LINETYPE.DOTTED_CROSS ||\n type === diagObj.db.LINETYPE.DOTTED_POINT ||\n type === diagObj.db.LINETYPE.DOTTED_OPEN\n ) {\n line.style('stroke-dasharray', '3, 3');\n line.attr('class', 'messageLine1');\n } else {\n line.attr('class', 'messageLine0');\n }\n\n let url = '';\n if (conf.arrowMarkerAbsolute) {\n url =\n window.location.protocol +\n '//' +\n window.location.host +\n window.location.pathname +\n window.location.search;\n url = url.replace(/\\(/g, '\\\\(');\n url = url.replace(/\\)/g, '\\\\)');\n }\n\n line.attr('stroke-width', 2);\n line.attr('stroke', 'none'); // handled by theme/css anyway\n line.style('fill', 'none'); // remove any fill colour\n if (type === diagObj.db.LINETYPE.SOLID || type === diagObj.db.LINETYPE.DOTTED) {\n line.attr('marker-end', 'url(' + url + '#arrowhead)');\n }\n if (type === diagObj.db.LINETYPE.SOLID_POINT || type === diagObj.db.LINETYPE.DOTTED_POINT) {\n line.attr('marker-end', 'url(' + url + '#filled-head)');\n }\n\n if (type === diagObj.db.LINETYPE.SOLID_CROSS || type === diagObj.db.LINETYPE.DOTTED_CROSS) {\n line.attr('marker-end', 'url(' + url + '#crosshead)');\n }\n\n // add node number\n if (sequenceVisible || conf.showSequenceNumbers) {\n line.attr('marker-start', 'url(' + url + '#sequencenumber)');\n diagram\n .append('text')\n .attr('x', startx)\n .attr('y', lineStartY + 4)\n .attr('font-family', 'sans-serif')\n .attr('font-size', '12px')\n .attr('text-anchor', 'middle')\n .attr('class', 'sequenceNumber')\n .text(sequenceIndex);\n }\n};\n\nexport const drawActors = function (\n diagram,\n actors,\n actorKeys,\n verticalPos,\n configuration,\n messages,\n isFooter\n) {\n if (configuration.hideUnusedParticipants === true) {\n const newActors = new Set();\n messages.forEach((message) => {\n newActors.add(message.from);\n newActors.add(message.to);\n });\n actorKeys = actorKeys.filter((actorKey) => newActors.has(actorKey));\n }\n\n // Draw the actors\n let prevWidth = 0;\n let prevMargin = 0;\n let maxHeight = 0;\n let prevBox = undefined;\n\n for (const actorKey of actorKeys) {\n const actor = actors[actorKey];\n const box = actor.box;\n\n // end of box\n if (prevBox && prevBox != box) {\n if (!isFooter) {\n bounds.models.addBox(prevBox);\n }\n prevMargin += conf.boxMargin + prevBox.margin;\n }\n\n // new box\n if (box && box != prevBox) {\n if (!isFooter) {\n box.x = prevWidth + prevMargin;\n box.y = verticalPos;\n }\n prevMargin += box.margin;\n }\n\n // Add some rendering data to the object\n actor.width = actor.width || conf.width;\n actor.height = Math.max(actor.height || conf.height, conf.height);\n actor.margin = actor.margin || conf.actorMargin;\n\n actor.x = prevWidth + prevMargin;\n actor.y = bounds.getVerticalPos();\n\n // Draw the box with the attached line\n const height = svgDraw.drawActor(diagram, actor, conf, isFooter);\n maxHeight = Math.max(maxHeight, height);\n bounds.insert(actor.x, verticalPos, actor.x + actor.width, actor.height);\n\n prevWidth += actor.width + prevMargin;\n if (actor.box) {\n actor.box.width = prevWidth + box.margin - actor.box.x;\n }\n prevMargin = actor.margin;\n prevBox = actor.box;\n bounds.models.addActor(actor);\n }\n\n // end of box\n if (prevBox && !isFooter) {\n bounds.models.addBox(prevBox);\n }\n\n // Add a margin between the actor boxes and the first arrow\n bounds.bumpVerticalPos(maxHeight);\n};\n\nexport const drawActorsPopup = function (diagram, actors, actorKeys, doc) {\n let maxHeight = 0;\n let maxWidth = 0;\n for (const actorKey of actorKeys) {\n const actor = actors[actorKey];\n const minMenuWidth = getRequiredPopupWidth(actor);\n const menuDimensions = svgDraw.drawPopup(\n diagram,\n actor,\n minMenuWidth,\n conf,\n conf.forceMenus,\n doc\n );\n if (menuDimensions.height > maxHeight) {\n maxHeight = menuDimensions.height;\n }\n if (menuDimensions.width + actor.x > maxWidth) {\n maxWidth = menuDimensions.width + actor.x;\n }\n }\n\n return { maxHeight: maxHeight, maxWidth: maxWidth };\n};\n\nexport const setConf = function (cnf) {\n assignWithDepth(conf, cnf);\n\n if (cnf.fontFamily) {\n conf.actorFontFamily = conf.noteFontFamily = conf.messageFontFamily = cnf.fontFamily;\n }\n if (cnf.fontSize) {\n conf.actorFontSize = conf.noteFontSize = conf.messageFontSize = cnf.fontSize;\n }\n if (cnf.fontWeight) {\n conf.actorFontWeight = conf.noteFontWeight = conf.messageFontWeight = cnf.fontWeight;\n }\n};\n\nconst actorActivations = function (actor) {\n return bounds.activations.filter(function (activation) {\n return activation.actor === actor;\n });\n};\n\nconst activationBounds = function (actor, actors) {\n // handle multiple stacked activations for same actor\n const actorObj = actors[actor];\n const activations = actorActivations(actor);\n\n const left = activations.reduce(function (acc, activation) {\n return Math.min(acc, activation.startx);\n }, actorObj.x + actorObj.width / 2);\n const right = activations.reduce(function (acc, activation) {\n return Math.max(acc, activation.stopx);\n }, actorObj.x + actorObj.width / 2);\n return [left, right];\n};\n\nfunction adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoopFn) {\n bounds.bumpVerticalPos(preMargin);\n let heightAdjust = postMargin;\n if (msg.id && msg.message && loopWidths[msg.id]) {\n const loopWidth = loopWidths[msg.id].width;\n const textConf = messageFont(conf);\n msg.message = utils.wrapLabel(`[${msg.message}]`, loopWidth - 2 * conf.wrapPadding, textConf);\n msg.width = loopWidth;\n msg.wrap = true;\n\n // const lines = common.splitBreaks(msg.message).length;\n const textDims = utils.calculateTextDimensions(msg.message, textConf);\n const totalOffset = Math.max(textDims.height, conf.labelBoxHeight);\n heightAdjust = postMargin + totalOffset;\n log.debug(`${totalOffset} - ${msg.message}`);\n }\n addLoopFn(msg);\n bounds.bumpVerticalPos(heightAdjust);\n}\n\n/**\n * Draws a sequenceDiagram in the tag with id: id based on the graph definition in text.\n *\n * @param _text - The text of the diagram\n * @param id - The id of the diagram which will be used as a DOM element id¨\n * @param _version - Mermaid version from package.json\n * @param diagObj - A standard diagram containing the db and the text and type etc of the diagram\n */\nexport const draw = function (_text: string, id: string, _version: string, diagObj: Diagram) {\n const { securityLevel, sequence } = configApi.getConfig();\n conf = sequence;\n diagObj.db.clear();\n // Parse the graph definition\n diagObj.parser.parse(_text);\n // Handle root and Document for when rendering in sandbox mode\n let sandboxElement;\n if (securityLevel === 'sandbox') {\n sandboxElement = select('#i' + id);\n }\n\n const root =\n securityLevel === 'sandbox'\n ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document;\n bounds.init();\n log.debug(diagObj.db);\n\n const diagram =\n securityLevel === 'sandbox' ? root.select(`[id=\"${id}\"]`) : select(`[id=\"${id}\"]`);\n\n // Fetch data from the parsing\n const actors = diagObj.db.getActors();\n const boxes = diagObj.db.getBoxes();\n const actorKeys = diagObj.db.getActorKeys();\n const messages = diagObj.db.getMessages();\n const title = diagObj.db.getDiagramTitle();\n const hasBoxes = diagObj.db.hasAtLeastOneBox();\n const hasBoxTitles = diagObj.db.hasAtLeastOneBoxWithTitle();\n const maxMessageWidthPerActor = getMaxMessageWidthPerActor(actors, messages, diagObj);\n conf.height = calculateActorMargins(actors, maxMessageWidthPerActor, boxes);\n\n svgDraw.insertComputerIcon(diagram);\n svgDraw.insertDatabaseIcon(diagram);\n svgDraw.insertClockIcon(diagram);\n\n if (hasBoxes) {\n bounds.bumpVerticalPos(conf.boxMargin);\n if (hasBoxTitles) {\n bounds.bumpVerticalPos(boxes[0].textMaxHeight);\n }\n }\n\n drawActors(diagram, actors, actorKeys, 0, conf, messages, false);\n const loopWidths = calculateLoopBounds(messages, actors, maxMessageWidthPerActor, diagObj);\n\n // The arrow head definition is attached to the svg once\n svgDraw.insertArrowHead(diagram);\n svgDraw.insertArrowCrossHead(diagram);\n svgDraw.insertArrowFilledHead(diagram);\n svgDraw.insertSequenceNumber(diagram);\n\n /**\n * @param msg - The message to draw.\n * @param verticalPos - The vertical position of the message.\n */\n function activeEnd(msg: any, verticalPos: number) {\n const activationData = bounds.endActivation(msg);\n if (activationData.starty + 18 > verticalPos) {\n activationData.starty = verticalPos - 6;\n verticalPos += 12;\n }\n svgDraw.drawActivation(\n diagram,\n activationData,\n verticalPos,\n conf,\n actorActivations(msg.from.actor).length\n );\n\n bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);\n }\n\n // Draw the messages/signals\n let sequenceIndex = 1;\n let sequenceIndexStep = 1;\n const messagesToDraw = [];\n messages.forEach(function (msg) {\n let loopModel, noteModel, msgModel;\n\n switch (msg.type) {\n case diagObj.db.LINETYPE.NOTE:\n noteModel = msg.noteModel;\n drawNote(diagram, noteModel);\n break;\n case diagObj.db.LINETYPE.ACTIVE_START:\n bounds.newActivation(msg, diagram, actors);\n break;\n case diagObj.db.LINETYPE.ACTIVE_END:\n activeEnd(msg, bounds.getVerticalPos());\n break;\n case diagObj.db.LINETYPE.LOOP_START:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin,\n conf.boxMargin + conf.boxTextMargin,\n (message) => bounds.newLoop(message)\n );\n break;\n case diagObj.db.LINETYPE.LOOP_END:\n loopModel = bounds.endLoop();\n svgDraw.drawLoop(diagram, loopModel, 'loop', conf);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n bounds.models.addLoop(loopModel);\n break;\n case diagObj.db.LINETYPE.RECT_START:\n adjustLoopHeightForWrap(loopWidths, msg, conf.boxMargin, conf.boxMargin, (message) =>\n bounds.newLoop(undefined, message.message)\n );\n break;\n case diagObj.db.LINETYPE.RECT_END:\n loopModel = bounds.endLoop();\n svgDraw.drawBackgroundRect(diagram, loopModel);\n bounds.models.addLoop(loopModel);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n break;\n case diagObj.db.LINETYPE.OPT_START:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin,\n conf.boxMargin + conf.boxTextMargin,\n (message) => bounds.newLoop(message)\n );\n break;\n case diagObj.db.LINETYPE.OPT_END:\n loopModel = bounds.endLoop();\n svgDraw.drawLoop(diagram, loopModel, 'opt', conf);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n bounds.models.addLoop(loopModel);\n break;\n case diagObj.db.LINETYPE.ALT_START:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin,\n conf.boxMargin + conf.boxTextMargin,\n (message) => bounds.newLoop(message)\n );\n break;\n case diagObj.db.LINETYPE.ALT_ELSE:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin + conf.boxTextMargin,\n conf.boxMargin,\n (message) => bounds.addSectionToLoop(message)\n );\n break;\n case diagObj.db.LINETYPE.ALT_END:\n loopModel = bounds.endLoop();\n svgDraw.drawLoop(diagram, loopModel, 'alt', conf);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n bounds.models.addLoop(loopModel);\n break;\n case diagObj.db.LINETYPE.PAR_START:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin,\n conf.boxMargin + conf.boxTextMargin,\n (message) => bounds.newLoop(message)\n );\n break;\n case diagObj.db.LINETYPE.PAR_AND:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin + conf.boxTextMargin,\n conf.boxMargin,\n (message) => bounds.addSectionToLoop(message)\n );\n break;\n case diagObj.db.LINETYPE.PAR_END:\n loopModel = bounds.endLoop();\n svgDraw.drawLoop(diagram, loopModel, 'par', conf);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n bounds.models.addLoop(loopModel);\n break;\n case diagObj.db.LINETYPE.AUTONUMBER:\n sequenceIndex = msg.message.start || sequenceIndex;\n sequenceIndexStep = msg.message.step || sequenceIndexStep;\n if (msg.message.visible) {\n diagObj.db.enableSequenceNumbers();\n } else {\n diagObj.db.disableSequenceNumbers();\n }\n break;\n case diagObj.db.LINETYPE.CRITICAL_START:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin,\n conf.boxMargin + conf.boxTextMargin,\n (message) => bounds.newLoop(message)\n );\n break;\n case diagObj.db.LINETYPE.CRITICAL_OPTION:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin + conf.boxTextMargin,\n conf.boxMargin,\n (message) => bounds.addSectionToLoop(message)\n );\n break;\n case diagObj.db.LINETYPE.CRITICAL_END:\n loopModel = bounds.endLoop();\n svgDraw.drawLoop(diagram, loopModel, 'critical', conf);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n bounds.models.addLoop(loopModel);\n break;\n case diagObj.db.LINETYPE.BREAK_START:\n adjustLoopHeightForWrap(\n loopWidths,\n msg,\n conf.boxMargin,\n conf.boxMargin + conf.boxTextMargin,\n (message) => bounds.newLoop(message)\n );\n break;\n case diagObj.db.LINETYPE.BREAK_END:\n loopModel = bounds.endLoop();\n svgDraw.drawLoop(diagram, loopModel, 'break', conf);\n bounds.bumpVerticalPos(loopModel.stopy - bounds.getVerticalPos());\n bounds.models.addLoop(loopModel);\n break;\n default:\n try {\n // lastMsg = msg\n msgModel = msg.msgModel;\n msgModel.starty = bounds.getVerticalPos();\n msgModel.sequenceIndex = sequenceIndex;\n msgModel.sequenceVisible = diagObj.db.showSequenceNumbers();\n const lineStartY = boundMessage(diagram, msgModel);\n messagesToDraw.push({ messageModel: msgModel, lineStartY: lineStartY });\n bounds.models.addMessage(msgModel);\n } catch (e) {\n log.error('error while drawing message', e);\n }\n }\n\n // Increment sequence counter if msg.type is a line (and not another event like activation or note, etc)\n if (\n [\n diagObj.db.LINETYPE.SOLID_OPEN,\n diagObj.db.LINETYPE.DOTTED_OPEN,\n diagObj.db.LINETYPE.SOLID,\n diagObj.db.LINETYPE.DOTTED,\n diagObj.db.LINETYPE.SOLID_CROSS,\n diagObj.db.LINETYPE.DOTTED_CROSS,\n diagObj.db.LINETYPE.SOLID_POINT,\n diagObj.db.LINETYPE.DOTTED_POINT,\n ].includes(msg.type)\n ) {\n sequenceIndex = sequenceIndex + sequenceIndexStep;\n }\n });\n\n messagesToDraw.forEach((e) => drawMessage(diagram, e.messageModel, e.lineStartY, diagObj));\n\n if (conf.mirrorActors) {\n // Draw actors below diagram\n bounds.bumpVerticalPos(conf.boxMargin * 2);\n drawActors(diagram, actors, actorKeys, bounds.getVerticalPos(), conf, messages, true);\n bounds.bumpVerticalPos(conf.boxMargin);\n fixLifeLineHeights(diagram, bounds.getVerticalPos());\n }\n\n bounds.models.boxes.forEach(function (box) {\n box.height = bounds.getVerticalPos() - box.y;\n bounds.insert(box.x, box.y, box.x + box.width, box.height);\n box.startx = box.x;\n box.starty = box.y;\n box.stopx = box.startx + box.width;\n box.stopy = box.starty + box.height;\n box.stroke = 'rgb(0,0,0, 0.5)';\n svgDraw.drawBox(diagram, box, conf);\n });\n\n if (hasBoxes) {\n bounds.bumpVerticalPos(conf.boxMargin);\n }\n\n // only draw popups for the top row of actors.\n const requiredBoxSize = drawActorsPopup(diagram, actors, actorKeys, doc);\n\n const { bounds: box } = bounds.getBounds();\n\n // Adjust line height of actor lines now that the height of the diagram is known\n log.debug('For line height fix Querying: #' + id + ' .actor-line');\n const actorLines = selectAll('#' + id + ' .actor-line');\n actorLines.attr('y2', box.stopy);\n\n // Make sure the height of the diagram supports long menus.\n let boxHeight = box.stopy - box.starty;\n if (boxHeight < requiredBoxSize.maxHeight) {\n boxHeight = requiredBoxSize.maxHeight;\n }\n\n let height = boxHeight + 2 * conf.diagramMarginY;\n if (conf.mirrorActors) {\n height = height - conf.boxMargin + conf.bottomMarginAdj;\n }\n\n // Make sure the width of the diagram supports wide menus.\n let boxWidth = box.stopx - box.startx;\n if (boxWidth < requiredBoxSize.maxWidth) {\n boxWidth = requiredBoxSize.maxWidth;\n }\n const width = boxWidth + 2 * conf.diagramMarginX;\n\n if (title) {\n diagram\n .append('text')\n .text(title)\n .attr('x', (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX)\n .attr('y', -25);\n }\n\n configureSvgSize(diagram, height, width, conf.useMaxWidth);\n\n const extraVertForTitle = title ? 40 : 0;\n diagram.attr(\n 'viewBox',\n box.startx -\n conf.diagramMarginX +\n ' -' +\n (conf.diagramMarginY + extraVertForTitle) +\n ' ' +\n width +\n ' ' +\n (height + extraVertForTitle)\n );\n\n log.debug(`models:`, bounds.models);\n};\n\n/**\n * Retrieves the max message width of each actor, supports signals (messages, loops) and notes.\n *\n * It will enumerate each given message, and will determine its text width, in relation to the actor\n * it originates from, and destined to.\n *\n * @param actors - The actors map\n * @param messages - A list of message objects to iterate\n * @param diagObj - The diagram object.\n * @returns The max message width of each actor.\n */\nfunction getMaxMessageWidthPerActor(\n actors: { [id: string]: any },\n messages: any[],\n diagObj: Diagram\n): { [id: string]: number } {\n const maxMessageWidthPerActor = {};\n\n messages.forEach(function (msg) {\n if (actors[msg.to] && actors[msg.from]) {\n const actor = actors[msg.to];\n\n // If this is the first actor, and the message is left of it, no need to calculate the margin\n if (msg.placement === diagObj.db.PLACEMENT.LEFTOF && !actor.prevActor) {\n return;\n }\n\n // If this is the last actor, and the message is right of it, no need to calculate the margin\n if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF && !actor.nextActor) {\n return;\n }\n\n const isNote = msg.placement !== undefined;\n const isMessage = !isNote;\n\n const textFont = isNote ? noteFont(conf) : messageFont(conf);\n const wrappedMessage = msg.wrap\n ? utils.wrapLabel(msg.message, conf.width - 2 * conf.wrapPadding, textFont)\n : msg.message;\n const messageDimensions = utils.calculateTextDimensions(wrappedMessage, textFont);\n const messageWidth = messageDimensions.width + 2 * conf.wrapPadding;\n\n /*\n * The following scenarios should be supported:\n *\n * - There's a message (non-note) between fromActor and toActor\n * - If fromActor is on the right and toActor is on the left, we should\n * define the toActor's margin\n * - If fromActor is on the left and toActor is on the right, we should\n * define the fromActor's margin\n * - There's a note, in which case fromActor == toActor\n * - If the note is to the left of the actor, we should define the previous actor\n * margin\n * - If the note is on the actor, we should define both the previous and next actor\n * margins, each being the half of the note size\n * - If the note is on the right of the actor, we should define the current actor\n * margin\n */\n if (isMessage && msg.from === actor.nextActor) {\n maxMessageWidthPerActor[msg.to] = Math.max(\n maxMessageWidthPerActor[msg.to] || 0,\n messageWidth\n );\n } else if (isMessage && msg.from === actor.prevActor) {\n maxMessageWidthPerActor[msg.from] = Math.max(\n maxMessageWidthPerActor[msg.from] || 0,\n messageWidth\n );\n } else if (isMessage && msg.from === msg.to) {\n maxMessageWidthPerActor[msg.from] = Math.max(\n maxMessageWidthPerActor[msg.from] || 0,\n messageWidth / 2\n );\n\n maxMessageWidthPerActor[msg.to] = Math.max(\n maxMessageWidthPerActor[msg.to] || 0,\n messageWidth / 2\n );\n } else if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) {\n maxMessageWidthPerActor[msg.from] = Math.max(\n maxMessageWidthPerActor[msg.from] || 0,\n messageWidth\n );\n } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) {\n maxMessageWidthPerActor[actor.prevActor] = Math.max(\n maxMessageWidthPerActor[actor.prevActor] || 0,\n messageWidth\n );\n } else if (msg.placement === diagObj.db.PLACEMENT.OVER) {\n if (actor.prevActor) {\n maxMessageWidthPerActor[actor.prevActor] = Math.max(\n maxMessageWidthPerActor[actor.prevActor] || 0,\n messageWidth / 2\n );\n }\n\n if (actor.nextActor) {\n maxMessageWidthPerActor[msg.from] = Math.max(\n maxMessageWidthPerActor[msg.from] || 0,\n messageWidth / 2\n );\n }\n }\n }\n });\n\n log.debug('maxMessageWidthPerActor:', maxMessageWidthPerActor);\n return maxMessageWidthPerActor;\n}\n\nconst getRequiredPopupWidth = function (actor) {\n let requiredPopupWidth = 0;\n const textFont = actorFont(conf);\n for (const key in actor.links) {\n const labelDimensions = utils.calculateTextDimensions(key, textFont);\n const labelWidth = labelDimensions.width + 2 * conf.wrapPadding + 2 * conf.boxMargin;\n if (requiredPopupWidth < labelWidth) {\n requiredPopupWidth = labelWidth;\n }\n }\n\n return requiredPopupWidth;\n};\n\n/**\n * This will calculate the optimal margin for each given actor,\n * for a given actor → messageWidth map.\n *\n * An actor's margin is determined by the width of the actor, the width of the largest message that\n * originates from it, and the configured conf.actorMargin.\n *\n * @param actors - The actors map to calculate margins for\n * @param actorToMessageWidth - A map of actor key → max message width it holds\n * @param boxes - The boxes around the actors if any\n */\nfunction calculateActorMargins(\n actors: { [id: string]: any },\n actorToMessageWidth: ReturnType,\n boxes\n) {\n let maxHeight = 0;\n Object.keys(actors).forEach((prop) => {\n const actor = actors[prop];\n if (actor.wrap) {\n actor.description = utils.wrapLabel(\n actor.description,\n conf.width - 2 * conf.wrapPadding,\n actorFont(conf)\n );\n }\n const actDims = utils.calculateTextDimensions(actor.description, actorFont(conf));\n actor.width = actor.wrap\n ? conf.width\n : Math.max(conf.width, actDims.width + 2 * conf.wrapPadding);\n\n actor.height = actor.wrap ? Math.max(actDims.height, conf.height) : conf.height;\n maxHeight = Math.max(maxHeight, actor.height);\n });\n\n for (const actorKey in actorToMessageWidth) {\n const actor = actors[actorKey];\n\n if (!actor) {\n continue;\n }\n\n const nextActor = actors[actor.nextActor];\n\n // No need to space out an actor that doesn't have a next link\n if (!nextActor) {\n const messageWidth = actorToMessageWidth[actorKey];\n const actorWidth = messageWidth + conf.actorMargin - actor.width / 2;\n actor.margin = Math.max(actorWidth, conf.actorMargin);\n continue;\n }\n\n const messageWidth = actorToMessageWidth[actorKey];\n const actorWidth = messageWidth + conf.actorMargin - actor.width / 2 - nextActor.width / 2;\n\n actor.margin = Math.max(actorWidth, conf.actorMargin);\n }\n\n let maxBoxHeight = 0;\n boxes.forEach((box) => {\n const textFont = messageFont(conf);\n let totalWidth = box.actorKeys.reduce((total, aKey) => {\n return (total += actors[aKey].width + (actors[aKey].margin || 0));\n }, 0);\n\n totalWidth -= 2 * conf.boxTextMargin;\n if (box.wrap) {\n box.name = utils.wrapLabel(box.name, totalWidth - 2 * conf.wrapPadding, textFont);\n }\n\n const boxMsgDimensions = utils.calculateTextDimensions(box.name, textFont);\n maxBoxHeight = Math.max(boxMsgDimensions.height, maxBoxHeight);\n const minWidth = Math.max(totalWidth, boxMsgDimensions.width + 2 * conf.wrapPadding);\n box.margin = conf.boxTextMargin;\n if (totalWidth < minWidth) {\n const missing = (minWidth - totalWidth) / 2;\n box.margin += missing;\n }\n });\n boxes.forEach((box) => (box.textMaxHeight = maxBoxHeight));\n\n return Math.max(maxHeight, conf.height);\n}\n\nconst buildNoteModel = function (msg, actors, diagObj) {\n const startx = actors[msg.from].x;\n const stopx = actors[msg.to].x;\n const shouldWrap = msg.wrap && msg.message;\n\n let textDimensions = utils.calculateTextDimensions(\n shouldWrap ? utils.wrapLabel(msg.message, conf.width, noteFont(conf)) : msg.message,\n noteFont(conf)\n );\n const noteModel = {\n width: shouldWrap\n ? conf.width\n : Math.max(conf.width, textDimensions.width + 2 * conf.noteMargin),\n height: 0,\n startx: actors[msg.from].x,\n stopx: 0,\n starty: 0,\n stopy: 0,\n message: msg.message,\n };\n if (msg.placement === diagObj.db.PLACEMENT.RIGHTOF) {\n noteModel.width = shouldWrap\n ? Math.max(conf.width, textDimensions.width)\n : Math.max(\n actors[msg.from].width / 2 + actors[msg.to].width / 2,\n textDimensions.width + 2 * conf.noteMargin\n );\n noteModel.startx = startx + (actors[msg.from].width + conf.actorMargin) / 2;\n } else if (msg.placement === diagObj.db.PLACEMENT.LEFTOF) {\n noteModel.width = shouldWrap\n ? Math.max(conf.width, textDimensions.width + 2 * conf.noteMargin)\n : Math.max(\n actors[msg.from].width / 2 + actors[msg.to].width / 2,\n textDimensions.width + 2 * conf.noteMargin\n );\n noteModel.startx = startx - noteModel.width + (actors[msg.from].width - conf.actorMargin) / 2;\n } else if (msg.to === msg.from) {\n textDimensions = utils.calculateTextDimensions(\n shouldWrap\n ? utils.wrapLabel(msg.message, Math.max(conf.width, actors[msg.from].width), noteFont(conf))\n : msg.message,\n noteFont(conf)\n );\n noteModel.width = shouldWrap\n ? Math.max(conf.width, actors[msg.from].width)\n : Math.max(actors[msg.from].width, conf.width, textDimensions.width + 2 * conf.noteMargin);\n noteModel.startx = startx + (actors[msg.from].width - noteModel.width) / 2;\n } else {\n noteModel.width =\n Math.abs(startx + actors[msg.from].width / 2 - (stopx + actors[msg.to].width / 2)) +\n conf.actorMargin;\n noteModel.startx =\n startx < stopx\n ? startx + actors[msg.from].width / 2 - conf.actorMargin / 2\n : stopx + actors[msg.to].width / 2 - conf.actorMargin / 2;\n }\n if (shouldWrap) {\n noteModel.message = utils.wrapLabel(\n msg.message,\n noteModel.width - 2 * conf.wrapPadding,\n noteFont(conf)\n );\n }\n log.debug(\n `NM:[${noteModel.startx},${noteModel.stopx},${noteModel.starty},${noteModel.stopy}:${noteModel.width},${noteModel.height}=${msg.message}]`\n );\n return noteModel;\n};\n\nconst buildMessageModel = function (msg, actors, diagObj) {\n let process = false;\n if (\n [\n diagObj.db.LINETYPE.SOLID_OPEN,\n diagObj.db.LINETYPE.DOTTED_OPEN,\n diagObj.db.LINETYPE.SOLID,\n diagObj.db.LINETYPE.DOTTED,\n diagObj.db.LINETYPE.SOLID_CROSS,\n diagObj.db.LINETYPE.DOTTED_CROSS,\n diagObj.db.LINETYPE.SOLID_POINT,\n diagObj.db.LINETYPE.DOTTED_POINT,\n ].includes(msg.type)\n ) {\n process = true;\n }\n if (!process) {\n return {};\n }\n const fromBounds = activationBounds(msg.from, actors);\n const toBounds = activationBounds(msg.to, actors);\n const fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0;\n const toIdx = fromBounds[0] < toBounds[0] ? 0 : 1;\n const allBounds = [...fromBounds, ...toBounds];\n const boundedWidth = Math.abs(toBounds[toIdx] - fromBounds[fromIdx]);\n if (msg.wrap && msg.message) {\n msg.message = utils.wrapLabel(\n msg.message,\n Math.max(boundedWidth + 2 * conf.wrapPadding, conf.width),\n messageFont(conf)\n );\n }\n const msgDims = utils.calculateTextDimensions(msg.message, messageFont(conf));\n\n return {\n width: Math.max(\n msg.wrap ? 0 : msgDims.width + 2 * conf.wrapPadding,\n boundedWidth + 2 * conf.wrapPadding,\n conf.width\n ),\n height: 0,\n startx: fromBounds[fromIdx],\n stopx: toBounds[toIdx],\n starty: 0,\n stopy: 0,\n message: msg.message,\n type: msg.type,\n wrap: msg.wrap,\n fromBounds: Math.min.apply(null, allBounds),\n toBounds: Math.max.apply(null, allBounds),\n };\n};\n\nconst calculateLoopBounds = function (messages, actors, _maxWidthPerActor, diagObj) {\n const loops = {};\n const stack = [];\n let current, noteModel, msgModel;\n\n messages.forEach(function (msg) {\n msg.id = utils.random({ length: 10 });\n switch (msg.type) {\n case diagObj.db.LINETYPE.LOOP_START:\n case diagObj.db.LINETYPE.ALT_START:\n case diagObj.db.LINETYPE.OPT_START:\n case diagObj.db.LINETYPE.PAR_START:\n case diagObj.db.LINETYPE.CRITICAL_START:\n case diagObj.db.LINETYPE.BREAK_START:\n stack.push({\n id: msg.id,\n msg: msg.message,\n from: Number.MAX_SAFE_INTEGER,\n to: Number.MIN_SAFE_INTEGER,\n width: 0,\n });\n break;\n case diagObj.db.LINETYPE.ALT_ELSE:\n case diagObj.db.LINETYPE.PAR_AND:\n case diagObj.db.LINETYPE.CRITICAL_OPTION:\n if (msg.message) {\n current = stack.pop();\n loops[current.id] = current;\n loops[msg.id] = current;\n stack.push(current);\n }\n break;\n case diagObj.db.LINETYPE.LOOP_END:\n case diagObj.db.LINETYPE.ALT_END:\n case diagObj.db.LINETYPE.OPT_END:\n case diagObj.db.LINETYPE.PAR_END:\n case diagObj.db.LINETYPE.CRITICAL_END:\n case diagObj.db.LINETYPE.BREAK_END:\n current = stack.pop();\n loops[current.id] = current;\n break;\n case diagObj.db.LINETYPE.ACTIVE_START:\n {\n const actorRect = actors[msg.from ? msg.from.actor : msg.to.actor];\n const stackedSize = actorActivations(msg.from ? msg.from.actor : msg.to.actor).length;\n const x =\n actorRect.x + actorRect.width / 2 + ((stackedSize - 1) * conf.activationWidth) / 2;\n const toAdd = {\n startx: x,\n stopx: x + conf.activationWidth,\n actor: msg.from.actor,\n enabled: true,\n };\n bounds.activations.push(toAdd);\n }\n break;\n case diagObj.db.LINETYPE.ACTIVE_END:\n {\n const lastActorActivationIdx = bounds.activations\n .map((a) => a.actor)\n .lastIndexOf(msg.from.actor);\n delete bounds.activations.splice(lastActorActivationIdx, 1)[0];\n }\n break;\n }\n const isNote = msg.placement !== undefined;\n if (isNote) {\n noteModel = buildNoteModel(msg, actors, diagObj);\n msg.noteModel = noteModel;\n stack.forEach((stk) => {\n current = stk;\n current.from = Math.min(current.from, noteModel.startx);\n current.to = Math.max(current.to, noteModel.startx + noteModel.width);\n current.width =\n Math.max(current.width, Math.abs(current.from - current.to)) - conf.labelBoxWidth;\n });\n } else {\n msgModel = buildMessageModel(msg, actors, diagObj);\n msg.msgModel = msgModel;\n if (msgModel.startx && msgModel.stopx && stack.length > 0) {\n stack.forEach((stk) => {\n current = stk;\n if (msgModel.startx === msgModel.stopx) {\n const from = actors[msg.from];\n const to = actors[msg.to];\n current.from = Math.min(\n from.x - msgModel.width / 2,\n from.x - from.width / 2,\n current.from\n );\n current.to = Math.max(to.x + msgModel.width / 2, to.x + from.width / 2, current.to);\n current.width =\n Math.max(current.width, Math.abs(current.to - current.from)) - conf.labelBoxWidth;\n } else {\n current.from = Math.min(msgModel.startx, current.from);\n current.to = Math.max(msgModel.stopx, current.to);\n current.width = Math.max(current.width, msgModel.width) - conf.labelBoxWidth;\n }\n });\n }\n }\n });\n bounds.activations = [];\n log.debug('Loop type widths:', loops);\n return loops;\n};\n\nexport default {\n bounds,\n drawActors,\n drawActorsPopup,\n setConf,\n draw,\n};\n","import { DiagramDefinition } from '../../diagram-api/types';\n// @ts-ignore: TODO Fix ts errors\nimport parser from './parser/sequenceDiagram';\nimport db from './sequenceDb';\nimport styles from './styles';\nimport renderer from './sequenceRenderer';\n\nexport const diagram: DiagramDefinition = {\n parser,\n db,\n renderer,\n styles,\n};\n"],"names":["o","parser","lexer","configApi.getConfig","commonClear","actors","text","actorCnt","sanitizeUrl","diagram","bounds","conf","actorActivations","messages","boxes","box","messageWidth","actorWidth"],"mappings":";;;;;;;AAyEA,IAAI,SAAU,WAAU;AACxB,MAAI,IAAE,SAAS,GAAE,GAAEA,IAAE,GAAE;AAAC,SAAIA,KAAEA,MAAG,IAAG,IAAE,EAAE,QAAO,KAAIA,GAAE,EAAE,CAAC,CAAC,IAAE;AAAE;AAAC,WAAOA;AAAA,EAAC,GAAE,MAAI,CAAC,GAAE,CAAC,GAAE,MAAI,CAAC,GAAE,CAAC,GAAE,MAAI,CAAC,GAAE,CAAC,GAAE,MAAI,CAAC,GAAE,CAAC,GAAE,MAAI,CAAC,GAAE,CAAC,GAAE,MAAI,CAA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